From 666bf37d460e81d62d11d2dd9d994a62e25a872c Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Sun, 10 Nov 2002 03:40:36 +0000 Subject: [PATCH] 2002-11-04 Max Bowsher * Exception.h (Exception::what): Add throw() specification, to agree with libstdc++-v3. * Exception.cc (Exception::what): Ditto. * IniDBBuilderPackage.h: Add 'std::' where needed. * PickCategoryLine.h: Ditto. * category.h: Ditto. * package_db.h: Ditto. * package_meta.h: Ditto. * package_source.h: Ditto. * package_version.h: Ditto. * site.h: Ditto. * win32.h: Define NOMINMAX before including . * package_meta.cc: Add 'using namespace std;'. (packagemeta::set_requirements): Remove default parameter values from definition (gcc3 likes them only in declaration). * package_version.cc: Add 'using namespace std;'. (packageversion::set_requirements): Remove default parameter values from definition (gcc3 likes them only in declaration). --- ChangeLog | 21 +++++++++++++++++++++ Exception.cc | 2 +- Exception.h | 4 ++-- IniDBBuilderPackage.h | 4 ++-- PickCategoryLine.h | 2 +- category.h | 2 +- package_db.h | 6 +++--- package_meta.cc | 4 +++- package_meta.h | 4 ++-- package_source.h | 2 +- package_version.cc | 4 +++- package_version.h | 8 ++++---- site.h | 2 +- win32.h | 2 ++ 14 files changed, 47 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b659df5..ddc49166 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2002-11-04 Max Bowsher + + * Exception.h (Exception::what): Add throw() specification, + to agree with libstdc++-v3. + * Exception.cc (Exception::what): Ditto. + * IniDBBuilderPackage.h: Add 'std::' where needed. + * PickCategoryLine.h: Ditto. + * category.h: Ditto. + * package_db.h: Ditto. + * package_meta.h: Ditto. + * package_source.h: Ditto. + * package_version.h: Ditto. + * site.h: Ditto. + * win32.h: Define NOMINMAX before including . + * package_meta.cc: Add 'using namespace std;'. + (packagemeta::set_requirements): Remove default parameter values + from definition (gcc3 likes them only in declaration). + * package_version.cc: Add 'using namespace std;'. + (packageversion::set_requirements): Remove default parameter + values from definition (gcc3 likes them only in declaration). + 2002-11-10 Robert Collins * compress_bz.cc: Don't include bzlib.h directly, the compress_bz.h diff --git a/Exception.cc b/Exception.cc index 407823e6..e6a234d4 100644 --- a/Exception.cc +++ b/Exception.cc @@ -20,7 +20,7 @@ Exception::Exception (char const *where, char const *message, int _appErrNo) : _ } char const * -Exception::what() const +Exception::what() const throw() { return _message; } diff --git a/Exception.h b/Exception.h index 950cf568..1b5dab0c 100644 --- a/Exception.h +++ b/Exception.h @@ -23,10 +23,10 @@ #include /* Generic excpetion class for throwing exceptions */ -class Exception : public exception { +class Exception : public std::exception { public: Exception (char const *where, char const *message, int appErrNo = 0); - char const *what() const; + char const *what() const throw(); int errNo() const; private: char const *_message; diff --git a/IniDBBuilderPackage.h b/IniDBBuilderPackage.h index c60c3020..a09959b2 100644 --- a/IniDBBuilderPackage.h +++ b/IniDBBuilderPackage.h @@ -73,8 +73,8 @@ private: packagemeta *csp; packageversion cspv; PackageSpecification *currentSpec; - vector *currentOrList; - vector *> *currentAndList; + std::vector *currentOrList; + std::vector *> *currentAndList; int trust; IniParseFeedback const &_feedback; }; diff --git a/PickCategoryLine.h b/PickCategoryLine.h index 41086d90..a75dc088 100644 --- a/PickCategoryLine.h +++ b/PickCategoryLine.h @@ -83,7 +83,7 @@ private: size_t depth; PickCategoryLine (PickCategoryLine const &); PickCategoryLine & operator= (PickCategoryLine const &); - vector < PickLine * > bucket; + std::vector < PickLine * > bucket; PickView& theView; }; #endif // _PICKCATEGORYLINE_H_ diff --git a/category.h b/category.h index d7cef5ac..9100d3cd 100644 --- a/category.h +++ b/category.h @@ -23,6 +23,6 @@ #include class packagemeta; -typedef pair > Category; +typedef std::pair > Category; #endif /* _CATEGORY_H_ */ diff --git a/package_db.h b/package_db.h index e44b13cf..54a3bf70 100644 --- a/package_db.h +++ b/package_db.h @@ -40,11 +40,11 @@ public: packagemeta * findBinary (PackageSpecification const &) const; packagemeta * findSource (PackageSpecification const &) const; /* all seen binary packages */ - static vector < packagemeta *> packages; + static std::vector < packagemeta *> packages; /* all seen source packages */ - static vector sourcePackages; + static std::vector sourcePackages; /* all seen categories */ - typedef map , String::caseless > categoriesType; + typedef std::map , String::caseless > categoriesType; static categoriesType categories; static PackageDBActions task; private: diff --git a/package_meta.cc b/package_meta.cc index 03d3c0c7..fad3c670 100644 --- a/package_meta.cc +++ b/package_meta.cc @@ -44,6 +44,8 @@ static const char *cvsid = "\n%%% $Id$\n"; #include +using namespace std; + static const char *standard_dirs[] = { "bin", "etc", @@ -416,7 +418,7 @@ packagemeta::set_action (packageversion const &default_version) } int -packagemeta::set_requirements (trusts deftrust = TRUST_CURR, size_t depth = 0) +packagemeta::set_requirements (trusts deftrust, size_t depth) { int changed = 0; /* handle build-depends */ diff --git a/package_meta.h b/package_meta.h index 2d14cb5d..61de81d3 100644 --- a/package_meta.h +++ b/package_meta.h @@ -95,8 +95,8 @@ public: * of a package disagree.... the first one read in will take precedence. */ void add_category (String const &); - set categories; - set versions; + std::set categories; + std::set versions; /* which one is installed. */ packageversion installed; diff --git a/package_source.h b/package_source.h index 4f493b34..a4f99093 100644 --- a/package_source.h +++ b/package_source.h @@ -102,7 +102,7 @@ public: virtual void set_canonical (char const *); virtual void set_cached (String const &); class md5 md5; - typedef vector sitestype; + typedef std::vector sitestype; sitestype sites; virtual ~ packagesource () diff --git a/package_version.cc b/package_version.cc index c40c50a6..ccd9d6f0 100644 --- a/package_version.cc +++ b/package_version.cc @@ -28,6 +28,8 @@ static const char *cvsid = #include "resource.h" #include +using namespace std; + /* a default class to avoid special casing empty packageversions */ /* TODO place into the class header */ @@ -368,7 +370,7 @@ processOneDependency(trusts deftrust, size_t depth, PackageSpecification *spec) } int -packageversion::set_requirements (trusts deftrust = TRUST_CURR, size_t depth = 0) +packageversion::set_requirements (trusts deftrust, size_t depth) { int changed = 0; vector *>::iterator dp = depends ()->begin(); diff --git a/package_version.h b/package_version.h index f2c390a3..ce7bb02e 100644 --- a/package_version.h +++ b/package_version.h @@ -117,7 +117,7 @@ public: void setSourcePackageSpecification (PackageSpecification const &); /* invariant: these never return NULL */ - vector *> *depends(), *predepends(), + std::vector *> *depends(), *predepends(), *recommends(), *suggests(), *replaces(), *conflicts(), *provides(), *binaries(); bool picked() const; /* true if this version is to be installed */ @@ -130,7 +130,7 @@ public: /* invariant: never null */ packagesource *source(); /* where can we source the file from */ /* invariant: never null */ - vector *sources(); /* expose the list of files. + std::vector *sources(); /* expose the list of files. source() returns the 'default' file sources() allows managing multiple files in a single package @@ -180,7 +180,7 @@ public: virtual PackageSpecification & sourcePackageSpecification (); virtual void setSourcePackageSpecification (PackageSpecification const &); - vector *> depends, predepends, recommends, + std::vector *> depends, predepends, recommends, suggests, replaces, conflicts, provides, binaries; bool picked; /* non zero if this version is to be installed */ @@ -191,7 +191,7 @@ public: virtual void uninstall () = 0; - vector sources; /* where can we source the files from */ + std::vector sources; /* where can we source the files from */ bool accessible () const; diff --git a/site.h b/site.h index 284d7fa6..6866c77e 100644 --- a/site.h +++ b/site.h @@ -73,7 +73,7 @@ public: bool operator >= (site_list_type const &) const; }; -typedef vector SiteList; +typedef std::vector SiteList; /* user chosen sites */ extern SiteList site_list; diff --git a/win32.h b/win32.h index 628f0f5d..a6a7350d 100644 --- a/win32.h +++ b/win32.h @@ -31,6 +31,8 @@ #define WIN32_LEAN_AND_MEAN /* We want a minimum IE version of 3 */ #define _WIN32_IE 0x0300 +/* libstdc++-v3 _really_ dislikes min & max defined as macros. */ +#define NOMINMAX #include #if HAVE_ALLOCA_H #include -- 2.43.5