Browse Source

warning: extra ‘;’ [-Wpedantic]

Git-Dch: Ignore
Reported-By: gcc -Wpedantic
debian/1.8.y
David Kalnischkies 8 years ago
parent
commit
d3e8fbb395
  1. 152
      apt-inst/filelist.h
  2. 2
      apt-pkg/acquire.cc
  3. 226
      apt-pkg/cacheiterators.h
  4. 176
      apt-pkg/cacheset.h
  5. 6
      apt-pkg/cdrom.cc
  6. 3
      apt-pkg/contrib/configuration.cc
  7. 2
      apt-pkg/contrib/error.cc
  8. 2
      apt-pkg/contrib/gpgv.h
  9. 12
      apt-pkg/contrib/progress.cc
  10. 2
      apt-pkg/contrib/strutl.cc
  11. 38
      apt-pkg/contrib/strutl.h
  12. 4
      apt-pkg/depcache.cc
  13. 4
      apt-pkg/indexcopy.cc
  14. 4
      apt-pkg/install-progress.cc
  15. 32
      apt-pkg/install-progress.h
  16. 20
      apt-pkg/pkgcache.cc
  17. 42
      apt-pkg/pkgcache.h
  18. 2
      apt-pkg/upgrade.h
  19. 62
      apt-private/acqprogress.cc
  20. 26
      cmdline/apt-cdrom.cc
  21. 8
      ftparchive/override.cc
  22. 2
      methods/cdrom.cc
  23. 6
      methods/http.cc
  24. 2
      methods/https.cc
  25. 28
      methods/mirror.cc
  26. 2
      methods/rsh.cc
  27. 20
      methods/server.cc
  28. 2
      methods/server.h

152
apt-inst/filelist.h

