Michael Vogt лет назад: 15
Родитель
Сommit
ea50fdfe2f
53 измененных файлов с 369 добавлено и 377 удалено
  1. 11 11
      apt-pkg/acquire-item.cc
  2. 3 7
      apt-pkg/acquire-method.cc
  3. 10 10
      apt-pkg/acquire.cc
  4. 31 31
      apt-pkg/algorithms.cc
  5. 2 2
      apt-pkg/aptconfiguration.cc
  6. 2 1
      apt-pkg/aptconfiguration.h
  7. 13 13
      apt-pkg/cdrom.cc
  8. 2 2
      apt-pkg/clean.cc
  9. 3 3
      apt-pkg/contrib/configuration.cc
  10. 3 3
      apt-pkg/contrib/error.cc
  11. 4 3
      apt-pkg/contrib/netrc.cc
  12. 15 15
      apt-pkg/contrib/strutl.cc
  13. 3 3
      apt-pkg/deb/debindexfile.cc
  14. 1 1
      apt-pkg/deb/deblistparser.cc
  15. 6 6
      apt-pkg/deb/debmetaindex.cc
  16. 1 1
      apt-pkg/deb/debrecords.cc
  17. 10 10
      apt-pkg/deb/dpkgpm.cc
  18. 14 14
      apt-pkg/depcache.cc
  19. 2 2
      apt-pkg/depcache.h
  20. 10 11
      apt-pkg/indexcopy.cc
  21. 2 1
      apt-pkg/indexfile.cc
  22. 13 13
      apt-pkg/orderlist.cc
  23. 16 16
      apt-pkg/packagemanager.cc
  24. 13 13
      apt-pkg/pkgcache.cc
  25. 14 14
      apt-pkg/pkgcachegen.cc
  26. 1 1
      apt-pkg/pkgrecords.cc
  27. 7 7
      apt-pkg/policy.cc
  28. 7 7
      apt-pkg/sourcelist.cc
  29. 5 5
      apt-pkg/srcrecords.cc
  30. 1 1
      apt-pkg/tagfile.h
  31. 3 3
      apt-pkg/vendorlist.cc
  32. 3 3
      apt-pkg/versionmatch.cc
  33. 52 52
      cmdline/apt-cache.cc
  34. 28 30
      cmdline/apt-get.cc
  35. 1 1
      cmdline/apt-sortpkgs.cc
  36. 4 0
      debian/changelog
  37. 8 8
      ftparchive/apt-ftparchive.cc
  38. 4 4
      ftparchive/multicompress.cc
  39. 3 3
      ftparchive/override.cc
  40. 2 2
      ftparchive/writer.cc
  41. 2 1
      methods/cdrom.cc
  42. 3 2
      methods/ftp.cc
  43. 3 3
      methods/gpgv.cc
  44. 3 3
      methods/http.cc
  45. 7 7
      methods/http.h
  46. 3 3
      methods/mirror.cc
  47. 5 2
      methods/rred.cc
  48. 1 1
      methods/rsh.h
  49. 8 0
      test/libapt/assert.h
  50. 0 7
      test/libapt/getarchitectures_test.cc
  51. 0 7
      test/libapt/getlanguages_test.cc
  52. 0 7
      test/libapt/getlistoffilesindir_test.cc
  53. 1 1
      test/test_udevcdrom.cc

+ 11 - 11
apt-pkg/acquire-item.cc

@@ -681,17 +681,17 @@ bool pkgAcqIndexDiffs::QueueNextDiff()					/*{{{*/
    // remove all patches until the next matching patch is found
    // remove all patches until the next matching patch is found
    // this requires the Index file to be ordered
    // this requires the Index file to be ordered
    for(vector<DiffInfo>::iterator I=available_patches.begin();
    for(vector<DiffInfo>::iterator I=available_patches.begin();
-       available_patches.size() > 0 && 
+       available_patches.empty() == false &&
 	  I != available_patches.end() &&
 	  I != available_patches.end() &&
-	  (*I).sha1 != local_sha1; 
-       I++) 
+	  I->sha1 != local_sha1;
+       ++I)
    {
    {
       available_patches.erase(I);
       available_patches.erase(I);
    }
    }
 
 
    // error checking and falling back if no patch was found
    // error checking and falling back if no patch was found
-   if(available_patches.size() == 0) 
-   { 
+   if(available_patches.empty() == true)
+   {
       Failed("", NULL);
       Failed("", NULL);
       return false;
       return false;
    }
    }
@@ -756,7 +756,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash,	/*
       chmod(FinalFile.c_str(),0644);
       chmod(FinalFile.c_str(),0644);
 
 
       // see if there is more to download
       // see if there is more to download
-      if(available_patches.size() > 0) {
+      if(available_patches.empty() == false) {
 	 new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
 	 new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
 			      ExpectedHash, ServerSha1, available_patches);
 			      ExpectedHash, ServerSha1, available_patches);
 	 return Finish();
 	 return Finish();
@@ -1375,7 +1375,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)				/*{{{*/
 #endif
 #endif
    for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
    for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
         Target != IndexTargets->end();
         Target != IndexTargets->end();
