Browse Source

cppcheck complains about some possible speed improvements which could be

done on the mirco-optimazation level, so lets fix them:
 (performance) Possible inefficient checking for emptiness.
 (performance) Prefer prefix ++/-- operators for non-primitive types.
tags/debian/0.8.15.6
David Kalnischkies 10 years ago
parent
commit
f7f0d6c756
42 changed files with 321 additions and 334 deletions
  1. +11
    -11
      apt-pkg/acquire-item.cc
  2. +1
    -1
      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. +13
    -13
      apt-pkg/cdrom.cc
  7. +2
    -2
      apt-pkg/clean.cc
  8. +3
    -3
      apt-pkg/contrib/configuration.cc
  9. +3
    -3
      apt-pkg/contrib/error.cc
  10. +15
    -15
      apt-pkg/contrib/strutl.cc
  11. +3
    -3
      apt-pkg/deb/debindexfile.cc
  12. +1
    -1
      apt-pkg/deb/deblistparser.cc
  13. +6
    -6
      apt-pkg/deb/debmetaindex.cc
  14. +1
    -1
      apt-pkg/deb/debrecords.cc
  15. +10
    -10
      apt-pkg/deb/dpkgpm.cc
  16. +14
    -14
      apt-pkg/depcache.cc
  17. +9
    -9
      apt-pkg/indexcopy.cc
  18. +8
    -8
      apt-pkg/orderlist.cc
  19. +10
    -10
      apt-pkg/packagemanager.cc
  20. +13
    -13
      apt-pkg/pkgcache.cc
  21. +14
    -14
      apt-pkg/pkgcachegen.cc
  22. +1
    -1
      apt-pkg/pkgrecords.cc
  23. +7
    -7
      apt-pkg/policy.cc
  24. +7
    -7
      apt-pkg/sourcelist.cc
  25. +5
    -5
      apt-pkg/srcrecords.cc
  26. +3
    -3
      apt-pkg/vendorlist.cc
  27. +3
    -3
      apt-pkg/versionmatch.cc
  28. +52
    -52
      cmdline/apt-cache.cc
  29. +28
    -28
      cmdline/apt-get.cc
  30. +8
    -8
      ftparchive/apt-ftparchive.cc
  31. +4
    -4
      ftparchive/multicompress.cc
  32. +3
    -3
      ftparchive/override.cc
  33. +2
    -2
      ftparchive/writer.cc
  34. +1
    -1
      methods/ftp.cc
  35. +3
    -3
      methods/gpgv.cc
  36. +3
    -3
      methods/http.cc
  37. +2
    -2
      methods/mirror.cc
  38. +8
    -0
      test/libapt/assert.h
  39. +0
    -7
      test/libapt/getarchitectures_test.cc
  40. +0
    -7
      test/libapt/getlanguages_test.cc
  41. +0
    -7
      test/libapt/getlistoffilesindir_test.cc
  42. +1
    -1
      test/test_udevcdrom.cc

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

@@ -681,17 +681,17 @@ bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/
// remove all patches until the next matching patch is found
// this requires the Index file to be ordered
for(vector<DiffInfo>::iterator I=available_patches.begin();
available_patches.size() > 0 &&
available_patches.empty() == false &&
I != available_patches.end() &&
(*I).sha1 != local_sha1;
I++)
I->sha1 != local_sha1;
++I)
{
available_patches.erase(I);
}