@ -42,25 +42,25 @@ class pkgFLCache
struct Package;
struct Diversion;
struct ConfFile;
class NodeIterator;
class DirIterator;
class PkgIterator;
class DiverIterator;
protected:
std::string CacheFile;
DynamicMMap ⤅
map_ptrloc LastTreeLookup;
unsigned long LastLookupSize;
// Helpers for the addition algorithms
map_ptrloc TreeLookup(map_ptrloc *Base,const char *Text,const char *TextEnd,
unsigned long Size,unsigned int *Count = 0,
bool Insert = false);
public:
// Pointers to the arrays of items
Header *HeaderP;
Node *NodeP;
@ -70,10 +70,10 @@ class pkgFLCache
ConfFile *ConfP;
char *StrP;
unsigned char *AnyP;
// Quick accessors
Node *FileHash;
// Accessors
Header &Head() {return *HeaderP;};
void PrintTree(map_ptrloc Base,unsigned long Size);
@ -89,7 +89,7 @@ class pkgFLCache
void DropNode(map_ptrloc Node);
inline DiverIterator DiverBegin();
// Diversion control
void BeginDiverLoad();
void FinishDiverLoad();
@ -97,7 +97,7 @@ class pkgFLCache
const char *To);
bool AddConfFile(const char *Name,const char *NameEnd,
PkgIterator const &Owner,const unsigned char *Sum);
pkgFLCache(DynamicMMap &Map);
// ~pkgFLCache();
};
@ -109,7 +109,7 @@ struct pkgFLCache::Header
short MajorVersion;
short MinorVersion;
bool Dirty;
// Size of structure values
unsigned HeaderSz;
unsigned NodeSz;
@ -117,7 +117,7 @@ struct pkgFLCache::Header
unsigned PackageSz;
unsigned DiversionSz;
unsigned ConfFileSz;
// Structure Counts;
unsigned int NodeCount;
unsigned int DirCount;
@ -126,13 +126,13 @@ struct pkgFLCache::Header
unsigned int ConfFileCount;
unsigned int HashSize;
unsigned long UniqNodes;
// Offsets
map_ptrloc FileHash;
map_ptrloc DirTree;
map_ptrloc Packages;
map_ptrloc Diversions;
/* Allocation pools, there should be one of these for each structure
excluding the header */
DynamicMMap::Pool Pools[5];
@ -177,7 +177,7 @@ struct pkgFLCache::Diversion
map_ptrloc OwnerPkg; // Package
map_ptrloc DivertFrom; // Node
map_ptrloc DivertTo; // String
map_ptrloc Next; // Diversion
unsigned long Flags;
@ -194,120 +194,120 @@ class pkgFLCache::PkgIterator
{
Package *Pkg;
pkgFLCache *Owner;
public:
inline bool end() const {return Owner == 0 || Pkg == Owner->PkgP?true:false;}
// Accessors
inline Package *operator ->() {return Pkg;};
inline Package const *operator ->() const {return Pkg;};
inline Package const &operator *() const {return *Pkg;};
inline operator Package *() {return Pkg == Owner->PkgP?0:Pkg;};
inline operator Package const *() const {return Pkg == Owner->PkgP?0:Pkg;};
inline unsigned long Offset() const {return Pkg - Owner->PkgP;};
inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;};
inline Package *operator ->() {return Pkg;}
inline Package const *operator ->() const {return Pkg;}
inline Package const &operator *() const {return *Pkg;}
inline operator Package *() {return Pkg == Owner->PkgP?0:Pkg;}
inline operator Package const *() const {return Pkg == Owner->PkgP?0:Pkg;}
inline unsigned long Offset() const {return Pkg - Owner->PkgP;}
inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;}
inline pkgFLCache::NodeIterator Files() const;
PkgIterator() : Pkg(0), Owner(0) {};
PkgIterator(pkgFLCache &Owner,Package *Trg) : Pkg(Trg), Owner(&Owner) {};
PkgIterator() : Pkg(0), Owner(0) {}
PkgIterator(pkgFLCache &Owner,Package *Trg) : Pkg(Trg), Owner(&Owner) {}
};
class pkgFLCache::DirIterator
{
Directory *Dir;
pkgFLCache *Owner;
public:
// Accessors
inline Directory *operator ->() {return Dir;};
inline Directory const *operator ->() const {return Dir;};
inline Directory const &operator *() const {return *Dir;};
inline operator Directory *() {return Dir == Owner->DirP?0:Dir;};
inline operator Directory const *() const {return Dir == Owner->DirP?0:Dir;};
inline Directory *operator ->() {return Dir;}
inline Directory const *operator ->() const {return Dir;}
inline Directory const &operator *() const {return *Dir;}
inline operator Directory *() {return Dir == Owner->DirP?0:Dir;}
inline operator Directory const *() const {return Dir == Owner->DirP?0:Dir;}
inline const char *Name() const {return Dir->Name == 0?0:Owner->StrP + Dir->Name;};
inline const char *Name() const {return Dir->Name == 0?0:Owner->StrP + Dir->Name;}
DirIterator() : Dir(0), Owner(0) {};
DirIterator(pkgFLCache &Owner,Directory *Trg) : Dir(Trg), Owner(&Owner) {};
DirIterator() : Dir(0), Owner(0) {}
DirIterator(pkgFLCache &Owner,Directory *Trg) : Dir(Trg), Owner(&Owner) {}
};
class pkgFLCache::DiverIterator
{
Diversion *Diver;
pkgFLCache *Owner;
public:
// Iteration
void operator ++(int) {if (Diver != Owner->DiverP) Diver = Owner->DiverP + Diver->Next;};
inline void operator ++() {operator ++(0);};
inline bool end() const {return Owner == 0 || Diver == Owner->DiverP;};
void operator ++(int) {if (Diver != Owner->DiverP) Diver = Owner->DiverP + Diver->Next;}
inline void operator ++() {operator ++(0);}
inline bool end() const {return Owner == 0 || Diver == Owner->DiverP;}
// Accessors
inline Diversion *operator ->() {return Diver;};
inline Diversion const *operator ->() const {return Diver;};
inline Diversion const &operator *() const {return *Diver;};
inline operator Diversion *() {return Diver == Owner->DiverP?0:Diver;};
inline operator Diversion const *() const {return Diver == Owner->DiverP?0:Diver;};
inline Diversion *operator ->() {return Diver;}
inline Diversion const *operator ->() const {return Diver;}
inline Diversion const &operator *() const {return *Diver;}
inline operator Diversion *() {return Diver == Owner->DiverP?0:Diver;}
inline operator Diversion const *() const {return Diver == Owner->DiverP?0:Diver;}
inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Diver->OwnerPkg);};
inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Diver->OwnerPkg);}
inline NodeIterator DivertFrom() const;
inline NodeIterator DivertTo() const;
DiverIterator() : Diver(0), Owner(0) {};
DiverIterator(pkgFLCache &Owner,Diversion *Trg) : Diver(Trg), Owner(&Owner) {};
DiverIterator(pkgFLCache &Owner,Diversion *Trg) : Diver(Trg), Owner(&Owner) {}
};
class pkgFLCache::NodeIterator
{
Node *Nde;
enum {NdePkg, NdeHash} Type;
enum {NdePkg, NdeHash} Type;
pkgFLCache *Owner;
public:
// Iteration
void operator ++(int) {if (Nde != Owner->NodeP) Nde = Owner->NodeP +
(Type == NdePkg?Nde->NextPkg:Nde->Next);};
inline void operator ++() {operator ++(0);};
inline bool end() const {return Owner == 0 || Nde == Owner->NodeP;};
void operator ++(int) {if (Nde != Owner->NodeP) Nde = Owner->NodeP +
(Type == NdePkg?Nde->NextPkg:Nde->Next);}
inline void operator ++() {operator ++(0);}
inline bool end() const {return Owner == 0 || Nde == Owner->NodeP;}
// Accessors
inline Node *operator ->() {return Nde;};
inline Node const *operator ->() const {return Nde;};
inline Node const &operator *() const {return *Nde;};
inline operator Node *() {return Nde == Owner->NodeP?0:Nde;};
inline operator Node const *() const {return Nde == Owner->NodeP?0:Nde;};
inline unsigned long Offset() const {return Nde - Owner->NodeP;};
inline DirIterator Dir() const {return DirIterator(*Owner,Owner->DirP + Nde->Dir);};
inline DiverIterator Diversion() const {return DiverIterator(*Owner,Owner->DiverP + Nde->Pointer);};
inline const char *File() const {return Nde->File == 0?0:Owner->StrP + Nde->File;};
inline const char *DirN() const {return Owner->StrP + Owner->DirP[Nde->Dir].Name;};
inline Node *operator ->() {return Nde;}
inline Node const *operator ->() const {return Nde;}
inline Node const &operator *() const {return *Nde;}
inline operator Node *() {return Nde == Owner->NodeP?0:Nde;}
inline operator Node const *() const {return Nde == Owner->NodeP?0:Nde;}
inline unsigned long Offset() const {return Nde - Owner->NodeP;}
inline DirIterator Dir() const {return DirIterator(*Owner,Owner->DirP + Nde->Dir);}
inline DiverIterator Diversion() const {return DiverIterator(*Owner,Owner->DiverP + Nde->Pointer);}
inline const char *File() const {return Nde->File == 0?0:Owner->StrP + Nde->File;}
inline const char *DirN() const {return Owner->StrP + Owner->DirP[Nde->Dir].Name;}
Package *RealPackage() const;
NodeIterator() : Nde(0), Type(NdeHash), Owner(0) {};
NodeIterator(pkgFLCache &Owner) : Nde(Owner.NodeP), Type(NdeHash), Owner(&Owner) {};
NodeIterator(pkgFLCache &Owner,Node *Trg) : Nde(Trg), Type(NdeHash), Owner(&Owner) {};
NodeIterator(pkgFLCache &Owner,Node *Trg,Package *) : Nde(Trg), Type(NdePkg), Owner(&Owner) {};
NodeIterator(pkgFLCache &Owner) : Nde(Owner.NodeP), Type(NdeHash), Owner(&Owner) {}
NodeIterator(pkgFLCache &Owner,Node *Trg) : Nde(Trg), Type(NdeHash), Owner(&Owner) {}
NodeIterator(pkgFLCache &Owner,Node *Trg,Package *) : Nde(Trg), Type(NdePkg), Owner(&Owner) {}
};
/* Inlines with forward references that cannot be included directly in their
respsective classes */
inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertFrom() const
{return NodeIterator(*Owner,Owner->NodeP + Diver->DivertFrom);};
inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertFrom() const
{return NodeIterator(*Owner,Owner->NodeP + Diver->DivertFrom);}
inline pkgFLCache::NodeIterator pkgFLCache::DiverIterator::DivertTo() const
{return NodeIterator(*Owner,Owner->NodeP + Diver->DivertTo);};
{return NodeIterator(*Owner,Owner->NodeP + Diver->DivertTo);}
inline pkgFLCache::NodeIterator pkgFLCache::PkgIterator::Files() const
{return NodeIterator(*Owner,Owner->NodeP + Pkg->Files,Pkg);};
{return NodeIterator(*Owner,Owner->NodeP + Pkg->Files,Pkg);}
inline pkgFLCache::DiverIterator pkgFLCache::DiverBegin()
{return DiverIterator(*this,DiverP + HeaderP->Diversions);};
{return DiverIterator(*this,DiverP + HeaderP->Diversions);}
inline pkgFLCache::PkgIterator pkgFLCache::GetPkg(const char *Name,bool Insert)
{return GetPkg(Name,Name+strlen(Name),Insert);};
inline pkgFLCache::PkgIterator pkgFLCache::GetPkg(const char *Name,bool Insert)
{return GetPkg(Name,Name+strlen(Name),Insert);}
#endif

