]> git.saurik.com Git - apt.git/commitdiff
fix some new compiler warnings reported by gcc-5
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 9 Mar 2015 14:54:39 +0000 (15:54 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 16 Mar 2015 17:01:21 +0000 (18:01 +0100)
Git-Dch: Ignore

apt-pkg/cacheset.cc
apt-pkg/cacheset.h
apt-pkg/cdrom.cc
apt-pkg/contrib/configuration.cc
apt-pkg/deb/debmetaindex.cc
apt-pkg/sourcelist.cc

index 9127a4064f94748f1cf88667e0fe3682205f38e4..0ad99713a57718eb9e56e1844855e95c33bd9c49 100644 (file)
@@ -754,7 +754,7 @@ pkgCache::VerIterator CacheSetHelper::canNotGetCandInstVer(pkgCacheFile &Cache,
                                                                        /*}}}*/
                                                                        /*}}}*/
 // showPackageSelection - by selector and given pattern                        /*{{{*/
-APT_CONST void CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const &pkg, enum PkgSelector const select,
+void CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const &pkg, enum PkgSelector const select,
                                       std::string const &pattern) {
        switch (select) {
 APT_IGNORE_DEPRECATED_PUSH
@@ -784,7 +784,7 @@ APT_CONST void CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const
                                                                        /*}}}*/
                                                                        /*}}}*/
 // showVersionSelection                                                        /*{{{*/
-APT_CONST void CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const &Pkg,
+void CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const &Pkg,
       pkgCache::VerIterator const &Ver, enum VerSelector const select, std::string const &pattern) {
        switch (select) {
 APT_IGNORE_DEPRECATED_PUSH
index 884e8b859cff9aced5259d3251c0a8b75cd49800..97aee8c2de9161e5423242762b67633eb4c2b566 100644 (file)
@@ -225,7 +225,9 @@ public:
                inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); }
                inline std::string FullName() const { return getPkg().FullName(); }
                APT_DEPRECATED inline const char *Section() const {
-                  APT_IGNORE_DEPRECATED(return getPkg().Section();)
+                  APT_IGNORE_DEPRECATED_PUSH
+                     return getPkg().Section();
+                  APT_IGNORE_DEPRECATED_POP
                }
                inline bool Purge() const {return getPkg().Purge(); }
                inline const char *Arch() const {return getPkg().Arch(); }
index aaa7b82e0f3e392e682ce846cd449317893982cd..5eccbe5de55ecda2a6e299029a27f113c759ef01 100644 (file)
@@ -466,7 +466,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
    // Open the stream for reading
    ifstream F((FileExists(File)?File.c_str():"/dev/null"),
              ios::in );
-   if (!F != 0)
+   if (F.fail() == true)
       return _error->Errno("ifstream::ifstream","Opening %s",File.c_str());
 
    string NewFile = File + ".new";
@@ -477,7 +477,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
                           "Failed to open %s.new",File.c_str());
 
    // Create a short uri without the path
-   string ShortURI = "cdrom:[" + Name + "]/";   
+   string ShortURI = "cdrom:[" + Name + "]/";
    string ShortURI2 = "cdrom:" + Name + "/";     // For Compatibility
 
    string Type;
@@ -485,12 +485,12 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
       Type = "deb-src";
    else
       Type = "deb";
-   
+
    char Buffer[300];
    int CurLine = 0;
    bool First = true;
    while (F.eof() == false)
-   {      
+   {
       F.getline(Buffer,sizeof(Buffer));
       CurLine++;
       if (F.fail() && !F.eof())
@@ -754,7 +754,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)                                     /*{{{*/
          FileExists(InfoDir + "/info") == true)
       {
         ifstream F((InfoDir + "/info").c_str());
-        if (!F == 0)
+        if (F.good() == true)
            getline(F,Name);
 
         if (Name.empty() == false)
index 483d5bb1b7f1944070d2a1eb5af8e3bc80e086fe..42e35d32abd99e176dd82c88852cfc5d5647810f 100644 (file)
@@ -629,19 +629,19 @@ string Configuration::Item::FullTag(const Item *Stop) const
    tag/value. AsSectional enables Sectional parsing.*/
 bool ReadConfigFile(Configuration &Conf,const string &FName,bool const &AsSectional,
                    unsigned const &Depth)
-{   
+{
    // Open the stream for reading
-   ifstream F(FName.c_str(),ios::in); 
-   if (!F != 0)
+   ifstream F(FName.c_str(),ios::in);
+   if (F.fail() == true)
       return _error->Errno("ifstream::ifstream",_("Opening configuration file %s"),FName.c_str());
 
    string LineBuffer;
    string Stack[100];
    unsigned int StackPos = 0;
-   
+
    // Parser state
    string ParentTag;
-   
+
    int CurLine = 0;
    bool InComment = false;
    while (F.eof() == false)
index 81e067424e215ca2e9c99748bd8d9bffb72c4d5b..aa2db8149f81d9136a54573b8abe0f46acae027d 100644 (file)
@@ -402,9 +402,12 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type
    {
       // parse arch=, arch+= and arch-= settings
       map<string, string>::const_iterator arch = Options.find("arch");
-      vector<string> Archs =
-               (arch != Options.end()) ? VectorizeString(arch->second, ',') :
-                               APT::Configuration::getArchitectures();
+      vector<string> Archs;
+      if (arch != Options.end())
+        Archs = VectorizeString(arch->second, ',');
+      else
+        Archs = APT::Configuration::getArchitectures();
+
       if ((arch = Options.find("arch+")) != Options.end())
       {
         std::vector<std::string> const plusArch = VectorizeString(arch->second, ',');
index 7170e8b5ba4ab1f81fdd056b6a9d3f44dc4aee65..8b960572bc71b2a7dd989419a5ad11ca93ea1e7f 100644 (file)
@@ -331,7 +331,7 @@ bool pkgSourceList::ParseFileOldStyle(string File)
 {
    // Open the stream for reading
    ifstream F(File.c_str(),ios::in /*| ios::nocreate*/);
-   if (!F != 0)
+   if (F.fail() == true)
       return _error->Errno("ifstream::ifstream",_("Opening %s"),File.c_str());
 
    // CNC:2003-12-10 - 300 is too short.