// error checking and falling back if no patch was found
if(available_patches.size() == 0)
{
if(available_patches.empty() == true)
{
Failed("", NULL);
return false;
}
@@ -756,7 +756,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash, /*
chmod(FinalFile.c_str(),0644);

// see if there is more to download
if(available_patches.size() > 0) {
if(available_patches.empty() == false) {
new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
ExpectedHash, ServerSha1, available_patches);
return Finish();
@@ -1375,7 +1375,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) /*{{{*/
#endif
for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
Target != IndexTargets->end();
Target++)
++Target)
{
HashString ExpectedIndexHash;
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
// 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;
if (Sources->FindIndex(i.File(),Index) == false)
@@ -1709,7 +1709,7 @@ pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
bool pkgAcqArchive::QueueNext()
{
string const ForceHash = _config->Find("Acquire::ForceHash");
for (; Vf.end() == false; Vf++)
for (; Vf.end() == false; ++Vf)
{
// Ignore not source sources
if ((Vf.File()->Flags & pkgCache::Flag::NotSource) != 0)
@@ -1820,7 +1820,7 @@ bool pkgAcqArchive::QueueNext()
Desc.ShortDesc = Version.ParentPkg().Name();
QueueURI(Desc);

Vf++;
++Vf;
return true;
}
return false;
@@ -1894,7 +1894,7 @@ void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
StringToBool(LookupTag(Message,"Transient-Failure"),false) == true)
{
// Vf = Version.FileList();
while (Vf.end() == false) Vf++;
while (Vf.end() == false) ++Vf;
StoreFilename = string();
Item::Failed(Message,Cnf);
return;


+ 1
- 1
apt-pkg/acquire-method.cc View File

@@ -81,7 +81,7 @@ void pkgAcqMethod::Fail(bool Transient)
void pkgAcqMethod::Fail(string Err,bool Transient)
{
// 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')
*I = ' ';


+ 10
- 10
apt-pkg/acquire.cc View File

@@ -116,7 +116,7 @@ pkgAcquire::~pkgAcquire()
/* */
void pkgAcquire::Shutdown()
{
while (Items.size() != 0)
while (Items.empty() == false)
{
if (Items[0]->Status == Item::StatFetching)
Items[0]->Status = Item::StatError;
@@ -155,7 +155,7 @@ void pkgAcquire::Remove(Item *Itm)
I = Items.begin();
}
else
I++;
++I;
}
}
/*}}}*/
@@ -411,7 +411,7 @@ pkgAcquire::RunResult pkgAcquire::Run(int PulseIntervall)
I->Shutdown(false);

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


+ 31
- 31
apt-pkg/algorithms.cc View File

@@ -91,7 +91,7 @@ bool pkgSimulate::Install(PkgIterator iPkg,string /*File*/)
Sim.MarkInstall(Pkg,false);

// 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)
continue;
@@ -140,7 +140,7 @@ bool pkgSimulate::Configure(PkgIterator iPkg)
Sim.Update();
// 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 ||
(Sim[D] & pkgDepCache::DepInstall) != 0)
@@ -204,7 +204,7 @@ bool pkgSimulate::Remove(PkgIterator iPkg,bool Purge)
void pkgSimulate::ShortBreaks()
{
cout << " [";
for (PkgIterator I = Sim.PkgBegin(); I.end() == false; I++)
for (PkgIterator I = Sim.PkgBegin(); I.end() == false; ++I)
{
if (Sim[I].InstBroken() == true)
{
@@ -226,7 +226,7 @@ bool pkgApplyStatus(pkgDepCache &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)
continue;
@@ -295,13 +295,13 @@ bool pkgFixBroken(pkgDepCache &Cache)
pkgDepCache::ActionGroup group(Cache);

// 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)
Cache.MarkInstall(I, true, 0, false);
/* Fix packages that are in a NeedArchive state but don't have a
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 ||
Cache[I].Delete() == true)
@@ -338,19 +338,19 @@ bool pkgDistUpgrade(pkgDepCache &Cache)

/* Auto upgrade all installed packages, this provides the basis
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)
Cache.MarkInstall(I, true, 0, false);

/* Now, auto upgrade all essential packages - this ensures that
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)
Cache.MarkInstall(I, true, 0, false);
/* We do it again over all previously installed packages to force
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)
Cache.MarkInstall(I, false, 0, false);

@@ -359,7 +359,7 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
// Hold back held packages.
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)
{
@@ -387,7 +387,7 @@ bool pkgAllUpgrade(pkgDepCache &Cache)
return false;
// 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)
Fix.Protect(I);
@@ -421,7 +421,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
do
{
Change = false;
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; I++)
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
{
// Not interesting
if (Cache[I].Upgrade() == false || Cache[I].NewInstall() == true)
@@ -438,7 +438,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
Change = true;
}
}
Count++;
++Count;
}
while (Change == true && Count < 10);

@@ -525,7 +525,7 @@ void pkgProblemResolver::MakeScores()
<< " AddEssential => " << AddEssential << endl;

// 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)
continue;
@@ -552,12 +552,12 @@ void pkgProblemResolver::MakeScores()
}

// 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)
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 ||
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
score of the packages that depend on the target Package. This
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)
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
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
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
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
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)
Scores[I->ID] += AddProtected;
@@ -704,7 +704,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
if (Start == End)
break;
Start++;
++Start;
}
if (Fail == true)
break;
@@ -750,7 +750,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
do
{
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)
Flags[I->ID] |= PreInstalled;
@@ -781,7 +781,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
would cause the removal of even lower score packages. */
SPtrArray<pkgCache::Package *> PList = new pkgCache::Package *[Size];
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;
This = this;
qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
@@ -901,7 +901,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
}
else
{
Start++;
++Start;
// We only worry about critical deps.
if (Start.IsCritical() != true)
continue;
@@ -1150,7 +1150,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
{
// See if this is the result of a hold
pkgCache::PkgIterator I = Cache.PkgBegin();
for (;I.end() != true; I++)
for (;I.end() != true; ++I)
{
if (Cache[I].InstBroken() == false)
continue;
@@ -1162,7 +1162,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
// set the auto-flags (mvo: I'm not sure if we _really_ need this)
pkgCache::PkgIterator I = Cache.PkgBegin();
for (;I.end() != true; I++) {
for (;I.end() != true; ++I) {
if (Cache[I].NewInstall() && !(Flags[I->ID] & PreInstalled)) {
if(_config->FindI("Debug::pkgAutoRemove",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. */
pkgCache::Package **PList = new pkgCache::Package *[Size];
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;
This = this;
qsort(PList,PEnd - PList,sizeof(*PList),&ScoreSort);
@@ -1317,7 +1317,7 @@ bool pkgProblemResolver::ResolveByKeep()

if (Start == End)
break;
Start++;
++Start;
}
if (InstOrNewPolicyBroken(I) == false)
@@ -1344,7 +1344,7 @@ void pkgProblemResolver::InstallProtect()
{
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)
{
@@ -1424,7 +1424,7 @@ bool ListUpdate(pkgAcquireStatus &Stat,
bool Failed = false;
bool TransientNetworkFailure = false;
for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin();
I != Fetcher.ItemsEnd(); I++)
I != Fetcher.ItemsEnd(); ++I)
{
if ((*I)->Status == pkgAcquire::Item::StatDone)
continue;


+ 2
- 2
apt-pkg/aptconfiguration.cc View File

@@ -53,7 +53,7 @@ const Configuration::getCompressionTypes(bool const &Cached) {
// load the order setting into our vector
std::vector<std::string> const order = _config->FindVector("Acquire::CompressionTypes::Order");
for (std::vector<std::string>::const_iterator o = order.begin();
o != order.end(); o++) {
o != order.end(); ++o) {
if ((*o).empty() == true)
continue;
// 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.
bool noneSeen = false;
for (std::vector<string>::const_iterator l = lang.begin();
l != lang.end(); l++) {
l != lang.end(); ++l) {
if (*l == "environment") {
for (std::vector<string>::const_iterator e = environment.begin();
e != environment.end(); ++e) {


+ 13
- 13
apt-pkg/cdrom.cc View File

@@ -310,7 +310,7 @@ void pkgCdrom::ReduceSourcelist(string CD,vector<string> &List)
sort(List.begin(),List.end());
// 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..
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 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..
string::size_type Space2 = (*J).find(' ');
@@ -405,7 +405,7 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
that were the same. */
bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
{
if (List.size() == 0)
if (List.empty() == true)
return true;

string File = _config->FindFile("Dir::Etc::sourcelist");
@@ -455,7 +455,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)

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(' ');
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
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(' ');
if (Space == string::npos)
@@ -661,13 +661,13 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
if (_config->FindB("Debug::aptcdrom",false) == true)
{
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 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 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;
}

@@ -688,7 +688,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
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)
UnmountCdrom(CDROM);
@@ -712,7 +712,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
{
// Escape special characters
string::iterator J = Name.begin();
for (; J != Name.end(); J++)
for (; J != Name.end(); ++J)
if (*J == '"' || *J == ']' || *J == '[')
*J = '_';
@@ -757,7 +757,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/

// Escape special characters
string::iterator J = Name.begin();
for (; J != Name.end(); J++)
for (; J != Name.end(); ++J)
if (*J == '"' || *J == ']' || *J == '[')
*J = '_';
@@ -804,7 +804,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
if(log != NULL)
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(' ');
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(' ');
if (Space == string::npos)


+ 2
- 2
apt-pkg/clean.cc View File

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


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

@@ -672,9 +672,9 @@ bool ReadConfigFile(Configuration &Conf,const string &FName,bool const &AsSectio
// Put the last fragment into the buffer
std::string::const_iterator NonWhitespaceStart = Start;
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)
LineBuffer += ' ';
@@ -850,7 +850,7 @@ bool ReadConfigDir(Configuration &Conf,const string &Dir,
vector<string> const List = GetListOfFilesInDir(Dir, "conf", true, true);

// 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)
return false;
return true;


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

@@ -193,7 +193,7 @@ bool GlobalError::PopMessage(std::string &Text) {

// check if another error message is pending
for (std::list<Item>::const_iterator m = Messages.begin();
m != Messages.end(); m++)
m != Messages.end(); ++m)
if (m->Type == ERROR || m->Type == FATAL)
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());

for (std::list<Item>::const_iterator m = Messages.begin();
m != Messages.end(); m++)
m != Messages.end(); ++m)
if (m->Type >= threshold)
out << (*m) << std::endl;
Discard();
@@ -231,7 +231,7 @@ bool GlobalError::empty(MsgType const &trashhold) const {
return true;

for (std::list<Item>::const_iterator m = Messages.begin();
m != Messages.end(); m++)
m != Messages.end(); ++m)
if (m->Type >= trashhold)
return false;



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

@@ -271,7 +271,7 @@ bool ParseCWord(const char *&String,string &Res)
string QuoteString(const string &Str, const char *Bad)
{
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 ||
*I == 0x25 || // percent '%' char
@@ -298,7 +298,7 @@ string DeQuoteString(string::const_iterator const &begin,
string::const_iterator const &end)
{
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 &&
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.
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
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
string::const_iterator J;
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);
}
for (; *I != '\n' && I < Message.end(); I++);
for (; *I != '\n' && I < Message.end(); ++I);
}
// Failed to find a match
@@ -1224,7 +1224,7 @@ int tolower_ascii(int const c)
bool CheckDomainList(const string &Host,const string &List)
{
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 != ',')
continue;
@@ -1248,7 +1248,7 @@ string DeEscapeString(const string &input)
char tmp[3];
string::const_iterator it, escape_start;
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
if (*it != '\\')
@@ -1264,7 +1264,7 @@ string DeEscapeString(const string &input)
// copy
output += *it;
// advance iterator one step further
it += 1;
++it;
continue;
}
@@ -1273,7 +1273,7 @@ string DeEscapeString(const string &input)
continue;

// read it
it++;
++it;
switch (*it)
{
case '0':
@@ -1310,7 +1310,7 @@ void URI::CopyFrom(const string &U)
string::const_iterator I = U.begin();

// 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;

/* 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
square brackets */
bool InBracket = false;
for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); SingleSlash++)
for (; SingleSlash < U.end() && (*SingleSlash != '/' || InBracket == true); ++SingleSlash)
{
if (*SingleSlash == '[')
InBracket = true;
@@ -1355,11 +1355,11 @@ void URI::CopyFrom(const string &U)
I = FirstColon + 1;
if (I > SingleSlash)
I = SingleSlash;
for (; I < SingleSlash && *I != ':'; I++);
for (; I < SingleSlash && *I != ':'; ++I);
string::const_iterator SecondColon = I;
// Search for the @ after the colon
for (; I < SingleSlash && *I != '@'; I++);
for (; I < SingleSlash && *I != '@'; ++I);
string::const_iterator At = I;
// Now write the host and user/pass


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

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


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

@@ -203,7 +203,7 @@ string debListParser::DescriptionLanguage()

std::vector<string> const lang = APT::Configuration::getLanguages(true);
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)
return *l;



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

@@ -206,7 +206,7 @@ vector <struct IndexTarget *>* debReleaseIndex::ComputeIndexTargets() const {
for (std::set<std::string>::const_iterator s = sections.begin();
s != sections.end(); ++s) {
for (std::vector<std::string>::const_iterator l = lang.begin();
l != lang.end(); l++) {
l != lang.end(); ++l) {
if (*l == "none") continue;
IndexTarget * Target = new OptionalIndexTarget();
Target->ShortDesc = "Translation-" + *l;
@@ -236,7 +236,7 @@ bool debReleaseIndex::GetIndexes(pkgAcquire *Owner, bool const &GetAll) const
// special case for --print-uris
if (GetAll) {
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,
(*Target)->ShortDesc, HashString());
}
@@ -279,7 +279,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
if (src != ArchEntries.end()) {
vector<debSectionEntry const*> const SectionEntries = src->second;
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()));
}

@@ -294,7 +294,7 @@ vector <pkgIndexFile *> *debReleaseIndex::GetIndexFiles() {
if (a->first == "source")
continue;
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));
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();
s != sections.end(); ++s)
for (set<string>::const_iterator l = s->second.begin();
l != s->second.end(); l++) {
l != s->second.end(); ++l) {
if (*l == "none") continue;
Indexes->push_back(new debTranslationsIndex(URI,Dist,s->first,(*l).c_str()));
}
@@ -351,7 +351,7 @@ class debSLTypeDebian : public pkgSourceList::Type
APT::Configuration::getArchitectures();

for (vector<metaIndex *>::const_iterator I = List.begin();
I != List.end(); I++)
I != List.end(); ++I)
{
// We only worry about debian entries here
if (strcmp((*I)->GetType(), "deb") != 0)


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

@@ -118,7 +118,7 @@ string debRecordParser::LongDesc()
{
vector<string> const lang = APT::Configuration::getLanguages();
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());
}



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

@@ -213,7 +213,7 @@ bool pkgDPkgPM::SendV2Pkgs(FILE *F)
fprintf(F,"\n");
// 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)
continue;
@@ -335,7 +335,7 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
// Feed it the filenames.
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
if (I->Op != Item::Install)
@@ -690,7 +690,7 @@ bool pkgDPkgPM::OpenLog()
chmod(history_name.c_str(), 0644);
fprintf(history_out, "\nStart-Date: %s\n", timestr);
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;
string *line = NULL;
@@ -868,14 +868,14 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// that will be [installed|configured|removed|purged] and add
// them to the PackageOps map (the dpkg states it goes through)
// 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)
continue;

string const name = (*I).Pkg.Name();
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]);
PackagesTotal++;
@@ -893,7 +893,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// Do all actions with the same Op in one run
vector<Item>::const_iterator J = I;
if (TriggersPending == true)
for (; J != List.end(); J++)
for (; J != List.end(); ++J)
{
if (J->Op == I->Op)
continue;
@@ -905,7 +905,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
break;
}
else
for (; J != List.end() && J->Op == I->Op; J++)
for (; J != List.end() && J->Op == I->Op; ++J)
/* nothing */;

// Generate the argument list
@@ -1011,7 +1011,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
// Write in the file or package names
if (I->Op == Item::Install)
{
for (;I != J && Size < MaxArgBytes; I++)
for (;I != J && Size < MaxArgBytes; ++I)
{
if (I->File[0] != '/')
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");
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)
continue;
@@ -1461,7 +1461,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
// log the ordering
const char *ops_str[] = {"Install", "Configure","Remove","Purge"};
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]);

// attach dmesg log (to learn about segfaults)


+ 14
- 14
apt-pkg/depcache.cc View File

@@ -129,7 +129,7 @@ bool pkgDepCache::Init(OpProgress *Prog)
/* Set the current state of everything. In this state all of the
packages are kept exactly as is. See AllUpgrade */
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)
Prog->Progress(Done);
@@ -292,7 +292,7 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) /*{{{*/
// then write the ones we have not seen yet
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];
if(P.Flags & Flag::Auto) {
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
PrvIterator P = Dep.TargetPkg().ProvidesList();
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)
if it is a conflicts. See the comment above. */
@@ -585,7 +585,7 @@ void pkgDepCache::BuildGroupOrs(VerIterator const &V)
{
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.
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)
DepIterator Start = D;
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];
LastOR = (D->CompareOp & Dep::Or) == Dep::Or;
@@ -715,15 +715,15 @@ void pkgDepCache::Update(OpProgress *Prog)

// Perform the depends pass
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)
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;

for (DepIterator D = V.DependsList(); D.end() != true; D++)
for (DepIterator D = V.DependsList(); D.end() != true; ++D)
{
// Build the dependency state.
unsigned char &State = DepState[D->ID];
@@ -760,7 +760,7 @@ void pkgDepCache::Update(OpProgress *Prog)
void pkgDepCache::Update(DepIterator D)
{
// Update the reverse deps
for (;D.end() != true; D++)
for (;D.end() != true; ++D)
{
unsigned char &State = DepState[D->ID];
State = DependencyState(D);
@@ -793,13 +793,13 @@ void pkgDepCache::Update(PkgIterator const &Pkg)
// Update the provides map for the current ver
if (Pkg->CurrentVer != 0)
for (PrvIterator P = Pkg.CurrentVer().ProvidesList();
P.end() != true; P++)
P.end() != true; ++P)
Update(P.ParentPkg().RevDependsList());

// Update the provides map for the candidate ver
if (PkgState[Pkg->ID].CandidateVer != 0)
for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList();
P.end() != true; P++)
P.end() != true; ++P)
Update(P.ParentPkg().RevDependsList());
}
/*}}}*/
@@ -1059,7 +1059,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst,
DepIterator Start = Dep;
bool Result = true;
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;