2
apt-pkg/acquire.cc

@ -468,7 +468,7 @@ void pkgAcquire::Bump()
pkgAcquire::Worker *pkgAcquire::WorkerStep(Worker *I)
{
return I->NextAcquire;
};
}
/*}}}*/
// Acquire::Clean - Cleans a directory /*{{{*/
// ---------------------------------------------------------------------

226
apt-pkg/cacheiterators.h

@ -55,26 +55,26 @@ template<typename Str, typename Itr> class pkgCache::Iterator :
public:
// Iteration
virtual void operator ++(int) = 0;
virtual void operator ++() = 0; // Should be {operator ++(0);};
inline bool end() const {return Owner == 0 || S == OwnerPointer();};
virtual void operator ++() = 0; // Should be {operator ++(0);}
inline bool end() const {return Owner == 0 || S == OwnerPointer();}
// Comparison
inline bool operator ==(const Itr &B) const {return S == B.S;};
inline bool operator !=(const Itr &B) const {return S != B.S;};
inline bool operator ==(const Itr &B) const {return S == B.S;}
inline bool operator !=(const Itr &B) const {return S != B.S;}
// Accessors
inline Str *operator ->() {return S;};
inline Str const *operator ->() const {return S;};
inline operator Str *() {return S == OwnerPointer() ? 0 : S;};
inline operator Str const *() const {return S == OwnerPointer() ? 0 : S;};
inline Str &operator *() {return *S;};
inline Str const &operator *() const {return *S;};
inline pkgCache *Cache() const {return Owner;};
inline Str *operator ->() {return S;}
inline Str const *operator ->() const {return S;}
inline operator Str *() {return S == OwnerPointer() ? 0 : S;}
inline operator Str const *() const {return S == OwnerPointer() ? 0 : S;}
inline Str &operator *() {return *S;}
inline Str const &operator *() const {return *S;}
inline pkgCache *Cache() const {return Owner;}
// Mixed stuff
inline void operator =(const Itr &B) {S = B.S; Owner = B.Owner;};
inline bool IsGood() const { return S && Owner && ! end();};
inline unsigned long Index() const {return S - OwnerPointer();};
inline void operator =(const Itr &B) {S = B.S; Owner = B.Owner;}
inline bool IsGood() const { return S && Owner && ! end();}
inline unsigned long Index() const {return S - OwnerPointer();}
void ReMap(void const * const oldMap, void const * const newMap) {
if (Owner == 0 || S == 0)
@ -83,8 +83,8 @@ template<typename Str, typename Itr> class pkgCache::Iterator :
}
// Constructors - look out for the variable assigning
inline Iterator() : S(0), Owner(0) {};
inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {};
inline Iterator() : S(0), Owner(0) {}
inline Iterator(pkgCache &Owner,Str *T = 0) : S(T), Owner(&Owner) {}
};
/*}}}*/
// Group Iterator /*{{{*/
@ -98,19 +98,19 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
protected:
inline Group* OwnerPointer() const {
return (Owner != 0) ? Owner->GrpP : 0;
};
}
public:
// This constructor is the 'begin' constructor, never use it.
inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
S = OwnerPointer();
operator ++(0);
};
}
virtual void operator ++(int);
virtual void operator ++() {operator ++(0);};
virtual void operator ++() {operator ++(0);}
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
inline PkgIterator PackageList() const;
PkgIterator FindPkg(std::string Arch = "any") const;
/** \brief find the package with the "best" architecture
@ -127,8 +127,8 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
inline GrpIterator(pkgCache &Owner, Group *Trg) : Iterator<Group, GrpIterator>(Owner, Trg), HashIndex(0) {
if (S == 0)
S = OwnerPointer();
};
inline GrpIterator() : Iterator<Group, GrpIterator>(), HashIndex(0) {};
}
inline GrpIterator() : Iterator<Group, GrpIterator>(), HashIndex(0) {}
};
/*}}}*/
@ -139,27 +139,27 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
protected:
inline Package* OwnerPointer() const {
return (Owner != 0) ? Owner->PkgP : 0;
};
}
public:
// This constructor is the 'begin' constructor, never use it.
inline PkgIterator(pkgCache &Owner) : Iterator<Package, PkgIterator>(Owner), HashIndex(-1) {
S = OwnerPointer();
operator ++(0);
};
}
virtual void operator ++(int);
virtual void operator ++() {operator ++(0);};
virtual void operator ++() {operator ++(0);}
enum OkState {NeedsNothing,NeedsUnpack,NeedsConfigure};
// Accessors
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}
inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge ||
(S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);};
inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;};
inline GrpIterator Group() const { return GrpIterator(*Owner, Owner->GrpP + S->Group);};
(S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);}
inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;}
inline GrpIterator Group() const { return GrpIterator(*Owner, Owner->GrpP + S->Group);}
inline VerIterator VersionList() const;
inline VerIterator CurrentVer() const;
@ -177,8 +177,8 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
inline PkgIterator(pkgCache &Owner,Package *Trg) : Iterator<Package, PkgIterator>(Owner, Trg), HashIndex(0) {
if (S == 0)
S = OwnerPointer();
};
inline PkgIterator() : Iterator<Package, PkgIterator>(), HashIndex(0) {};
}
inline PkgIterator() : Iterator<Package, PkgIterator>(), HashIndex(0) {}
};
/*}}}*/
// Version Iterator /*{{{*/
@ -186,12 +186,12 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
protected:
inline Version* OwnerPointer() const {
return (Owner != 0) ? Owner->VerP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->VerP) S = Owner->VerP + S->NextVer;};
inline void operator ++() {operator ++(0);};
void operator ++(int) {if (S != Owner->VerP) S = Owner->VerP + S->NextVer;}
inline void operator ++() {operator ++(0);}
// Comparison
int CompareVer(const VerIterator &B) const;
@ -201,17 +201,17 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
referring to the same "real" version */
inline bool SimilarVer(const VerIterator &B) const {
return (B.end() == false && S->Hash == B->Hash && strcmp(VerStr(), B.VerStr()) == 0);
};
}
// Accessors
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;}
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}
inline const char *Arch() const {
if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All)
return "all";
return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
};
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
}
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);}
inline DescIterator DescriptionList() const;
DescIterator TranslatedDescription() const;
@ -219,7 +219,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
inline PrvIterator ProvidesList() const;
inline VerFileIterator FileList() const;
bool Downloadable() const;
inline const char *PriorityType() const {return Owner->Priority(S->Priority);};
inline const char *PriorityType() const {return Owner->Priority(S->Priority);}
const char *MultiArchType() const;
std::string RelStr() const;
@ -229,8 +229,8 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Iterator<Version, VerIterator>(Owner, Trg) {
if (S == 0)
S = OwnerPointer();
};
inline VerIterator() : Iterator<Version, VerIterator>() {};
}
inline VerIterator() : Iterator<Version, VerIterator>() {}
};
/*}}}*/
// Description Iterator /*{{{*/
@ -238,26 +238,26 @@ class pkgCache::DescIterator : public Iterator<Description, DescIterator> {
protected:
inline Description* OwnerPointer() const {
return (Owner != 0) ? Owner->DescP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->DescP) S = Owner->DescP + S->NextDesc;};
inline void operator ++() {operator ++(0);};
void operator ++(int) {if (S != Owner->DescP) S = Owner->DescP + S->NextDesc;}
inline void operator ++() {operator ++(0);}
// Comparison
int CompareDesc(const DescIterator &B) const;
// Accessors
inline const char *LanguageCode() const {return Owner->StrP + S->language_code;};
inline const char *md5() const {return Owner->StrP + S->md5sum;};
inline const char *LanguageCode() const {return Owner->StrP + S->language_code;}
inline const char *md5() const {return Owner->StrP + S->md5sum;}
inline DescFileIterator FileList() const;
inline DescIterator() : Iterator<Description, DescIterator>() {};
inline DescIterator() : Iterator<Description, DescIterator>() {}
inline DescIterator(pkgCache &Owner,Description *Trg = 0) : Iterator<Description, DescIterator>(Owner, Trg) {
if (S == 0)
S = Owner.DescP;
};
}
};
/*}}}*/
// Dependency iterator /*{{{*/
@ -267,21 +267,21 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
protected:
inline Dependency* OwnerPointer() const {
return (Owner != 0) ? Owner->DepP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->DepP) S = Owner->DepP +
(Type == DepVer ? S->NextDepends : S->NextRevDepends);};
inline void operator ++() {operator ++(0);};
(Type == DepVer ? S->NextDepends : S->NextRevDepends);}
inline void operator ++() {operator ++(0);}
// Accessors
inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;};
inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->Package);};
inline PkgIterator SmartTargetPkg() const {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;};
inline VerIterator ParentVer() const {return VerIterator(*Owner,Owner->VerP + S->ParentVer);};
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);};
inline bool Reverse() const {return Type == DepRev;};
inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;}
inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->Package);}
inline PkgIterator SmartTargetPkg() const {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;}
inline VerIterator ParentVer() const {return VerIterator(*Owner,Owner->VerP + S->ParentVer);}
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);}
inline bool Reverse() const {return Type == DepRev;}
bool IsCritical() const;
bool IsNegative() const;
bool IsIgnorable(PrvIterator const &Prv) const;
@ -292,8 +292,8 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
void GlobOr(DepIterator &Start,DepIterator &End);
Version **AllTargets() const;
bool SmartTargetPkg(PkgIterator &Result) const;
inline const char *CompType() const {return Owner->CompType(S->CompareOp);};
inline const char *DepType() const {return Owner->DepType(S->Type);};
inline const char *CompType() const {return Owner->CompType(S->CompareOp);}
inline const char *DepType() const {return Owner->DepType(S->Type);}
//Nice printable representation
friend std::ostream& operator <<(std::ostream& out, DepIterator D);
@ -302,13 +302,13 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
Iterator<Dependency, DepIterator>(Owner, Trg), Type(DepVer) {
if (S == 0)
S = Owner.DepP;
};
}
inline DepIterator(pkgCache &Owner, Dependency *Trg, Package*) :
Iterator<Dependency, DepIterator>(Owner, Trg), Type(DepRev) {
if (S == 0)
S = Owner.DepP;
};
inline DepIterator() : Iterator<Dependency, DepIterator>(), Type(DepVer) {};
}
inline DepIterator() : Iterator<Dependency, DepIterator>(), Type(DepVer) {}
};
/*}}}*/
// Provides iterator /*{{{*/
@ -318,34 +318,34 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> {
protected:
inline Provides* OwnerPointer() const {
return (Owner != 0) ? Owner->ProvideP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->ProvideP) S = Owner->ProvideP +
(Type == PrvVer?S->NextPkgProv:S->NextProvides);};
inline void operator ++() {operator ++(0);};
(Type == PrvVer?S->NextPkgProv:S->NextProvides);}
inline void operator ++() {operator ++(0);}
// Accessors
inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;};
inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;};
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);};
inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);};
inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;}
inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;}
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);}
inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);}
inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);}
bool IsMultiArchImplicit() const;
inline PrvIterator() : Iterator<Provides, PrvIterator>(), Type(PrvVer) {};
inline PrvIterator() : Iterator<Provides, PrvIterator>(), Type(PrvVer) {}
inline PrvIterator(pkgCache &Owner, Provides *Trg, Version*) :
Iterator<Provides, PrvIterator>(Owner, Trg), Type(PrvVer) {
if (S == 0)
S = Owner.ProvideP;
};
}
inline PrvIterator(pkgCache &Owner, Provides *Trg, Package*) :
Iterator<Provides, PrvIterator>(Owner, Trg), Type(PrvPkg) {
if (S == 0)
S = Owner.ProvideP;
};
}
};
/*}}}*/
// Package file /*{{{*/
@ -353,32 +353,32 @@ class pkgCache::PkgFileIterator : public Iterator<PackageFile, PkgFileIterator>
protected:
inline PackageFile* OwnerPointer() const {
return (Owner != 0) ? Owner->PkgFileP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;};
inline void operator ++() {operator ++(0);};
void operator ++(int) {if (S != Owner->PkgFileP) S = Owner->PkgFileP + S->NextFile;}
inline void operator ++() {operator ++(0);}
// Accessors
inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;};
inline const char *Archive() const {return S->Archive == 0?0:Owner->StrP + S->Archive;};
inline const char *Component() const {return S->Component == 0?0:Owner->StrP + S->Component;};
inline const char *Version() const {return S->Version == 0?0:Owner->StrP + S->Version;};
inline const char *Origin() const {return S->Origin == 0?0:Owner->StrP + S->Origin;};
inline const char *Codename() const {return S->Codename ==0?0:Owner->StrP + S->Codename;};
inline const char *Label() const {return S->Label == 0?0:Owner->StrP + S->Label;};
inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;};
inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;};
inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;};
inline const char *FileName() const {return S->FileName == 0?0:Owner->StrP + S->FileName;}
inline const char *Archive() const {return S->Archive == 0?0:Owner->StrP + S->Archive;}
inline const char *Component() const {return S->Component == 0?0:Owner->StrP + S->Component;}
inline const char *Version() const {return S->Version == 0?0:Owner->StrP + S->Version;}
inline const char *Origin() const {return S->Origin == 0?0:Owner->StrP + S->Origin;}
inline const char *Codename() const {return S->Codename ==0?0:Owner->StrP + S->Codename;}
inline const char *Label() const {return S->Label == 0?0:Owner->StrP + S->Label;}
inline const char *Site() const {return S->Site == 0?0:Owner->StrP + S->Site;}
inline const char *Architecture() const {return S->Architecture == 0?0:Owner->StrP + S->Architecture;}
inline const char *IndexType() const {return S->IndexType == 0?0:Owner->StrP + S->IndexType;}
bool IsOk();
std::string RelStr();
// Constructors
inline PkgFileIterator() : Iterator<PackageFile, PkgFileIterator>() {};
inline PkgFileIterator(pkgCache &Owner) : Iterator<PackageFile, PkgFileIterator>(Owner, Owner.PkgFileP) {};
inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator<PackageFile, PkgFileIterator>(Owner, Trg) {};
inline PkgFileIterator() : Iterator<PackageFile, PkgFileIterator>() {}
inline PkgFileIterator(pkgCache &Owner) : Iterator<PackageFile, PkgFileIterator>(Owner, Owner.PkgFileP) {}
inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator<PackageFile, PkgFileIterator>(Owner, Trg) {}
};
/*}}}*/
// Version File /*{{{*/
@ -386,18 +386,18 @@ class pkgCache::VerFileIterator : public pkgCache::Iterator<VerFile, VerFileIter
protected:
inline VerFile* OwnerPointer() const {
return (Owner != 0) ? Owner->VerFileP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->VerFileP) S = Owner->VerFileP + S->NextFile;};
inline void operator ++() {operator ++(0);};
void operator ++(int) {if (S != Owner->VerFileP) S = Owner->VerFileP + S->NextFile;}
inline void operator ++() {operator ++(0);}
// Accessors
inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);};
inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);}
inline VerFileIterator() : Iterator<VerFile, VerFileIterator>() {};
inline VerFileIterator(pkgCache &Owner,VerFile *Trg) : Iterator<VerFile, VerFileIterator>(Owner, Trg) {};
inline VerFileIterator() : Iterator<VerFile, VerFileIterator>() {}
inline VerFileIterator(pkgCache &Owner,VerFile *Trg) : Iterator<VerFile, VerFileIterator>(Owner, Trg) {}
};
/*}}}*/
// Description File /*{{{*/
@ -405,40 +405,40 @@ class pkgCache::DescFileIterator : public Iterator<DescFile, DescFileIterator> {
protected:
inline DescFile* OwnerPointer() const {
return (Owner != 0) ? Owner->DescFileP : 0;
};
}
public:
// Iteration
void operator ++(int) {if (S != Owner->DescFileP) S = Owner->DescFileP + S->NextFile;};
inline void operator ++() {operator ++(0);};
void operator ++(int) {if (S != Owner->DescFileP) S = Owner->DescFileP + S->NextFile;}
inline void operator ++() {operator ++(0);}
// Accessors
inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);};
inline PkgFileIterator File() const {return PkgFileIterator(*Owner,S->File + Owner->PkgFileP);}
inline DescFileIterator() : Iterator<DescFile, DescFileIterator>() {};
inline DescFileIterator(pkgCache &Owner,DescFile *Trg) : Iterator<DescFile, DescFileIterator>(Owner, Trg) {};
inline DescFileIterator() : Iterator<DescFile, DescFileIterator>() {}
inline DescFileIterator(pkgCache &Owner,DescFile *Trg) : Iterator<DescFile, DescFileIterator>(Owner, Trg) {}
};
/*}}}*/
// Inlined Begin functions can't be in the class because of order problems /*{{{*/
inline pkgCache::PkgIterator pkgCache::GrpIterator::PackageList() const
{return PkgIterator(*Owner,Owner->PkgP + S->FirstPackage);};
{return PkgIterator(*Owner,Owner->PkgP + S->FirstPackage);}
inline pkgCache::VerIterator pkgCache::PkgIterator::VersionList() const
{return VerIterator(*Owner,Owner->VerP + S->VersionList);};
{return VerIterator(*Owner,Owner->VerP + S->VersionList);}
inline pkgCache::VerIterator pkgCache::PkgIterator::CurrentVer() const
{return VerIterator(*Owner,Owner->VerP + S->CurrentVer);};
{return VerIterator(*Owner,Owner->VerP + S->CurrentVer);}
inline pkgCache::DepIterator pkgCache::PkgIterator::RevDependsList() const
{return DepIterator(*Owner,Owner->DepP + S->RevDepends,S);};
{return DepIterator(*Owner,Owner->DepP + S->RevDepends,S);}
inline pkgCache::PrvIterator pkgCache::PkgIterator::ProvidesList() const
{return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);};
{return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);}
inline pkgCache::DescIterator pkgCache::VerIterator::DescriptionList() const
{return DescIterator(*Owner,Owner->DescP + S->DescriptionList);};
{return DescIterator(*Owner,Owner->DescP + S->DescriptionList);}
inline pkgCache::PrvIterator pkgCache::VerIterator::ProvidesList() const
{return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);};
{return PrvIterator(*Owner,Owner->ProvideP + S->ProvidesList,S);}
inline pkgCache::DepIterator pkgCache::VerIterator::DependsList() const
{return DepIterator(*Owner,Owner->DepP + S->DependsList,S);};
{return DepIterator(*Owner,Owner->DepP + S->DependsList,S);}
inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const
{return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);};
{return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);}
inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const
{return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);};
{return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);}
/*}}}*/
#endif