-        Target++)
+        ++Target)
    {
    {
       HashString ExpectedIndexHash;
       HashString ExpectedIndexHash;
       if (verify)
       if (verify)
@@ -1672,7 +1672,7 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
 
 
    // check if we have one trusted source for the package. if so, switch
    // check if we have one trusted source for the package. if so, switch
    // to "TrustedOnly" mode
    // to "TrustedOnly" mode
-   for (pkgCache::VerFileIterator i = Version.FileList(); i.end() == false; i++)
+   for (pkgCache::VerFileIterator i = Version.FileList(); i.end() == false; ++i)
    {
    {
       pkgIndexFile *Index;
       pkgIndexFile *Index;
       if (Sources->FindIndex(i.File(),Index) == false)
       if (Sources->FindIndex(i.File(),Index) == false)
@@ -1709,7 +1709,7 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
 bool pkgAcqArchive::QueueNext()
 bool pkgAcqArchive::QueueNext()
 {
 {
    string const ForceHash = _config->Find("Acquire::ForceHash");
    string const ForceHash = _config->Find("Acquire::ForceHash");
-   for (; Vf.end() == false; Vf++)
+   for (; Vf.end() == false; ++Vf)
    {
    {
       // Ignore not source sources
       // Ignore not source sources
       if ((Vf.File()->Flags & pkgCache::Flag::NotSource) != 0)
       if ((Vf.File()->Flags & pkgCache::Flag::NotSource) != 0)
@@ -1820,7 +1820,7 @@ bool pkgAcqArchive::QueueNext()
       Desc.ShortDesc = Version.ParentPkg().Name();
       Desc.ShortDesc = Version.ParentPkg().Name();
       QueueURI(Desc);
       QueueURI(Desc);
 
 
-      Vf++;
+      ++Vf;
       return true;
       return true;
    }
    }
    return false;
    return false;
@@ -1894,7 +1894,7 @@ void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
        StringToBool(LookupTag(Message,"Transient-Failure"),false) == true)
        StringToBool(LookupTag(Message,"Transient-Failure"),false) == true)
    {
    {
       // Vf = Version.FileList();
       // Vf = Version.FileList();
-      while (Vf.end() == false) Vf++;
+      while (Vf.end() == false) ++Vf;
       StoreFilename = string();
       StoreFilename = string();
       Item::Failed(Message,Cnf);
       Item::Failed(Message,Cnf);
       return;
       return;

+ 3 - 7
apt-pkg/acquire-method.cc

@@ -81,7 +81,7 @@ void pkgAcqMethod::Fail(bool Transient)
 void pkgAcqMethod::Fail(string Err,bool Transient)
 void pkgAcqMethod::Fail(string Err,bool Transient)
 {
 {
    // Strip out junk from the error messages
    // Strip out junk from the error messages
-   for (string::iterator I = Err.begin(); I != Err.end(); I++)
+   for (string::iterator I = Err.begin(); I != Err.end(); ++I)
    {
    {
       if (*I == '\r') 
       if (*I == '\r') 
 	 *I = ' ';
 	 *I = ' ';
@@ -421,12 +421,8 @@ void pkgAcqMethod::Status(const char *Format,...)
    to keep the pipeline synchronized. */
    to keep the pipeline synchronized. */
 void pkgAcqMethod::Redirect(const string &NewURI)
 void pkgAcqMethod::Redirect(const string &NewURI)
 {
 {
-   std::cout << "103 Redirect\nURI: ";
-   if (Queue != 0)
-      std::cout << Queue->Uri << "\n";
-   else
-      std::cout << "<UNKNOWN>\n";
-   std::cout << "New-URI: " << NewURI << "\n"
+   std::cout << "103 Redirect\nURI: " << Queue->Uri << "\n"
+	     << "New-URI: " << NewURI << "\n"
 	     << "\n" << std::flush;
 	     << "\n" << std::flush;
 
 
    // Change the URI for the request.
    // Change the URI for the request.

+ 10 - 10
apt-pkg/acquire.cc

@@ -116,7 +116,7 @@ pkgAcquire::~pkgAcquire()
 /* */
 /* */
 void pkgAcquire::Shutdown()
 void pkgAcquire::Shutdown()
 {
 {
-   while (Items.size() != 0)
+   while (Items.empty() == false)
    {
    {
       if (Items[0]->Status == Item::StatFetching)
       if (Items[0]->Status == Item::StatFetching)
          Items[0]->Status = Item::StatError;
          Items[0]->Status = Item::StatError;
@@ -155,7 +155,7 @@ void pkgAcquire::Remove(Item *Itm)
 	 I = Items.begin();
 	 I = Items.begin();
       }      
       }      
       else 
       else 
-	 I++;
+	 ++I;
    }
    }
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -411,7 +411,7 @@ pkgAcquire::RunResult pkgAcquire::Run(int PulseIntervall)
       I->Shutdown(false);
       I->Shutdown(false);
 
 
    // Shut down the items
    // Shut down the items
-   for (ItemIterator I = Items.begin(); I != Items.end(); I++)
+   for (ItemIterator I = Items.begin(); I != Items.end(); ++I)
       (*I)->Finished(); 
       (*I)->Finished(); 
    
    
    if (_error->PendingError())
    if (_error->PendingError())
@@ -467,7 +467,7 @@ bool pkgAcquire::Clean(string Dir)
       
       
       // Look in the get list
       // Look in the get list
       ItemCIterator I = Items.begin();
       ItemCIterator I = Items.begin();
-      for (; I != Items.end(); I++)
+      for (; I != Items.end(); ++I)
 	 if (flNotDir((*I)->DestFile) == Dir->d_name)
 	 if (flNotDir((*I)->DestFile) == Dir->d_name)
 	    break;
 	    break;
       
       
@@ -488,7 +488,7 @@ bool pkgAcquire::Clean(string Dir)
 unsigned long long pkgAcquire::TotalNeeded()
 unsigned long long pkgAcquire::TotalNeeded()
 {
 {
    unsigned long long Total = 0;
    unsigned long long Total = 0;
-   for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); I++)
+   for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); ++I)
       Total += (*I)->FileSize;
       Total += (*I)->FileSize;
    return Total;
    return Total;
 }
 }
@@ -499,7 +499,7 @@ unsigned long long pkgAcquire::TotalNeeded()
 unsigned long long pkgAcquire::FetchNeeded()
 unsigned long long pkgAcquire::FetchNeeded()
 {
 {
    unsigned long long Total = 0;
    unsigned long long Total = 0;
-   for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); I++)
+   for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); ++I)
       if ((*I)->Local == false)
       if ((*I)->Local == false)
 	 Total += (*I)->FileSize;
 	 Total += (*I)->FileSize;
    return Total;
    return Total;
@@ -511,7 +511,7 @@ unsigned long long pkgAcquire::FetchNeeded()
 unsigned long long pkgAcquire::PartialPresent()
 unsigned long long pkgAcquire::PartialPresent()
 {
 {
   unsigned long long Total = 0;
   unsigned long long Total = 0;
-   for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); I++)
+   for (ItemCIterator I = ItemsBegin(); I != ItemsEnd(); ++I)
       if ((*I)->Local == false)
       if ((*I)->Local == false)
 	 Total += (*I)->PartialSize;
 	 Total += (*I)->PartialSize;
    return Total;
    return Total;
@@ -781,11 +781,11 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
    unsigned int Unknown = 0;
    unsigned int Unknown = 0;
    unsigned int Count = 0;
    unsigned int Count = 0;
    for (pkgAcquire::ItemCIterator I = Owner->ItemsBegin(); I != Owner->ItemsEnd();
    for (pkgAcquire::ItemCIterator I = Owner->ItemsBegin(); I != Owner->ItemsEnd();
-	I++, Count++)
+	++I, ++Count)
    {
    {
       TotalItems++;
       TotalItems++;
       if ((*I)->Status == pkgAcquire::Item::StatDone)
       if ((*I)->Status == pkgAcquire::Item::StatDone)
-	 CurrentItems++;
+	 ++CurrentItems;
       
       
       // Totally ignore local items
       // Totally ignore local items
       if ((*I)->Local == true)
       if ((*I)->Local == true)
@@ -795,7 +795,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner)
       if ((*I)->Complete == true)
       if ((*I)->Complete == true)
 	 CurrentBytes += (*I)->FileSize;
 	 CurrentBytes += (*I)->FileSize;
       if ((*I)->FileSize == 0 && (*I)->Complete == false)
       if ((*I)->FileSize == 0 && (*I)->Complete == false)
-	 Unknown++;
+	 ++Unknown;
    }
    }
    
    
    // Compute the current completion
    // Compute the current completion

+ 31 - 31
apt-pkg/algorithms.cc

@@ -91,7 +91,7 @@ bool pkgSimulate::Install(PkgIterator iPkg,string /*File*/)
    Sim.MarkInstall(Pkg,false);
    Sim.MarkInstall(Pkg,false);
 
 
    // Look for broken conflicts+predepends.
    // Look for broken conflicts+predepends.
-   for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++)
+   for (PkgIterator I = Sim.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Sim[I].InstallVer == 0)
       if (Sim[I].InstallVer == 0)
 	 continue;
 	 continue;
@@ -140,7 +140,7 @@ bool pkgSimulate::Configure(PkgIterator iPkg)
       Sim.Update();
       Sim.Update();
       
       
       // Print out each package and the failed dependencies
       // Print out each package and the failed dependencies
-      for (pkgCache::DepIterator D = Sim[Pkg].InstVerIter(Sim).DependsList(); D.end() == false; D++)
+      for (pkgCache::DepIterator D = Sim[Pkg].InstVerIter(Sim).DependsList(); D.end() == false; ++D)
       {
       {
 	 if (Sim.IsImportantDep(D) == false || 
 	 if (Sim.IsImportantDep(D) == false || 
 	     (Sim[D] & pkgDepCache::DepInstall) != 0)
 	     (Sim[D] & pkgDepCache::DepInstall) != 0)
@@ -204,7 +204,7 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge)
 void pkgSimulate::ShortBreaks()
 void pkgSimulate::ShortBreaks()
 {
 {
    cout << " [";
    cout << " [";
-   for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++)
+   for (PkgIterator I = Sim.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Sim[I].InstBroken() == true)
       if (Sim[I].InstBroken() == true)
       {
       {
@@ -226,7 +226,7 @@ bool pkgApplyStatus(pkgDepCache &Cache)
 {
 {
    pkgDepCache::ActionGroup group(Cache);
    pkgDepCache::ActionGroup group(Cache);
 
 
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (I->VersionList == 0)
       if (I->VersionList == 0)
 	 continue;
 	 continue;
@@ -295,13 +295,13 @@ bool pkgFixBroken(pkgDepCache &Cache)
    pkgDepCache::ActionGroup group(Cache);
    pkgDepCache::ActionGroup group(Cache);
 
 
    // Auto upgrade all broken packages
    // Auto upgrade all broken packages
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       if (Cache[I].NowBroken() == true)
       if (Cache[I].NowBroken() == true)
 	 Cache.MarkInstall(I, true, 0, false);
 	 Cache.MarkInstall(I, true, 0, false);
    
    
    /* Fix packages that are in a NeedArchive state but don't have a
    /* Fix packages that are in a NeedArchive state but don't have a
       downloadable install version */
       downloadable install version */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (I.State() != pkgCache::PkgIterator::NeedsUnpack ||
       if (I.State() != pkgCache::PkgIterator::NeedsUnpack ||
 	  Cache[I].Delete() == true)
 	  Cache[I].Delete() == true)
@@ -338,19 +338,19 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
 
 
    /* Auto upgrade all installed packages, this provides the basis 
    /* Auto upgrade all installed packages, this provides the basis 
       for the installation */
       for the installation */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       if (I->CurrentVer != 0)
       if (I->CurrentVer != 0)
 	 Cache.MarkInstall(I, true, 0, false);
 	 Cache.MarkInstall(I, true, 0, false);
 
 
    /* Now, auto upgrade all essential packages - this ensures that
    /* Now, auto upgrade all essential packages - this ensures that
       the essential packages are present and working */
       the essential packages are present and working */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
       if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
 	 Cache.MarkInstall(I, true, 0, false);
 	 Cache.MarkInstall(I, true, 0, false);
    
    
    /* We do it again over all previously installed packages to force 
    /* We do it again over all previously installed packages to force 
       conflict resolution on them all. */
       conflict resolution on them all. */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       if (I->CurrentVer != 0)
       if (I->CurrentVer != 0)
 	 Cache.MarkInstall(I, false, 0, false);
 	 Cache.MarkInstall(I, false, 0, false);
 
 
@@ -359,7 +359,7 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
    // Hold back held packages.
    // Hold back held packages.
    if (_config->FindB("APT::Ignore-Hold",false) == false)
    if (_config->FindB("APT::Ignore-Hold",false) == false)
    {
    {
-      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       {
       {
 	 if (I->SelectedState == pkgCache::State::Hold)
 	 if (I->SelectedState == pkgCache::State::Hold)
 	 {
 	 {
@@ -387,7 +387,7 @@ bool pkgAllUpgrade(pkgDepCache &Cache)
       return false;
       return false;
    
    
    // Upgrade all installed packages
    // Upgrade all installed packages
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Cache[I].Install() == true)
       if (Cache[I].Install() == true)
 	 Fix.Protect(I);
 	 Fix.Protect(I);
@@ -421,7 +421,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
    do
    do
    {
    {
       Change = false;
       Change = false;
-      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       {
       {
 	 // Not interesting
 	 // Not interesting
 	 if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true)
 	 if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true)
@@ -438,7 +438,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
 	       Change = true;
 	       Change = true;
 	 }	 
 	 }	 
       }      
       }      
-      Count++;
+      ++Count;
    }
    }
    while (Change == true && Count < 10);
    while (Change == true && Count < 10);
 
 
@@ -525,7 +525,7 @@ void pkgProblemResolver::MakeScores()
          << "  AddEssential => " << AddEssential << endl;
          << "  AddEssential => " << AddEssential << endl;
 
 
    // Generate the base scores for a package based on its properties
    // Generate the base scores for a package based on its properties
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Cache[I].InstallVer == 0)
       if (Cache[I].InstallVer == 0)
 	 continue;
 	 continue;
@@ -552,12 +552,12 @@ void pkgProblemResolver::MakeScores()
    }
    }
 
 
    // Now that we have the base scores we go and propogate dependencies
    // Now that we have the base scores we go and propogate dependencies
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Cache[I].InstallVer == 0)
       if (Cache[I].InstallVer == 0)
 	 continue;
 	 continue;
       
       
-      for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; D++)
+      for (pkgCache::DepIterator D = Cache[I].InstVerIter(Cache).DependsList(); D.end() == false; ++D)
       {
       {
 	 if (D->Type == pkgCache::Dep::Depends || 
 	 if (D->Type == pkgCache::Dep::Depends || 
 	     D->Type == pkgCache::Dep::PreDepends)
 	     D->Type == pkgCache::Dep::PreDepends)
@@ -574,12 +574,12 @@ void pkgProblemResolver::MakeScores()
    /* Now we cause 1 level of dependency inheritance, that is we add the 
    /* Now we cause 1 level of dependency inheritance, that is we add the 
       score of the packages that depend on the target Package. This 
       score of the packages that depend on the target Package. This 
       fortifies high scoring packages */
       fortifies high scoring packages */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Cache[I].InstallVer == 0)
       if (Cache[I].InstallVer == 0)
 	 continue;
 	 continue;
       
       
-      for (pkgCache::DepIterator D = I.RevDependsList(); D.end() == false; D++)
+      for (pkgCache::DepIterator D = I.RevDependsList(); D.end() == false; ++D)
       {
       {
 	 // Only do it for the install version
 	 // Only do it for the install version
 	 if ((pkgCache::Version *)D.ParentVer() != Cache[D.ParentPkg()].InstallVer ||
 	 if ((pkgCache::Version *)D.ParentVer() != Cache[D.ParentPkg()].InstallVer ||
@@ -594,9 +594,9 @@ void pkgProblemResolver::MakeScores()
 
 
    /* Now we propogate along provides. This makes the packages that 
    /* Now we propogate along provides. This makes the packages that 
       provide important packages extremely important */
       provide important packages extremely important */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
-      for (pkgCache::PrvIterator P = I.ProvidesList(); P.end() == false; P++)
+      for (pkgCache::PrvIterator P = I.ProvidesList(); P.end() == false; ++P)
       {
       {
 	 // Only do it once per package
 	 // Only do it once per package
 	 if ((pkgCache::Version *)P.OwnerVer() != Cache[P.OwnerPkg()].InstallVer)
 	 if ((pkgCache::Version *)P.OwnerVer() != Cache[P.OwnerPkg()].InstallVer)
@@ -607,7 +607,7 @@ void pkgProblemResolver::MakeScores()
 
 
    /* Protected things are pushed really high up. This number should put them
    /* Protected things are pushed really high up. This number should put them
       ahead of everything */
       ahead of everything */
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if ((Flags[I->ID] & Protected) != 0)
       if ((Flags[I->ID] & Protected) != 0)
 	 Scores[I->ID] += AddProtected;
 	 Scores[I->ID] += AddProtected;
@@ -704,7 +704,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
 	 
 	 
 	 if (Start == End)
 	 if (Start == End)
 	    break;
 	    break;
-	 Start++;
+	 ++Start;
       }
       }
       if (Fail == true)
       if (Fail == true)
 	 break;
 	 break;
@@ -750,7 +750,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
    do
    do
    {
    {
       Again = false;
       Again = false;
-      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       {
       {
 	 if (Cache[I].Install() == true)
 	 if (Cache[I].Install() == true)
 	    Flags[I->ID] |= PreInstalled;
 	    Flags[I->ID] |= PreInstalled;
@@ -781,7 +781,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
       would cause the removal of even lower score packages. */
       would cause the removal of even lower score packages. */
    SPtrArray<pkgCache::Package *> PList = new pkgCache::Package *[Size];
    SPtrArray<pkgCache::Package *> PList = new pkgCache::Package *[Size];
    pkgCache::Package **PEnd = PList;
    pkgCache::Package **PEnd = PList;
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       *PEnd++ = I;
       *PEnd++ = I;
    This = this;
    This = this;
    qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
    qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
@@ -901,7 +901,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 	    }
 	    }
 	    else
 	    else
             {
             {
-	       Start++;
+	       ++Start;
 	       // We only worry about critical deps.
 	       // We only worry about critical deps.
 	       if (Start.IsCritical() != true)
 	       if (Start.IsCritical() != true)
                   continue;
                   continue;
@@ -1150,7 +1150,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
    {
    {
       // See if this is the result of a hold
       // See if this is the result of a hold
       pkgCache::PkgIterator I = Cache.PkgBegin();
       pkgCache::PkgIterator I = Cache.PkgBegin();
-      for (;I.end() != true; I++)
+      for (;I.end() != true; ++I)
       {
       {
 	 if (Cache[I].InstBroken() == false)
 	 if (Cache[I].InstBroken() == false)
 	    continue;
 	    continue;
@@ -1162,7 +1162,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
    
    
    // set the auto-flags (mvo: I'm not sure if we _really_ need this)
    // set the auto-flags (mvo: I'm not sure if we _really_ need this)
    pkgCache::PkgIterator I = Cache.PkgBegin();
    pkgCache::PkgIterator I = Cache.PkgBegin();
-   for (;I.end() != true; I++) {
+   for (;I.end() != true; ++I) {
       if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) {
       if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) {
 	 if(_config->FindI("Debug::pkgAutoRemove",false)) {
 	 if(_config->FindI("Debug::pkgAutoRemove",false)) {
 	    std::clog << "Resolve installed new pkg: " << I.FullName(false) 
 	    std::clog << "Resolve installed new pkg: " << I.FullName(false) 
@@ -1220,7 +1220,7 @@ bool pkgProblemResolver::ResolveByKeep()
       would cause the removal of even lower score packages. */
       would cause the removal of even lower score packages. */
    pkgCache::Package **PList = new pkgCache::Package *[Size];
    pkgCache::Package **PList = new pkgCache::Package *[Size];
    pkgCache::Package **PEnd = PList;
    pkgCache::Package **PEnd = PList;
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       *PEnd++ = I;
       *PEnd++ = I;
    This = this;
    This = this;
    qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
    qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
@@ -1317,7 +1317,7 @@ bool pkgProblemResolver::ResolveByKeep()
 
 
 	    if (Start == End)
 	    if (Start == End)
 	       break;
 	       break;
-	    Start++;
+	    ++Start;
 	 }
 	 }
 	      
 	      
 	 if (InstOrNewPolicyBroken(I) == false)
 	 if (InstOrNewPolicyBroken(I) == false)
@@ -1344,7 +1344,7 @@ void pkgProblemResolver::InstallProtect()
 {
 {
    pkgDepCache::ActionGroup group(Cache);
    pkgDepCache::ActionGroup group(Cache);
 
 
-   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if ((Flags[I->ID] & Protected) == Protected)
       if ((Flags[I->ID] & Protected) == Protected)
       {
       {
@@ -1424,7 +1424,7 @@ bool ListUpdate(pkgAcquireStatus &Stat,
    bool Failed = false;
    bool Failed = false;
    bool TransientNetworkFailure = false;
    bool TransientNetworkFailure = false;
    for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); 
    for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); 
-	I != Fetcher.ItemsEnd(); I++)
+	I != Fetcher.ItemsEnd(); ++I)
    {
    {
       if ((*I)->Status == pkgAcquire::Item::StatDone)
       if ((*I)->Status == pkgAcquire::Item::StatDone)
 	 continue;
 	 continue;

+ 2 - 2
apt-pkg/aptconfiguration.cc

@@ -53,7 +53,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
 	// load the order setting into our vector
 	// load the order setting into our vector
 	std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
 	std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
 	for (std::vector<std::string>::const_iterator o = order.begin();
 	for (std::vector<std::string>::const_iterator o = order.begin();
-	     o != order.end(); o++) {
+	     o != order.end(); ++o) {
 		if ((*o).empty() == true)
 		if ((*o).empty() == true)
 			continue;
 			continue;
 		// ignore types we have no method ready to use
 		// ignore types we have no method ready to use
@@ -274,7 +274,7 @@ std::vector<std::string> const Configuration::getLanguages(bool const &All,
 	// then needed and ensure the codes are not listed twice.
 	// then needed and ensure the codes are not listed twice.
 	bool noneSeen = false;
 	bool noneSeen = false;
 	for (std::vector<string>::const_iterator l = lang.begin();
 	for (std::vector<string>::const_iterator l = lang.begin();
-	     l != lang.end(); l++) {
+	     l != lang.end(); ++l) {
 		if (*l == "environment") {
 		if (*l == "environment") {
 			for (std::vector<string>::const_iterator e = environment.begin();
 			for (std::vector<string>::const_iterator e = environment.begin();
 			     e != environment.end(); ++e) {
 			     e != environment.end(); ++e) {

+ 2 - 1
apt-pkg/aptconfiguration.h

@@ -13,6 +13,7 @@
 // Include Files							/*{{{*/
 // Include Files							/*{{{*/
 #include <string>
 #include <string>
 #include <vector>
 #include <vector>
+#include <limits>
 									/*}}}*/
 									/*}}}*/
 namespace APT {
 namespace APT {
 class Configuration {							/*{{{*/
 class Configuration {							/*{{{*/
@@ -94,7 +95,7 @@ public:									/*{{{*/
 		Compressor(char const *name, char const *extension, char const *binary,
 		Compressor(char const *name, char const *extension, char const *binary,
 			   char const *compressArg, char const *uncompressArg,
 			   char const *compressArg, char const *uncompressArg,
 			   unsigned short const cost);
 			   unsigned short const cost);
-		Compressor() {};
+		Compressor() : Cost(std::numeric_limits<unsigned short>::max()) {};
 	};
 	};
 
 
 	/** \brief Return a vector of Compressors supported for data.tar's
 	/** \brief Return a vector of Compressors supported for data.tar's

+ 13 - 13
apt-pkg/cdrom.cc

@@ -310,7 +310,7 @@ void pkgCdrom::ReduceSourcelist(string CD,vector<string> &List)
    sort(List.begin(),List.end());
    sort(List.begin(),List.end());
    
    
    // Collect similar entries
    // Collect similar entries
-   for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       // Find a space..
       // Find a space..
       string::size_type Space = (*I).find(' ');
       string::size_type Space = (*I).find(' ');
@@ -322,7 +322,7 @@ void pkgCdrom::ReduceSourcelist(string CD,vector<string> &List)
 
 
       string Word1 = string(*I,Space,SSpace-Space);
       string Word1 = string(*I,Space,SSpace-Space);
       string Prefix = string(*I,0,Space);
       string Prefix = string(*I,0,Space);
-      for (vector<string>::iterator J = List.begin(); J != I; J++)
+      for (vector<string>::iterator J = List.begin(); J != I; ++J)
       {
       {
 	 // Find a space..
 	 // Find a space..
 	 string::size_type Space2 = (*J).find(' ');
 	 string::size_type Space2 = (*J).find(' ');
@@ -405,7 +405,7 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
    that were the same. */
    that were the same. */
 bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
 bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
 {
 {
-   if (List.size() == 0)
+   if (List.empty() == true)
       return true;
       return true;
 
 
    string File = _config->FindFile("Dir::Etc::sourcelist");
    string File = _config->FindFile("Dir::Etc::sourcelist");
@@ -455,7 +455,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
 
 
       if (First == true)
       if (First == true)
       {
       {
-	 for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+	 for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
 	 {
 	 {
 	    string::size_type Space = (*I).find(' ');
 	    string::size_type Space = (*I).find(' ');
 	    if (Space == string::npos)
 	    if (Space == string::npos)
@@ -489,7 +489,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
    // Just in case the file was empty
    // Just in case the file was empty
    if (First == true)
    if (First == true)
    {
    {
-      for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+      for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
       {
       {
 	 string::size_type Space = (*I).find(' ');
 	 string::size_type Space = (*I).find(' ');
 	 if (Space == string::npos)
 	 if (Space == string::npos)
@@ -661,13 +661,13 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
    if (_config->FindB("Debug::aptcdrom",false) == true)
    if (_config->FindB("Debug::aptcdrom",false) == true)
    {
    {
       cout << "I found (binary):" << endl;
       cout << "I found (binary):" << endl;
-      for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+      for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
 	 cout << *I << endl;
 	 cout << *I << endl;
       cout << "I found (source):" << endl;
       cout << "I found (source):" << endl;
-      for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); I++)
+      for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); ++I)
 	 cout << *I << endl;
 	 cout << *I << endl;
       cout << "I found (Signatures):" << endl;
       cout << "I found (Signatures):" << endl;
-      for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); I++)
+      for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); ++I)
 	 cout << *I << endl;
 	 cout << *I << endl;
    }   
    }   
 
 
@@ -688,7 +688,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
       log->Update(msg.str(), STEP_SCAN);
       log->Update(msg.str(), STEP_SCAN);
    }
    }
 
 
-   if (List.size() == 0 && SourceList.size() == 0) 
+   if (List.empty() == true && SourceList.empty() == true) 
    {
    {
       if (_config->FindB("APT::CDROM::NoMount",false) == false) 
       if (_config->FindB("APT::CDROM::NoMount",false) == false) 
 	 UnmountCdrom(CDROM);
 	 UnmountCdrom(CDROM);
@@ -712,7 +712,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
 	 {
 	 {
 	    // Escape special characters
 	    // Escape special characters
 	    string::iterator J = Name.begin();
 	    string::iterator J = Name.begin();
-	    for (; J != Name.end(); J++)
+	    for (; J != Name.end(); ++J)
 	       if (*J == '"' || *J == ']' || *J == '[')
 	       if (*J == '"' || *J == ']' || *J == '[')
 		  *J = '_';
 		  *J = '_';
 	    
 	    
@@ -757,7 +757,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
 
 
    // Escape special characters
    // Escape special characters
    string::iterator J = Name.begin();
    string::iterator J = Name.begin();
-   for (; J != Name.end(); J++)
+   for (; J != Name.end(); ++J)
       if (*J == '"' || *J == ']' || *J == '[')
       if (*J == '"' || *J == ']' || *J == '[')
 	 *J = '_';
 	 *J = '_';
    
    
@@ -804,7 +804,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
    if(log != NULL)
    if(log != NULL)
       log->Update(_("Source list entries for this disc are:\n"));
       log->Update(_("Source list entries for this disc are:\n"));
 
 
-   for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       string::size_type Space = (*I).find(' ');
       string::size_type Space = (*I).find(' ');
       if (Space == string::npos)
       if (Space == string::npos)
@@ -823,7 +823,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)					/*{{{*/
       }
       }
    }
    }
 
 
-   for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); I++)
+   for (vector<string>::iterator I = SourceList.begin(); I != SourceList.end(); ++I)
    {
    {
       string::size_type Space = (*I).find(' ');
       string::size_type Space = (*I).find(' ');
       if (Space == string::npos)
       if (Space == string::npos)

+ 2 - 2
apt-pkg/clean.cc

@@ -85,12 +85,12 @@ bool pkgArchiveCleaner::Go(string Dir,pkgCache &Cache)
       if (P.end() != true)
       if (P.end() != true)
       {
       {
 	 pkgCache::VerIterator V = P.VersionList();
 	 pkgCache::VerIterator V = P.VersionList();
-	 for (; V.end() == false; V++)
+	 for (; V.end() == false; ++V)
 	 {
 	 {
 	    // See if we can fetch this version at all
 	    // See if we can fetch this version at all
 	    bool IsFetchable = false;
 	    bool IsFetchable = false;
 	    for (pkgCache::VerFileIterator J = V.FileList(); 
 	    for (pkgCache::VerFileIterator J = V.FileList(); 
-		 J.end() == false; J++)
+		 J.end() == false; ++J)
 	    {
 	    {
 	       if (CleanInstalled == true &&
 	       if (CleanInstalled == true &&
 		   (J.File()->Flags & pkgCache::Flag::NotSource) != 0)
 		   (J.File()->Flags & pkgCache::Flag::NotSource) != 0)

+ 3 - 3
apt-pkg/contrib/configuration.cc

@@ -672,9 +672,9 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool const &AsSectio
 	    // Put the last fragment into the buffer
 	    // Put the last fragment into the buffer
 	    std::string::const_iterator NonWhitespaceStart = Start;
 	    std::string::const_iterator NonWhitespaceStart = Start;
 	    std::string::const_iterator NonWhitespaceStop = I;
 	    std::string::const_iterator NonWhitespaceStop = I;
-	    for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; NonWhitespaceStart++)
+	    for (; NonWhitespaceStart != I && isspace(*NonWhitespaceStart) != 0; ++NonWhitespaceStart)
 	      ;
 	      ;
-	    for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; NonWhitespaceStop--)
+	    for (; NonWhitespaceStop != NonWhitespaceStart && isspace(NonWhitespaceStop[-1]) != 0; --NonWhitespaceStop)
 	      ;
 	      ;
 	    if (LineBuffer.empty() == false && NonWhitespaceStop - NonWhitespaceStart != 0)
 	    if (LineBuffer.empty() == false && NonWhitespaceStop - NonWhitespaceStart != 0)
 	       LineBuffer += ' ';
 	       LineBuffer += ' ';
@@ -850,7 +850,7 @@ bool ReadConfigDir(Configuration &Conf,const string &Dir,
    vector<string> const List = GetListOfFilesInDir(Dir, "conf", true, true);
    vector<string> const List = GetListOfFilesInDir(Dir, "conf", true, true);
 
 
    // Read the files
    // Read the files
-   for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
       if (ReadConfigFile(Conf,*I,AsSectional,Depth) == false)
       if (ReadConfigFile(Conf,*I,AsSectional,Depth) == false)
 	 return false;
 	 return false;
    return true;
    return true;

+ 3 - 3
apt-pkg/contrib/error.cc

@@ -193,7 +193,7 @@ bool GlobalError::PopMessage(std::string &Text) {
 
 
 	// check if another error message is pending
 	// check if another error message is pending
 	for (std::list<Item>::const_iterator m = Messages.begin();
 	for (std::list<Item>::const_iterator m = Messages.begin();
-	     m != Messages.end(); m++)
+	     m != Messages.end(); ++m)
 		if (m->Type == ERROR || m->Type == FATAL)
 		if (m->Type == ERROR || m->Type == FATAL)
 			return Ret;
 			return Ret;
 
 
@@ -210,7 +210,7 @@ void GlobalError::DumpErrors(std::ostream &out, MsgType const &threshold,
 			Messages.insert(Messages.begin(), s->Messages.begin(), s->Messages.end());
 			Messages.insert(Messages.begin(), s->Messages.begin(), s->Messages.end());
 
 
 	for (std::list<Item>::const_iterator m = Messages.begin();
 	for (std::list<Item>::const_iterator m = Messages.begin();
-	     m != Messages.end(); m++)
+	     m != Messages.end(); ++m)
 		if (m->Type >= threshold)
 		if (m->Type >= threshold)
 			out << (*m) << std::endl;
 			out << (*m) << std::endl;
 	Discard();
 	Discard();
@@ -231,7 +231,7 @@ bool GlobalError::empty(MsgType const &trashhold) const {
 		return true;
 		return true;
 
 
 	for (std::list<Item>::const_iterator m = Messages.begin();
 	for (std::list<Item>::const_iterator m = Messages.begin();
-	     m != Messages.end(); m++)
+	     m != Messages.end(); ++m)
 		if (m->Type >= trashhold)
 		if (m->Type >= trashhold)
 			return false;
 			return false;
 
 

+ 4 - 3
apt-pkg/contrib/netrc.cc

@@ -47,10 +47,7 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
   int specific_login = (login[0] != 0);
   int specific_login = (login[0] != 0);
   char *home = NULL;
   char *home = NULL;
   bool netrc_alloc = false;
   bool netrc_alloc = false;
-  int state = NOTHING;
 
 
-  char state_login = 0;        /* Found a login keyword */
-  char state_password = 0;     /* Found a password keyword */
   int state_our_login = false;  /* With specific_login,
   int state_our_login = false;  /* With specific_login,
                                    found *our* login name */
                                    found *our* login name */
 
 
@@ -81,6 +78,10 @@ int parsenetrc (char *host, char *login, char *password, char *netrcfile = NULL)
     bool done = false;
     bool done = false;
     char netrcbuffer[256];
     char netrcbuffer[256];
 
 
+    int state = NOTHING;
+    char state_login = 0;        /* Found a login keyword */
+    char state_password = 0;     /* Found a password keyword */
+
     while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) {
     while (!done && fgets(netrcbuffer, sizeof (netrcbuffer), file)) {
       tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
       tok = strtok_r (netrcbuffer, " \t\n", &tok_buf);
       while (!done && tok) {
       while (!done && tok) {

+ 15 - 15
apt-pkg/contrib/strutl.cc

@@ -271,7 +271,7 @@ bool ParseCWord(const char *&String,string &Res)
 string QuoteString(const string &Str, const char *Bad)
 string QuoteString(const string &Str, const char *Bad)
 {
 {
    string Res;
    string Res;
-   for (string::const_iterator I = Str.begin(); I != Str.end(); I++)
+   for (string::const_iterator I = Str.begin(); I != Str.end(); ++I)
    {
    {
       if (strchr(Bad,*I) != 0 || isprint(*I) == 0 || 
       if (strchr(Bad,*I) != 0 || isprint(*I) == 0 || 
 	  *I == 0x25 || // percent '%' char
 	  *I == 0x25 || // percent '%' char
@@ -298,7 +298,7 @@ string DeQuoteString(string::const_iterator const &begin,
 			string::const_iterator const &end)
 			string::const_iterator const &end)
 {
 {
    string Res;
    string Res;
-   for (string::const_iterator I = begin; I != end; I++)
+   for (string::const_iterator I = begin; I != end; ++I)
    {
    {
       if (*I == '%' && I + 2 < end &&
       if (*I == '%' && I + 2 < end &&
 	  isxdigit(I[1]) && isxdigit(I[2]))
 	  isxdigit(I[1]) && isxdigit(I[2]))
@@ -632,7 +632,7 @@ string LookupTag(const string &Message,const char *Tag,const char *Default)
 {
 {
    // Look for a matching tag.
    // Look for a matching tag.
    int Length = strlen(Tag);
    int Length = strlen(Tag);
-   for (string::const_iterator I = Message.begin(); I + Length < Message.end(); I++)
+   for (string::const_iterator I = Message.begin(); I + Length < Message.end(); ++I)
    {
    {
       // Found the tag
       // Found the tag
       if (I[Length] == ':' && stringcasecmp(I,I+Length,Tag) == 0)
       if (I[Length] == ':' && stringcasecmp(I,I+Length,Tag) == 0)
@@ -640,14 +640,14 @@ string LookupTag(const string &Message,const char *Tag,const char *Default)
 	 // Find the end of line and strip the leading/trailing spaces
 	 // Find the end of line and strip the leading/trailing spaces
 	 string::const_iterator J;
 	 string::const_iterator J;
 	 I += Length + 1;
 	 I += Length + 1;
-	 for (; isspace(*I) != 0 && I < Message.end(); I++);
-	 for (J = I; *J != '\n' && J < Message.end(); J++);
-	 for (; J > I && isspace(J[-1]) != 0; J--);
+	 for (; isspace(*I) != 0 && I < Message.end(); ++I);
+	 for (J = I; *J != '\n' && J < Message.end(); ++J);
+	 for (; J > I && isspace(J[-1]) != 0; --J);
 	 
 	 
 	 return string(I,J);
 	 return string(I,J);
       }
       }
       
       
-      for (; *I != '\n' && I < Message.end(); I++);
+      for (; *I != '\n' && I < Message.end(); ++I);
    }   
    }   
    
    
    // Failed to find a match
    // Failed to find a match
@@ -1224,7 +1224,7 @@ int tolower_ascii(int const c)
 bool CheckDomainList(const string &Host,const string &List)
 bool CheckDomainList(const string &Host,const string &List)
 {
 {
    string::const_iterator Start = List.begin();
    string::const_iterator Start = List.begin();
-   for (string::const_iterator Cur = List.begin(); Cur <= List.end(); Cur++)
+   for (string::const_iterator Cur = List.begin(); Cur <= List.end(); ++Cur)
    {
    {
       if (Cur < List.end() && *Cur != ',')
       if (Cur < List.end() && *Cur != ',')
 	 continue;
 	 continue;
@@ -1248,7 +1248,7 @@ string DeEscapeString(const string &input)
    char tmp[3];
    char tmp[3];
    string::const_iterator it, escape_start;
    string::const_iterator it, escape_start;
    string output, octal, hex;
    string output, octal, hex;
-   for (it = input.begin(); it != input.end(); it++) 
+   for (it = input.begin(); it != input.end(); ++it)
    {
    {
       // just copy non-escape chars
       // just copy non-escape chars
       if (*it != '\\')
       if (*it != '\\')
@@ -1264,7 +1264,7 @@ string DeEscapeString(const string &input)
          // copy
          // copy
          output += *it;
          output += *it;
          // advance iterator one step further
          // advance iterator one step further
-         it += 1;
+         ++it;
          continue;
          continue;
       }
       }
         
         
@@ -1273,7 +1273,7 @@ string DeEscapeString(const string &input)
          continue;
          continue;
 
 
       // read it
       // read it
-      it++;
+      ++it;
       switch (*it)
       switch (*it)
       {
       {
          case '0':
          case '0':
@@ -1310,7 +1310,7 @@ void URI::CopyFrom(const string &U)
    string::const_iterator I = U.begin();
    string::const_iterator I = U.begin();
 
 
    // Locate the first colon, this separates the scheme
    // Locate the first colon, this separates the scheme
-   for (; I < U.end() && *I != ':' ; I++);
+   for (; I < U.end() && *I != ':' ; ++I);
    string::const_iterator FirstColon = I;
    string::const_iterator FirstColon = I;
 
 
    /* Determine if this is a host type URI with a leading double //
    /* Determine if this is a host type URI with a leading double //
@@ -1322,7 +1322,7 @@ void URI::CopyFrom(const string &U)
    /* Find the / indicating the end of the hostname, ignoring /'s in the
    /* Find the / indicating the end of the hostname, ignoring /'s in the
       square brackets */
       square brackets */
    bool InBracket = false;
    bool InBracket = false;
-   for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); SingleSlash++)
+   for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); ++SingleSlash)
    {
    {
       if (*SingleSlash == '[')
       if (*SingleSlash == '[')
 	 InBracket = true;
 	 InBracket = true;
@@ -1355,11 +1355,11 @@ void URI::CopyFrom(const string &U)
    I = FirstColon + 1;
    I = FirstColon + 1;
    if (I > SingleSlash)
    if (I > SingleSlash)
       I = SingleSlash;
       I = SingleSlash;
-   for (; I < SingleSlash && *I != ':'; I++);
+   for (; I < SingleSlash && *I != ':'; ++I);
    string::const_iterator SecondColon = I;
    string::const_iterator SecondColon = I;
    
    
    // Search for the @ after the colon
    // Search for the @ after the colon
-   for (; I < SingleSlash && *I != '@'; I++);
+   for (; I < SingleSlash && *I != '@'; ++I);
    string::const_iterator At = I;
    string::const_iterator At = I;
    
    
    // Now write the host and user/pass
    // Now write the host and user/pass

+ 3 - 3
apt-pkg/deb/debindexfile.cc

@@ -352,7 +352,7 @@ pkgCache::PkgFileIterator debPackagesIndex::FindInCache(pkgCache &Cache) const
 {
 {
    string FileName = IndexFile("Packages");
    string FileName = IndexFile("Packages");
    pkgCache::PkgFileIterator File = Cache.FileBegin();
    pkgCache::PkgFileIterator File = Cache.FileBegin();
-   for (; File.end() == false; File++)
+   for (; File.end() == false; ++File)
    {
    {
        if (File.FileName() == NULL || FileName != File.FileName())
        if (File.FileName() == NULL || FileName != File.FileName())
 	 continue;
 	 continue;
@@ -540,7 +540,7 @@ pkgCache::PkgFileIterator debTranslationsIndex::FindInCache(pkgCache &Cache) con
    string FileName = IndexFile(Language);
    string FileName = IndexFile(Language);
    
    
    pkgCache::PkgFileIterator File = Cache.FileBegin();
    pkgCache::PkgFileIterator File = Cache.FileBegin();
-   for (; File.end() == false; File++)
+   for (; File.end() == false; ++File)
    {
    {
       if (FileName != File.FileName())
       if (FileName != File.FileName())
 	 continue;
 	 continue;
@@ -620,7 +620,7 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
 pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const
 pkgCache::PkgFileIterator debStatusIndex::FindInCache(pkgCache &Cache) const
 {
 {
    pkgCache::PkgFileIterator File = Cache.FileBegin();
    pkgCache::PkgFileIterator File = Cache.FileBegin();
-   for (; File.end() == false; File++)
+   for (; File.end() == false; ++File)
    {
    {
       if (this->File != File.FileName())
       if (this->File != File.FileName())
 	 continue;
 	 continue;

+ 1 - 1
apt-pkg/deb/deblistparser.cc

@@ -203,7 +203,7 @@ string debListParser::DescriptionLanguage()
 
 
    std::vector<string> const lang = APT::Configuration::getLanguages(true);
    std::vector<string> const lang = APT::Configuration::getLanguages(true);
    for (std::vector<string>::const_iterator l = lang.begin();
    for (std::vector<string>::const_iterator l = lang.begin();
-	l != lang.end(); l++)
+	l != lang.end(); ++l)
       if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
       if (Section.FindS(string("Description-").append(*l).c_str()).empty() == false)
 	 return *l;
 	 return *l;
 
 

+ 6 - 6
apt-pkg/deb/debmetaindex.cc

@@ -206,7 +206,7 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
 		for (std::set<std::string>::const_iterator s = sections.begin();
 		for (std::set<std::string>::const_iterator s = sections.begin();
 		     s != sections.end(); ++s) {
 		     s != sections.end(); ++s) {
 			for (std::vector<std::string>::const_iterator l = lang.begin();
 			for (std::vector<std::string>::const_iterator l = lang.begin();
-			     l != lang.end(); l++) {
+			     l != lang.end(); ++l) {
 				if (*l == "none") continue;
 				if (*l == "none") continue;
 				IndexTarget * Target = new OptionalIndexTarget();
 				IndexTarget * Target = new OptionalIndexTarget();
 				Target->ShortDesc = "Translation-" + *l;
 				Target->ShortDesc = "Translation-" + *l;
@@ -236,7 +236,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
    // special case for --print-uris
    // special case for --print-uris
    if (GetAll) {
    if (GetAll) {
       vector <struct IndexTarget *> *targets = ComputeIndexTargets();
       vector <struct IndexTarget *> *targets = ComputeIndexTargets();
-      for (vector <struct IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); Target++) {
+      for (vector <struct IndexTarget*>::const_iterator Target = targets->begin(); Target != targets->end(); ++Target) {
 	 new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
 	 new pkgAcqIndex(Owner, (*Target)->URI, (*Target)->Description,
 			 (*Target)->ShortDesc, HashString());
 			 (*Target)->ShortDesc, HashString());
       }
       }
@@ -279,7 +279,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
 	if (src != ArchEntries.end()) {
 	if (src != ArchEntries.end()) {
 		vector<debSectionEntry const*> const SectionEntries = src->second;
 		vector<debSectionEntry const*> const SectionEntries = src->second;
 		for (vector<debSectionEntry const*>::const_iterator I = SectionEntries.begin();
 		for (vector<debSectionEntry const*>::const_iterator I = SectionEntries.begin();
-		     I != SectionEntries.end(); I++)
+		     I != SectionEntries.end(); ++I)
 			Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted()));
 			Indexes->push_back(new debSourcesIndex (URI, Dist, (*I)->Section, IsTrusted()));
 	}
 	}
 
 
@@ -294,7 +294,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
 		if (a->first == "source")
 		if (a->first == "source")
 			continue;
 			continue;
 		for (vector<debSectionEntry const*>::const_iterator I = a->second.begin();
 		for (vector<debSectionEntry const*>::const_iterator I = a->second.begin();
-		     I != a->second.end(); I++) {
+		     I != a->second.end(); ++I) {
 			Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted(), a->first));
 			Indexes->push_back(new debPackagesIndex (URI, Dist, (*I)->Section, IsTrusted(), a->first));
 			sections[(*I)->Section].insert(lang.begin(), lang.end());
 			sections[(*I)->Section].insert(lang.begin(), lang.end());
 		}
 		}
@@ -303,7 +303,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
 	for (map<string, set<string> >::const_iterator s = sections.begin();
 	for (map<string, set<string> >::const_iterator s = sections.begin();
 	     s != sections.end(); ++s)
 	     s != sections.end(); ++s)
 		for (set<string>::const_iterator l = s->second.begin();
 		for (set<string>::const_iterator l = s->second.begin();
-		     l != s->second.end(); l++) {
+		     l != s->second.end(); ++l) {
 			if (*l == "none") continue;
 			if (*l == "none") continue;
 			Indexes->push_back(new debTranslationsIndex(URI,Dist,s->first,(*l).c_str()));
 			Indexes->push_back(new debTranslationsIndex(URI,Dist,s->first,(*l).c_str()));
 		}
 		}
@@ -351,7 +351,7 @@ class debSLTypeDebian : public pkgSourceList::Type
 				APT::Configuration::getArchitectures();
 				APT::Configuration::getArchitectures();
 
 
       for (vector<metaIndex *>::const_iterator I = List.begin();
       for (vector<metaIndex *>::const_iterator I = List.begin();
-	   I != List.end(); I++)
+	   I != List.end(); ++I)
       {
       {
 	 // We only worry about debian entries here
 	 // We only worry about debian entries here
 	 if (strcmp((*I)->GetType(), "deb") != 0)
 	 if (strcmp((*I)->GetType(), "deb") != 0)

+ 1 - 1
apt-pkg/deb/debrecords.cc

@@ -118,7 +118,7 @@ string debRecordParser::LongDesc()
   {
   {
      vector<string> const lang = APT::Configuration::getLanguages();
      vector<string> const lang = APT::Configuration::getLanguages();
      for (vector<string>::const_iterator l = lang.begin();
      for (vector<string>::const_iterator l = lang.begin();
-	  orig.empty() && l != lang.end(); l++)
+	  orig.empty() && l != lang.end(); ++l)
 	orig = Section.FindS(string("Description-").append(*l).c_str());
 	orig = Section.FindS(string("Description-").append(*l).c_str());
   }
   }
 
 

+ 10 - 10
apt-pkg/deb/dpkgpm.cc

@@ -213,7 +213,7 @@ bool pkgDPkgPM::SendV2Pkgs(FILE *F)
    fprintf(F,"\n");
    fprintf(F,"\n");
  
  
    // Write out the package actions in order.
    // Write out the package actions in order.
-   for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       if(I->Pkg.end() == true)
       if(I->Pkg.end() == true)
 	 continue;
 	 continue;
@@ -335,7 +335,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
       // Feed it the filenames.
       // Feed it the filenames.
       if (Version <= 1)
       if (Version <= 1)
       {
       {
-	 for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+	 for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
 	 {
 	 {
 	    // Only deal with packages to be installed from .deb
 	    // Only deal with packages to be installed from .deb
 	    if (I->Op != Item::Install)
 	    if (I->Op != Item::Install)
@@ -690,7 +690,7 @@ bool pkgDPkgPM::OpenLog()
       chmod(history_name.c_str(), 0644);
       chmod(history_name.c_str(), 0644);
       fprintf(history_out, "\nStart-Date: %s\n", timestr);
       fprintf(history_out, "\nStart-Date: %s\n", timestr);
       string remove, purge, install, reinstall, upgrade, downgrade;
       string remove, purge, install, reinstall, upgrade, downgrade;
-      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+      for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
       {
       {
 	 enum { CANDIDATE, CANDIDATE_AUTO, CURRENT_CANDIDATE, CURRENT } infostring;
 	 enum { CANDIDATE, CANDIDATE_AUTO, CURRENT_CANDIDATE, CURRENT } infostring;
 	 string *line = NULL;
 	 string *line = NULL;
@@ -868,14 +868,14 @@ bool pkgDPkgPM::Go(int OutStatusFd)
    // that will be [installed|configured|removed|purged] and add
    // that will be [installed|configured|removed|purged] and add
    // them to the PackageOps map (the dpkg states it goes through)
    // them to the PackageOps map (the dpkg states it goes through)
    // and the PackageOpsTranslations (human readable strings)
    // and the PackageOpsTranslations (human readable strings)
-   for (vector<Item>::const_iterator I = List.begin(); I != List.end();I++)
+   for (vector<Item>::const_iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       if((*I).Pkg.end() == true)
       if((*I).Pkg.end() == true)
 	 continue;
 	 continue;
 
 
       string const name = (*I).Pkg.Name();
       string const name = (*I).Pkg.Name();
       PackageOpsDone[name] = 0;
       PackageOpsDone[name] = 0;
-      for(int i=0; (DpkgStatesOpMap[(*I).Op][i]).state != NULL;  i++) 
+      for(int i=0; (DpkgStatesOpMap[(*I).Op][i]).state != NULL; ++i)
       {
       {
 	 PackageOps[name].push_back(DpkgStatesOpMap[(*I).Op][i]);
 	 PackageOps[name].push_back(DpkgStatesOpMap[(*I).Op][i]);
 	 PackagesTotal++;
 	 PackagesTotal++;
@@ -893,7 +893,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       // Do all actions with the same Op in one run
       // Do all actions with the same Op in one run
       vector<Item>::const_iterator J = I;
       vector<Item>::const_iterator J = I;
       if (TriggersPending == true)
       if (TriggersPending == true)
-	 for (; J != List.end(); J++)
+	 for (; J != List.end(); ++J)
 	 {
 	 {
 	    if (J->Op == I->Op)
 	    if (J->Op == I->Op)
 	       continue;
 	       continue;
@@ -905,7 +905,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 	    break;
 	    break;
 	 }
 	 }
       else
       else
-	 for (; J != List.end() && J->Op == I->Op; J++)
+	 for (; J != List.end() && J->Op == I->Op; ++J)
 	    /* nothing */;
 	    /* nothing */;
 
 
       // Generate the argument list
       // Generate the argument list
@@ -1011,7 +1011,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       // Write in the file or package names
       // Write in the file or package names
       if (I->Op == Item::Install)
       if (I->Op == Item::Install)
       {
       {
-	 for (;I != J && Size < MaxArgBytes; I++)
+	 for (;I != J && Size < MaxArgBytes; ++I)
 	 {
 	 {
 	    if (I->File[0] != '/')
 	    if (I->File[0] != '/')
 	       return _error->Error("Internal Error, Pathname to install is not absolute '%s'",I->File.c_str());
 	       return _error->Error("Internal Error, Pathname to install is not absolute '%s'",I->File.c_str());
@@ -1023,7 +1023,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       {
       {
 	 string const nativeArch = _config->Find("APT::Architecture");
 	 string const nativeArch = _config->Find("APT::Architecture");
 	 unsigned long const oldSize = I->Op == Item::Configure ? Size : 0;
 	 unsigned long const oldSize = I->Op == Item::Configure ? Size : 0;
-	 for (;I != J && Size < MaxArgBytes; I++)
+	 for (;I != J && Size < MaxArgBytes; ++I)
 	 {
 	 {
 	    if((*I).Pkg.end() == true)
 	    if((*I).Pkg.end() == true)
 	       continue;
 	       continue;
@@ -1461,7 +1461,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
    // log the ordering 
    // log the ordering 
    const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
    const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
    fprintf(report, "AptOrdering:\n");
    fprintf(report, "AptOrdering:\n");
-   for (vector<Item>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<Item>::iterator I = List.begin(); I != List.end(); ++I)
       fprintf(report, " %s: %s\n", (*I).Pkg.Name(), ops_str[(*I).Op]);
       fprintf(report, " %s: %s\n", (*I).Pkg.Name(), ops_str[(*I).Op]);
 
 
    // attach dmesg log (to learn about segfaults)
    // attach dmesg log (to learn about segfaults)

+ 14 - 14
apt-pkg/depcache.cc

@@ -129,7 +129,7 @@ bool pkgDepCache::Init(OpProgress *Prog)
    /* Set the current state of everything. In this state all of the
    /* Set the current state of everything. In this state all of the
       packages are kept exactly as is. See AllUpgrade */
       packages are kept exactly as is. See AllUpgrade */
    int Done = 0;
    int Done = 0;
-   for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
+   for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done)
    {
    {
       if (Prog != 0 && Done%20 == 0)
       if (Prog != 0 && Done%20 == 0)
 	 Prog->Progress(Done);
 	 Prog->Progress(Done);
@@ -292,7 +292,7 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly)	/*{{{*/
    
    
    // then write the ones we have not seen yet
    // then write the ones we have not seen yet
    std::ostringstream ostr;
    std::ostringstream ostr;
-   for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); pkg++) {
+   for(pkgCache::PkgIterator pkg=Cache->PkgBegin(); !pkg.end(); ++pkg) {
       StateCache const &P = PkgState[pkg->ID];
       StateCache const &P = PkgState[pkg->ID];
       if(P.Flags & Flag::Auto) {
       if(P.Flags & Flag::Auto) {
 	 if (pkgs_seen.find(pkg.FullName()) != pkgs_seen.end()) {
 	 if (pkgs_seen.find(pkg.FullName()) != pkgs_seen.end()) {
@@ -365,7 +365,7 @@ bool pkgDepCache::CheckDep(DepIterator Dep,int Type,PkgIterator &Res)
    // Check the providing packages
    // Check the providing packages
    PrvIterator P = Dep.TargetPkg().ProvidesList();
    PrvIterator P = Dep.TargetPkg().ProvidesList();
    PkgIterator Pkg = Dep.ParentPkg();
    PkgIterator Pkg = Dep.ParentPkg();
-   for (; P.end() != true; P++)
+   for (; P.end() != true; ++P)
    {
    {
       /* Provides may never be applied against the same package (or group)
       /* Provides may never be applied against the same package (or group)
          if it is a conflicts. See the comment above. */
          if it is a conflicts. See the comment above. */
@@ -585,7 +585,7 @@ void pkgDepCache::BuildGroupOrs(VerIterator const &V)
 {
 {
    unsigned char Group = 0;
    unsigned char Group = 0;
    
    
-   for (DepIterator D = V.DependsList(); D.end() != true; D++)
+   for (DepIterator D = V.DependsList(); D.end() != true; ++D)
    {
    {
       // Build the dependency state.
       // Build the dependency state.
       unsigned char &State = DepState[D->ID];
       unsigned char &State = DepState[D->ID];
@@ -625,7 +625,7 @@ unsigned char pkgDepCache::VersionState(DepIterator D,unsigned char Check,
       // Compute a single dependency element (glob or)
       // Compute a single dependency element (glob or)
       DepIterator Start = D;
       DepIterator Start = D;
       unsigned char State = 0;
       unsigned char State = 0;
-      for (bool LastOR = true; D.end() == false && LastOR == true; D++)
+      for (bool LastOR = true; D.end() == false && LastOR == true; ++D)
       {
       {
 	 State |= DepState[D->ID];
 	 State |= DepState[D->ID];
 	 LastOR = (D->CompareOp & Dep::Or) == Dep::Or;
 	 LastOR = (D->CompareOp & Dep::Or) == Dep::Or;
@@ -715,15 +715,15 @@ void pkgDepCache::Update(OpProgress *Prog)
 
 
    // Perform the depends pass
    // Perform the depends pass
    int Done = 0;
    int Done = 0;
-   for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
+   for (PkgIterator I = PkgBegin(); I.end() != true; ++I, ++Done)
    {
    {
       if (Prog != 0 && Done%20 == 0)
       if (Prog != 0 && Done%20 == 0)
 	 Prog->Progress(Done);
 	 Prog->Progress(Done);
-      for (VerIterator V = I.VersionList(); V.end() != true; V++)
+      for (VerIterator V = I.VersionList(); V.end() != true; ++V)
       {
       {
 	 unsigned char Group = 0;
 	 unsigned char Group = 0;
 
 
-	 for (DepIterator D = V.DependsList(); D.end() != true; D++)
+	 for (DepIterator D = V.DependsList(); D.end() != true; ++D)
 	 {
 	 {
 	    // Build the dependency state.
 	    // Build the dependency state.
 	    unsigned char &State = DepState[D->ID];
 	    unsigned char &State = DepState[D->ID];
@@ -760,7 +760,7 @@ void pkgDepCache::Update(OpProgress *Prog)
 void pkgDepCache::Update(DepIterator D)
 void pkgDepCache::Update(DepIterator D)
 {
 {
    // Update the reverse deps
    // Update the reverse deps
-   for (;D.end() != true; D++)
+   for (;D.end() != true; ++D)
    {      
    {      
       unsigned char &State = DepState[D->ID];
       unsigned char &State = DepState[D->ID];
       State = DependencyState(D);
       State = DependencyState(D);
@@ -793,13 +793,13 @@ void pkgDepCache::Update(PkgIterator const &Pkg)
    // Update the provides map for the current ver
    // Update the provides map for the current ver
    if (Pkg->CurrentVer != 0)
    if (Pkg->CurrentVer != 0)
       for (PrvIterator P = Pkg.CurrentVer().ProvidesList(); 
       for (PrvIterator P = Pkg.CurrentVer().ProvidesList(); 
-	   P.end() != true; P++)
+	   P.end() != true; ++P)
 	 Update(P.ParentPkg().RevDependsList());
 	 Update(P.ParentPkg().RevDependsList());
 
 
    // Update the provides map for the candidate ver
    // Update the provides map for the candidate ver
    if (PkgState[Pkg->ID].CandidateVer != 0)
    if (PkgState[Pkg->ID].CandidateVer != 0)
       for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList();
       for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList();
-	   P.end() != true; P++)
+	   P.end() != true; ++P)
 	 Update(P.ParentPkg().RevDependsList());
 	 Update(P.ParentPkg().RevDependsList());
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -1059,7 +1059,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
       DepIterator Start = Dep;
       DepIterator Start = Dep;
       bool Result = true;
       bool Result = true;
       unsigned Ors = 0;
       unsigned Ors = 0;
-      for (bool LastOR = true; Dep.end() == false && LastOR == true; Dep++,Ors++)
+      for (bool LastOR = true; Dep.end() == false && LastOR == true; ++Dep, ++Ors)
       {
       {
 	 LastOR = (Dep->CompareOp & Dep::Or) == Dep::Or;
 	 LastOR = (Dep->CompareOp & Dep::Or) == Dep::Or;
 
 
@@ -1522,12 +1522,12 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk
       unless they are already installed */
       unless they are already installed */
    VerIterator Last(*(pkgCache *)this,0);
    VerIterator Last(*(pkgCache *)this,0);
    
    
-   for (VerIterator I = Pkg.VersionList(); I.end() == false; I++)
+   for (VerIterator I = Pkg.VersionList(); I.end() == false; ++I)
    {
    {
       if (Pkg.CurrentVer() == I)
       if (Pkg.CurrentVer() == I)
 	 return I;
 	 return I;
       
       
-      for (VerFileIterator J = I.FileList(); J.end() == false; J++)
+      for (VerFileIterator J = I.FileList(); J.end() == false; ++J)
       {
       {
 	 if ((J.File()->Flags & Flag::NotSource) != 0)
 	 if ((J.File()->Flags & Flag::NotSource) != 0)
 	    continue;
 	    continue;

+ 2 - 2
apt-pkg/depcache.h

@@ -390,7 +390,7 @@ class pkgDepCache : protected pkgCache::Namespace
    // @{
    // @{
    void MarkKeep(PkgIterator const &Pkg, bool Soft = false,
    void MarkKeep(PkgIterator const &Pkg, bool Soft = false,
 		 bool FromUser = true, unsigned long Depth = 0);
 		 bool FromUser = true, unsigned long Depth = 0);
-   void MarkDelete(PkgIterator const &Pkg, bool Purge = false,
+   void MarkDelete(PkgIterator const &Pkg, bool MarkPurge = false,
                    unsigned long Depth = 0, bool FromUser = true);
                    unsigned long Depth = 0, bool FromUser = true);
    void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true,
    void MarkInstall(PkgIterator const &Pkg,bool AutoInst = true,
 		    unsigned long Depth = 0, bool FromUser = true,
 		    unsigned long Depth = 0, bool FromUser = true,
@@ -459,7 +459,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *  \param Depth     recursive deep of this Marker call
     *  \param Depth     recursive deep of this Marker call
     *  \param FromUser  was the remove requested by the user?
     *  \param FromUser  was the remove requested by the user?
     */
     */
-   virtual bool IsDeleteOk(const PkgIterator &Pkg,bool Purge = false,
+   virtual bool IsDeleteOk(const PkgIterator &Pkg,bool MarkPurge = false,
 			    unsigned long Depth = 0, bool FromUser = true);
 			    unsigned long Depth = 0, bool FromUser = true);
 
 
    // read persistent states
    // read persistent states

+ 10 - 11
apt-pkg/indexcopy.cc

@@ -43,7 +43,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
 			     pkgCdromStatus *log)
 			     pkgCdromStatus *log)
 {
 {
    OpProgress *Progress = NULL;
    OpProgress *Progress = NULL;
-   if (List.size() == 0)
+   if (List.empty() == true)
       return true;
       return true;
    
    
    if(log) 
    if(log) 
@@ -54,7 +54,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
    
    
    // Prepare the progress indicator
    // Prepare the progress indicator
    unsigned long TotalSize = 0;
    unsigned long TotalSize = 0;
-   for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       struct stat Buf;
       struct stat Buf;
       if (stat(string(*I + GetFileName()).c_str(),&Buf) != 0 &&
       if (stat(string(*I + GetFileName()).c_str(),&Buf) != 0 &&
@@ -68,7 +68,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
    unsigned int NotFound = 0;
    unsigned int NotFound = 0;
    unsigned int WrongSize = 0;
    unsigned int WrongSize = 0;
    unsigned int Packages = 0;
    unsigned int Packages = 0;
-   for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
    {      
    {      
       string OrigPath = string(*I,CDROM.length());
       string OrigPath = string(*I,CDROM.length());
       unsigned long FileSize = 0;
       unsigned long FileSize = 0;
@@ -583,13 +583,13 @@ bool SigVerify::CopyMetaIndex(string CDROM, string CDName,		/*{{{*/
 bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList,	/*{{{*/
 bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList,	/*{{{*/
 			      vector<string> PkgList,vector<string> SrcList)
 			      vector<string> PkgList,vector<string> SrcList)
 {
 {
-   if (SigList.size() == 0)
+   if (SigList.empty() == true)
       return true;
       return true;
 
 
    bool Debug = _config->FindB("Debug::aptcdrom",false);
    bool Debug = _config->FindB("Debug::aptcdrom",false);
 
 
    // Read all Release files
    // Read all Release files
-   for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); I++)
+   for (vector<string>::iterator I = SigList.begin(); I != SigList.end(); ++I)
    { 
    { 
       if(Debug)
       if(Debug)
 	 cout << "Signature verify for: " << *I << endl;
 	 cout << "Signature verify for: " << *I << endl;
@@ -633,7 +633,7 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList,
       // go over the Indexfiles and see if they verify
       // go over the Indexfiles and see if they verify
       // if so, remove them from our copy of the lists
       // if so, remove them from our copy of the lists
       vector<string> keys = MetaIndex->MetaKeys();
       vector<string> keys = MetaIndex->MetaKeys();
-      for (vector<string>::iterator I = keys.begin(); I != keys.end(); I++)
+      for (vector<string>::iterator I = keys.begin(); I != keys.end(); ++I)
       { 
       { 
 	 if(!Verify(prefix,*I, MetaIndex)) {
 	 if(!Verify(prefix,*I, MetaIndex)) {
 	    // something went wrong, don't copy the Release.gpg
 	    // something went wrong, don't copy the Release.gpg
@@ -776,7 +776,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
 				vector<string> &List, pkgCdromStatus *log)
 				vector<string> &List, pkgCdromStatus *log)
 {
 {
    OpProgress *Progress = NULL;
    OpProgress *Progress = NULL;
-   if (List.size() == 0)
+   if (List.empty() == true)
       return true;
       return true;
    
    
    if(log) 
    if(log) 
@@ -786,7 +786,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
    
    
    // Prepare the progress indicator
    // Prepare the progress indicator
    unsigned long TotalSize = 0;
    unsigned long TotalSize = 0;
-   for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       struct stat Buf;
       struct stat Buf;
       if (stat(string(*I).c_str(),&Buf) != 0 &&
       if (stat(string(*I).c_str(),&Buf) != 0 &&
@@ -800,7 +800,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
    unsigned int NotFound = 0;
    unsigned int NotFound = 0;
    unsigned int WrongSize = 0;
    unsigned int WrongSize = 0;
    unsigned int Packages = 0;
    unsigned int Packages = 0;
-   for (vector<string>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::iterator I = List.begin(); I != List.end(); ++I)
    {      
    {      
       string OrigPath = string(*I,CDROM.length());
       string OrigPath = string(*I,CDROM.length());
       unsigned long FileSize = 0;
       unsigned long FileSize = 0;
@@ -885,7 +885,6 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
       this->Section = &Section;
       this->Section = &Section;
       string Prefix;
       string Prefix;
       unsigned long Hits = 0;
       unsigned long Hits = 0;
-      unsigned long Chop = 0;
       while (Parser.Step(Section) == true)
       while (Parser.Step(Section) == true)
       {
       {
 	 if(Progress)
 	 if(Progress)
@@ -903,7 +902,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,	/*{{{*/
       fclose(TargetFl);
       fclose(TargetFl);
 
 
       if (Debug == true)
       if (Debug == true)
-	 cout << " Processed by using Prefix '" << Prefix << "' and chop " << Chop << endl;
+	 cout << " Processed by using Prefix '" << Prefix << "' and chop " << endl;
 	 
 	 
       if (_config->FindB("APT::CDROM::NoAct",false) == false)
       if (_config->FindB("APT::CDROM::NoAct",false) == false)
       {
       {

+ 2 - 1
apt-pkg/indexfile.cc

@@ -27,7 +27,8 @@ unsigned long pkgIndexFile::Type::GlobalListLen = 0;
 pkgIndexFile::Type::Type()
 pkgIndexFile::Type::Type()
 {
 {
    ItmList[GlobalListLen] = this;
    ItmList[GlobalListLen] = this;
-   GlobalListLen++;   
+   GlobalListLen++;
+   Label = NULL;
 }
 }
 									/*}}}*/
 									/*}}}*/
 // Type::GetType - Locate the type by name				/*{{{*/
 // Type::GetType - Locate the type by name				/*{{{*/

+ 13 - 13
apt-pkg/orderlist.cc

@@ -145,13 +145,13 @@ bool pkgOrderList::DoRun()
    Depth = 0;
    Depth = 0;
    WipeFlags(Added | AddPending | Loop | InList);
    WipeFlags(Added | AddPending | Loop | InList);
 
 
-   for (iterator I = List; I != End; I++)
+   for (iterator I = List; I != End; ++I)
       Flag(*I,InList);
       Flag(*I,InList);
 
 
    // Rebuild the main list into the temp list.
    // Rebuild the main list into the temp list.
    iterator OldEnd = End;
    iterator OldEnd = End;
    End = NList;
    End = NList;
-   for (iterator I = List; I != OldEnd; I++)
+   for (iterator I = List; I != OldEnd; ++I)
       if (VisitNode(PkgIterator(Cache,*I)) == false)
       if (VisitNode(PkgIterator(Cache,*I)) == false)
       {
       {
 	 End = OldEnd;
 	 End = OldEnd;
@@ -197,7 +197,7 @@ bool pkgOrderList::OrderCritical()
    {
    {
       clog << "** Critical Unpack ordering done" << endl;
       clog << "** Critical Unpack ordering done" << endl;
 
 
-      for (iterator I = List; I != End; I++)
+      for (iterator I = List; I != End; ++I)
       {
       {
 	 PkgIterator P(Cache,*I);
 	 PkgIterator P(Cache,*I);
 	 if (IsNow(P) == true)
 	 if (IsNow(P) == true)
@@ -222,7 +222,7 @@ bool pkgOrderList::OrderUnpack(string *FileList)
       WipeFlags(After);
       WipeFlags(After);
 
 
       // Set the inlist flag
       // Set the inlist flag
-      for (iterator I = List; I != End; I++)
+      for (iterator I = List; I != End; ++I)
       {
       {
 	 PkgIterator P(Cache,*I);
 	 PkgIterator P(Cache,*I);
 	 if (IsMissing(P) == true && IsNow(P) == true)
 	 if (IsMissing(P) == true && IsNow(P) == true)
@@ -270,7 +270,7 @@ bool pkgOrderList::OrderUnpack(string *FileList)
    {
    {
       clog << "** Unpack ordering done" << endl;
       clog << "** Unpack ordering done" << endl;
 
 
-      for (iterator I = List; I != End; I++)
+      for (iterator I = List; I != End; ++I)
       {
       {
 	 PkgIterator P(Cache,*I);
 	 PkgIterator P(Cache,*I);
 	 if (IsNow(P) == true)
 	 if (IsNow(P) == true)
@@ -323,7 +323,7 @@ int pkgOrderList::Score(PkgIterator Pkg)
       Score += ScoreImmediate;
       Score += ScoreImmediate;
 
 
    for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList();
    for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList();
-	D.end() == false; D++)
+	D.end() == false; ++D)
       if (D->Type == pkgCache::Dep::PreDepends)
       if (D->Type == pkgCache::Dep::PreDepends)
       {
       {
 	 Score += ScorePreDepends;
 	 Score += ScorePreDepends;
@@ -488,7 +488,7 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver)
       return true;
       return true;
    
    
    bool Res = true;
    bool Res = true;
-   for (PrvIterator P = Ver.ProvidesList(); P.end() == false; P++)
+   for (PrvIterator P = Ver.ProvidesList(); P.end() == false; ++P)
       Res &= (this->*F)(P.ParentPkg().RevDependsList());
       Res &= (this->*F)(P.ParentPkg().RevDependsList());
    return Res;
    return Res;
 }
 }
@@ -615,7 +615,7 @@ bool pkgOrderList::VisitNode(PkgIterator Pkg)
    Loops are preprocessed and logged. */
    Loops are preprocessed and logged. */
 bool pkgOrderList::DepUnPackCrit(DepIterator D)
 bool pkgOrderList::DepUnPackCrit(DepIterator D)
 {
 {
-   for (; D.end() == false; D++)
+   for (; D.end() == false; ++D)
    {
    {
       if (D.Reverse() == true)
       if (D.Reverse() == true)
       {
       {
@@ -693,7 +693,7 @@ bool pkgOrderList::DepUnPackPreD(DepIterator D)
    if (D.Reverse() == true)
    if (D.Reverse() == true)
       return DepUnPackCrit(D);
       return DepUnPackCrit(D);
    
    
-   for (; D.end() == false; D++)
+   for (; D.end() == false; ++D)
    {
    {
       if (D.IsCritical() == false)
       if (D.IsCritical() == false)
 	 continue;
 	 continue;
@@ -736,7 +736,7 @@ bool pkgOrderList::DepUnPackPre(DepIterator D)
    if (D.Reverse() == true)
    if (D.Reverse() == true)
       return true;
       return true;
    
    
-   for (; D.end() == false; D++)
+   for (; D.end() == false; ++D)
    {
    {
       /* Only consider the PreDepends or Depends. Depends are only
       /* Only consider the PreDepends or Depends. Depends are only
        	 considered at the lowest depth or in the case of immediate
        	 considered at the lowest depth or in the case of immediate
@@ -791,7 +791,7 @@ bool pkgOrderList::DepUnPackPre(DepIterator D)
 bool pkgOrderList::DepUnPackDep(DepIterator D)
 bool pkgOrderList::DepUnPackDep(DepIterator D)
 {
 {
    
    
-   for (; D.end() == false; D++)
+   for (; D.end() == false; ++D)
       if (D.IsCritical() == true)
       if (D.IsCritical() == true)
       {
       {
 	 if (D.Reverse() == true)
 	 if (D.Reverse() == true)
@@ -846,7 +846,7 @@ bool pkgOrderList::DepConfigure(DepIterator D)
    if (D.Reverse() == true)
    if (D.Reverse() == true)
       return true;
       return true;
    
    
-   for (; D.end() == false; D++)
+   for (; D.end() == false; ++D)
       if (D->Type == pkgCache::Dep::Depends)
       if (D->Type == pkgCache::Dep::Depends)
 	 if (VisitProvides(D,false) == false)
 	 if (VisitProvides(D,false) == false)
 	    return false;
 	    return false;
@@ -868,7 +868,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
 {
 {
    if (D.Reverse() == false)
    if (D.Reverse() == false)
       return true;
       return true;
-   for (; D.end() == false; D++)
+   for (; D.end() == false; ++D)
       if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
       if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
       {
       {
 	 // Duplication elimination, consider the current version only
 	 // Duplication elimination, consider the current version only

+ 16 - 16
apt-pkg/packagemanager.cc

@@ -63,7 +63,7 @@ bool pkgPackageManager::GetArchives(pkgAcquire *Owner,pkgSourceList *Sources,
    if (ordering == false)
    if (ordering == false)
       return _error->Error("Internal ordering error");
       return _error->Error("Internal ordering error");
 
 
-   for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+   for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
    {
    {
       PkgIterator Pkg(Cache,*I);
       PkgIterator Pkg(Cache,*I);
       FileNames[Pkg->ID] = string();
       FileNames[Pkg->ID] = string();
@@ -99,7 +99,7 @@ bool pkgPackageManager::FixMissing()
    List->SetFileList(FileNames);
    List->SetFileList(FileNames);
 
 
    bool Bad = false;
    bool Bad = false;
-   for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (List->IsMissing(I) == false)
       if (List->IsMissing(I) == false)
 	 continue;
 	 continue;
@@ -140,7 +140,7 @@ void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer, unsigned
       D = I.CurrentVer().DependsList(); 
       D = I.CurrentVer().DependsList(); 
    }
    }
 
 
-   for ( /* nothing */  ; D.end() == false; D++)
+   for ( /* nothing */  ; D.end() == false; ++D)
       if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
       if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
       {
       {
 	 if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
 	 if(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
@@ -169,7 +169,7 @@ bool pkgPackageManager::CreateOrderList()
    static bool const NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
    static bool const NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
    
    
    // Generate the list of affected packages and sort it
    // Generate the list of affected packages and sort it
-   for (PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
+   for (PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
    {
    {
       // Ignore no-version packages
       // Ignore no-version packages
       if (I->VersionList == 0)
       if (I->VersionList == 0)
@@ -229,7 +229,7 @@ bool pkgPackageManager::DepAlwaysTrue(DepIterator D)
 bool pkgPackageManager::CheckRConflicts(PkgIterator Pkg,DepIterator D,
 bool pkgPackageManager::CheckRConflicts(PkgIterator Pkg,DepIterator D,
 					const char *Ver)
 					const char *Ver)
 {
 {
-   for (;D.end() == false; D++)
+   for (;D.end() == false; ++D)
    {
    {
       if (D->Type != pkgCache::Dep::Conflicts &&
       if (D->Type != pkgCache::Dep::Conflicts &&
 	  D->Type != pkgCache::Dep::Obsoletes)
 	  D->Type != pkgCache::Dep::Obsoletes)
@@ -262,7 +262,7 @@ bool pkgPackageManager::ConfigureAll()
    pkgOrderList OList(&Cache);
    pkgOrderList OList(&Cache);
    
    
    // Populate the order list
    // Populate the order list
-   for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+   for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
       if (List->IsFlag(pkgCache::PkgIterator(Cache,*I),
       if (List->IsFlag(pkgCache::PkgIterator(Cache,*I),
 		       pkgOrderList::UnPacked) == true)
 		       pkgOrderList::UnPacked) == true)
 	 OList.push_back(*I);
 	 OList.push_back(*I);
@@ -274,7 +274,7 @@ bool pkgPackageManager::ConfigureAll()
    bool const ConfigurePkgs = (conf == "all");
    bool const ConfigurePkgs = (conf == "all");
 
 
    // Perform the configuring
    // Perform the configuring
-   for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
+   for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); ++I)
    {
    {
       PkgIterator Pkg(Cache,*I);
       PkgIterator Pkg(Cache,*I);
 
 
@@ -309,7 +309,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
 	 return false;
 	 return false;
 
 
    // Perform the configuring
    // Perform the configuring
-   for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); I++)
+   for (pkgOrderList::iterator I = OList.begin(); I != OList.end(); ++I)
    {
    {
       PkgIterator Pkg(Cache,*I);
       PkgIterator Pkg(Cache,*I);
       
       
@@ -364,13 +364,13 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
    {
    {
       if (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends)
       if (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends)
       {
       {
-	 D++;
+	 ++D;
 	 continue;
 	 continue;
       }
       }
       
       
       // Grok or groups
       // Grok or groups
       Bad = true;
       Bad = true;
-      for (bool LastOR = true; D.end() == false && LastOR == true; D++)
+      for (bool LastOR = true; D.end() == false && LastOR == true; ++D)
       {
       {
 	 LastOR = (D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or;
 	 LastOR = (D->CompareOp & pkgCache::Dep::Or) == pkgCache::Dep::Or;
 	 
 	 
@@ -378,7 +378,7 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
 	    continue;
 	    continue;
 
 
 	 SPtrArray<Version *> VList = D.AllTargets();
 	 SPtrArray<Version *> VList = D.AllTargets();
-	 for (Version **I = VList; *I != 0 && Bad == true; I++)
+	 for (Version **I = VList; *I != 0 && Bad == true; ++I)
 	 {
 	 {
 	    VerIterator Ver(Cache,*I);
 	    VerIterator Ver(Cache,*I);
 	    PkgIterator Pkg = Ver.ParentPkg();
 	    PkgIterator Pkg = Ver.ParentPkg();
@@ -444,7 +444,7 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
    if (Pkg->CurrentVer != 0)
    if (Pkg->CurrentVer != 0)
    {
    {
       for (DepIterator D = Pkg.RevDependsList(); D.end() == false &&
       for (DepIterator D = Pkg.RevDependsList(); D.end() == false &&
-	   IsEssential == false; D++)
+	   IsEssential == false; ++D)
 	 if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
 	 if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
 	    if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
 	    if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
 	       IsEssential = true;
 	       IsEssential = true;
@@ -564,7 +564,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
 	       return _error->Error("Couldn't configure pre-depend %s for %s, "
 	       return _error->Error("Couldn't configure pre-depend %s for %s, "
 				    "probably a dependency cycle.",
 				    "probably a dependency cycle.",
 				    End.TargetPkg().Name(),Pkg.Name());
 				    End.TargetPkg().Name(),Pkg.Name());
-	    Start++;
+	    ++Start;
 	 }
 	 }
 	 else
 	 else
 	    break;
 	    break;
@@ -597,7 +597,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
       return false;
       return false;
    
    
    for (PrvIterator P = instVer.ProvidesList();
    for (PrvIterator P = instVer.ProvidesList();
-	P.end() == false; P++)
+	P.end() == false; ++P)
       CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
       CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());
 
 
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
    List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
@@ -652,7 +652,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
       clog << "Done ordering" << endl;
       clog << "Done ordering" << endl;
 
 
    bool DoneSomething = false;
    bool DoneSomething = false;
-   for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+   for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
    {
    {
       PkgIterator Pkg(Cache,*I);
       PkgIterator Pkg(Cache,*I);
 
 
@@ -701,7 +701,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
       return Failed;
       return Failed;
 
 
    // Sanity check
    // Sanity check
-   for (pkgOrderList::iterator I = List->begin(); I != List->end(); I++)
+   for (pkgOrderList::iterator I = List->begin(); I != List->end(); ++I)
    {
    {
       if (List->IsFlag(*I,pkgOrderList::Configured) == false)
       if (List->IsFlag(*I,pkgOrderList::Configured) == false)
       {
       {

+ 13 - 13
apt-pkg/pkgcache.cc

@@ -175,7 +175,7 @@ bool pkgCache::ReMap(bool const &Errorchecks)
 unsigned long pkgCache::sHash(const string &Str) const
 unsigned long pkgCache::sHash(const string &Str) const
 {
 {
    unsigned long Hash = 0;
    unsigned long Hash = 0;
-   for (string::const_iterator I = Str.begin(); I != Str.end(); I++)
+   for (string::const_iterator I = Str.begin(); I != Str.end(); ++I)
       Hash = 5*Hash + tolower_ascii(*I);
       Hash = 5*Hash + tolower_ascii(*I);
    return Hash % _count(HeaderP->PkgHashTable);
    return Hash % _count(HeaderP->PkgHashTable);
 }
 }
@@ -183,7 +183,7 @@ unsigned long pkgCache::sHash(const string &Str) const
 unsigned long pkgCache::sHash(const char *Str) const
 unsigned long pkgCache::sHash(const char *Str) const
 {
 {
    unsigned long Hash = 0;
    unsigned long Hash = 0;
-   for (const char *I = Str; *I != 0; I++)
+   for (const char *I = Str; *I != 0; ++I)
       Hash = 5*Hash + tolower_ascii(*I);
       Hash = 5*Hash + tolower_ascii(*I);
    return Hash % _count(HeaderP->PkgHashTable);
    return Hash % _count(HeaderP->PkgHashTable);
 }
 }
@@ -569,7 +569,7 @@ bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result) const
       virtual package libc-dev which is provided by libc5-dev and libc6-dev
       virtual package libc-dev which is provided by libc5-dev and libc6-dev
       we must ignore libc5-dev when considering the provides list. */ 
       we must ignore libc5-dev when considering the provides list. */ 
    PrvIterator PStart = Result.ProvidesList();
    PrvIterator PStart = Result.ProvidesList();
-   for (; PStart.end() != true && PStart.OwnerPkg() == ParentPkg(); PStart++);
+   for (; PStart.end() != true && PStart.OwnerPkg() == ParentPkg(); ++PStart);
 
 
    // Nothing but indirect self provides
    // Nothing but indirect self provides
    if (PStart.end() == true)
    if (PStart.end() == true)
@@ -577,7 +577,7 @@ bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result) const
    
    
    // Check for single packages in the provides list
    // Check for single packages in the provides list
    PrvIterator P = PStart;
    PrvIterator P = PStart;
-   for (; P.end() != true; P++)
+   for (; P.end() != true; ++P)
    {
    {
       // Skip over self provides
       // Skip over self provides
       if (P.OwnerPkg() == ParentPkg())
       if (P.OwnerPkg() == ParentPkg())
@@ -611,7 +611,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
       PkgIterator DPkg = TargetPkg();
       PkgIterator DPkg = TargetPkg();
 
 
       // Walk along the actual package providing versions
       // Walk along the actual package providing versions
-      for (VerIterator I = DPkg.VersionList(); I.end() == false; I++)
+      for (VerIterator I = DPkg.VersionList(); I.end() == false; ++I)
       {
       {
 	 if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false)
 	 if (Owner->VS->CheckDep(I.VerStr(),S->CompareOp,TargetVer()) == false)
 	    continue;
 	    continue;
@@ -626,7 +626,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
       }
       }
       
       
       // Follow all provides
       // Follow all provides
-      for (PrvIterator I = DPkg.ProvidesList(); I.end() == false; I++)
+      for (PrvIterator I = DPkg.ProvidesList(); I.end() == false; ++I)
       {
       {
 	 if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false)
 	 if (Owner->VS->CheckDep(I.ProvideVersion(),S->CompareOp,TargetVer()) == false)
 	    continue;
 	    continue;
@@ -717,7 +717,7 @@ int pkgCache::VerIterator::CompareVer(const VerIterator &B) const
    /* Start at A and look for B. If B is found then A > B otherwise
    /* Start at A and look for B. If B is found then A > B otherwise
       B was before A so A < B */
       B was before A so A < B */
    VerIterator I = *this;
    VerIterator I = *this;
-   for (;I.end() == false; I++)
+   for (;I.end() == false; ++I)
       if (I == B)
       if (I == B)
 	 return 1;
 	 return 1;
    return -1;
    return -1;
@@ -729,7 +729,7 @@ int pkgCache::VerIterator::CompareVer(const VerIterator &B) const
 bool pkgCache::VerIterator::Downloadable() const
 bool pkgCache::VerIterator::Downloadable() const
 {
 {
    VerFileIterator Files = FileList();
    VerFileIterator Files = FileList();
-   for (; Files.end() == false; Files++)
+   for (; Files.end() == false; ++Files)
       if ((Files.File()->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource)
       if ((Files.File()->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource)
 	 return true;
 	 return true;
    return false;
    return false;
@@ -742,7 +742,7 @@ bool pkgCache::VerIterator::Downloadable() const
 bool pkgCache::VerIterator::Automatic() const
 bool pkgCache::VerIterator::Automatic() const
 {
 {
    VerFileIterator Files = FileList();
    VerFileIterator Files = FileList();
-   for (; Files.end() == false; Files++)
+   for (; Files.end() == false; ++Files)
       // Do not check ButAutomaticUpgrades here as it is kind of automatic…
       // Do not check ButAutomaticUpgrades here as it is kind of automatic…
       if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic)
       if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic)
 	 return true;
 	 return true;
@@ -760,7 +760,7 @@ pkgCache::VerFileIterator pkgCache::VerIterator::NewestFile() const
 {
 {
    VerFileIterator Files = FileList();
    VerFileIterator Files = FileList();
    VerFileIterator Highest = Files;
    VerFileIterator Highest = Files;
-   for (; Files.end() == false; Files++)
+   for (; Files.end() == false; ++Files)
    {
    {
       if (Owner->VS->CmpReleaseVer(Files.File().Version(),Highest.File().Version()) > 0)
       if (Owner->VS->CmpReleaseVer(Files.File().Version(),Highest.File().Version()) > 0)
 	 Highest = Files;
 	 Highest = Files;
@@ -777,7 +777,7 @@ string pkgCache::VerIterator::RelStr() const
 {
 {
    bool First = true;
    bool First = true;
    string Res;
    string Res;
-   for (pkgCache::VerFileIterator I = this->FileList(); I.end() == false; I++)
+   for (pkgCache::VerFileIterator I = this->FileList(); I.end() == false; ++I)
    {
    {
       // Do not print 'not source' entries'
       // Do not print 'not source' entries'
       pkgCache::PkgFileIterator File = I.File();
       pkgCache::PkgFileIterator File = I.File();
@@ -786,7 +786,7 @@ string pkgCache::VerIterator::RelStr() const
 
 
       // See if we have already printed this out..
       // See if we have already printed this out..
       bool Seen = false;
       bool Seen = false;
-      for (pkgCache::VerFileIterator J = this->FileList(); I != J; J++)
+      for (pkgCache::VerFileIterator J = this->FileList(); I != J; ++J)
       {
       {
 	 pkgCache::PkgFileIterator File2 = J.File();
 	 pkgCache::PkgFileIterator File2 = J.File();
 	 if (File2->Label == 0 || File->Label == 0)
 	 if (File2->Label == 0 || File->Label == 0)
@@ -887,7 +887,7 @@ pkgCache::DescIterator pkgCache::VerIterator::TranslatedDescription() const
 {
 {
    std::vector<string> const lang = APT::Configuration::getLanguages();
    std::vector<string> const lang = APT::Configuration::getLanguages();
    for (std::vector<string>::const_iterator l = lang.begin();
    for (std::vector<string>::const_iterator l = lang.begin();
-	l != lang.end(); l++)
+	l != lang.end(); ++l)
    {
    {
       pkgCache::DescIterator Desc = DescriptionList();
       pkgCache::DescIterator Desc = DescriptionList();
       for (; Desc.end() == false; ++Desc)
       for (; Desc.end() == false; ++Desc)

+ 14 - 14
apt-pkg/pkgcachegen.cc

@@ -220,7 +220,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
 
 
 	    // don't add a new description if we have one for the given
 	    // don't add a new description if we have one for the given
 	    // md5 && language
 	    // md5 && language
-	    for ( ; Desc.end() == false; Desc++)
+	    for ( ; Desc.end() == false; ++Desc)
 	       if (MD5SumValue(Desc.md5()) == CurMd5 && 
 	       if (MD5SumValue(Desc.md5()) == CurMd5 && 
 	           Desc.LanguageCode() == List.DescriptionLanguage())
 	           Desc.LanguageCode() == List.DescriptionLanguage())
 		  duplicate=true;
 		  duplicate=true;
@@ -229,7 +229,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
 	    
 	    
  	    for (Desc = Ver.DescriptionList();
  	    for (Desc = Ver.DescriptionList();
 		 Desc.end() == false;
 		 Desc.end() == false;
-		 LastDesc = &Desc->NextDesc, Desc++)
+		 LastDesc = &Desc->NextDesc, ++Desc)
 	    {
 	    {
  	       if (MD5SumValue(Desc.md5()) == CurMd5) 
  	       if (MD5SumValue(Desc.md5()) == CurMd5) 
                {
                {
@@ -395,7 +395,7 @@ bool pkgCacheGenerator::MergeFileProvides(ListParser &List)
       unsigned long Hash = List.VersionHash();
       unsigned long Hash = List.VersionHash();
       pkgCache::VerIterator Ver = Pkg.VersionList();
       pkgCache::VerIterator Ver = Pkg.VersionList();
       Dynamic<pkgCache::VerIterator> DynVer(Ver);
       Dynamic<pkgCache::VerIterator> DynVer(Ver);
-      for (; Ver.end() == false; Ver++)
+      for (; Ver.end() == false; ++Ver)
       {
       {
 	 if (Ver->Hash == Hash && Version.c_str() == Ver.VerStr())
 	 if (Ver->Hash == Hash && Version.c_str() == Ver.VerStr())
 	 {
 	 {
@@ -511,7 +511,7 @@ bool pkgCacheGenerator::NewFileVer(pkgCache::VerIterator &Ver,
    
    
    // Link it to the end of the list
    // Link it to the end of the list
    map_ptrloc *Last = &Ver->FileList;
    map_ptrloc *Last = &Ver->FileList;
-   for (pkgCache::VerFileIterator V = Ver.FileList(); V.end() == false; V++)
+   for (pkgCache::VerFileIterator V = Ver.FileList(); V.end() == false; ++V)
       Last = &V->NextFile;
       Last = &V->NextFile;
    VF->NextFile = *Last;
    VF->NextFile = *Last;
    *Last = VF.Index();
    *Last = VF.Index();
@@ -568,7 +568,7 @@ bool pkgCacheGenerator::NewFileDesc(pkgCache::DescIterator &Desc,
 
 
    // Link it to the end of the list
    // Link it to the end of the list
    map_ptrloc *Last = &Desc->FileList;
    map_ptrloc *Last = &Desc->FileList;
-   for (pkgCache::DescFileIterator D = Desc.FileList(); D.end() == false; D++)
+   for (pkgCache::DescFileIterator D = Desc.FileList(); D.end() == false; ++D)
       Last = &D->NextFile;
       Last = &D->NextFile;
 
 
    DF->NextFile = *Last;
    DF->NextFile = *Last;
@@ -623,7 +623,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
       // Create Conflicts in between the group
       // Create Conflicts in between the group
       pkgCache::GrpIterator G = GetCache().GrpBegin();
       pkgCache::GrpIterator G = GetCache().GrpBegin();
       Dynamic<pkgCache::GrpIterator> DynG(G);
       Dynamic<pkgCache::GrpIterator> DynG(G);
-      for (; G.end() != true; G++)
+      for (; G.end() != true; ++G)
       {
       {
 	 string const PkgName = G.Name();
 	 string const PkgName = G.Name();
 	 pkgCache::PkgIterator P = G.PackageList();
 	 pkgCache::PkgIterator P = G.PackageList();
@@ -634,7 +634,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
 	    Dynamic<pkgCache::PkgIterator> DynallPkg(allPkg);
 	    Dynamic<pkgCache::PkgIterator> DynallPkg(allPkg);
 	    pkgCache::VerIterator V = P.VersionList();
 	    pkgCache::VerIterator V = P.VersionList();
 	    Dynamic<pkgCache::VerIterator> DynV(V);
 	    Dynamic<pkgCache::VerIterator> DynV(V);
-	    for (; V.end() != true; V++)
+	    for (; V.end() != true; ++V)
 	    {
 	    {
                // copy P.Arch() into a string here as a cache remap
                // copy P.Arch() into a string here as a cache remap
                // in NewDepends() later may alter the pointer location
                // in NewDepends() later may alter the pointer location
@@ -728,7 +728,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg,
    if (OldDepLast == NULL)
    if (OldDepLast == NULL)
    {
    {
       OldDepLast = &Ver->DependsList;
       OldDepLast = &Ver->DependsList;
-      for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
+      for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; ++D)
 	 OldDepLast = &D->NextDepends;
 	 OldDepLast = &D->NextDepends;
    } else if (oldMap != Map.Data())
    } else if (oldMap != Map.Data())
       OldDepLast += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap;
       OldDepLast += (map_ptrloc*) Map.Data() - (map_ptrloc*) oldMap;
@@ -958,7 +958,7 @@ static bool CheckValidity(const string &CacheFile,
       verify the IMS data and check that it is on the disk too.. */
       verify the IMS data and check that it is on the disk too.. */
    SPtrArray<bool> Visited = new bool[Cache.HeaderP->PackageFileCount];
    SPtrArray<bool> Visited = new bool[Cache.HeaderP->PackageFileCount];
    memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount);
    memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount);
-   for (; Start != End; Start++)
+   for (; Start != End; ++Start)
    {
    {
       if (Debug == true)
       if (Debug == true)
 	 std::clog << "Checking PkgFile " << (*Start)->Describe() << ": ";
 	 std::clog << "Checking PkgFile " << (*Start)->Describe() << ": ";
@@ -1025,7 +1025,7 @@ static bool CheckValidity(const string &CacheFile,
 static unsigned long ComputeSize(FileIterator Start,FileIterator End)
 static unsigned long ComputeSize(FileIterator Start,FileIterator End)
 {
 {
    unsigned long TotalSize = 0;
    unsigned long TotalSize = 0;
-   for (; Start != End; Start++)
+   for (; Start != End; ++Start)
    {
    {
       if ((*Start)->HasPackages() == false)
       if ((*Start)->HasPackages() == false)
 	 continue;      
 	 continue;      
@@ -1043,7 +1043,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
 		       FileIterator Start, FileIterator End)
 		       FileIterator Start, FileIterator End)
 {
 {
    FileIterator I;
    FileIterator I;
-   for (I = Start; I != End; I++)
+   for (I = Start; I != End; ++I)
    {
    {
       if ((*I)->HasPackages() == false)
       if ((*I)->HasPackages() == false)
 	 continue;
 	 continue;
@@ -1073,7 +1073,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
 	 Progress->Done();
 	 Progress->Done();
       TotalSize = ComputeSize(Start, End);
       TotalSize = ComputeSize(Start, End);
       CurrentSize = 0;
       CurrentSize = 0;
-      for (I = Start; I != End; I++)
+      for (I = Start; I != End; ++I)
       {
       {
 	 unsigned long Size = (*I)->Size();
 	 unsigned long Size = (*I)->Size();
 	 if (Progress != NULL)
 	 if (Progress != NULL)
@@ -1120,12 +1120,12 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
    vector<pkgIndexFile *> Files;
    vector<pkgIndexFile *> Files;
    for (vector<metaIndex *>::const_iterator i = List.begin();
    for (vector<metaIndex *>::const_iterator i = List.begin();
         i != List.end();
         i != List.end();
-        i++)
+        ++i)
    {
    {
       vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
       vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
       for (vector<pkgIndexFile *>::const_iterator j = Indexes->begin();
       for (vector<pkgIndexFile *>::const_iterator j = Indexes->begin();
 	   j != Indexes->end();
 	   j != Indexes->end();
-	   j++)
+	   ++j)
          Files.push_back (*j);
          Files.push_back (*j);
    }
    }
    
    

+ 1 - 1
apt-pkg/pkgrecords.cc

@@ -24,7 +24,7 @@ pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache),
   Files(Cache.HeaderP->PackageFileCount)
   Files(Cache.HeaderP->PackageFileCount)
 {
 {
    for (pkgCache::PkgFileIterator I = Cache.FileBegin();
    for (pkgCache::PkgFileIterator I = Cache.FileBegin();
-        I.end() == false; I++)
+        I.end() == false; ++I)
    {
    {
       const pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(I.IndexType());
       const pkgIndexFile::Type *Type = pkgIndexFile::Type::GetType(I.IndexType());
       if (Type == 0)
       if (Type == 0)

+ 7 - 7
apt-pkg/policy.cc

@@ -81,7 +81,7 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
 bool pkgPolicy::InitDefaults()
 bool pkgPolicy::InitDefaults()
 {   
 {   
    // Initialize the priorities based on the status of the package file
    // Initialize the priorities based on the status of the package file
-   for (pkgCache::PkgFileIterator I = Cache->FileBegin(); I != Cache->FileEnd(); I++)
+   for (pkgCache::PkgFileIterator I = Cache->FileBegin(); I != Cache->FileEnd(); ++I)
    {
    {
       PFPriority[I->ID] = 500;
       PFPriority[I->ID] = 500;
       if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
       if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
@@ -98,10 +98,10 @@ bool pkgPolicy::InitDefaults()
    signed Cur = 989;
    signed Cur = 989;
    StatusOverride = false;
    StatusOverride = false;
    for (vector<Pin>::const_iterator I = Defaults.begin(); I != Defaults.end();
    for (vector<Pin>::const_iterator I = Defaults.begin(); I != Defaults.end();
-	I++, Cur--)
+	++I, --Cur)
    {
    {
       pkgVersionMatch Match(I->Data,I->Type);
       pkgVersionMatch Match(I->Data,I->Type);
-      for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); F++)
+      for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F)
       {
       {
 	 if (Match.FileMatch(F) == true && Fixed[F->ID] == false)
 	 if (Match.FileMatch(F) == true && Fixed[F->ID] == false)
 	 {
 	 {
@@ -122,7 +122,7 @@ bool pkgPolicy::InitDefaults()
    }
    }
 
 
    if (_config->FindB("Debug::pkgPolicy",false) == true)
    if (_config->FindB("Debug::pkgPolicy",false) == true)
-      for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); F++)
+      for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F)
 	 std::clog << "Prio of " << F.FileName() << ' ' << PFPriority[F->ID] << std::endl; 
 	 std::clog << "Prio of " << F.FileName() << ' ' << PFPriority[F->ID] << std::endl; 
    
    
    return true;   
    return true;   
@@ -162,12 +162,12 @@ pkgCache::VerIterator pkgPolicy::GetCandidateVer(pkgCache::PkgIterator const &Pk
       tracks the default when the default is taken away, and a permanent
       tracks the default when the default is taken away, and a permanent
       pin that stays at that setting.
       pin that stays at that setting.
     */
     */
-   for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; Ver++)
+   for (pkgCache::VerIterator Ver = Pkg.VersionList(); Ver.end() == false; ++Ver)
    {
    {
       /* Lets see if this version is the installed version */
       /* Lets see if this version is the installed version */
       bool instVer = (Pkg.CurrentVer() == Ver);
       bool instVer = (Pkg.CurrentVer() == Ver);
 
 
-      for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
+      for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF)
       {
       {
 	 /* If this is the status file, and the current version is not the
 	 /* If this is the status file, and the current version is not the
 	    version in the status file (ie it is not installed, or somesuch)
 	    version in the status file (ie it is not installed, or somesuch)
@@ -356,7 +356,7 @@ bool ReadPinDir(pkgPolicy &Plcy,string Dir)
    vector<string> const List = GetListOfFilesInDir(Dir, "pref", true, true);
    vector<string> const List = GetListOfFilesInDir(Dir, "pref", true, true);
 
 
    // Read the files
    // Read the files
-   for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
       if (ReadPinFile(Plcy, *I) == false)
       if (ReadPinFile(Plcy, *I) == false)
 	 return false;
 	 return false;
    return true;
    return true;

+ 7 - 7
apt-pkg/sourcelist.cc

@@ -173,7 +173,7 @@ pkgSourceList::pkgSourceList(string File)
 /* */
 /* */
 pkgSourceList::~pkgSourceList()
 pkgSourceList::~pkgSourceList()
 {
 {
-   for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+   for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
       delete *I;
       delete *I;
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -218,7 +218,7 @@ bool pkgSourceList::ReadMainList()
 /* */
 /* */
 void pkgSourceList::Reset()
 void pkgSourceList::Reset()
 {
 {
-   for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+   for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
       delete *I;
       delete *I;
    SrcList.erase(SrcList.begin(),SrcList.end());
    SrcList.erase(SrcList.begin(),SrcList.end());
 }
 }
@@ -296,11 +296,11 @@ bool pkgSourceList::ReadAppend(string File)
 bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
 bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
 			      pkgIndexFile *&Found) const
 			      pkgIndexFile *&Found) const
 {
 {
-   for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+   for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
    {
    {
       vector<pkgIndexFile *> *Indexes = (*I)->GetIndexFiles();
       vector<pkgIndexFile *> *Indexes = (*I)->GetIndexFiles();
       for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
       for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
-	   J != Indexes->end(); J++)
+	   J != Indexes->end(); ++J)
       {
       {
          if ((*J)->FindInCache(*File.Cache()) == File)
          if ((*J)->FindInCache(*File.Cache()) == File)
          {
          {
@@ -318,7 +318,7 @@ bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
 /* */
 /* */
 bool pkgSourceList::GetIndexes(pkgAcquire *Owner, bool GetAll) const
 bool pkgSourceList::GetIndexes(pkgAcquire *Owner, bool GetAll) const
 {
 {
-   for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
+   for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
       if ((*I)->GetIndexes(Owner,GetAll) == false)
       if ((*I)->GetIndexes(Owner,GetAll) == false)
 	 return false;
 	 return false;
    return true;
    return true;
@@ -334,7 +334,7 @@ bool pkgSourceList::ReadSourceDir(string Dir)
    vector<string> const List = GetListOfFilesInDir(Dir, "list", true);
    vector<string> const List = GetListOfFilesInDir(Dir, "list", true);
 
 
    // Read the files
    // Read the files
-   for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
       if (ReadAppend(*I) == false)
       if (ReadAppend(*I) == false)
 	 return false;
 	 return false;
    return true;
    return true;
@@ -353,7 +353,7 @@ time_t pkgSourceList::GetLastModifiedTime()
 
 
    // calculate the time
    // calculate the time
    time_t mtime_sources = GetModificationTime(Main);
    time_t mtime_sources = GetModificationTime(Main);
-   for (vector<string>::const_iterator I = List.begin(); I != List.end(); I++)
+   for (vector<string>::const_iterator I = List.begin(); I != List.end(); ++I)
       mtime_sources = std::max(mtime_sources, GetModificationTime(*I));
       mtime_sources = std::max(mtime_sources, GetModificationTime(*I));
 
 
    return mtime_sources;
    return mtime_sources;

+ 5 - 5
apt-pkg/srcrecords.cc

@@ -24,11 +24,11 @@
 /* Open all the source index files */
 /* Open all the source index files */
 pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0)
 pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0)
 {
 {
-   for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); I++)
+   for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       vector<pkgIndexFile *> *Indexes = (*I)->GetIndexFiles();
       vector<pkgIndexFile *> *Indexes = (*I)->GetIndexFiles();
       for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
       for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
-	   J != Indexes->end(); J++)
+	   J != Indexes->end(); ++J)
       {
       {
          Parser* P = (*J)->CreateSrcParser();
          Parser* P = (*J)->CreateSrcParser();
 	 if (_error->PendingError() == true)
 	 if (_error->PendingError() == true)
@@ -66,7 +66,7 @@ bool pkgSrcRecords::Restart()
 {
 {
    Current = Files.begin();
    Current = Files.begin();
    for (vector<Parser*>::iterator I = Files.begin();
    for (vector<Parser*>::iterator I = Files.begin();
-        I != Files.end(); I++)
+        I != Files.end(); ++I)
       (*I)->Restart();
       (*I)->Restart();
    
    
    return true;
    return true;
@@ -89,7 +89,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn
       {
       {
 	 if (_error->PendingError() == true)
 	 if (_error->PendingError() == true)
 	    return 0;
 	    return 0;
-	 Current++;
+	 ++Current;
 	 if (Current == Files.end())
 	 if (Current == Files.end())
 	    return 0;
 	    return 0;
       }
       }
@@ -107,7 +107,7 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn
       
       
       // Check for a binary hit
       // Check for a binary hit
       const char **I = (*Current)->Binaries();
       const char **I = (*Current)->Binaries();
-      for (; I != 0 && *I != 0; I++)
+      for (; I != 0 && *I != 0; ++I)
 	 if (strcmp(Package,*I) == 0)
 	 if (strcmp(Package,*I) == 0)
 	    return *Current;
 	    return *Current;
    }
    }

+ 1 - 1
apt-pkg/tagfile.h

@@ -79,7 +79,7 @@ class pkgTagSection
       Stop = this->Stop;
       Stop = this->Stop;
    };
    };
    
    
-   pkgTagSection() : Section(0), Stop(0) {};
+   pkgTagSection() : Section(0), TagCount(0), Stop(0) {};
 };
 };
 
 
 class pkgTagFile
 class pkgTagFile

+ 3 - 3
apt-pkg/vendorlist.cc

@@ -11,7 +11,7 @@
 pkgVendorList::~pkgVendorList()
 pkgVendorList::~pkgVendorList()
 {
 {
    for (vector<const Vendor *>::const_iterator I = VendorList.begin(); 
    for (vector<const Vendor *>::const_iterator I = VendorList.begin(); 
-        I != VendorList.end(); I++)
+        I != VendorList.end(); ++I)
       delete *I;
       delete *I;
 }
 }
 
 
@@ -49,7 +49,7 @@ bool pkgVendorList::Read(string File)					/*{{{*/
 bool pkgVendorList::CreateList(Configuration& Cnf)			/*{{{*/
 bool pkgVendorList::CreateList(Configuration& Cnf)			/*{{{*/
 {
 {
    for (vector<const Vendor *>::const_iterator I = VendorList.begin(); 
    for (vector<const Vendor *>::const_iterator I = VendorList.begin(); 
-	I != VendorList.end(); I++)
+	I != VendorList.end(); ++I)
       delete *I;
       delete *I;
    VendorList.erase(VendorList.begin(),VendorList.end());
    VendorList.erase(VendorList.begin(),VendorList.end());
 
 
@@ -129,7 +129,7 @@ const Vendor* pkgVendorList::LookupFingerprint(string Fingerprint)	/*{{{*/
 									/*}}}*/
 									/*}}}*/
 const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput)	/*{{{*/
 const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput)	/*{{{*/
 {
 {
-   for (std::vector<string>::const_iterator I = GPGVOutput.begin(); I != GPGVOutput.end(); I++)
+   for (std::vector<string>::const_iterator I = GPGVOutput.begin(); I != GPGVOutput.end(); ++I)
    {
    {
       string::size_type pos = (*I).find("VALIDSIG ");
       string::size_type pos = (*I).find("VALIDSIG ");
       if (_config->FindB("Debug::Vendor", false))
       if (_config->FindB("Debug::Vendor", false))

+ 3 - 3
apt-pkg/versionmatch.cc

@@ -60,7 +60,7 @@ pkgVersionMatch::pkgVersionMatch(string Data,MatchType Type) : Type(Type)
       
       
       // Are we a simple specification?
       // Are we a simple specification?
       string::const_iterator I = Data.begin();
       string::const_iterator I = Data.begin();
-      for (; I != Data.end() && *I != '='; I++);
+      for (; I != Data.end() && *I != '='; ++I);
       if (I == Data.end())
       if (I == Data.end())
       {
       {
 	 // Temporary
 	 // Temporary
@@ -152,7 +152,7 @@ bool pkgVersionMatch::MatchVer(const char *A,string B,bool Prefix)
 pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg)
 pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg)
 {
 {
    pkgCache::VerIterator Ver = Pkg.VersionList();
    pkgCache::VerIterator Ver = Pkg.VersionList();
-   for (; Ver.end() == false; Ver++)
+   for (; Ver.end() == false; ++Ver)
    {
    {
       if (Type == Version)
       if (Type == Version)
       {
       {
@@ -163,7 +163,7 @@ pkgCache::VerIterator pkgVersionMatch::Find(pkgCache::PkgIterator Pkg)
 	 continue;
 	 continue;
       }
       }
       
       
-      for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; VF++)
+      for (pkgCache::VerFileIterator VF = Ver.FileList(); VF.end() == false; ++VF)
 	 if (FileMatch(VF.File()) == true)
 	 if (FileMatch(VF.File()) == true)
 	    return Ver;
 	    return Ver;
    }
    }

+ 52 - 52
cmdline/apt-cache.cc

@@ -141,7 +141,7 @@ bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important)
 	       
 	       
 	       if (Start == End)
 	       if (Start == End)
 		  break;
 		  break;
-	       Start++;
+	       ++Start;
 	    }
 	    }
 	    while (1);
 	    while (1);
 
 
@@ -169,7 +169,7 @@ bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important)
 	       if (Start == End)
 	       if (Start == End)
 		  break;
 		  break;
 	       cout << " | ";
 	       cout << " | ";
-	       Start++;
+	       ++Start;
 	    }
 	    }
 	    while (1);
 	    while (1);
 	    
 	    
@@ -187,7 +187,7 @@ bool UnMet(CommandLine &CmdL)
 
 
    if (CmdL.FileSize() <= 1)
    if (CmdL.FileSize() <= 1)
    {
    {
-      for (pkgCache::PkgIterator P = CacheFile.GetPkgCache()->PkgBegin(); P.end() == false; P++)
+      for (pkgCache::PkgIterator P = CacheFile.GetPkgCache()->PkgBegin(); P.end() == false; ++P)
 	 for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
 	 for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
 	    if (ShowUnMet(V, Important) == false)
 	    if (ShowUnMet(V, Important) == false)
 	       return false;
 	       return false;
@@ -217,13 +217,13 @@ bool DumpPackage(CommandLine &CmdL)
    {
    {
       cout << "Package: " << Pkg.FullName(true) << endl;
       cout << "Package: " << Pkg.FullName(true) << endl;
       cout << "Versions: " << endl;
       cout << "Versions: " << endl;
-      for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
+      for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; ++Cur)
       {
       {
 	 cout << Cur.VerStr();
 	 cout << Cur.VerStr();
-	 for (pkgCache::VerFileIterator Vf = Cur.FileList(); Vf.end() == false; Vf++)
+	 for (pkgCache::VerFileIterator Vf = Cur.FileList(); Vf.end() == false; ++Vf)
 	    cout << " (" << Vf.File().FileName() << ")";
 	    cout << " (" << Vf.File().FileName() << ")";
 	 cout << endl;
 	 cout << endl;
-	 for (pkgCache::DescIterator D = Cur.DescriptionList(); D.end() == false; D++)
+	 for (pkgCache::DescIterator D = Cur.DescriptionList(); D.end() == false; ++D)
 	 {
 	 {
 	    cout << " Description Language: " << D.LanguageCode() << endl
 	    cout << " Description Language: " << D.LanguageCode() << endl
 		 << "                 File: " << D.FileList().File().FileName() << endl
 		 << "                 File: " << D.FileList().File().FileName() << endl
@@ -235,7 +235,7 @@ bool DumpPackage(CommandLine &CmdL)
       cout << endl;
       cout << endl;
       
       
       cout << "Reverse Depends: " << endl;
       cout << "Reverse Depends: " << endl;
-      for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() != true; D++)
+      for (pkgCache::DepIterator D = Pkg.RevDependsList(); D.end() != true; ++D)
       {
       {
 	 cout << "  " << D.ParentPkg().FullName(true) << ',' << D.TargetPkg().FullName(true);
 	 cout << "  " << D.ParentPkg().FullName(true) << ',' << D.TargetPkg().FullName(true);
 	 if (D->Version != 0)
 	 if (D->Version != 0)
@@ -245,24 +245,24 @@ bool DumpPackage(CommandLine &CmdL)
       }
       }
       
       
       cout << "Dependencies: " << endl;
       cout << "Dependencies: " << endl;
-      for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
+      for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; ++Cur)
       {
       {
 	 cout << Cur.VerStr() << " - ";
 	 cout << Cur.VerStr() << " - ";
-	 for (pkgCache::DepIterator Dep = Cur.DependsList(); Dep.end() != true; Dep++)
+	 for (pkgCache::DepIterator Dep = Cur.DependsList(); Dep.end() != true; ++Dep)
 	    cout << Dep.TargetPkg().FullName(true) << " (" << (int)Dep->CompareOp << " " << DeNull(Dep.TargetVer()) << ") ";
 	    cout << Dep.TargetPkg().FullName(true) << " (" << (int)Dep->CompareOp << " " << DeNull(Dep.TargetVer()) << ") ";
 	 cout << endl;
 	 cout << endl;
       }      
       }      
 
 
       cout << "Provides: " << endl;
       cout << "Provides: " << endl;
-      for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; Cur++)
+      for (pkgCache::VerIterator Cur = Pkg.VersionList(); Cur.end() != true; ++Cur)
       {
       {
 	 cout << Cur.VerStr() << " - ";
 	 cout << Cur.VerStr() << " - ";
-	 for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; Prv++)
+	 for (pkgCache::PrvIterator Prv = Cur.ProvidesList(); Prv.end() != true; ++Prv)
 	    cout << Prv.ParentPkg().FullName(true) << " ";
 	    cout << Prv.ParentPkg().FullName(true) << " ";
 	 cout << endl;
 	 cout << endl;
       }
       }
       cout << "Reverse Provides: " << endl;
       cout << "Reverse Provides: " << endl;
-      for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; Prv++)
+      for (pkgCache::PrvIterator Prv = Pkg.ProvidesList(); Prv.end() != true; ++Prv)
 	 cout << Prv.OwnerPkg().FullName(true) << " " << Prv.OwnerVer().VerStr() << endl;
 	 cout << Prv.OwnerPkg().FullName(true) << " " << Prv.OwnerVer().VerStr() << endl;
    }
    }
 
 
@@ -290,7 +290,7 @@ bool Stats(CommandLine &Cmd)
    int DVirt = 0;
    int DVirt = 0;
    int Missing = 0;
    int Missing = 0;
    pkgCache::PkgIterator I = Cache->PkgBegin();
    pkgCache::PkgIterator I = Cache->PkgBegin();
-   for (;I.end() != true; I++)
+   for (;I.end() != true; ++I)
    {
    {
       if (I->VersionList != 0 && I->ProvidesList == 0)
       if (I->VersionList != 0 && I->ProvidesList == 0)
       {
       {
@@ -353,11 +353,11 @@ bool Stats(CommandLine &Cmd)
    cout << _("Total globbed strings: ") << Count << " (" << SizeToStr(Size) << ')' << endl;
    cout << _("Total globbed strings: ") << Count << " (" << SizeToStr(Size) << ')' << endl;
 
 
    unsigned long DepVerSize = 0;
    unsigned long DepVerSize = 0;
-   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
    {
    {
-      for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; V++)
+      for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
       {
       {
-	 for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; D++)
+	 for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; ++D)
 	 {
 	 {
 	    if (D->Version != 0)
 	    if (D->Version != 0)
 	       DepVerSize += strlen(D.TargetVer()) + 1;
 	       DepVerSize += strlen(D.TargetVer()) + 1;
@@ -394,17 +394,17 @@ bool Dump(CommandLine &Cmd)
 
 
    cout << "Using Versioning System: " << Cache->VS->Label << endl;
    cout << "Using Versioning System: " << Cache->VS->Label << endl;
    
    
-   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
    {
    {
       cout << "Package: " << P.FullName(true) << endl;
       cout << "Package: " << P.FullName(true) << endl;
-      for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; V++)
+      for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
       {
       {
 	 cout << " Version: " << V.VerStr() << endl;
 	 cout << " Version: " << V.VerStr() << endl;
 	 cout << "     File: " << V.FileList().File().FileName() << endl;
 	 cout << "     File: " << V.FileList().File().FileName() << endl;
-	 for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; D++)
+	 for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; ++D)
 	    cout << "  Depends: " << D.TargetPkg().FullName(true) << ' ' << 
 	    cout << "  Depends: " << D.TargetPkg().FullName(true) << ' ' << 
 	                     DeNull(D.TargetVer()) << endl;
 	                     DeNull(D.TargetVer()) << endl;
-	 for (pkgCache::DescIterator D = V.DescriptionList(); D.end() == false; D++)
+	 for (pkgCache::DescIterator D = V.DescriptionList(); D.end() == false; ++D)
 	 {
 	 {
 	    cout << " Description Language: " << D.LanguageCode() << endl
 	    cout << " Description Language: " << D.LanguageCode() << endl
 		 << "                 File: " << D.FileList().File().FileName() << endl
 		 << "                 File: " << D.FileList().File().FileName() << endl
@@ -413,7 +413,7 @@ bool Dump(CommandLine &Cmd)
       }      
       }      
    }
    }
 
 
-   for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; F++)
+   for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; ++F)
    {
    {
       cout << "File: " << F.FileName() << endl;
       cout << "File: " << F.FileName() << endl;
       cout << " Type: " << F.IndexType() << endl;
       cout << " Type: " << F.IndexType() << endl;
@@ -449,7 +449,7 @@ bool DumpAvail(CommandLine &Cmd)
    memset(VFList,0,sizeof(*VFList)*Count);
    memset(VFList,0,sizeof(*VFList)*Count);
    
    
    // Map versions that we want to write out onto the VerList array.
    // Map versions that we want to write out onto the VerList array.
-   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
    {    
    {    
       if (P->VersionList == 0)
       if (P->VersionList == 0)
 	 continue;
 	 continue;
@@ -466,7 +466,7 @@ bool DumpAvail(CommandLine &Cmd)
       }
       }
       
       
       pkgCache::VerFileIterator VF = V.FileList();
       pkgCache::VerFileIterator VF = V.FileList();
-      for (; VF.end() == false ; VF++)
+      for (; VF.end() == false ; ++VF)
 	 if ((VF.File()->Flags & pkgCache::Flag::NotSource) == 0)
 	 if ((VF.File()->Flags & pkgCache::Flag::NotSource) == 0)
 	    break;
 	    break;
       
       
@@ -480,9 +480,9 @@ bool DumpAvail(CommandLine &Cmd)
          handling works OK. */
          handling works OK. */
       if (VF.end() == true)
       if (VF.end() == true)
       {
       {
-	 for (pkgCache::VerIterator Cur = P.VersionList(); Cur.end() != true; Cur++)
+	 for (pkgCache::VerIterator Cur = P.VersionList(); Cur.end() != true; ++Cur)
 	 {
 	 {
-	    for (VF = Cur.FileList(); VF.end() == false; VF++)
+	    for (VF = Cur.FileList(); VF.end() == false; ++VF)
 	    {	 
 	    {	 
 	       if ((VF.File()->Flags & pkgCache::Flag::NotSource) == 0)
 	       if ((VF.File()->Flags & pkgCache::Flag::NotSource) == 0)
 	       {
 	       {
@@ -615,7 +615,7 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
 	 if (RevDepends == true)
 	 if (RevDepends == true)
 	    cout << "Reverse Depends:" << endl;
 	    cout << "Reverse Depends:" << endl;
 	 for (pkgCache::DepIterator D = RevDepends ? Pkg.RevDependsList() : Ver.DependsList();
 	 for (pkgCache::DepIterator D = RevDepends ? Pkg.RevDependsList() : Ver.DependsList();
-	      D.end() == false; D++)
+	      D.end() == false; ++D)
 	 {
 	 {
 	    switch (D->Type) {
 	    switch (D->Type) {
 	    case pkgCache::Dep::PreDepends: if (!ShowPreDepends) continue; break;
 	    case pkgCache::Dep::PreDepends: if (!ShowPreDepends) continue; break;
@@ -741,7 +741,7 @@ bool XVcg(CommandLine &CmdL)
    memset(Flags,0,sizeof(*Flags)*Cache->Head().PackageCount);
    memset(Flags,0,sizeof(*Flags)*Cache->Head().PackageCount);
    
    
    // Map the shapes
    // Map the shapes
-   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
    {   
    {   
       if (Pkg->VersionList == 0)
       if (Pkg->VersionList == 0)
       {
       {
@@ -788,7 +788,7 @@ bool XVcg(CommandLine &CmdL)
    while (Act == true)
    while (Act == true)
    {
    {
       Act = false;
       Act = false;
-      for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+      for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
       {
       {
 	 // See we need to show this package
 	 // See we need to show this package
 	 if (Show[Pkg->ID] == None || Show[Pkg->ID] >= DoneNR)
 	 if (Show[Pkg->ID] == None || Show[Pkg->ID] >= DoneNR)
@@ -814,14 +814,14 @@ bool XVcg(CommandLine &CmdL)
 	    continue;
 	    continue;
 	 
 	 
 	 pkgCache::VerIterator Ver = Pkg.VersionList();
 	 pkgCache::VerIterator Ver = Pkg.VersionList();
-	 for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
+	 for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; ++D)
 	 {
 	 {
 	    // See if anything can meet this dep
 	    // See if anything can meet this dep
 	    // Walk along the actual package providing versions
 	    // Walk along the actual package providing versions
 	    bool Hit = false;
 	    bool Hit = false;
 	    pkgCache::PkgIterator DPkg = D.TargetPkg();
 	    pkgCache::PkgIterator DPkg = D.TargetPkg();
 	    for (pkgCache::VerIterator I = DPkg.VersionList();
 	    for (pkgCache::VerIterator I = DPkg.VersionList();
-		      I.end() == false && Hit == false; I++)
+		      I.end() == false && Hit == false; ++I)
 	    {
 	    {
 	       if (Cache->VS->CheckDep(I.VerStr(),D->CompareOp,D.TargetVer()) == true)
 	       if (Cache->VS->CheckDep(I.VerStr(),D->CompareOp,D.TargetVer()) == true)
 		  Hit = true;
 		  Hit = true;
@@ -829,7 +829,7 @@ bool XVcg(CommandLine &CmdL)
 	    
 	    
 	    // Follow all provides
 	    // Follow all provides
 	    for (pkgCache::PrvIterator I = DPkg.ProvidesList(); 
 	    for (pkgCache::PrvIterator I = DPkg.ProvidesList(); 
-		      I.end() == false && Hit == false; I++)
+		      I.end() == false && Hit == false; ++I)
 	    {
 	    {
 	       if (Cache->VS->CheckDep(I.ProvideVersion(),D->CompareOp,D.TargetVer()) == false)
 	       if (Cache->VS->CheckDep(I.ProvideVersion(),D->CompareOp,D.TargetVer()) == false)
 		  Hit = true;
 		  Hit = true;
@@ -889,7 +889,7 @@ bool XVcg(CommandLine &CmdL)
    
    
    /* Draw the box colours after the fact since we can not tell what colour
    /* Draw the box colours after the fact since we can not tell what colour
       they should be until everything is finished drawing */
       they should be until everything is finished drawing */
-   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
    {
    {
       if (Show[Pkg->ID] < DoneNR)
       if (Show[Pkg->ID] < DoneNR)
 	 continue;
 	 continue;
@@ -953,7 +953,7 @@ bool Dotty(CommandLine &CmdL)
    memset(Flags,0,sizeof(*Flags)*Cache->Head().PackageCount);
    memset(Flags,0,sizeof(*Flags)*Cache->Head().PackageCount);
    
    
    // Map the shapes
    // Map the shapes
-   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
    {   
    {   
       if (Pkg->VersionList == 0)
       if (Pkg->VersionList == 0)
       {
       {
@@ -1000,7 +1000,7 @@ bool Dotty(CommandLine &CmdL)
    while (Act == true)
    while (Act == true)
    {
    {
       Act = false;
       Act = false;
-      for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+      for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
       {
       {
 	 // See we need to show this package
 	 // See we need to show this package
 	 if (Show[Pkg->ID] == None || Show[Pkg->ID] >= DoneNR)
 	 if (Show[Pkg->ID] == None || Show[Pkg->ID] >= DoneNR)
@@ -1024,14 +1024,14 @@ bool Dotty(CommandLine &CmdL)
 	    continue;
 	    continue;
 	 
 	 
 	 pkgCache::VerIterator Ver = Pkg.VersionList();
 	 pkgCache::VerIterator Ver = Pkg.VersionList();
-	 for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; D++)
+	 for (pkgCache::DepIterator D = Ver.DependsList(); D.end() == false; ++D)
 	 {
 	 {
 	    // See if anything can meet this dep
 	    // See if anything can meet this dep
 	    // Walk along the actual package providing versions
 	    // Walk along the actual package providing versions
 	    bool Hit = false;
 	    bool Hit = false;
 	    pkgCache::PkgIterator DPkg = D.TargetPkg();
 	    pkgCache::PkgIterator DPkg = D.TargetPkg();
 	    for (pkgCache::VerIterator I = DPkg.VersionList();
 	    for (pkgCache::VerIterator I = DPkg.VersionList();
-		      I.end() == false && Hit == false; I++)
+		      I.end() == false && Hit == false; ++I)
 	    {
 	    {
 	       if (Cache->VS->CheckDep(I.VerStr(),D->CompareOp,D.TargetVer()) == true)
 	       if (Cache->VS->CheckDep(I.VerStr(),D->CompareOp,D.TargetVer()) == true)
 		  Hit = true;
 		  Hit = true;
@@ -1039,7 +1039,7 @@ bool Dotty(CommandLine &CmdL)
 	    
 	    
 	    // Follow all provides
 	    // Follow all provides
 	    for (pkgCache::PrvIterator I = DPkg.ProvidesList(); 
 	    for (pkgCache::PrvIterator I = DPkg.ProvidesList(); 
-		      I.end() == false && Hit == false; I++)
+		      I.end() == false && Hit == false; ++I)
 	    {
 	    {
 	       if (Cache->VS->CheckDep(I.ProvideVersion(),D->CompareOp,D.TargetVer()) == false)
 	       if (Cache->VS->CheckDep(I.ProvideVersion(),D->CompareOp,D.TargetVer()) == false)
 		  Hit = true;
 		  Hit = true;
@@ -1094,7 +1094,7 @@ bool Dotty(CommandLine &CmdL)
    
    
    /* Draw the box colours after the fact since we can not tell what colour
    /* Draw the box colours after the fact since we can not tell what colour
       they should be until everything is finished drawing */
       they should be until everything is finished drawing */
-   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+   for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); Pkg.end() == false; ++Pkg)
    {
    {
       if (Show[Pkg->ID] < DoneNR)
       if (Show[Pkg->ID] < DoneNR)
 	 continue;
 	 continue;
@@ -1127,7 +1127,7 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V)
 
 
    // Find an appropriate file
    // Find an appropriate file
    pkgCache::VerFileIterator Vf = V.FileList();
    pkgCache::VerFileIterator Vf = V.FileList();
-   for (; Vf.end() == false; Vf++)
+   for (; Vf.end() == false; ++Vf)
       if ((Vf.File()->Flags & pkgCache::Flag::NotSource) == 0)
       if ((Vf.File()->Flags & pkgCache::Flag::NotSource) == 0)
 	 break;
 	 break;
    if (Vf.end() == true)
    if (Vf.end() == true)
@@ -1272,7 +1272,7 @@ bool Search(CommandLine &CmdL)
 	 continue;
 	 continue;
 
 
       // Include all the packages that provide matching names too
       // Include all the packages that provide matching names too
-      for (pkgCache::PrvIterator Prv = P.ProvidesList() ; Prv.end() == false; Prv++)
+      for (pkgCache::PrvIterator Prv = P.ProvidesList() ; Prv.end() == false; ++Prv)
       {
       {
 	 pkgCache::VerIterator V = Plcy->GetCandidateVer(Prv.OwnerPkg());
 	 pkgCache::VerIterator V = Plcy->GetCandidateVer(Prv.OwnerPkg());
 	 if (V.end() == true)
 	 if (V.end() == true)
@@ -1341,13 +1341,13 @@ bool ShowAuto(CommandLine &CmdL)
    std::vector<string> packages;
    std::vector<string> packages;
    packages.reserve(Cache->HeaderP->PackageCount / 3);
    packages.reserve(Cache->HeaderP->PackageCount / 3);
    
    
-   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; P++)
+   for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
       if ((*DepCache)[P].Flags & pkgCache::Flag::Auto)
       if ((*DepCache)[P].Flags & pkgCache::Flag::Auto)
          packages.push_back(P.Name());
          packages.push_back(P.Name());
 
 
     std::sort(packages.begin(), packages.end());
     std::sort(packages.begin(), packages.end());
     
     
-    for (vector<string>::iterator I = packages.begin(); I != packages.end(); I++)
+    for (vector<string>::iterator I = packages.begin(); I != packages.end(); ++I)
             cout << *I << "\n";
             cout << *I << "\n";
 
 
    _error->Notice(_("This command is deprecated. Please use 'apt-mark showauto' instead."));
    _error->Notice(_("This command is deprecated. Please use 'apt-mark showauto' instead."));
@@ -1391,7 +1391,7 @@ bool ShowPkgNames(CommandLine &CmdL)
 
 
    if (CmdL.FileList[1] != 0)
    if (CmdL.FileList[1] != 0)
    {
    {
-      for (;I.end() != true; I++)
+      for (;I.end() != true; ++I)
       {
       {
 	 if (All == false && I->FirstPackage == 0)
 	 if (All == false && I->FirstPackage == 0)
 	    continue;
 	    continue;
@@ -1405,7 +1405,7 @@ bool ShowPkgNames(CommandLine &CmdL)
    }
    }
    
    
    // Show all pkgs
    // Show all pkgs
-   for (;I.end() != true; I++)
+   for (;I.end() != true; ++I)
    {
    {
       if (All == false && I->FirstPackage == 0)
       if (All == false && I->FirstPackage == 0)
 	 continue;
 	 continue;
@@ -1476,7 +1476,7 @@ bool Policy(CommandLine &CmdL)
    if (CmdL.FileList[1] == 0)
    if (CmdL.FileList[1] == 0)
    {
    {
       cout << _("Package files:") << endl;   
       cout << _("Package files:") << endl;   
-      for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; F++)
+      for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F.end() == false; ++F)
       {
       {
 	 // Locate the associated index files so we can derive a description
 	 // Locate the associated index files so we can derive a description
 	 pkgIndexFile *Indx;
 	 pkgIndexFile *Indx;
@@ -1498,7 +1498,7 @@ bool Policy(CommandLine &CmdL)
       // Show any packages have explicit pins
       // Show any packages have explicit pins
       cout << _("Pinned packages:") << endl;
       cout << _("Pinned packages:") << endl;
       pkgCache::PkgIterator I = Cache->PkgBegin();
       pkgCache::PkgIterator I = Cache->PkgBegin();
-      for (;I.end() != true; I++)
+      for (;I.end() != true; ++I)
       {
       {
 	 if (Plcy->GetPriority(I) == 0)
 	 if (Plcy->GetPriority(I) == 0)
 	    continue;
 	    continue;
@@ -1560,14 +1560,14 @@ bool Policy(CommandLine &CmdL)
       
       
       // Show the priority tables
       // Show the priority tables
       cout << _("  Version table:") << endl;
       cout << _("  Version table:") << endl;
-      for (V = Pkg.VersionList(); V.end() == false; V++)
+      for (V = Pkg.VersionList(); V.end() == false; ++V)
       {
       {
 	 if (Pkg.CurrentVer() == V)
 	 if (Pkg.CurrentVer() == V)
 	    cout << " *** " << V.VerStr();
 	    cout << " *** " << V.VerStr();
 	 else
 	 else
 	    cout << "     " << V.VerStr();
 	    cout << "     " << V.VerStr();
 	 cout << " " << Plcy->GetPriority(Pkg) << endl;
 	 cout << " " << Plcy->GetPriority(Pkg) << endl;
-	 for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; VF++)
+	 for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF)
 	 {
 	 {
 	    // Locate the associated index files so we can derive a description
 	    // Locate the associated index files so we can derive a description
 	    pkgIndexFile *Indx;
 	    pkgIndexFile *Indx;
@@ -1607,9 +1607,9 @@ bool Madison(CommandLine &CmdL)
       APT::PackageSet pkgset = APT::PackageSet::FromString(CacheFile, *I, helper);
       APT::PackageSet pkgset = APT::PackageSet::FromString(CacheFile, *I, helper);
       for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
       for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
       {
       {
-         for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; V++)
+         for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; ++V)
          {
          {
-            for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; VF++)
+            for (pkgCache::VerFileIterator VF = V.FileList(); VF.end() == false; ++VF)
             {
             {
 // This might be nice, but wouldn't uniquely identify the source -mdz
 // This might be nice, but wouldn't uniquely identify the source -mdz
 //                if (VF.File().Archive() != 0)
 //                if (VF.File().Archive() != 0)
@@ -1619,11 +1619,11 @@ bool Madison(CommandLine &CmdL)
 //                }
 //                }
 
 
                // Locate the associated index files so we can derive a description
                // Locate the associated index files so we can derive a description
-               for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); S++)
+               for (pkgSourceList::const_iterator S = SrcList->begin(); S != SrcList->end(); ++S)
                {
                {
                     vector<pkgIndexFile *> *Indexes = (*S)->GetIndexFiles();
                     vector<pkgIndexFile *> *Indexes = (*S)->GetIndexFiles();
                     for (vector<pkgIndexFile *>::const_iterator IF = Indexes->begin();
                     for (vector<pkgIndexFile *>::const_iterator IF = Indexes->begin();
-                         IF != Indexes->end(); IF++)
+                         IF != Indexes->end(); ++IF)
                     {
                     {
                          if ((*IF)->FindInCache(*(VF.File().Cache())) == VF.File())
                          if ((*IF)->FindInCache(*(VF.File().Cache())) == VF.File())
                          {
                          {

+ 28 - 30
cmdline/apt-get.cc

@@ -363,7 +363,7 @@ void ShowBroken(ostream &out,CacheFile &Cache,bool Now)
 	    
 	    
 	    if (Start == End)
 	    if (Start == End)
 	       break;
 	       break;
-	    Start++;
+	    ++Start;
 	 }	 
 	 }	 
       }	    
       }	    
    }   
    }   
@@ -537,7 +537,7 @@ bool ShowEssential(ostream &out,CacheFile &Cache)
 	 continue;
 	 continue;
 
 
       // Print out any essential package depenendents that are to be removed
       // Print out any essential package depenendents that are to be removed
-      for (pkgCache::DepIterator D = I.CurrentVer().DependsList(); D.end() == false; D++)
+      for (pkgCache::DepIterator D = I.CurrentVer().DependsList(); D.end() == false; ++D)
       {
       {
 	 // Skip everything but depends
 	 // Skip everything but depends
 	 if (D->Type != pkgCache::Dep::PreDepends &&
 	 if (D->Type != pkgCache::Dep::PreDepends &&
@@ -574,7 +574,7 @@ void Stats(ostream &out,pkgDepCache &Dep)
    unsigned long Downgrade = 0;
    unsigned long Downgrade = 0;
    unsigned long Install = 0;
    unsigned long Install = 0;
    unsigned long ReInstall = 0;
    unsigned long ReInstall = 0;
-   for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; I++)
+   for (pkgCache::PkgIterator I = Dep.PkgBegin(); I.end() == false; ++I)
    {
    {
       if (Dep[I].NewInstall() == true)
       if (Dep[I].NewInstall() == true)
 	 Install++;
 	 Install++;
@@ -666,7 +666,7 @@ public:
 				}
 				}
 				// if we found no candidate which provide this package, show non-candidates
 				// if we found no candidate which provide this package, show non-candidates
 				if (provider == 0)
 				if (provider == 0)
-					for (I = Pkg.ProvidesList(); I.end() == false; I++)
+					for (I = Pkg.ProvidesList(); I.end() == false; ++I)
 						out << "  " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr()
 						out << "  " << I.OwnerPkg().FullName(true) << " " << I.OwnerVer().VerStr()
 						    << _(" [Not candidate version]") << endl;
 						    << _(" [Not candidate version]") << endl;
 				else
 				else
@@ -682,7 +682,7 @@ public:
 				SPtrArray<bool> Seen = new bool[Cache.GetPkgCache()->Head().PackageCount];
 				SPtrArray<bool> Seen = new bool[Cache.GetPkgCache()->Head().PackageCount];
 				memset(Seen,0,Cache.GetPkgCache()->Head().PackageCount*sizeof(*Seen));
 				memset(Seen,0,Cache.GetPkgCache()->Head().PackageCount*sizeof(*Seen));
 				for (pkgCache::DepIterator Dep = Pkg.RevDependsList();
 				for (pkgCache::DepIterator Dep = Pkg.RevDependsList();
-				     Dep.end() == false; Dep++) {
+				     Dep.end() == false; ++Dep) {
 					if (Dep->Type != pkgCache::Dep::Replaces)
 					if (Dep->Type != pkgCache::Dep::Replaces)
 						continue;
 						continue;
 					if (Seen[Dep.ParentPkg()->ID] == true)
 					if (Seen[Dep.ParentPkg()->ID] == true)
@@ -869,9 +869,7 @@ struct TryToInstall {
 struct TryToRemove {
 struct TryToRemove {
    pkgCacheFile* Cache;
    pkgCacheFile* Cache;
    pkgProblemResolver* Fix;
    pkgProblemResolver* Fix;
-   bool FixBroken;
    bool PurgePkgs;
    bool PurgePkgs;
-   unsigned long AutoMarkChanged;
 
 
    TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
    TryToRemove(pkgCacheFile &Cache, pkgProblemResolver *PM) : Cache(&Cache), Fix(PM),
 				PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
 				PurgePkgs(_config->FindB("APT::Get::Purge", false)) {};
@@ -923,7 +921,7 @@ void CacheFile::Sort()
    List = new pkgCache::Package *[Cache->Head().PackageCount];
    List = new pkgCache::Package *[Cache->Head().PackageCount];
    memset(List,0,sizeof(*List)*Cache->Head().PackageCount);
    memset(List,0,sizeof(*List)*Cache->Head().PackageCount);
    pkgCache::PkgIterator I = Cache->PkgBegin();
    pkgCache::PkgIterator I = Cache->PkgBegin();
-   for (;I.end() != true; I++)
+   for (;I.end() != true; ++I)
       List[I->ID] = I;
       List[I->ID] = I;
 
 
    SortCache = *this;
    SortCache = *this;
@@ -955,7 +953,7 @@ bool CacheFile::CheckDeps(bool AllowBroken)
       if ((DCache->PolicyBrokenCount() > 0))
       if ((DCache->PolicyBrokenCount() > 0))
       {
       {
 	 // upgrade all policy-broken packages with ForceImportantDeps=True
 	 // upgrade all policy-broken packages with ForceImportantDeps=True
-	 for (pkgCache::PkgIterator I = Cache->PkgBegin(); !I.end(); I++)
+	 for (pkgCache::PkgIterator I = Cache->PkgBegin(); !I.end(); ++I)
 	    if ((*DCache)[I].NowPolicyBroken() == true) 
 	    if ((*DCache)[I].NowPolicyBroken() == true) 
 	       DCache->MarkInstall(I,true,0, false, true);
 	       DCache->MarkInstall(I,true,0, false, true);
       }
       }
@@ -1046,7 +1044,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
    if (_config->FindB("APT::Get::Purge",false) == true)
    if (_config->FindB("APT::Get::Purge",false) == true)
    {
    {
       pkgCache::PkgIterator I = Cache->PkgBegin();
       pkgCache::PkgIterator I = Cache->PkgBegin();
-      for (; I.end() == false; I++)
+      for (; I.end() == false; ++I)
       {
       {
 	 if (I.Purge() == false && Cache[I].Mode == pkgDepCache::ModeDelete)
 	 if (I.Purge() == false && Cache[I].Mode == pkgDepCache::ModeDelete)
 	    Cache->MarkDelete(I,true);
 	    Cache->MarkDelete(I,true);
@@ -1240,7 +1238,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
    if (_config->FindB("APT::Get::Print-URIs") == true)
    if (_config->FindB("APT::Get::Print-URIs") == true)
    {
    {
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
-      for (; I != Fetcher.UriEnd(); I++)
+      for (; I != Fetcher.UriEnd(); ++I)
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
       return true;
       return true;
@@ -1264,7 +1262,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
 	 {
 	 {
 	    if ((*I)->Local == true)
 	    if ((*I)->Local == true)
 	    {
 	    {
-	       I++;
+	       ++I;
 	       continue;
 	       continue;
 	    }
 	    }
 
 
@@ -1284,7 +1282,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
       
       
       // Print out errors
       // Print out errors
       bool Failed = false;
       bool Failed = false;
-      for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
+      for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
       {
       {
 	 if ((*I)->Status == pkgAcquire::Item::StatDone &&
 	 if ((*I)->Status == pkgAcquire::Item::StatDone &&
 	     (*I)->Complete == true)
 	     (*I)->Complete == true)
@@ -1444,7 +1442,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
 	 // we have a default release, try to locate the pkg. we do it like
 	 // we have a default release, try to locate the pkg. we do it like
 	 // this because GetCandidateVer() will not "downgrade", that means
 	 // this because GetCandidateVer() will not "downgrade", that means
 	 // "apt-get source -t stable apt" won't work on a unstable system
 	 // "apt-get source -t stable apt" won't work on a unstable system
-	 for (pkgCache::VerIterator Ver = Pkg.VersionList();; Ver++)
+	 for (pkgCache::VerIterator Ver = Pkg.VersionList();; ++Ver)
 	 {
 	 {
 	    // try first only exact matches, later fuzzy matches
 	    // try first only exact matches, later fuzzy matches
 	    if (Ver.end() == true)
 	    if (Ver.end() == true)
@@ -1465,7 +1463,7 @@ pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
 	       continue;
 	       continue;
 
 
 	    for (pkgCache::VerFileIterator VF = Ver.FileList();
 	    for (pkgCache::VerFileIterator VF = Ver.FileList();
-		 VF.end() == false; VF++) 
+		 VF.end() == false; ++VF)
 	    {
 	    {
 	       /* If this is the status file, and the current version is not the
 	       /* If this is the status file, and the current version is not the
 		  version in the status file (ie it is not installed, or somesuch)
 		  version in the status file (ie it is not installed, or somesuch)
@@ -1617,7 +1615,7 @@ bool DoUpdate(CommandLine &CmdL)
 	 return false;
 	 return false;
 
 
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
-      for (; I != Fetcher.UriEnd(); I++)
+      for (; I != Fetcher.UriEnd(); ++I)
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
       return true;
       return true;
@@ -2000,7 +1998,7 @@ bool DoInstall(CommandLine &CmdL)
 	       if(Start.TargetPkg().ProvidesList() != 0)
 	       if(Start.TargetPkg().ProvidesList() != 0)
 	       {
 	       {
 		  pkgCache::PrvIterator I = Start.TargetPkg().ProvidesList();
 		  pkgCache::PrvIterator I = Start.TargetPkg().ProvidesList();
-		  for (; I.end() == false; I++)
+		  for (; I.end() == false; ++I)
 		  {
 		  {
 		     pkgCache::PkgIterator Pkg = I.OwnerPkg();
 		     pkgCache::PkgIterator Pkg = I.OwnerPkg();
 		     if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer() && 
 		     if (Cache[Pkg].CandidateVerIter(Cache) == I.OwnerVer() && 
@@ -2023,7 +2021,7 @@ bool DoInstall(CommandLine &CmdL)
 
 
 	       if (Start >= End)
 	       if (Start >= End)
 		  break;
 		  break;
-	       Start++;
+	       ++Start;
 	    }
 	    }
 	    
 	    
 	    if(foundInstalledInOrGroup == false)
 	    if(foundInstalledInOrGroup == false)
@@ -2137,7 +2135,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
 
 
    // Install everything with the install flag set
    // Install everything with the install flag set
    pkgCache::PkgIterator I = Cache->PkgBegin();
    pkgCache::PkgIterator I = Cache->PkgBegin();
-   for (;I.end() != true; I++)
+   for (;I.end() != true; ++I)
    {
    {
       /* Install the package only if it is a new install, the autoupgrader
       /* Install the package only if it is a new install, the autoupgrader
          will deal with the rest */
          will deal with the rest */
@@ -2147,7 +2145,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
 
 
    /* Now install their deps too, if we do this above then order of
    /* Now install their deps too, if we do this above then order of
       the status file is significant for | groups */
       the status file is significant for | groups */
-   for (I = Cache->PkgBegin();I.end() != true; I++)
+   for (I = Cache->PkgBegin();I.end() != true; ++I)
    {
    {
       /* Install the package only if it is a new install, the autoupgrader
       /* Install the package only if it is a new install, the autoupgrader
          will deal with the rest */
          will deal with the rest */
@@ -2156,7 +2154,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
    }
    }
    
    
    // Apply erasures now, they override everything else.
    // Apply erasures now, they override everything else.
-   for (I = Cache->PkgBegin();I.end() != true; I++)
+   for (I = Cache->PkgBegin();I.end() != true; ++I)
    {
    {
       // Remove packages 
       // Remove packages 
       if (I->SelectedState == pkgCache::State::DeInstall ||
       if (I->SelectedState == pkgCache::State::DeInstall ||
@@ -2173,7 +2171,7 @@ bool DoDSelectUpgrade(CommandLine &CmdL)
       // Hold back held packages.
       // Hold back held packages.
       if (_config->FindB("APT::Ignore-Hold",false) == false)
       if (_config->FindB("APT::Ignore-Hold",false) == false)
       {
       {
-	 for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() == false; I++)
+	 for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() == false; ++I)
 	 {
 	 {
 	    if (I->SelectedState == pkgCache::State::Hold)
 	    if (I->SelectedState == pkgCache::State::Hold)
 	    {
 	    {
@@ -2319,7 +2317,7 @@ bool DoDownload(CommandLine &CmdL)
    if (_config->FindB("APT::Get::Print-URIs") == true)
    if (_config->FindB("APT::Get::Print-URIs") == true)
    {
    {
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
-      for (; I != Fetcher.UriEnd(); I++)
+      for (; I != Fetcher.UriEnd(); ++I)
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
       return true;
       return true;
@@ -2437,7 +2435,7 @@ bool DoSource(CommandLine &CmdL)
 
 
       // Load them into the fetcher
       // Load them into the fetcher
       for (vector<pkgSrcRecords::File>::const_iterator I = Lst.begin();
       for (vector<pkgSrcRecords::File>::const_iterator I = Lst.begin();
-	   I != Lst.end(); I++)
+	   I != Lst.end(); ++I)
       {
       {
 	 // Try to guess what sort of file it is we are getting.
 	 // Try to guess what sort of file it is we are getting.
 	 if (I->Type == "dsc")
 	 if (I->Type == "dsc")
@@ -2539,7 +2537,7 @@ bool DoSource(CommandLine &CmdL)
    if (_config->FindB("APT::Get::Print-URIs") == true)
    if (_config->FindB("APT::Get::Print-URIs") == true)
    {
    {
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
       pkgAcquire::UriIterator I = Fetcher.UriBegin();
-      for (; I != Fetcher.UriEnd(); I++)
+      for (; I != Fetcher.UriEnd(); ++I)
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	 cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' << 
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
 	       I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
       delete[] Dsc;
       delete[] Dsc;
@@ -2555,7 +2553,7 @@ bool DoSource(CommandLine &CmdL)
 
 
    // Print error messages
    // Print error messages
    bool Failed = false;
    bool Failed = false;
-   for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
+   for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); ++I)
    {
    {
       if ((*I)->Status == pkgAcquire::Item::StatDone &&
       if ((*I)->Status == pkgAcquire::Item::StatDone &&
 	  (*I)->Complete == true)
 	  (*I)->Complete == true)
@@ -2584,7 +2582,7 @@ bool DoSource(CommandLine &CmdL)
    if (Process == 0)
    if (Process == 0)
    {
    {
       bool const fixBroken = _config->FindB("APT::Get::Fix-Broken", false);
       bool const fixBroken = _config->FindB("APT::Get::Fix-Broken", false);
-      for (unsigned I = 0; I != J; I++)
+      for (unsigned I = 0; I != J; ++I)
       {
       {
 	 string Dir = Dsc[I].Package + '-' + Cache->VS().UpstreamVersion(Dsc[I].Version.c_str());
 	 string Dir = Dsc[I].Package + '-' + Cache->VS().UpstreamVersion(Dsc[I].Version.c_str());
 	 
 	 
@@ -2733,7 +2731,7 @@ bool DoBuildDep(CommandLine &CmdL)
 	 BuildDeps.push_back(rec);
 	 BuildDeps.push_back(rec);
       }
       }
 
 
-      if (BuildDeps.size() == 0)
+      if (BuildDeps.empty() == true)
       {
       {
 	 ioprintf(c1out,_("%s has no build depends.\n"),Src.c_str());
 	 ioprintf(c1out,_("%s has no build depends.\n"),Src.c_str());
 	 continue;
 	 continue;
@@ -2743,7 +2741,7 @@ bool DoBuildDep(CommandLine &CmdL)
       vector <pkgSrcRecords::Parser::BuildDepRec>::iterator D;
       vector <pkgSrcRecords::Parser::BuildDepRec>::iterator D;
       pkgProblemResolver Fix(Cache);
       pkgProblemResolver Fix(Cache);
       bool skipAlternatives = false; // skip remaining alternatives in an or group
       bool skipAlternatives = false; // skip remaining alternatives in an or group
-      for (D = BuildDeps.begin(); D != BuildDeps.end(); D++)
+      for (D = BuildDeps.begin(); D != BuildDeps.end(); ++D)
       {
       {
          bool hasAlternatives = (((*D).Op & pkgCache::Dep::Or) == pkgCache::Dep::Or);
          bool hasAlternatives = (((*D).Op & pkgCache::Dep::Or) == pkgCache::Dep::Or);
 
 
@@ -2922,7 +2920,7 @@ bool DoBuildDep(CommandLine &CmdL)
 		* installed
 		* installed
 		*/
 		*/
 	       pkgCache::PrvIterator Prv = Pkg.ProvidesList();
 	       pkgCache::PrvIterator Prv = Pkg.ProvidesList();
-	       for (; Prv.end() != true; Prv++)
+	       for (; Prv.end() != true; ++Prv)
 	       {
 	       {
 		  if (_config->FindB("Debug::BuildDeps",false) == true)
 		  if (_config->FindB("Debug::BuildDeps",false) == true)
 		     cout << "  Checking provider " << Prv.OwnerPkg().FullName() << endl;
 		     cout << "  Checking provider " << Prv.OwnerPkg().FullName() << endl;

+ 1 - 1
cmdline/apt-sortpkgs.cc

@@ -106,7 +106,7 @@ bool DoIt(string InFile)
    
    
    // Emit
    // Emit
    unsigned char *Buffer = new unsigned char[Largest+1];
    unsigned char *Buffer = new unsigned char[Largest+1];
-   for (vector<PkgName>::iterator I = List.begin(); I != List.end(); I++)
+   for (vector<PkgName>::iterator I = List.begin(); I != List.end(); ++I)
    {
    {
       // Read in the Record.
       // Read in the Record.
       if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false)
       if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false)

+ 4 - 0
debian/changelog

@@ -1,5 +1,6 @@
 apt (0.8.15.5.6) UNRELEASED; urgency=low
 apt (0.8.15.5.6) UNRELEASED; urgency=low
 
 
+  [ Michael Vogt ]
   * apt-pkg/contrib/fileutl.{cc,h}:
   * apt-pkg/contrib/fileutl.{cc,h}:
     - add GetModificationTime() helper
     - add GetModificationTime() helper
   * apt-pkg/pkgcachegen.cc:
   * apt-pkg/pkgcachegen.cc:
@@ -17,6 +18,9 @@ apt (0.8.15.5.6) UNRELEASED; urgency=low
   * apt-pkg/acquire-item.cc:
   * apt-pkg/acquire-item.cc:
     - if no Release.gpg file is found, still load the hashes for
     - if no Release.gpg file is found, still load the hashes for
       verification (closes: #636314) and add test
       verification (closes: #636314) and add test
+  
+  [ David Kalnischkies ]
+  * lots of cppcheck fixes
 
 
  -- Michael Vogt <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200
  -- Michael Vogt <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200
 
 

+ 8 - 8
ftparchive/apt-ftparchive.cc

@@ -384,7 +384,7 @@ bool PackageMap::GenContents(Configuration &Setup,
       files associated with this contents file into one great big honking
       files associated with this contents file into one great big honking
       memory structure, then dump the sorted version */
       memory structure, then dump the sorted version */
    c0out << ' ' << this->Contents << ":" << flush;
    c0out << ' ' << this->Contents << ":" << flush;
-   for (vector<PackageMap>::iterator I = Begin; I != End; I++)
+   for (vector<PackageMap>::iterator I = Begin; I != End; ++I)
    {
    {
       if (I->Contents != this->Contents)
       if (I->Contents != this->Contents)
 	 continue;
 	 continue;
@@ -770,10 +770,10 @@ bool Generate(CommandLine &CmdL)
    // Generate packages
    // Generate packages
    if (CmdL.FileSize() <= 2)
    if (CmdL.FileSize() <= 2)
    {
    {
-      for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+      for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
 	 if (I->GenPackages(Setup,Stats) == false)
 	 if (I->GenPackages(Setup,Stats) == false)
 	    _error->DumpErrors();
 	    _error->DumpErrors();
-      for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+      for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
 	 if (I->GenSources(Setup,SrcStats) == false)
 	 if (I->GenSources(Setup,SrcStats) == false)
 	    _error->DumpErrors();
 	    _error->DumpErrors();
    }
    }
@@ -782,7 +782,7 @@ bool Generate(CommandLine &CmdL)
       // Make a choice list out of the package list..
       // Make a choice list out of the package list..
       RxChoiceList *List = new RxChoiceList[2*PkgList.size()+1];
       RxChoiceList *List = new RxChoiceList[2*PkgList.size()+1];
       RxChoiceList *End = List;
       RxChoiceList *End = List;
-      for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+      for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
       {
       {
 	 End->UserData = &(*I);
 	 End->UserData = &(*I);
 	 End->Str = I->BaseDir.c_str();
 	 End->Str = I->BaseDir.c_str();
@@ -832,7 +832,7 @@ bool Generate(CommandLine &CmdL)
    }
    }
 
 
    // close the Translation master files
    // close the Translation master files
-   for (vector<PackageMap>::reverse_iterator I = PkgList.rbegin(); I != PkgList.rend(); I++)
+   for (vector<PackageMap>::reverse_iterator I = PkgList.rbegin(); I != PkgList.rend(); ++I)
       if (I->TransWriter != NULL && I->TransWriter->DecreaseRefCounter() == 0)
       if (I->TransWriter != NULL && I->TransWriter->DecreaseRefCounter() == 0)
 	 delete I->TransWriter;
 	 delete I->TransWriter;
 
 
@@ -843,7 +843,7 @@ bool Generate(CommandLine &CmdL)
 
 
    // Sort the contents file list by date
    // Sort the contents file list by date
    string ArchiveDir = Setup.FindDir("Dir::ArchiveDir");
    string ArchiveDir = Setup.FindDir("Dir::ArchiveDir");
-   for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+   for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
    {
    {
       struct stat A;
       struct stat A;
       if (MultiCompress::GetStat(flCombine(ArchiveDir,I->Contents),
       if (MultiCompress::GetStat(flCombine(ArchiveDir,I->Contents),
@@ -860,7 +860,7 @@ bool Generate(CommandLine &CmdL)
       hashes of the .debs this means they have not changed either so the 
       hashes of the .debs this means they have not changed either so the 
       contents must be up to date. */
       contents must be up to date. */
    unsigned long MaxContentsChange = Setup.FindI("Default::MaxContentsChange",UINT_MAX)*1024;
    unsigned long MaxContentsChange = Setup.FindI("Default::MaxContentsChange",UINT_MAX)*1024;
-   for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); I++)
+   for (vector<PackageMap>::iterator I = PkgList.begin(); I != PkgList.end(); ++I)
    {
    {
       // This record is not relevent
       // This record is not relevent
       if (I->ContentsDone == true ||
       if (I->ContentsDone == true ||
@@ -936,7 +936,7 @@ bool Clean(CommandLine &CmdL)
 	 _error->DumpErrors();
 	 _error->DumpErrors();
       
       
       string CacheDB = I->BinCacheDB;
       string CacheDB = I->BinCacheDB;
-      for (; I != PkgList.end() && I->BinCacheDB == CacheDB; I++);
+      for (; I != PkgList.end() && I->BinCacheDB == CacheDB; ++I);
    }
    }
    
    
    return true;
    return true;

+ 4 - 4
ftparchive/multicompress.cc

@@ -48,11 +48,11 @@ MultiCompress::MultiCompress(string const &Output,string const &Compress,
    string::const_iterator I = Compress.begin();
    string::const_iterator I = Compress.begin();
    for (; I != Compress.end();)
    for (; I != Compress.end();)
    {
    {
-      for (; I != Compress.end() && isspace(*I); I++);
+      for (; I != Compress.end() && isspace(*I); ++I);
       
       
       // Grab a word
       // Grab a word
       string::const_iterator Start = I;
       string::const_iterator Start = I;
-      for (; I != Compress.end() && !isspace(*I); I++);
+      for (; I != Compress.end() && !isspace(*I); ++I);
 
 
       // Find the matching compressor
       // Find the matching compressor
       std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
       std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
@@ -129,11 +129,11 @@ bool MultiCompress::GetStat(string const &Output,string const &Compress,struct s
    bool DidStat = false;
    bool DidStat = false;
    for (; I != Compress.end();)
    for (; I != Compress.end();)
    {
    {
-      for (; I != Compress.end() && isspace(*I); I++);
+      for (; I != Compress.end() && isspace(*I); ++I);
       
       
       // Grab a word
       // Grab a word
       string::const_iterator Start = I;
       string::const_iterator Start = I;
-      for (; I != Compress.end() && !isspace(*I); I++);
+      for (; I != Compress.end() && !isspace(*I); ++I);
 
 
       // Find the matching compressor
       // Find the matching compressor
       std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();
       std::vector<APT::Configuration::Compressor> Compressors = APT::Configuration::getCompressors();

+ 3 - 3
ftparchive/override.cc

@@ -231,7 +231,7 @@ Override::Item* Override::GetItem(string const &Package, string const &Architect
 	 if (R->OldMaint != "") result->OldMaint = R->OldMaint;
 	 if (R->OldMaint != "") result->OldMaint = R->OldMaint;
 	 if (R->NewMaint != "") result->NewMaint = R->NewMaint;
 	 if (R->NewMaint != "") result->NewMaint = R->NewMaint;
 	 for (map<string,string>::const_iterator foI = R->FieldOverride.begin();
 	 for (map<string,string>::const_iterator foI = R->FieldOverride.begin();
-	      foI != R->FieldOverride.end(); foI++)
+	      foI != R->FieldOverride.end(); ++foI)
          {
          {
 	    result->FieldOverride[foI->first] = foI->second;
 	    result->FieldOverride[foI->first] = foI->second;
 	 }
 	 }
@@ -268,7 +268,7 @@ string Override::Item::SwapMaint(string const &Orig,bool &Failed)
       string::const_iterator Start = End;      
       string::const_iterator Start = End;      
       for (; End < OldMaint.end() &&
       for (; End < OldMaint.end() &&
 	   (End + 3 >= OldMaint.end() || End[0] != ' ' || 
 	   (End + 3 >= OldMaint.end() || End[0] != ' ' || 
-	    End[1] != '/' || End[2] != '/'); End++);
+	    End[1] != '/' || End[2] != '/'); ++End);
       if (stringcasecmp(Start,End,Orig.begin(),Orig.end()) == 0)
       if (stringcasecmp(Start,End,Orig.begin(),Orig.end()) == 0)
 	 return NewMaint;
 	 return NewMaint;
       
       
@@ -276,7 +276,7 @@ string Override::Item::SwapMaint(string const &Orig,bool &Failed)
 	 break;
 	 break;
 
 
       // Skip the divider and white space
       // Skip the divider and white space
-      for (; End < OldMaint.end() && (*End == '/' || *End == ' '); End++);
+      for (; End < OldMaint.end() && (*End == '/' || *End == ' '); ++End);
    }
    }
 #else
 #else
    if (stringcasecmp(OldMaint.begin(),OldMaint.end(),Orig.begin(),Orig.end()) == 0)
    if (stringcasecmp(OldMaint.begin(),OldMaint.end(),Orig.begin(),Orig.end()) == 0)

+ 2 - 2
ftparchive/writer.cc

@@ -491,7 +491,7 @@ bool PackagesWriter::DoPackage(string FileName)
    }
    }
 
 
    for (map<string,string>::const_iterator I = OverItem->FieldOverride.begin(); 
    for (map<string,string>::const_iterator I = OverItem->FieldOverride.begin(); 
-        I != OverItem->FieldOverride.end(); I++) 
+        I != OverItem->FieldOverride.end(); ++I)
       SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
       SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
 
 
    SetTFRewriteData(Changes[End++], 0, 0);
    SetTFRewriteData(Changes[End++], 0, 0);
@@ -816,7 +816,7 @@ bool SourcesWriter::DoPackage(string FileName)
       SetTFRewriteData(Changes[End++], "Maintainer", NewMaint.c_str());
       SetTFRewriteData(Changes[End++], "Maintainer", NewMaint.c_str());
    
    
    for (map<string,string>::const_iterator I = SOverItem->FieldOverride.begin(); 
    for (map<string,string>::const_iterator I = SOverItem->FieldOverride.begin(); 
-        I != SOverItem->FieldOverride.end(); I++) 
+        I != SOverItem->FieldOverride.end(); ++I)
       SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
       SetTFRewriteData(Changes[End++],I->first.c_str(),I->second.c_str());
 
 
    SetTFRewriteData(Changes[End++], 0, 0);
    SetTFRewriteData(Changes[End++], 0, 0);

+ 2 - 1
methods/cdrom.cc

@@ -54,7 +54,8 @@ class CDROMMethod : public pkgAcqMethod
 CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
 CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
 					  SendConfig | NeedsCleanup |
 					  SendConfig | NeedsCleanup |
 					  Removable), 
 					  Removable), 
-                                          DatabaseLoaded(false), 
+                                          DatabaseLoaded(false),
+					  Debug(false),
                                           MountedByApt(false)
                                           MountedByApt(false)
 {
 {
    UdevCdroms.Dlopen();
    UdevCdroms.Dlopen();

+ 3 - 2
methods/ftp.cc

@@ -69,7 +69,8 @@ time_t FtpMethod::FailTime = 0;
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* */
 /* */
 FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), 
 FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), 
-                            DataListenFd(-1), ServerName(Srv)
+                            DataListenFd(-1), ServerName(Srv),
+			    ForceExtended(false), TryPassive(true)
 {
 {
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    Debug = _config->FindB("Debug::Acquire::Ftp",false);
    PasvAddr = 0;
    PasvAddr = 0;
@@ -559,7 +560,7 @@ bool FTPConn::ExtGoPasv()
    string::const_iterator List[4];
    string::const_iterator List[4];
    unsigned Count = 0;
    unsigned Count = 0;
    Pos++;
    Pos++;
-   for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); I++)
+   for (string::const_iterator I = Msg.begin() + Pos; I < Msg.end(); ++I)
    {
    {
       if (*I != Msg[Pos])
       if (*I != Msg[Pos])
 	 continue;
 	 continue;

+ 3 - 3
methods/gpgv.cc

@@ -213,21 +213,21 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
          {
          {
             errmsg += _("The following signatures were invalid:\n");
             errmsg += _("The following signatures were invalid:\n");
             for (vector<string>::iterator I = BadSigners.begin();
             for (vector<string>::iterator I = BadSigners.begin();
-		 I != BadSigners.end(); I++)
+		 I != BadSigners.end(); ++I)
                errmsg += (*I + "\n");
                errmsg += (*I + "\n");
          }
          }
          if (!WorthlessSigners.empty())
          if (!WorthlessSigners.empty())
          {
          {
             errmsg += _("The following signatures were invalid:\n");
             errmsg += _("The following signatures were invalid:\n");
             for (vector<string>::iterator I = WorthlessSigners.begin();
             for (vector<string>::iterator I = WorthlessSigners.begin();
-		 I != WorthlessSigners.end(); I++)
+		 I != WorthlessSigners.end(); ++I)
                errmsg += (*I + "\n");
                errmsg += (*I + "\n");
          }
          }
          if (!NoPubKeySigners.empty())
          if (!NoPubKeySigners.empty())
          {
          {
              errmsg += _("The following signatures couldn't be verified because the public key is not available:\n");
              errmsg += _("The following signatures couldn't be verified because the public key is not available:\n");
             for (vector<string>::iterator I = NoPubKeySigners.begin();
             for (vector<string>::iterator I = NoPubKeySigners.begin();
-		 I != NoPubKeySigners.end(); I++)
+		 I != NoPubKeySigners.end(); ++I)
                errmsg += (*I + "\n");
                errmsg += (*I + "\n");
          }
          }
       }
       }

+ 3 - 3
methods/http.cc

@@ -402,10 +402,10 @@ ServerState::RunHeadersResult ServerState::RunHeaders()
       if (Debug == true)
       if (Debug == true)
 	 clog << Data;
 	 clog << Data;
       
       
-      for (string::const_iterator I = Data.begin(); I < Data.end(); I++)
+      for (string::const_iterator I = Data.begin(); I < Data.end(); ++I)
       {
       {
 	 string::const_iterator J = I;
 	 string::const_iterator J = I;
-	 for (; J != Data.end() && *J != '\n' && *J != '\r';J++);
+	 for (; J != Data.end() && *J != '\n' && *J != '\r'; ++J);
 	 if (HeaderLine(string(I,J)) == false)
 	 if (HeaderLine(string(I,J)) == false)
 	    return RUN_HEADERS_PARSE_ERROR;
 	    return RUN_HEADERS_PARSE_ERROR;
 	 I = J;
 	 I = J;
@@ -1325,7 +1325,7 @@ int HttpMethod::Loop()
                StopRedirects = true;
                StopRedirects = true;
             else
             else
             {
             {
-               for (StringVectorIterator I = R.begin(); I != R.end(); I++)
+               for (StringVectorIterator I = R.begin(); I != R.end(); ++I)
                   if (Queue->Uri == *I)
                   if (Queue->Uri == *I)
                   {
                   {
                      R[0] = "STOP";
                      R[0] = "STOP";

+ 7 - 7
methods/http.h

@@ -36,14 +36,14 @@ class CircleBuf
    static struct timeval BwReadTick;
    static struct timeval BwReadTick;
    static const unsigned int BW_HZ;
    static const unsigned int BW_HZ;
 
 
-   unsigned long LeftRead()
+   unsigned long LeftRead() const
    {
    {
       unsigned long Sz = Size - (InP - OutP);
       unsigned long Sz = Size - (InP - OutP);
       if (Sz > Size - (InP%Size))
       if (Sz > Size - (InP%Size))
 	 Sz = Size - (InP%Size);
 	 Sz = Size - (InP%Size);
       return Sz;
       return Sz;
    }
    }
-   unsigned long LeftWrite()
+   unsigned long LeftWrite() const
    {
    {
       unsigned long Sz = InP - OutP;
       unsigned long Sz = InP - OutP;
       if (InP > MaxGet)
       if (InP > MaxGet)
@@ -68,12 +68,12 @@ class CircleBuf
    
    
    // Control the write limit
    // Control the write limit
    void Limit(long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;}   
    void Limit(long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;}   
-   bool IsLimit() {return MaxGet == OutP;};
-   void Print() {cout << MaxGet << ',' << OutP << endl;};
+   bool IsLimit() const {return MaxGet == OutP;};
+   void Print() const {cout << MaxGet << ',' << OutP << endl;};
 
 
    // Test for free space in the buffer
    // Test for free space in the buffer
-   bool ReadSpace() {return Size - (InP - OutP) > 0;};
-   bool WriteSpace() {return InP - OutP > 0;};
+   bool ReadSpace() const {return Size - (InP - OutP) > 0;};
+   bool WriteSpace() const {return InP - OutP > 0;};
 
 
    // Dump everything
    // Dump everything
    void Reset();
    void Reset();
@@ -113,7 +113,7 @@ struct ServerState
    URI ServerName;
    URI ServerName;
   
   
    bool HeaderLine(string Line);
    bool HeaderLine(string Line);
-   bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
+   bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
    void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0;
    void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0;
                  Encoding = Closes; time(&Date); ServerFd = -1; 
                  Encoding = Closes; time(&Date); ServerFd = -1; 
                  Pipeline = true;};
                  Pipeline = true;};

+ 3 - 3
methods/mirror.cc

@@ -54,7 +54,7 @@ using namespace std;
  */
  */
 
 
 MirrorMethod::MirrorMethod()
 MirrorMethod::MirrorMethod()
-   : HttpMethod(), DownloadedMirrorFile(false)
+   : HttpMethod(), DownloadedMirrorFile(false), Debug(false)
 {
 {
 };
 };
 
 
@@ -107,7 +107,7 @@ bool MirrorMethod::Clean(string Dir)
 	 continue;
 	 continue;
 
 
       // see if we have that uri
       // see if we have that uri
-      for(I=list.begin(); I != list.end(); I++)
+      for(I=list.begin(); I != list.end(); ++I)
       {
       {
 	 string uri = (*I)->GetURI();
 	 string uri = (*I)->GetURI();
 	 if(uri.find("mirror://") != 0)
 	 if(uri.find("mirror://") != 0)
@@ -330,7 +330,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str)
    vector<metaIndex *>::const_iterator I;
    vector<metaIndex *>::const_iterator I;
    pkgSourceList list;
    pkgSourceList list;
    list.ReadMainList();
    list.ReadMainList();
-   for(I=list.begin(); I != list.end(); I++)
+   for(I=list.begin(); I != list.end(); ++I)
    {
    {
       string uristr = (*I)->GetURI();
       string uristr = (*I)->GetURI();
       if(Debug)
       if(Debug)

+ 5 - 2
methods/rred.cc

@@ -51,7 +51,7 @@ protected:
 	virtual bool Fetch(FetchItem *Itm);
 	virtual bool Fetch(FetchItem *Itm);
 
 
 public:
 public:
-	RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig) {};
+	RredMethod() : pkgAcqMethod("1.1",SingleInstance | SendConfig), Debug(false) {};
 };
 };
 										/*}}}*/
 										/*}}}*/
 /** \brief applyFile - in reverse order with a tail recursion			{{{
 /** \brief applyFile - in reverse order with a tail recursion			{{{
@@ -239,7 +239,9 @@ RredMethod::State RredMethod::patchFile(FileFd &Patch, FileFd &From,		/*{{{*/
    return result;
    return result;
 }
 }
 										/*}}}*/
 										/*}}}*/
-struct EdCommand {								/*{{{*/
+/* struct EdCommand								{{{*/
+#ifdef _POSIX_MAPPED_FILES
+struct EdCommand {
   size_t data_start;
   size_t data_start;
   size_t data_end;
   size_t data_end;
   size_t data_lines;
   size_t data_lines;
@@ -248,6 +250,7 @@ struct EdCommand {								/*{{{*/
   char type;
   char type;
 };
 };
 #define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */
 #define IOV_COUNT 1024 /* Don't really want IOV_MAX since it can be arbitrarily large */
+#endif
 										/*}}}*/
 										/*}}}*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,		/*{{{*/
 RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From,		/*{{{*/
 					FileFd &out_file, Hashes *hash) const {
 					FileFd &out_file, Hashes *hash) const {

+ 1 - 1
methods/rsh.h

@@ -34,7 +34,7 @@ class RSHConn
    // Raw connection IO
    // Raw connection IO
    bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);
    bool WriteMsg(string &Text,bool Sync,const char *Fmt,...);
    bool Connect(string Host, string User);
    bool Connect(string Host, string User);
-   bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
+   bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;};
 
 
    // Connection control
    // Connection control
    bool Open();
    bool Open();

+ 8 - 0
test/libapt/assert.h

@@ -53,3 +53,11 @@ void assertEqualsOr2(int const &expect1, int const &expect2, unsigned int const
 	assertEqualsOr2<unsigned int const&, unsigned int const&>(expect1, expect2, get, line);
 	assertEqualsOr2<unsigned int const&, unsigned int const&>(expect1, expect2, get, line);
 }
 }
 
 
+
+// simple helper to quickly output a vectors
+template < typename X >
+void dumpVector(X vec) {
+	for (typename X::const_iterator v = vec.begin();
+	     v != vec.end(); ++v)
+		std::cout << *v << std::endl;
+}

+ 0 - 7
test/libapt/getarchitectures_test.cc

@@ -7,13 +7,6 @@
 
 
 #include <iostream>
 #include <iostream>
 
 
-// simple helper to quickly output a vector of strings
-void dumpVector(std::vector<std::string> vec) {
-	for (std::vector<std::string>::const_iterator v = vec.begin();
-	     v != vec.end(); v++)
-		std::cout << *v << std::endl;
-}
-
 int main(int argc,char *argv[])
 int main(int argc,char *argv[])
 {
 {
 	std::vector<std::string> vec;
 	std::vector<std::string> vec;

+ 0 - 7
test/libapt/getlanguages_test.cc

@@ -7,13 +7,6 @@
 
 
 #include <iostream>
 #include <iostream>
 
 
-// simple helper to quickly output a vector of strings
-void dumpVector(std::vector<std::string> vec) {
-	for (std::vector<std::string>::const_iterator v = vec.begin();
-	     v != vec.end(); v++)
-		std::cout << *v << std::endl;
-}
-
 int main(int argc,char *argv[])
 int main(int argc,char *argv[])
 {
 {
 	if (argc != 2) {
 	if (argc != 2) {

+ 0 - 7
test/libapt/getlistoffilesindir_test.cc

@@ -7,13 +7,6 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <iostream>
 #include <iostream>
 
 
-// simple helper to quickly output a vector of strings
-void dumpVector(std::vector<std::string> vec) {
-	for (std::vector<std::string>::const_iterator v = vec.begin();
-	     v != vec.end(); v++)
-		std::cout << *v << std::endl;
-}
-
 #define P(x)	string(argv[1]).append("/").append(x)
 #define P(x)	string(argv[1]).append("/").append(x)
 
 
 int main(int argc,char *argv[])
 int main(int argc,char *argv[])

+ 1 - 1
test/test_udevcdrom.cc

@@ -10,7 +10,7 @@ int main()
 
 
    vector<CdromDevice> l;
    vector<CdromDevice> l;
    l = c.Scan();
    l = c.Scan();
-   assert(l.size() > 0);
+   assert(l.empty() == false);
    for (i=0;i<l.size();i++)
    for (i=0;i<l.size();i++)
       std::cerr << l[i].DeviceName << " " 
       std::cerr << l[i].DeviceName << " " 
 		<< l[i].Mounted << " " 
 		<< l[i].Mounted << " "