@@ -1522,12 +1522,12 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk
unless they are already installed */
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)
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)
continue;


+ 9
- 9
apt-pkg/indexcopy.cc View File

@@ -43,7 +43,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
pkgCdromStatus *log)
{
OpProgress *Progress = NULL;
if (List.size() == 0)
if (List.empty() == true)
return true;
if(log)
@@ -54,7 +54,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector<string> &List,
// Prepare the progress indicator
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;
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 WrongSize = 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());
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, /*{{{*/
vector<string> PkgList,vector<string> SrcList)
{
if (SigList.size() == 0)
if (SigList.empty() == true)
return true;

bool Debug = _config->FindB("Debug::aptcdrom",false);

// 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)
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
// if so, remove them from our copy of the lists
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)) {
// 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)
{
OpProgress *Progress = NULL;
if (List.size() == 0)
if (List.empty() == true)
return true;
if(log)
@@ -786,7 +786,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/
// Prepare the progress indicator
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;
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 WrongSize = 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());
unsigned long FileSize = 0;


+ 8
- 8
apt-pkg/orderlist.cc View File

@@ -323,7 +323,7 @@ int pkgOrderList::Score(PkgIterator Pkg)
Score += ScoreImmediate;

for (DepIterator D = Cache[Pkg].InstVerIter(Cache).DependsList();
D.end() == false; D++)
D.end() == false; ++D)
if (D->Type == pkgCache::Dep::PreDepends)
{
Score += ScorePreDepends;
@@ -488,7 +488,7 @@ bool pkgOrderList::VisitRProvides(DepFunc F,VerIterator Ver)
return 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());
return Res;
}
@@ -615,7 +615,7 @@ bool pkgOrderList::VisitNode(PkgIterator Pkg)
Loops are preprocessed and logged. */
bool pkgOrderList::DepUnPackCrit(DepIterator D)
{
for (; D.end() == false; D++)
for (; D.end() == false; ++D)
{
if (D.Reverse() == true)
{
@@ -693,7 +693,7 @@ bool pkgOrderList::DepUnPackPreD(DepIterator D)
if (D.Reverse() == true)
return DepUnPackCrit(D);
for (; D.end() == false; D++)
for (; D.end() == false; ++D)
{
if (D.IsCritical() == false)
continue;
@@ -736,7 +736,7 @@ bool pkgOrderList::DepUnPackPre(DepIterator D)
if (D.Reverse() == true)
return true;
for (; D.end() == false; D++)
for (; D.end() == false; ++D)
{
/* Only consider the PreDepends or Depends. Depends are only
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)
{
for (; D.end() == false; D++)
for (; D.end() == false; ++D)
if (D.IsCritical() == true)
{
if (D.Reverse() == true)
@@ -846,7 +846,7 @@ bool pkgOrderList::DepConfigure(DepIterator D)
if (D.Reverse() == true)
return true;
for (; D.end() == false; D++)
for (; D.end() == false; ++D)
if (D->Type == pkgCache::Dep::Depends)
if (VisitProvides(D,false) == false)
return false;
@@ -868,7 +868,7 @@ bool pkgOrderList::DepRemove(DepIterator D)
{
if (D.Reverse() == false)
return true;
for (; D.end() == false; D++)
for (; D.end() == false; ++D)
if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
{
// Duplication elimination, consider the current version only


+ 10
- 10
apt-pkg/packagemanager.cc View File

@@ -99,7 +99,7 @@ bool pkgPackageManager::FixMissing()
List->SetFileList(FileNames);

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)
continue;
@@ -140,7 +140,7 @@ void pkgPackageManager::ImmediateAdd(PkgIterator I, bool UseInstallVer, unsigned
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(!List->IsFlag(D.TargetPkg(), pkgOrderList::Immediate))
@@ -169,7 +169,7 @@ bool pkgPackageManager::CreateOrderList()
static bool const NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true);
// 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
if (I->VersionList == 0)
@@ -229,7 +229,7 @@ bool pkgPackageManager::DepAlwaysTrue(DepIterator D)
bool pkgPackageManager::CheckRConflicts(PkgIterator Pkg,DepIterator D,
const char *Ver)
{
for (;D.end() == false; D++)
for (;D.end() == false; ++D)
{
if (D->Type != pkgCache::Dep::Conflicts &&
D->Type != pkgCache::Dep::Obsoletes)
@@ -364,13 +364,13 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
{
if (D->Type != pkgCache::Dep::Depends && D->Type != pkgCache::Dep::PreDepends)
{
D++;
++D;
continue;
}
// Grok or groups
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;
@@ -378,7 +378,7 @@ bool pkgPackageManager::DepAdd(pkgOrderList &OList,PkgIterator Pkg,int Depth)
continue;

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);
PkgIterator Pkg = Ver.ParentPkg();
@@ -444,7 +444,7 @@ bool pkgPackageManager::EarlyRemove(PkgIterator Pkg)
if (Pkg->CurrentVer != 0)
{
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.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
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, "
"probably a dependency cycle.",
End.TargetPkg().Name(),Pkg.Name());
Start++;
++Start;
}
else
break;
@@ -597,7 +597,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
return false;
for (PrvIterator P = instVer.ProvidesList();
P.end() == false; P++)
P.end() == false; ++P)
CheckRConflicts(Pkg,P.ParentPkg().RevDependsList(),P.ProvideVersion());

List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);


+ 13
- 13
apt-pkg/pkgcache.cc View File

@@ -175,7 +175,7 @@ bool pkgCache::ReMap(bool const &Errorchecks)
unsigned long pkgCache::sHash(const string &Str) const
{
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);
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 Hash = 0;
for (const char *I = Str; *I != 0; I++)
for (const char *I = Str; *I != 0; ++I)
Hash = 5*Hash + tolower_ascii(*I);
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
we must ignore libc5-dev when considering the provides list. */
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
if (PStart.end() == true)
@@ -577,7 +577,7 @@ bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result) const
// Check for single packages in the provides list
PrvIterator P = PStart;
for (; P.end() != true; P++)
for (; P.end() != true; ++P)
{
// Skip over self provides
if (P.OwnerPkg() == ParentPkg())
@@ -611,7 +611,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
PkgIterator DPkg = TargetPkg();

// 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)
continue;
@@ -626,7 +626,7 @@ pkgCache::Version **pkgCache::DepIterator::AllTargets() const
}
// 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)
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
B was before A so A < B */
VerIterator I = *this;
for (;I.end() == false; I++)
for (;I.end() == false; ++I)
if (I == B)
return 1;
return -1;
@@ -729,7 +729,7 @@ int pkgCache::VerIterator::CompareVer(const VerIterator &B) const
bool pkgCache::VerIterator::Downloadable() const
{
VerFileIterator Files = FileList();
for (; Files.end() == false; Files++)
for (; Files.end() == false; ++Files)
if ((Files.File()->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource)
return true;
return false;
@@ -742,7 +742,7 @@ bool pkgCache::VerIterator::Downloadable() const
bool pkgCache::VerIterator::Automatic() const
{
VerFileIterator Files = FileList();
for (; Files.end() == false; Files++)
for (; Files.end() == false; ++Files)
// Do not check ButAutomaticUpgrades here as it is kind of automatic…
if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic)
return true;
@@ -760,7 +760,7 @@ pkgCache::VerFileIterator pkgCache::VerIterator::NewestFile() const
{
VerFileIterator Files = FileList();
VerFileIterator Highest = Files;
for (; Files.end() == false; Files++)
for (; Files.end() == false; ++Files)
{
if (Owner->VS->CmpReleaseVer(Files.File().Version(),Highest.File().Version()) > 0)
Highest = Files;
@@ -777,7 +777,7 @@ string pkgCache::VerIterator::RelStr() const
{
bool First = true;
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'
pkgCache::PkgFileIterator File = I.File();
@@ -786,7 +786,7 @@ string pkgCache::VerIterator::RelStr() const

// See if we have already printed this out..
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();
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();
for (std::vector<string>::const_iterator l = lang.begin();
l != lang.end(); l++)
l != lang.end(); ++l)
{
pkgCache::DescIterator Desc = DescriptionList();
for (; Desc.end() == false; ++Desc)


+ 14
- 14
apt-pkg/pkgcachegen.cc View File

@@ -220,7 +220,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,

// don't add a new description if we have one for the given
// md5 && language
for ( ; Desc.end() == false; Desc++)
for ( ; Desc.end() == false; ++Desc)
if (MD5SumValue(Desc.md5()) == CurMd5 &&
Desc.LanguageCode() == List.DescriptionLanguage())
duplicate=true;
@@ -229,7 +229,7 @@ bool pkgCacheGenerator::MergeList(ListParser &List,
for (Desc = Ver.DescriptionList();
Desc.end() == false;
LastDesc = &Desc->NextDesc, Desc++)
LastDesc = &Desc->NextDesc, ++Desc)
{
if (MD5SumValue(Desc.md5()) == CurMd5)
{
@@ -395,7 +395,7 @@ bool pkgCacheGenerator::MergeFileProvides(ListParser &List)
unsigned long Hash = List.VersionHash();
pkgCache::VerIterator Ver = Pkg.VersionList();
Dynamic<pkgCache::VerIterator> DynVer(Ver);
for (; Ver.end() == false; Ver++)
for (; Ver.end() == false; ++Ver)
{
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
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;
VF->NextFile = *Last;
*Last = VF.Index();
@@ -568,7 +568,7 @@ bool pkgCacheGenerator::NewFileDesc(pkgCache::DescIterator &Desc,

// Link it to the end of the list
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;

DF->NextFile = *Last;
@@ -623,7 +623,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
// Create Conflicts in between the group
pkgCache::GrpIterator G = GetCache().GrpBegin();
Dynamic<pkgCache::GrpIterator> DynG(G);
for (; G.end() != true; G++)
for (; G.end() != true; ++G)
{
string const PkgName = G.Name();
pkgCache::PkgIterator P = G.PackageList();
@@ -634,7 +634,7 @@ bool pkgCacheGenerator::FinishCache(OpProgress *Progress)
Dynamic<pkgCache::PkgIterator> DynallPkg(allPkg);
pkgCache::VerIterator V = P.VersionList();
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
// in NewDepends() later may alter the pointer location
@@ -728,7 +728,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg,
if (OldDepLast == NULL)
{
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;
} else if (oldMap != Map.Data())
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.. */
SPtrArray<bool> Visited = new bool[Cache.HeaderP->PackageFileCount];
memset(Visited,0,sizeof(*Visited)*Cache.HeaderP->PackageFileCount);
for (; Start != End; Start++)
for (; Start != End; ++Start)
{
if (Debug == true)
std::clog << "Checking PkgFile " << (*Start)->Describe() << ": ";
@@ -1025,7 +1025,7 @@ static bool CheckValidity(const string &CacheFile,
static unsigned long ComputeSize(FileIterator Start,FileIterator End)
{
unsigned long TotalSize = 0;
for (; Start != End; Start++)
for (; Start != End; ++Start)
{
if ((*Start)->HasPackages() == false)
continue;
@@ -1043,7 +1043,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
FileIterator Start, FileIterator End)
{
FileIterator I;
for (I = Start; I != End; I++)
for (I = Start; I != End; ++I)
{
if ((*I)->HasPackages() == false)
continue;
@@ -1073,7 +1073,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
Progress->Done();
TotalSize = ComputeSize(Start, End);
CurrentSize = 0;
for (I = Start; I != End; I++)
for (I = Start; I != End; ++I)
{
unsigned long Size = (*I)->Size();
if (Progress != NULL)
@@ -1120,12 +1120,12 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
vector<pkgIndexFile *> Files;
for (vector<metaIndex *>::const_iterator i = List.begin();
i != List.end();
i++)
++i)
{
vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
for (vector<pkgIndexFile *>::const_iterator j = Indexes->begin();
j != Indexes->end();
j++)
++j)
Files.push_back (*j);
}


+ 1
- 1
apt-pkg/pkgrecords.cc View File

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


+ 7
- 7
apt-pkg/policy.cc View File

@@ -81,7 +81,7 @@ pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
bool pkgPolicy::InitDefaults()
{
// 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;
if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
@@ -98,10 +98,10 @@ bool pkgPolicy::InitDefaults()
signed Cur = 989;
StatusOverride = false;
for (vector<Pin>::const_iterator I = Defaults.begin(); I != Defaults.end();
I++, Cur--)
++I, --Cur)
{
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)
{
@@ -122,7 +122,7 @@ bool pkgPolicy::InitDefaults()
}

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;
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
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 */
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
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);

// 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)
return false;
return true;


+ 7
- 7
apt-pkg/sourcelist.cc View File

@@ -173,7 +173,7 @@ pkgSourceList::pkgSourceList(string File)
/* */
pkgSourceList::~pkgSourceList()
{
for (const_iterator I = SrcList.begin(); I != SrcList.end(); I++)
for (const_iterator I = SrcList.begin(); I != SrcList.end(); ++I)
delete *I;
}
/*}}}*/
@@ -218,7 +218,7 @@ bool pkgSourceList::ReadMainList()
/* */
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;
SrcList.erase(SrcList.begin(),SrcList.end());
}
@@ -296,11 +296,11 @@ bool pkgSourceList::ReadAppend(string File)
bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
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();
for (vector<pkgIndexFile *>::const_iterator J = Indexes->begin();
J != Indexes->end(); J++)
J != Indexes->end(); ++J)
{
if ((*J)->FindInCache(*File.Cache()) == File)
{
@@ -318,7 +318,7 @@ bool pkgSourceList::FindIndex(pkgCache::PkgFileIterator File,
/* */
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)
return false;
return true;
@@ -334,7 +334,7 @@ bool pkgSourceList::ReadSourceDir(string Dir)
vector<string> const List = GetListOfFilesInDir(Dir, "list", true);

// 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)
return false;
return true;
@@ -353,7 +353,7 @@ time_t pkgSourceList::GetLastModifiedTime()

// calculate the time
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));

return mtime_sources;


+ 5
- 5
apt-pkg/srcrecords.cc View File

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


+ 3
- 3
apt-pkg/vendorlist.cc View File

@@ -11,7 +11,7 @@
pkgVendorList::~pkgVendorList()
{
for (vector<const Vendor *>::const_iterator I = VendorList.begin();
I != VendorList.end(); I++)
I != VendorList.end(); ++I)
delete *I;
}

@@ -49,7 +49,7 @@ bool pkgVendorList::Read(string File) /*{{{*/
bool pkgVendorList::CreateList(Configuration& Cnf) /*{{{*/
{
for (vector<const Vendor *>::const_iterator I = VendorList.begin();
I != VendorList.end(); I++)
I != VendorList.end(); ++I)
delete *I;
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) /*{{{*/
{
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 ");
if (_config->FindB("Debug::Vendor", false))