176
apt-pkg/cacheset.h

@ -43,8 +43,8 @@ class CacheSetHelper { /*{{{*/
public: /*{{{*/
CacheSetHelper(bool const ShowError = true,
GlobalError::MsgType ErrorType = GlobalError::ERROR) :
ShowError(ShowError), ErrorType(ErrorType) {};
virtual ~CacheSetHelper() {};
ShowError(ShowError), ErrorType(ErrorType) {}
virtual ~CacheSetHelper() {}
virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
@ -76,9 +76,9 @@ public: /*{{{*/
virtual pkgCache::VerIterator canNotFindInstalledVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
bool showErrors() const { return ShowError; };
bool showErrors(bool const newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); };
GlobalError::MsgType errorType() const { return ErrorType; };
bool showErrors() const { return ShowError; }
bool showErrors(bool const newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); }
GlobalError::MsgType errorType() const { return ErrorType; }
GlobalError::MsgType errorType(GlobalError::MsgType const &newValue)
{
if (ErrorType == newValue) return ErrorType;
@ -87,7 +87,7 @@ public: /*{{{*/
ErrorType = newValue;
return oldValue;
}
};
}
/*}}}*/
protected:
@ -124,12 +124,12 @@ public:
inline pkgCache::PkgIterator::OkState State() const { return getPkg().State(); }
inline const char *CandVersion() const { return getPkg().CandVersion(); }
inline const char *CurVersion() const { return getPkg().CurVersion(); }
inline pkgCache *Cache() const { return getPkg().Cache(); };
inline unsigned long Index() const {return getPkg().Index();};
inline pkgCache *Cache() const { return getPkg().Cache(); }
inline unsigned long Index() const {return getPkg().Index();}
// we have only valid iterators here
inline bool end() const { return false; };
inline bool end() const { return false; }
inline pkgCache::Package const * operator->() const {return &*getPkg();};
inline pkgCache::Package const * operator->() const {return &*getPkg();}
};
/*}}}*/
@ -154,7 +154,7 @@ public:
unsigned short ID;
const char * const Alias;
Position Pos;
Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {};
Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}
};
static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
@ -177,12 +177,12 @@ public: /*{{{*/
public:
const_iterator(typename Container::const_iterator i) : _iter(i) {}
pkgCache::PkgIterator getPkg(void) const { return *_iter; }
inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
operator typename Container::const_iterator(void) const { return _iter; }
inline const_iterator& operator++() { ++_iter; return *this; }
inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; };
inline bool operator==(const_iterator const &i) const { return _iter == i._iter; };
inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; }
inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }
friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); }
};
class iterator : public PackageContainerInterface::const_iterator,
@ -191,43 +191,43 @@ public: /*{{{*/
public:
iterator(typename Container::iterator i) : _iter(i) {}
pkgCache::PkgIterator getPkg(void) const { return *_iter; }
inline pkgCache::PkgIterator operator*(void) const { return *_iter; };
inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
operator typename Container::iterator(void) const { return _iter; }
operator typename PackageContainer<Container>::const_iterator() { return typename PackageContainer<Container>::const_iterator(_iter); }
inline iterator& operator++() { ++_iter; return *this; }
inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
inline bool operator==(iterator const &i) const { return _iter == i._iter; };
inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; };
inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; };
inline bool operator!=(iterator const &i) const { return _iter != i._iter; }
inline bool operator==(iterator const &i) const { return _iter == i._iter; }
inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; }
inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; }
friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); }
};
/*}}}*/
bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; };
template<class Cont> void insert(PackageContainer<Cont> const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); };
void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); };
bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; }
template<class Cont> void insert(PackageContainer<Cont> const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); }
void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }
bool empty() const { return _cont.empty(); };
void clear() { return _cont.clear(); };
bool empty() const { return _cont.empty(); }
void clear() { return _cont.clear(); }
//FIXME: on ABI break, replace the first with the second without bool
void erase(iterator position) { _cont.erase((typename Container::iterator)position); };
iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); };
size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); };
void erase(iterator first, iterator last) { _cont.erase(first, last); };
size_t size() const { return _cont.size(); };
void erase(iterator position) { _cont.erase((typename Container::iterator)position); }
iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); }
size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }
void erase(iterator first, iterator last) { _cont.erase(first, last); }
size_t size() const { return _cont.size(); }
const_iterator begin() const { return const_iterator(_cont.begin()); };
const_iterator end() const { return const_iterator(_cont.end()); };
iterator begin() { return iterator(_cont.begin()); };
iterator end() { return iterator(_cont.end()); };
const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); };
const_iterator begin() const { return const_iterator(_cont.begin()); }
const_iterator end() const { return const_iterator(_cont.end()); }
iterator begin() { return iterator(_cont.begin()); }
iterator end() { return iterator(_cont.end()); }
const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
void setConstructor(Constructor const &by) { ConstructedBy = by; };
Constructor getConstructor() const { return ConstructedBy; };
void setConstructor(Constructor const &by) { ConstructedBy = by; }
Constructor getConstructor() const { return ConstructedBy; }
PackageContainer() : ConstructedBy(UNKNOWN) {};
PackageContainer(Constructor const &by) : ConstructedBy(by) {};
PackageContainer() : ConstructedBy(UNKNOWN) {}
PackageContainer(Constructor const &by) : ConstructedBy(by) {}
/** \brief returns all packages in the cache who belong to the given task
@ -365,7 +365,7 @@ private: /*{{{*/
template<> template<class Cont> void PackageContainer<std::list<pkgCache::PkgIterator> >::insert(PackageContainer<Cont> const &pkgcont) {
for (typename PackageContainer<Cont>::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p)
_cont.push_back(*p);
};
}
// these two are 'inline' as otherwise the linker has problems with seeing these untemplated
// specializations again and again - but we need to see them, so that library users can use them
template<> inline bool PackageContainer<std::list<pkgCache::PkgIterator> >::insert(pkgCache::PkgIterator const &P) {
@ -373,11 +373,11 @@ template<> inline bool PackageContainer<std::list<pkgCache::PkgIterator> >::inse
return false;
_cont.push_back(P);
return true;
};
}
template<> inline void PackageContainer<std::list<pkgCache::PkgIterator> >::insert(const_iterator begin, const_iterator end) {
for (const_iterator p = begin; p != end; ++p)
_cont.push_back(*p);
};
}
typedef PackageContainer<std::set<pkgCache::PkgIterator> > PackageSet;
typedef PackageContainer<std::list<pkgCache::PkgIterator> > PackageList;
@ -392,27 +392,27 @@ public:
virtual pkgCache::VerIterator getVer() const = 0;
operator pkgCache::VerIterator(void) { return getVer(); }
inline pkgCache *Cache() const { return getVer().Cache(); };
inline unsigned long Index() const {return getVer().Index();};
inline int CompareVer(const pkgCache::VerIterator &B) const { return getVer().CompareVer(B); };
inline const char *VerStr() const { return getVer().VerStr(); };
inline const char *Section() const { return getVer().Section(); };
inline const char *Arch() const { return getVer().Arch(); };
inline pkgCache::PkgIterator ParentPkg() const { return getVer().ParentPkg(); };
inline pkgCache::DescIterator DescriptionList() const { return getVer().DescriptionList(); };
inline pkgCache::DescIterator TranslatedDescription() const { return getVer().TranslatedDescription(); };
inline pkgCache::DepIterator DependsList() const { return getVer().DependsList(); };
inline pkgCache::PrvIterator ProvidesList() const { return getVer().ProvidesList(); };
inline pkgCache::VerFileIterator FileList() const { return getVer().FileList(); };
inline bool Downloadable() const { return getVer().Downloadable(); };
inline const char *PriorityType() const { return getVer().PriorityType(); };
inline std::string RelStr() const { return getVer().RelStr(); };
inline bool Automatic() const { return getVer().Automatic(); };
inline pkgCache::VerFileIterator NewestFile() const { return getVer().NewestFile(); };
inline pkgCache *Cache() const { return getVer().Cache(); }
inline unsigned long Index() const {return getVer().Index();}
inline int CompareVer(const pkgCache::VerIterator &B) const { return getVer().CompareVer(B); }
inline const char *VerStr() const { return getVer().VerStr(); }
inline const char *Section() const { return getVer().Section(); }
inline const char *Arch() const { return getVer().Arch(); }
inline pkgCache::PkgIterator ParentPkg() const { return getVer().ParentPkg(); }
inline pkgCache::DescIterator DescriptionList() const { return getVer().DescriptionList(); }
inline pkgCache::DescIterator TranslatedDescription() const { return getVer().TranslatedDescription(); }
inline pkgCache::DepIterator DependsList() const { return getVer().DependsList(); }
inline pkgCache::PrvIterator ProvidesList() const { return getVer().ProvidesList(); }
inline pkgCache::VerFileIterator FileList() const { return getVer().FileList(); }
inline bool Downloadable() const { return getVer().Downloadable(); }
inline const char *PriorityType() const { return getVer().PriorityType(); }
inline std::string RelStr() const { return getVer().RelStr(); }
inline bool Automatic() const { return getVer().Automatic(); }
inline pkgCache::VerFileIterator NewestFile() const { return getVer().NewestFile(); }
// we have only valid iterators here
inline bool end() const { return false; };
inline bool end() const { return false; }
inline pkgCache::Version const * operator->() const { return &*getVer(); };
inline pkgCache::Version const * operator->() const { return &*getVer(); }
};
/*}}}*/
@ -446,7 +446,7 @@ public:
Version SelectVersion;
Modifier (unsigned short const &id, const char * const alias, Position const &pos,
Version const &select) : ID(id), Alias(alias), Pos(pos),
SelectVersion(select) {};
SelectVersion(select) {}
};
static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache,
@ -509,12 +509,12 @@ public: /*{{{*/
public:
const_iterator(typename Container::const_iterator i) : _iter(i) {}
pkgCache::VerIterator getVer(void) const { return *_iter; }
inline pkgCache::VerIterator operator*(void) const { return *_iter; };
inline pkgCache::VerIterator operator*(void) const { return *_iter; }
operator typename Container::const_iterator(void) const { return _iter; }
inline const_iterator& operator++() { ++_iter; return *this; }
inline const_iterator operator++(int) { const_iterator tmp(*this); operator++(); return tmp; }
inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; };
inline bool operator==(const_iterator const &i) const { return _iter == i._iter; };
inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; }
inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }
friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); }
};
class iterator : public VersionContainerInterface::const_iterator,
@ -523,36 +523,36 @@ public: /*{{{*/
public:
iterator(typename Container::iterator i) : _iter(i) {}
pkgCache::VerIterator getVer(void) const { return *_iter; }
inline pkgCache::VerIterator operator*(void) const { return *_iter; };
inline pkgCache::VerIterator operator*(void) const { return *_iter; }
operator typename Container::iterator(void) const { return _iter; }
operator typename VersionContainer<Container>::const_iterator() { return typename VersionContainer<Container>::const_iterator(_iter); }
inline iterator& operator++() { ++_iter; return *this; }
inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; }
inline bool operator!=(iterator const &i) const { return _iter != i._iter; };
inline bool operator==(iterator const &i) const { return _iter == i._iter; };
inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; };
inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; };
inline bool operator!=(iterator const &i) const { return _iter != i._iter; }
inline bool operator==(iterator const &i) const { return _iter == i._iter; }
inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; }
inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; }
friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); }
};
/*}}}*/
bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; };
template<class Cont> void insert(VersionContainer<Cont> const &vercont) { _cont.insert((typename Cont::const_iterator)vercont.begin(), (typename Cont::const_iterator)vercont.end()); };
void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); };
bool empty() const { return _cont.empty(); };
void clear() { return _cont.clear(); };
bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; }
template<class Cont> void insert(VersionContainer<Cont> const &vercont) { _cont.insert((typename Cont::const_iterator)vercont.begin(), (typename Cont::const_iterator)vercont.end()); }
void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }
bool empty() const { return _cont.empty(); }
void clear() { return _cont.clear(); }
//FIXME: on ABI break, replace the first with the second without bool
void erase(iterator position) { _cont.erase((typename Container::iterator)position); };
iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); };
size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); };
void erase(iterator first, iterator last) { _cont.erase(first, last); };
size_t size() const { return _cont.size(); };
const_iterator begin() const { return const_iterator(_cont.begin()); };
const_iterator end() const { return const_iterator(_cont.end()); };
iterator begin() { return iterator(_cont.begin()); };
iterator end() { return iterator(_cont.end()); };
const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); };
void erase(iterator position) { _cont.erase((typename Container::iterator)position); }
iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); }
size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); }
void erase(iterator first, iterator last) { _cont.erase(first, last); }
size_t size() const { return _cont.size(); }
const_iterator begin() const { return const_iterator(_cont.begin()); }
const_iterator end() const { return const_iterator(_cont.end()); }
iterator begin() { return iterator(_cont.begin()); }
iterator end() { return iterator(_cont.end()); }
const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); }
/** \brief returns all versions specified on the commandline
@ -659,7 +659,7 @@ public: /*{{{*/
template<> template<class Cont> void VersionContainer<std::list<pkgCache::VerIterator> >::insert(VersionContainer<Cont> const &vercont) {
for (typename VersionContainer<Cont>::const_iterator v = vercont.begin(); v != vercont.end(); ++v)
_cont.push_back(*v);
};
}
// these two are 'inline' as otherwise the linker has problems with seeing these untemplated
// specializations again and again - but we need to see them, so that library users can use them
template<> inline bool VersionContainer<std::list<pkgCache::VerIterator> >::insert(pkgCache::VerIterator const &V) {
@ -667,11 +667,11 @@ template<> inline bool VersionContainer<std::list<pkgCache::VerIterator> >::inse
return false;
_cont.push_back(V);
return true;
};
}
template<> inline void VersionContainer<std::list<pkgCache::VerIterator> >::insert(const_iterator begin, const_iterator end) {
for (const_iterator v = begin; v != end; ++v)
_cont.push_back(*v);
};
}
typedef VersionContainer<std::set<pkgCache::VerIterator> > VersionSet;
typedef VersionContainer<std::list<pkgCache::VerIterator> > VersionList;
}

