]> git.saurik.com Git - apt.git/commitdiff
G++3 fixes from Randolph
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:57:57 +0000 (16:57 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:57:57 +0000 (16:57 +0000)
Author: jgg
Date: 2001-05-14 05:47:30 GMT
G++3 fixes from Randolph

apt-pkg/contrib/configuration.cc
apt-pkg/pkgcache.cc
apt-pkg/tagfile.cc
apt-pkg/version.h

index b8c806e28524cef4380f586476d0caaca2eedf94..2fa570c2195bf5fd15d7cb6ce9fff76b5d489b47 100644 (file)
@@ -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
 #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());
    
index fa231ef375878460c843c5c6e9bd8b011b60472c..d0a86ec69f004229920b25ffd5173593c15c6fa5 100644 (file)
@@ -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
 #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);
index faea00ec50fd3d36bf71f9ffb0ec679205623279..49330bad51b41ff29fb6ebef907ce17cfa547409 100644 (file)
@@ -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
     
 #include <string>
 #include <stdio.h>
+#include <ctype.h>
                                                                        /*}}}*/
 
+using std::string;
+
 // TagFile::pkgTagFile - Constructor                                   /*{{{*/
 // ---------------------------------------------------------------------
 /* */
index 27e8e1f1bc016c7644eb2ae0dfd585572d30a6df..4c37ba8f868625266633ed74dc03495eb5968e0e 100644 (file)
@@ -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();