Explorar o código

fix: Prefer prefix ++/-- operators for non-primitive types

Git-Dch: Ignore
Reported-By: cppcheck
David Kalnischkies %!s(int64=11) %!d(string=hai) anos
pai
achega
804de19f5f
Modificáronse 3 ficheiros con 6 adicións e 6 borrados
  1. 1 1
      apt-inst/extract.cc
  2. 1 1
      apt-pkg/pkgcachegen.cc
  3. 4 4
      apt-pkg/sourcelist.cc

+ 1 - 1
apt-inst/extract.cc

@@ -404,7 +404,7 @@ bool pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator Nde,
       // Now see if this package matches one in a replace depends
       // Now see if this package matches one in a replace depends
       pkgCache::DepIterator Dep = Ver.DependsList();
       pkgCache::DepIterator Dep = Ver.DependsList();
       bool Ok = false;
       bool Ok = false;
-      for (; Dep.end() == false; Dep++)
+      for (; Dep.end() == false; ++Dep)
       {
       {
 	 if (Dep->Type != pkgCache::Dep::Replaces)
 	 if (Dep->Type != pkgCache::Dep::Replaces)
 	    continue;
 	    continue;

+ 1 - 1
apt-pkg/pkgcachegen.cc

@@ -362,7 +362,7 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator
       /* We know the list is sorted so we use that fact in the search.
       /* We know the list is sorted so we use that fact in the search.
          Insertion of new versions is done with correct sorting */
          Insertion of new versions is done with correct sorting */
       int Res = 1;
       int Res = 1;
-      for (; Ver.end() == false; LastVer = &Ver->NextVer, Ver++)
+      for (; Ver.end() == false; LastVer = &Ver->NextVer, ++Ver)
       {
       {
 	 Res = Cache.VS->CmpVersion(Version,Ver.VerStr());
 	 Res = Cache.VS->CmpVersion(Version,Ver.VerStr());
 	 // Version is higher as current version - insert here
 	 // Version is higher as current version - insert here

+ 4 - 4
apt-pkg/sourcelist.cc

@@ -119,7 +119,7 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
    std::vector<std::string> list_section = StringSplit(Section, " ");
    std::vector<std::string> list_section = StringSplit(Section, " ");
    
    
    for (std::vector<std::string>::const_iterator U = list_uris.begin();
    for (std::vector<std::string>::const_iterator U = list_uris.begin();
-        U != list_uris.end(); U++)
+        U != list_uris.end(); ++U)
    {
    {
       std::string URI = (*U);
       std::string URI = (*U);
       if (!FixupURI(URI))
       if (!FixupURI(URI))
@@ -129,10 +129,10 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
       }
       }
 
 
       for (std::vector<std::string>::const_iterator I = list_dist.begin();
       for (std::vector<std::string>::const_iterator I = list_dist.begin();
-           I != list_dist.end(); I++)
+           I != list_dist.end(); ++I)
       {
       {
          for (std::vector<std::string>::const_iterator J = list_section.begin();
          for (std::vector<std::string>::const_iterator J = list_section.begin();
-              J != list_section.end(); J++)
+              J != list_section.end(); ++J)
          {
          {
             if (CreateItem(List, URI, (*I), (*J), Options) == false)
             if (CreateItem(List, URI, (*I), (*J), Options) == false)
             {
             {
@@ -408,7 +408,7 @@ int pkgSourceList::ParseFileDeb822(string File)
       string const types = Tags.FindS("Types");
       string const types = Tags.FindS("Types");
       std::vector<std::string> list_types = StringSplit(types, " ");
       std::vector<std::string> list_types = StringSplit(types, " ");
       for (std::vector<std::string>::const_iterator I = list_types.begin();
       for (std::vector<std::string>::const_iterator I = list_types.begin();
-        I != list_types.end(); I++)
+        I != list_types.end(); ++I)
       {
       {
          Type *Parse = Type::GetType((*I).c_str());
          Type *Parse = Type::GetType((*I).c_str());
          if (Parse == 0)
          if (Parse == 0)