6
apt-pkg/cdrom.cc

@ -933,10 +933,10 @@ pkgUdevCdromDevices::Dlopen() /*{{{*/
// convenience interface, this will just call ScanForRemovable
vector<CdromDevice>
pkgUdevCdromDevices::Scan()
{
{
bool CdromOnly = _config->FindB("APT::cdrom::CdromOnly", true);
return ScanForRemovable(CdromOnly);
};
return ScanForRemovable(CdromOnly);
}
/*}}}*/
/*{{{*/
vector<CdromDevice>

3
apt-pkg/contrib/configuration.cc

@ -43,8 +43,7 @@ Configuration::Configuration() : ToFree(true)
}
Configuration::Configuration(const Item *Root) : Root((Item *)Root), ToFree(false)
{
};
}
/*}}}*/
// Configuration::~Configuration - Destructor /*{{{*/
// ---------------------------------------------------------------------

2
apt-pkg/contrib/error.cc

@ -223,7 +223,7 @@ void GlobalError::DumpErrors(std::ostream &out, MsgType const &threshold,
void GlobalError::Discard() {
Messages.clear();
PendingFlag = false;
};
}
/*}}}*/
// GlobalError::empty - does our error list include anything? /*{{{*/
bool GlobalError::empty(MsgType const &trashhold) const {

2
apt-pkg/contrib/gpgv.h

@ -45,7 +45,7 @@ inline void ExecGPGV(std::string const &File, std::string const &FileSig,
int const &statusfd = -1) {
int fd[2];
ExecGPGV(File, FileSig, statusfd, fd);
};
}
#undef APT_noreturn

12
apt-pkg/contrib/progress.cc

@ -125,14 +125,14 @@ bool OpProgress::CheckChange(float Interval)
// OpTextProgress::OpTextProgress - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
OpTextProgress::OpTextProgress(Configuration &Config) :
NoUpdate(false), NoDisplay(false), LastLen(0)
OpTextProgress::OpTextProgress(Configuration &Config) :
NoUpdate(false), NoDisplay(false), LastLen(0)
{
if (Config.FindI("quiet",0) >= 1 || Config.FindB("quiet::NoUpdate", false) == true)
NoUpdate = true;
if (Config.FindI("quiet",0) >= 2)