diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:57:57 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:57:57 +0000 |
commit | 851a45a85fa486abc642e10f19afef11f621c29d (patch) | |
tree | 4422363bbe6e4bf3fc5f9ca8f9efcfe9ec79f0b9 /apt-pkg | |
parent | 422d9f6e1887b3adbb2a8e6798c61390079a0965 (diff) |
G++3 fixes from Randolph
Author: jgg
Date: 2001-05-14 05:47:30 GMT
G++3 fixes from Randolph
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/contrib/configuration.cc | 9 | ||||
-rw-r--r-- | apt-pkg/pkgcache.cc | 10 | ||||
-rw-r--r-- | apt-pkg/tagfile.cc | 5 | ||||
-rw-r--r-- | apt-pkg/version.h | 9 |
4 files changed, 22 insertions, 11 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index b8c806e28..2fa570c21 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: configuration.cc,v 1.21 2001/04/29 05:24:42 jgg Exp $ +// $Id: configuration.cc,v 1.22 2001/05/14 05:47:30 jgg Exp $ /* ###################################################################### Configuration Class @@ -24,11 +24,14 @@ #include <vector> #include <algorithm> #include <fstream> +#include <iostream> #include <stdio.h> #include <dirent.h> #include <sys/stat.h> #include <unistd.h> + +using namespace std; /*}}}*/ Configuration *_config = new Configuration; @@ -92,7 +95,7 @@ Configuration::Item *Configuration::Lookup(Item *Head,const char *S, if (Len != 0) { for (; I != 0; Last = &I->Next, I = I->Next) - if ((Res = stringcasecmp(I->Tag.begin(),I->Tag.end(),S,S + Len)) == 0) + if ((Res = stringcasecmp(I->Tag,S,S + Len)) == 0) break; } else @@ -438,7 +441,7 @@ bool ReadConfigFile(Configuration &Conf,string FName,bool AsSectional, unsigned Depth) { // Open the stream for reading - ifstream F(FName.c_str(),ios::in | ios::nocreate); + ifstream F(FName.c_str(),ios::in); if (!F != 0) return _error->Errno("ifstream::ifstream",_("Opening configuration file %s"),FName.c_str()); diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index fa231ef37..d0a86ec69 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: pkgcache.cc,v 1.34 2001/04/29 05:13:51 jgg Exp $ +// $Id: pkgcache.cc,v 1.35 2001/05/14 05:54:10 jgg Exp $ /* ###################################################################### Package Cache - Accessor code for the cache @@ -37,10 +37,12 @@ #include <sys/stat.h> #include <unistd.h> +#include <ctype.h> #include <system.h> - /*}}}*/ +using std::string; + // Cache::Header::Header - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Simply initialize the header */ @@ -154,7 +156,7 @@ bool pkgCache::ReMap() unsigned long pkgCache::sHash(string Str) const { unsigned long Hash = 0; - for (const char *I = Str.begin(); I != Str.end(); I++) + for (string::const_iterator I = Str.begin(); I != Str.end(); I++) Hash = 5*Hash + tolower(*I); return Hash % _count(HeaderP->HashTable); } @@ -178,7 +180,7 @@ pkgCache::PkgIterator pkgCache::FindPkg(string Name) for (; Pkg != PkgP; Pkg = PkgP + Pkg->NextPackage) { if (Pkg->Name != 0 && StrP[Pkg->Name] == Name[0] && - stringcasecmp(Name.begin(),Name.end(),StrP + Pkg->Name) == 0) + stringcasecmp(Name,StrP + Pkg->Name) == 0) return PkgIterator(*this,Pkg); } return PkgIterator(*this,0); diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index faea00ec5..49330bad5 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: tagfile.cc,v 1.29 2001/04/22 05:42:52 jgg Exp $ +// $Id: tagfile.cc,v 1.30 2001/05/14 05:56:26 jgg Exp $ /* ###################################################################### Fast scanner for RFC-822 type header information @@ -23,8 +23,11 @@ #include <string> #include <stdio.h> +#include <ctype.h> /*}}}*/ +using std::string; + // TagFile::pkgTagFile - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ diff --git a/apt-pkg/version.h b/apt-pkg/version.h index 27e8e1f1b..4c37ba8f8 100644 --- a/apt-pkg/version.h +++ b/apt-pkg/version.h @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: version.h,v 1.6 2001/02/20 07:03:17 jgg Exp $ +// $Id: version.h,v 1.7 2001/05/14 05:58:33 jgg Exp $ /* ###################################################################### Version - Versioning system.. @@ -26,6 +26,8 @@ #include <string> +using std::string; + class pkgVersioningSystem { public: @@ -39,6 +41,7 @@ class pkgVersioningSystem // Compare versions.. virtual int DoCmpVersion(const char *A,const char *Aend, const char *B,const char *Bend) = 0; + virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) = 0; virtual int DoCmpReleaseVer(const char *A,const char *Aend, const char *B,const char *Bend) = 0; @@ -55,7 +58,7 @@ class pkgVersioningSystem }; inline int CmpVersion(string A,string B) { - return DoCmpVersion(A.begin(),A.end(),B.begin(),B.end()); + return DoCmpVersion(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length()); }; inline int CmpReleaseVer(const char *A, const char *B) { @@ -63,7 +66,7 @@ class pkgVersioningSystem }; inline int CmpReleaseVer(string A,string B) { - return DoCmpReleaseVer(A.begin(),A.end(),B.begin(),B.end()); + return DoCmpReleaseVer(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length()); }; pkgVersioningSystem(); |