diff -urN apt-0.3.19cnc55.org/apt-pkg/acquire-method.cc apt-0.3.19cnc55/apt-pkg/acquire-method.cc --- apt-0.3.19cnc55.org/apt-pkg/acquire-method.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/acquire-method.cc Tue Mar 12 17:18:31 2002 @@ -27,6 +27,8 @@ #include #include #include +#include +using namespace std; /*}}}*/ // AcqMethod::pkgAcqMethod - Constructor /*{{{*/ @@ -85,7 +87,7 @@ void pkgAcqMethod::Fail(string Err,bool Transient) { // Strip out junk from the error messages - for (char *I = Err.begin(); I != Err.end(); I++) + for (string::iterator I = Err.begin(); I != Err.end(); I++) { if (*I == '\r') *I = ' '; @@ -285,10 +287,10 @@ { ::Configuration &Cnf = *_config; - const char *I = Message.begin(); + const char *I = Message.data(); unsigned int Length = strlen("Config-Item"); - for (; I + Length < Message.end(); I++) + for (; I + Length < Message.data()+Message.size(); I++) { // Not a config item if (I[Length] != ':' || stringcasecmp(I,I+Length,"Config-Item") != 0) @@ -296,11 +298,11 @@ I += Length + 1; - for (; I < Message.end() && *I == ' '; I++); + for (; I < Message.data()+Message.size() && *I == ' '; I++); const char *Equals = I; - for (; Equals < Message.end() && *Equals != '='; Equals++); + for (; Equals < Message.data()+Message.size() && *Equals != '='; Equals++); const char *End = Equals; - for (; End < Message.end() && *End != '\n'; End++); + for (; End < Message.data()+Message.size() && *End != '\n'; End++); if (End == Equals) return false; diff -urN apt-0.3.19cnc55.org/apt-pkg/acquire-worker.cc apt-0.3.19cnc55/apt-pkg/acquire-worker.cc --- apt-0.3.19cnc55.org/apt-pkg/acquire-worker.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/acquire-worker.cc Tue Mar 12 17:18:31 2002 @@ -131,7 +131,7 @@ // Setup the FDs dup2(Pipes[1],STDOUT_FILENO); dup2(Pipes[2],STDIN_FILENO); - dup2(((filebuf *)clog.rdbuf())->fd(),STDERR_FILENO); +// dup2(((filebuf *)clog.rdbuf())->fd(),STDERR_FILENO); SetCloseExec(STDOUT_FILENO,false); SetCloseExec(STDIN_FILENO,false); SetCloseExec(STDERR_FILENO,false); @@ -465,7 +465,7 @@ int Res; do { - Res = write(OutFd,OutQueue.begin(),OutQueue.length()); + Res = write(OutFd,OutQueue.data(),OutQueue.length()); } while (Res < 0 && errno == EINTR); diff -urN apt-0.3.19cnc55.org/apt-pkg/acquire-worker.h apt-0.3.19cnc55/apt-pkg/acquire-worker.h --- apt-0.3.19cnc55.org/apt-pkg/acquire-worker.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/acquire-worker.h Tue Mar 12 17:18:38 2002 @@ -21,10 +21,10 @@ // Interfacing to the method process class pkgAcquire::Worker { - friend pkgAcquire; + friend class pkgAcquire; protected: - friend Queue; + friend class Queue; /* Linked list starting at a Queue and a linked list starting at Acquire */ diff -urN apt-0.3.19cnc55.org/apt-pkg/acquire.cc apt-0.3.19cnc55/apt-pkg/acquire.cc --- apt-0.3.19cnc55.org/apt-pkg/acquire.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/acquire.cc Tue Mar 12 17:18:31 2002 @@ -365,7 +365,7 @@ I->Shutdown(false); // Shut down the items - for (Item **I = Items.begin(); I != Items.end(); I++) + for (vector::iterator I = Items.begin(); I != Items.end(); I++) (*I)->Finished(); if (_error->PendingError()) diff -urN apt-0.3.19cnc55.org/apt-pkg/acquire.h apt-0.3.19cnc55/apt-pkg/acquire.h --- apt-0.3.19cnc55.org/apt-pkg/acquire.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/acquire.h Tue Mar 12 17:18:38 2002 @@ -34,6 +34,7 @@ #include #include +using namespace std; #ifdef __GNUG__ #pragma interface "apt-pkg/acquire.h" @@ -52,8 +53,8 @@ class Worker; struct MethodConfig; struct ItemDesc; - friend Item; - friend Queue; + friend class Item; + friend class Queue; protected: @@ -100,8 +101,8 @@ // Simple iteration mechanism inline Worker *WorkersBegin() {return Workers;}; Worker *WorkerStep(Worker *I); - inline Item **ItemsBegin() {return Items.begin();}; - inline Item **ItemsEnd() {return Items.end();}; + inline Item **ItemsBegin() {return &*Items.begin();}; + inline Item **ItemsEnd() {return &*Items.end();}; // Iterate over queued Item URIs class UriIterator; @@ -132,8 +133,8 @@ // List of possible items queued for download. class pkgAcquire::Queue { - friend pkgAcquire; - friend pkgAcquire::UriIterator; + friend class pkgAcquire; + friend class pkgAcquire::UriIterator; Queue *Next; public: diff -urN apt-0.3.19cnc55.org/apt-pkg/algorithms.cc apt-0.3.19cnc55/apt-pkg/algorithms.cc --- apt-0.3.19cnc55.org/apt-pkg/algorithms.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/algorithms.cc Tue Mar 12 17:21:54 2002 @@ -20,7 +20,7 @@ #include #include #include -#include +#include /*}}}*/ #include diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/cdromutl.h apt-0.3.19cnc55/apt-pkg/contrib/cdromutl.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/cdromutl.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/cdromutl.h Tue Mar 12 17:18:38 2002 @@ -11,6 +11,7 @@ #define PKGLIB_ACQUIRE_METHOD_H #include +using namespace std; #ifdef __GNUG__ #pragma interface "apt-pkg/cdromutl.h" diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/configuration.cc apt-0.3.19cnc55/apt-pkg/contrib/configuration.cc --- apt-0.3.19cnc55.org/apt-pkg/contrib/configuration.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/configuration.cc Tue Mar 12 17:19:51 2002 @@ -20,7 +20,8 @@ #include #include -#include +#include +#include /*}}}*/ Configuration *_config = new Configuration; @@ -84,7 +85,7 @@ 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.data(),I->Tag.data()+I->Tag.size(),S,S + Len)) == 0) break; } else @@ -429,7 +430,7 @@ 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 -urN apt-0.3.19cnc55.org/apt-pkg/contrib/configuration.h apt-0.3.19cnc55/apt-pkg/contrib/configuration.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/configuration.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/configuration.h Tue Mar 12 17:18:38 2002 @@ -33,6 +33,7 @@ #endif #include +using namespace std; class Configuration { @@ -70,7 +71,7 @@ string FindFile(const char *Name,const char *Default = 0) const; string FindDir(const char *Name,const char *Default = 0) const; int FindI(const char *Name,int Default = 0) const; - int FindI(string Name,bool Default = 0) const {return FindI(Name.c_str(),Default);}; + int FindI(string Name,bool Default = 0) const {return FindI(Name.c_str(),int (Default));}; bool FindB(const char *Name,bool Default = false) const; bool FindB(string Name,bool Default = false) const {return FindB(Name.c_str(),Default);}; string FindAny(const char *Name,const char *Default = 0) const; diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/error.cc apt-0.3.19cnc55/apt-pkg/contrib/error.cc --- apt-0.3.19cnc55.org/apt-pkg/contrib/error.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/error.cc Tue Mar 12 17:18:31 2002 @@ -26,6 +26,9 @@ #include #include +#include +using namespace std; + #include "config.h" /*}}}*/ diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/error.h apt-0.3.19cnc55/apt-pkg/contrib/error.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/error.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/error.h Tue Mar 12 17:18:38 2002 @@ -45,6 +45,7 @@ #endif #include +using namespace std; class GlobalError { diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/fileutl.cc apt-0.3.19cnc55/apt-pkg/contrib/fileutl.cc --- apt-0.3.19cnc55.org/apt-pkg/contrib/fileutl.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/fileutl.cc Tue Mar 12 17:18:31 2002 @@ -28,6 +28,8 @@ #include #include #include +#include +using namespace std; /*}}}*/ // CopyFile - Buffered copy of a file /*{{{*/ diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/fileutl.h apt-0.3.19cnc55/apt-pkg/contrib/fileutl.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/fileutl.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/fileutl.h Tue Mar 12 17:18:38 2002 @@ -26,6 +26,7 @@ #endif #include +using namespace std; class FileFd { diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/i18n.h apt-0.3.19cnc55/apt-pkg/contrib/i18n.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/i18n.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/i18n.h Tue Mar 12 17:18:31 2002 @@ -46,8 +46,8 @@ # define bindtextdomain(Domain, Directory) /* empty */ # undef textdomain # define textdomain(Domain) /* empty */ -# undef setlocale -# define setlocale(cat, log) +//# undef setlocale +//# define setlocale(cat, log) # define _(a) a #endif diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/md5.cc apt-0.3.19cnc55/apt-pkg/contrib/md5.cc --- apt-0.3.19cnc55.org/apt-pkg/contrib/md5.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/md5.cc Tue Mar 12 17:18:31 2002 @@ -191,7 +191,7 @@ /* Converts the hex string into a set of chars */ bool MD5SumValue::Set(string Str) { - return Hex2Num(Str.begin(),Str.end(),Sum,sizeof(Sum)); + return Hex2Num(Str.data(),Str.data()+Str.size(),Sum,sizeof(Sum)); } /*}}}*/ // MD5SumValue::Value - Convert the number into a string /*{{{*/ diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/md5.h apt-0.3.19cnc55/apt-pkg/contrib/md5.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/md5.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/md5.h Tue Mar 12 17:18:38 2002 @@ -28,12 +28,13 @@ #endif #include +using namespace std; class MD5Summation; class MD5SumValue { - friend MD5Summation; + friend class MD5Summation; unsigned char Sum[4*4]; public: diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/mmap.h apt-0.3.19cnc55/apt-pkg/contrib/mmap.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/mmap.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/mmap.h Tue Mar 12 17:18:38 2002 @@ -92,7 +92,7 @@ unsigned long RawAllocate(unsigned long Size,unsigned long Aln = 0); unsigned long Allocate(unsigned long ItemSize); unsigned long WriteString(const char *String,unsigned long Len = (unsigned long)-1); - inline unsigned long WriteString(string S) {return WriteString(S.begin(),S.size());}; + inline unsigned long WriteString(string S) {return WriteString(S.data(),S.size());}; void UsePools(Pool &P,unsigned int Count) {Pools = &P; PoolCount = Count;}; DynamicMMap(FileFd &F,unsigned long Flags,unsigned long WorkSpace = 2*1024*1024); diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/progress.cc apt-0.3.19cnc55/apt-pkg/contrib/progress.cc --- apt-0.3.19cnc55.org/apt-pkg/contrib/progress.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/progress.cc Tue Mar 12 17:18:31 2002 @@ -15,6 +15,7 @@ #include #include #include +#include /*}}}*/ #include diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/progress.h apt-0.3.19cnc55/apt-pkg/contrib/progress.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/progress.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/progress.h Tue Mar 12 17:18:38 2002 @@ -27,6 +27,7 @@ #include #include +using namespace std; class Configuration; class OpProgress diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/strutl.cc apt-0.3.19cnc55/apt-pkg/contrib/strutl.cc --- apt-0.3.19cnc55.org/apt-pkg/contrib/strutl.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/strutl.cc Tue Mar 12 17:18:31 2002 @@ -464,22 +464,22 @@ { // Look for a matching tag. int Length = strlen(Tag); - for (string::iterator I = Message.begin(); I + Length < Message.end(); I++) + for (const char *I = Message.data(); I + Length < Message.data()+Message.size(); I++) { // Found the tag if (I[Length] == ':' && stringcasecmp(I,I+Length,Tag) == 0) { // Find the end of line and strip the leading/trailing spaces - string::iterator J; + const char *J; I += Length + 1; - for (; isspace(*I) != 0 && I < Message.end(); I++); - for (J = I; *J != '\n' && J < Message.end(); J++); + for (; isspace(*I) != 0 && I < Message.data()+Message.size(); I++); + for (J = I; *J != '\n' && J < Message.data()+Message.size(); J++); for (; J > I && isspace(J[-1]) != 0; J--); return string(I,J-I); } - for (; *I != '\n' && I < Message.end(); I++); + for (; *I != '\n' && I < Message.data()+Message.size(); I++); } // Failed to find a match @@ -492,7 +492,7 @@ // --------------------------------------------------------------------- /* This inspects the string to see if it is true or if it is false and then returns the result. Several varients on true/false are checked. */ -int StringToBool(string Text,int Default = -1) +int StringToBool(string Text,int Default) { char *End; int Res = strtol(Text.c_str(),&End,0); @@ -867,16 +867,16 @@ matched against the argument */ bool CheckDomainList(string Host,string List) { - string::const_iterator Start = List.begin(); - for (string::const_iterator Cur = List.begin(); Cur <= List.end(); Cur++) + const char *Start = List.data(); + for (const char *Cur = List.data(); Cur <= List.data()+List.size(); Cur++) { - if (Cur < List.end() && *Cur != ',') + if (Cur < List.data()+List.size() && *Cur != ',') continue; // Match the end of the string.. if ((Host.size() >= (unsigned)(Cur - Start)) && Cur - Start != 0 && - stringcasecmp(Host.end() - (Cur - Start),Host.end(),Start,Cur) == 0) + stringcasecmp(Host.data()+Host.size() - (Cur - Start),Host.data()+Host.size(),Start,Cur) == 0) return true; Start = Cur + 1; diff -urN apt-0.3.19cnc55.org/apt-pkg/contrib/strutl.h apt-0.3.19cnc55/apt-pkg/contrib/strutl.h --- apt-0.3.19cnc55.org/apt-pkg/contrib/strutl.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/contrib/strutl.h Tue Mar 12 17:18:38 2002 @@ -24,7 +24,8 @@ #include #include #include - +using namespace std; + char *_strstrip(char *String); char *_strtabexpand(char *String,size_t Len); bool ParseQuoteWord(const char *&String,string &Res); @@ -49,11 +50,11 @@ int stringcmp(const char *A,const char *AEnd,const char *B,const char *BEnd); inline int stringcmp(const char *A,const char *AEnd,const char *B) {return stringcmp(A,AEnd,B,B+strlen(B));}; -inline int stringcmp(string A,const char *B) {return stringcmp(A.begin(),A.end(),B,B+strlen(B));}; +inline int stringcmp(string A,const char *B) {return stringcmp(A.data(),A.data()+A.size(),B,B+strlen(B));}; int stringcasecmp(const char *A,const char *AEnd,const char *B,const char *BEnd); inline int stringcasecmp(const char *A,const char *AEnd,const char *B) {return stringcasecmp(A,AEnd,B,B+strlen(B));}; -inline int stringcasecmp(string A,const char *B) {return stringcasecmp(A.begin(),A.end(),B,B+strlen(B));}; -inline int stringcasecmp(string A,string B) {return stringcasecmp(A.begin(),A.end(),B.begin(),B.end());}; +inline int stringcasecmp(string A,const char *B) {return stringcasecmp(A.data(),A.data()+A.size(),B,B+strlen(B));}; +inline int stringcasecmp(string A,string B) {return stringcasecmp(A.data(),A.data()+A.size(),B.data(),B.data()+B.size());}; class URI { diff -urN apt-0.3.19cnc55.org/apt-pkg/deb/deblistparser.cc apt-0.3.19cnc55/apt-pkg/deb/deblistparser.cc --- apt-0.3.19cnc55.org/apt-pkg/deb/deblistparser.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/deb/deblistparser.cc Tue Mar 12 17:18:31 2002 @@ -17,6 +17,7 @@ #include #include +#include /*}}}*/ // ListParser::debListParser - Constructor /*{{{*/ @@ -483,7 +484,7 @@ if (Section.Find("Architecture",Start,Stop) == false) return true; - if (stringcmp(Start,Stop,Arch.begin(),Arch.end()) == 0) + if (stringcmp(Start,Stop,Arch.data(),Arch.data()+Arch.size()) == 0) return true; if (stringcmp(Start,Stop,"all") == 0) diff -urN apt-0.3.19cnc55.org/apt-pkg/deb/debsrcrecords.cc apt-0.3.19cnc55/apt-pkg/deb/debsrcrecords.cc --- apt-0.3.19cnc55.org/apt-pkg/deb/debsrcrecords.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/deb/debsrcrecords.cc Tue Mar 12 17:18:31 2002 @@ -33,17 +33,17 @@ return 0; // XXX no bounds check: exploitable? // Strip any leading spaces - string::const_iterator Start = Bins.begin(); - for (; Start != Bins.end() && isspace(*Start) != 0; Start++); + const char *Start = Bins.data(); + for (; Start != Bins.data()+Bins.size() && isspace(*Start) != 0; Start++); - string::const_iterator Pos = Start; - while (Pos != Bins.end()) + const char *Pos = Start; + while (Pos != Bins.data()+Bins.size()) { // Skip to the next ',' - for (; Pos != Bins.end() && *Pos != ','; Pos++); + for (; Pos != Bins.data()+Bins.size() && *Pos != ','; Pos++); // Back remove spaces - string::const_iterator End = Pos; + const char *End = Pos; for (; End > Start && (End[-1] == ',' || isspace(End[-1]) != 0); End--); // Stash the string @@ -54,7 +54,7 @@ *Buf++ = 0; // Advance pos - for (; Pos != Bins.end() && (*Pos == ',' || isspace(*Pos) != 0); Pos++); + for (; Pos != Bins.data()+Bins.size() && (*Pos == ',' || isspace(*Pos) != 0); Pos++); Start = Pos; } diff -urN apt-0.3.19cnc55.org/apt-pkg/deb/dpkginit.cc apt-0.3.19cnc55/apt-pkg/deb/dpkginit.cc --- apt-0.3.19cnc55.org/apt-pkg/deb/dpkginit.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/deb/dpkginit.cc Tue Mar 12 17:18:31 2002 @@ -23,6 +23,7 @@ #include #include #include +#include /*}}}*/ // DpkgLock::pkgDpkgLock - Constructor /*{{{*/ diff -urN apt-0.3.19cnc55.org/apt-pkg/deb/dpkgpm.cc apt-0.3.19cnc55/apt-pkg/deb/dpkgpm.cc --- apt-0.3.19cnc55.org/apt-pkg/deb/dpkgpm.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/deb/dpkgpm.cc Tue Mar 12 17:18:31 2002 @@ -23,6 +23,8 @@ #include #include #include +#include +using namespace std; /*}}}*/ // DPkgPM::pkgDPkgPM - Constructor /*{{{*/ @@ -200,7 +202,7 @@ /* Feed the filename of each package that is pending install into the pipe. */ - if (Fd.Write(I->File.begin(),I->File.length()) == false || + if (Fd.Write(I->File.data(),I->File.length()) == false || Fd.Write("\n",1) == false) { kill(Process,SIGINT); diff -urN apt-0.3.19cnc55.org/apt-pkg/pkgcache.cc apt-0.3.19cnc55/apt-pkg/pkgcache.cc --- apt-0.3.19cnc55.org/apt-pkg/pkgcache.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/pkgcache.cc Tue Mar 12 17:18:31 2002 @@ -144,7 +144,7 @@ for (const char *I = Str.begin(); I != Str.end(); I++) Hash = 5*Hash + tolower(*I); #else - for (const char *I = Str.begin(); I != Str.end(); I++) + for (const char *I = Str.data(); I != Str.data()+Str.size(); I++) Hash = 5*Hash + *I; #endif return Hash % _count(HeaderP->HashTable); @@ -179,7 +179,7 @@ return PkgIterator(*this,Pkg); #else if (Pkg->Name != 0 && StrP[Pkg->Name] == Name[0] && - stringcmp(Name.begin(),Name.end(),StrP + Pkg->Name) == 0) + stringcmp(Name.data(),Name.data()+Name.size(),StrP + Pkg->Name) == 0) return PkgIterator(*this,Pkg); #endif } diff -urN apt-0.3.19cnc55.org/apt-pkg/pkgcache.h apt-0.3.19cnc55/apt-pkg/pkgcache.h --- apt-0.3.19cnc55.org/apt-pkg/pkgcache.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/pkgcache.h Tue Mar 12 17:18:38 2002 @@ -48,12 +48,12 @@ class PrvIterator; class PkgFileIterator; class VerFileIterator; - friend PkgIterator; - friend VerIterator; - friend DepIterator; - friend PrvIterator; - friend PkgFileIterator; - friend VerFileIterator; + friend class PkgIterator; + friend class VerIterator; + friend class DepIterator; + friend class PrvIterator; + friend class PkgFileIterator; + friend class VerFileIterator; // These are all the constants used in the cache structures struct Dep diff -urN apt-0.3.19cnc55.org/apt-pkg/pkgcachegen.cc apt-0.3.19cnc55/apt-pkg/pkgcachegen.cc --- apt-0.3.19cnc55.org/apt-pkg/pkgcachegen.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/pkgcachegen.cc Tue Mar 12 17:18:31 2002 @@ -108,7 +108,7 @@ int Res = 1; for (; Ver.end() == false; Last = &Ver->NextVer, Ver++) { - Res = _system->versionCompare(Version.begin(),Version.end(),Ver.VerStr(), + Res = _system->versionCompare(Version.data(),Version.data()+Version.size(),Ver.VerStr(), Ver.VerStr() + strlen(Ver.VerStr())); if (Res >= 0) { break; @@ -158,7 +158,7 @@ { for (; Ver.end() == false; Last = &Ver->NextVer, Ver++) { - Res = _system->versionCompare(Version.begin(),Version.end(),Ver.VerStr(), + Res = _system->versionCompare(Version.data(),Version.data()+Version.size(),Ver.VerStr(), Ver.VerStr() + strlen(Ver.VerStr())); if (Res != 0) break; diff -urN apt-0.3.19cnc55.org/apt-pkg/pkgcachegen.h apt-0.3.19cnc55/apt-pkg/pkgcachegen.h --- apt-0.3.19cnc55.org/apt-pkg/pkgcachegen.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/pkgcachegen.h Tue Mar 12 17:18:38 2002 @@ -39,7 +39,7 @@ public: class ListParser; - friend ListParser; + friend class ListParser; protected: @@ -74,7 +74,7 @@ class pkgCacheGenerator::ListParser { pkgCacheGenerator *Owner; - friend pkgCacheGenerator; + friend class pkgCacheGenerator; // Some cache items pkgCache::VerIterator OldDepVer; diff -urN apt-0.3.19cnc55.org/apt-pkg/pkgrecords.h apt-0.3.19cnc55/apt-pkg/pkgrecords.h --- apt-0.3.19cnc55.org/apt-pkg/pkgrecords.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/pkgrecords.h Tue Mar 12 17:18:38 2002 @@ -60,7 +60,7 @@ protected: public: - friend pkgRecords; + friend class pkgRecords; virtual bool Jump(pkgCache::VerFileIterator const &Ver) = 0; diff -urN apt-0.3.19cnc55.org/apt-pkg/rpm/rpmfactory.h apt-0.3.19cnc55/apt-pkg/rpm/rpmfactory.h --- apt-0.3.19cnc55.org/apt-pkg/rpm/rpmfactory.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/rpm/rpmfactory.h Tue Mar 12 17:18:38 2002 @@ -4,7 +4,7 @@ #include #include -#include +#include #include class RPMFactory : public SystemFactory diff -urN apt-0.3.19cnc55.org/apt-pkg/rpm/rpmlistparser.cc apt-0.3.19cnc55/apt-pkg/rpm/rpmlistparser.cc --- apt-0.3.19cnc55.org/apt-pkg/rpm/rpmlistparser.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/rpm/rpmlistparser.cc Tue Mar 12 17:18:31 2002 @@ -80,7 +80,7 @@ char *p; #ifdef DUPPACK - AllowedDupPackages = new slist; + AllowedDupPackages = new list; const Configuration::Item *Top = _config->Tree("RPM::AllowedDupPkgs"); @@ -108,7 +108,7 @@ AllowedDupPackages = NULL;//akk #endif - HoldPackages = new slist; + HoldPackages = new list; Top = _config->Tree("RPM::HoldPkgs"); @@ -180,7 +180,7 @@ if (AllowedDupPackages != NULL) { - for (slist::iterator iter = AllowedDupPackages->begin(); + for (list::iterator iter = AllowedDupPackages->begin(); iter != AllowedDupPackages->end(); iter++) { @@ -459,7 +459,7 @@ { const char *str = Package().c_str(); - for (slist::iterator iter = HoldPackages->begin(); + for (list::iterator iter = HoldPackages->begin(); iter != HoldPackages->end(); iter++) { diff -urN apt-0.3.19cnc55.org/apt-pkg/rpm/rpmlistparser.h apt-0.3.19cnc55/apt-pkg/rpm/rpmlistparser.h --- apt-0.3.19cnc55.org/apt-pkg/rpm/rpmlistparser.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/rpm/rpmlistparser.h Tue Mar 12 17:18:38 2002 @@ -16,9 +16,10 @@ #include #include #include -#include +#include #include #include +using namespace std; class rpmListParser : public pkgCacheGenerator::ListParser { @@ -33,10 +34,10 @@ map *multiarchs; map *DupPackages; - slist *AllowedDupPackages; + list *AllowedDupPackages; bool duplicated; - slist *HoldPackages; + list *HoldPackages; bool parsing_hdlist; diff -urN apt-0.3.19cnc55.org/apt-pkg/rpm/rpmpm.cc apt-0.3.19cnc55/apt-pkg/rpm/rpmpm.cc --- apt-0.3.19cnc55.org/apt-pkg/rpm/rpmpm.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/rpm/rpmpm.cc Tue Mar 12 17:18:31 2002 @@ -26,6 +26,8 @@ #include #include +#include +using namespace std; #include @@ -208,7 +210,7 @@ /* Feed the filename of each package that is pending install into the pipe. */ - if (Fd.Write(I->File.begin(),I->File.length()) == false || + if (Fd.Write(I->File.data(),I->File.length()) == false || Fd.Write("\n",1) == false) { kill(Process,SIGINT); @@ -229,7 +231,7 @@ /*}}}*/ -bool pkgRPMPM::ExecRPM(Operation operation, slist *files, bool nodeps) +bool pkgRPMPM::ExecRPM(Operation operation, list *files, bool nodeps) { // Generate the argument list const char *Args[10000]; @@ -330,7 +332,7 @@ break; } - for (slist::iterator i = files->begin(); + for (list::iterator i = files->begin(); i != files->end() && n < sizeof(Args); i++) { @@ -422,9 +424,9 @@ } -bool pkgRPMPM::Process(slist *install, - slist *upgrade, - slist *uninstall) +bool pkgRPMPM::Process(list *install, + list *upgrade, + list *uninstall) { if (_config->FindB("RPM::Check-Signatures", false) == true) { @@ -469,9 +471,9 @@ if (RunScriptsWithPkgs("RPM::Pre-Install-Pkgs") == false) return false; - slist *install = new slist; - slist *upgrade = new slist; - slist *uninstall = new slist; + list *install = new list; + list *upgrade = new list; + list *uninstall = new list; for (vector::iterator I = List.begin(); I != List.end(); I++) { diff -urN apt-0.3.19cnc55.org/apt-pkg/rpm/rpmpm.h apt-0.3.19cnc55/apt-pkg/rpm/rpmpm.h --- apt-0.3.19cnc55.org/apt-pkg/rpm/rpmpm.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/rpm/rpmpm.h Tue Mar 12 17:18:38 2002 @@ -17,7 +17,7 @@ #include #include -#include +#include class pkgRPMPM : public pkgPackageManager @@ -50,10 +50,10 @@ virtual bool Configure(PkgIterator Pkg); virtual bool Remove(PkgIterator Pkg,bool Purge = false); - bool ExecRPM(Operation operation, slist *files, bool nodeps); - bool Process(slist *install, - slist *upgrade, - slist *uninstall); + bool ExecRPM(Operation operation, list *files, bool nodeps); + bool Process(list *install, + list *upgrade, + list *uninstall); virtual bool Go(); virtual void Reset(); diff -urN apt-0.3.19cnc55.org/apt-pkg/rpm/rpmversion.cc apt-0.3.19cnc55/apt-pkg/rpm/rpmversion.cc --- apt-0.3.19cnc55.org/apt-pkg/rpm/rpmversion.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/rpm/rpmversion.cc Tue Mar 12 17:18:31 2002 @@ -22,7 +22,7 @@ int RPMFactory::versionCompare(string A,string B) { - return versionCompare(A.begin(),A.end(),B.begin(),B.end()); + return versionCompare(A.data(),A.data()+A.size(),B.data(),B.data()+B.size()); } diff -urN apt-0.3.19cnc55.org/apt-pkg/sourcelist.cc apt-0.3.19cnc55/apt-pkg/sourcelist.cc --- apt-0.3.19cnc55.org/apt-pkg/sourcelist.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/sourcelist.cc Tue Mar 12 17:21:01 2002 @@ -22,7 +22,7 @@ #include -#include +#include #include #include #include @@ -91,7 +91,7 @@ bool pkgSourceList::Read(string File) { // Open the stream for reading - ifstream F(File.c_str(),ios::in | ios::nocreate); + ifstream F(File.c_str(),ios::in); if (!F != 0) return _error->Errno("ifstream::ifstream","Opening %s",File.c_str()); diff -urN apt-0.3.19cnc55.org/apt-pkg/sourcelist.h apt-0.3.19cnc55/apt-pkg/sourcelist.h --- apt-0.3.19cnc55.org/apt-pkg/sourcelist.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/sourcelist.h Tue Mar 12 17:20:20 2002 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #ifdef __GNUG__ diff -urN apt-0.3.19cnc55.org/apt-pkg/tagfile.cc apt-0.3.19cnc55/apt-pkg/tagfile.cc --- apt-0.3.19cnc55.org/apt-pkg/tagfile.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/tagfile.cc Tue Mar 12 17:18:31 2002 @@ -23,6 +23,8 @@ #include #include +#include +using namespace std; /*}}}*/ // TagFile::pkgTagFile - Constructor /*{{{*/ diff -urN apt-0.3.19cnc55.org/apt-pkg/version.cc apt-0.3.19cnc55/apt-pkg/version.cc --- apt-0.3.19cnc55.org/apt-pkg/version.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/apt-pkg/version.cc Tue Mar 12 17:18:31 2002 @@ -50,7 +50,7 @@ int SystemFactory::versionCompare(string A,string B) { - return versionCompare(A.begin(),A.end(),B.begin(),B.end()); + return versionCompare(A.data(),A.data()+A.size(),B.data(),B.data()+B.size()); } /*}}}*/ diff -urN apt-0.3.19cnc55.org/cmdline/apt-cache.cc apt-0.3.19cnc55/cmdline/apt-cache.cc --- apt-0.3.19cnc55.org/cmdline/apt-cache.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/cmdline/apt-cache.cc Tue Mar 12 17:24:41 2002 @@ -38,7 +38,7 @@ #include -#include +#include #include #include #include diff -urN apt-0.3.19cnc55.org/cmdline/apt-cdrom.cc apt-0.3.19cnc55/cmdline/apt-cdrom.cc --- apt-0.3.19cnc55.org/cmdline/apt-cdrom.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/cmdline/apt-cdrom.cc Tue Mar 12 17:31:04 2002 @@ -34,6 +34,7 @@ #include #include /*}}}*/ +using namespace std; #define PACKAGES "pkglist" #define SOURCES "srclist" @@ -514,7 +515,8 @@ string File = _config->FindFile("Dir::Etc::sourcelist"); // Open the stream for reading - ifstream F(File.c_str(),ios::in | ios::nocreate); + ifstream F((FileExists(File)?File.c_str():"/dev/null"), + ios::in ); if (!F != 0) return _error->Errno("ifstream::ifstream","Opening %s",File.c_str()); diff -urN apt-0.3.19cnc55.org/cmdline/apt-get.cc apt-0.3.19cnc55/cmdline/apt-get.cc --- apt-0.3.19cnc55.org/cmdline/apt-get.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/cmdline/apt-get.cc Tue Mar 12 17:28:13 2002 @@ -54,7 +54,7 @@ #include "acqprogress.h" -#include +#include #include #include #include @@ -66,11 +66,11 @@ #include #include /*}}}*/ +using namespace std; - -ostream c0out; -ostream c1out; -ostream c2out; +ostream c0out(0); +ostream c1out(0); +ostream c2out(0); ofstream devnull("/dev/null"); unsigned int ScreenWidth = 80; @@ -1202,7 +1202,7 @@ // Populate it with the source selection for (I = List.begin(); I != List.end(); I++) { - new pkgAcqIndex(&Fetcher,I); + new pkgAcqIndex(&Fetcher,&*I); if (_error->PendingError() == true) return false; } diff -urN apt-0.3.19cnc55.org/cmdline/rpmindexcopy.cc apt-0.3.19cnc55/cmdline/rpmindexcopy.cc --- apt-0.3.19cnc55.org/cmdline/rpmindexcopy.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/cmdline/rpmindexcopy.cc Tue Mar 12 17:31:30 2002 @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include diff -urN apt-0.3.19cnc55.org/methods/cdrom.cc apt-0.3.19cnc55/methods/cdrom.cc --- apt-0.3.19cnc55.org/methods/cdrom.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/methods/cdrom.cc Tue Mar 12 17:18:31 2002 @@ -17,6 +17,8 @@ #include #include #include +#include +using namespace std; /*}}}*/ class CDROMMethod : public pkgAcqMethod diff -urN apt-0.3.19cnc55.org/methods/gpg.cc apt-0.3.19cnc55/methods/gpg.cc --- apt-0.3.19cnc55.org/methods/gpg.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/methods/gpg.cc Tue Mar 12 17:18:31 2002 @@ -8,6 +8,7 @@ #include #include #include +#include class GPGMethod : public pkgAcqMethod diff -urN apt-0.3.19cnc55.org/tools/cached_md5.cc apt-0.3.19cnc55/tools/cached_md5.cc --- apt-0.3.19cnc55.org/tools/cached_md5.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/tools/cached_md5.cc Tue Mar 12 17:40:00 2002 @@ -38,10 +38,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff -urN apt-0.3.19cnc55.org/tools/cached_md5.h apt-0.3.19cnc55/tools/cached_md5.h --- apt-0.3.19cnc55.org/tools/cached_md5.h Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/tools/cached_md5.h Tue Mar 12 17:39:18 2002 @@ -16,6 +16,8 @@ #include #include +using namespace std; + class CachedMD5 { string filename; diff -urN apt-0.3.19cnc55.org/tools/genpkglist.cc apt-0.3.19cnc55/tools/genpkglist.cc --- apt-0.3.19cnc55.org/tools/genpkglist.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/tools/genpkglist.cc Tue Mar 12 17:38:11 2002 @@ -74,6 +74,7 @@ #include #include +#include #include #include @@ -82,7 +83,7 @@ #include "cached_md5.h" - +using namespace std; #define CRPMTAG_TIMESTAMP 1012345 diff -urN apt-0.3.19cnc55.org/tools/gensrclist.cc apt-0.3.19cnc55/tools/gensrclist.cc --- apt-0.3.19cnc55.org/tools/gensrclist.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/tools/gensrclist.cc Tue Mar 12 17:49:06 2002 @@ -47,8 +47,9 @@ #include #include +#include #include -#include +#include #include #include @@ -56,7 +57,7 @@ #include "cached_md5.h" - +using namespace std; @@ -105,7 +106,7 @@ } } -bool readRPMTable(char *file, map* > &table) +bool readRPMTable(char *file, map* > &table) { FILE *indexf; char buf[512]; @@ -129,14 +130,14 @@ srpm = string(buf); if (table.find(srpm) != table.end()) { - slist *list = table[srpm]; + list *xlist = table[srpm]; - list->push_front(strdup(f)); + xlist->push_front(strdup(f)); } else { - slist *list = new slist; + list *xlist = new list; - list->push_front(strdup(f)); - table[srpm] = list; + xlist->push_front(strdup(f)); + table[srpm] = xlist; } } @@ -175,7 +176,7 @@ char *directory; char *index; CachedMD5 *md5cache; - map* > rpmTable; // table that maps srpm -> generated rpm + map* > rpmTable; // table that maps srpm -> generated rpm bool mapi = false; bool progressBar = false; bool flatStructure = false; @@ -329,24 +330,24 @@ foundInIndex = false; { int count = 0; - char **list = NULL; - slist *rpmlist = rpmTable[string(dirEntries[entry_cur]->d_name)]; + char **xlist = NULL; + list *rpmlist = rpmTable[string(dirEntries[entry_cur]->d_name)]; if (rpmlist) { - list = new char *[rpmlist->size()]; + xlist = new char *[rpmlist->size()]; foundInIndex = true; - for (slist::const_iterator i = rpmlist->begin(); + for (list::const_iterator i = rpmlist->begin(); i != rpmlist->end(); i++) { - list[count++] = *i; + xlist[count++] = *i; } } if (count) { headerAddEntry(newHeader, CRPMTAG_BINARY, - RPM_STRING_ARRAY_TYPE, list, count); + RPM_STRING_ARRAY_TYPE, xlist, count); } } if (foundInIndex || !mapi) diff -urN apt-0.3.19cnc55.org/tools/hdlist2pkglist.cc apt-0.3.19cnc55/tools/hdlist2pkglist.cc --- apt-0.3.19cnc55.org/tools/hdlist2pkglist.cc Tue Mar 12 18:04:10 2002 +++ apt-0.3.19cnc55/tools/hdlist2pkglist.cc Tue Mar 12 17:50:29 2002 @@ -36,21 +36,24 @@ #include #include #include +#include #include #include #include -#include #include #include #include #include #include +#include #include #include #include +using namespace std; + // from rpmlib extern "C" { extern int mdfile(const char *fn, unsigned char *digest);