X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d77559acad5da864e764aef8aed08046e4d38ed4..2853201580944cb4e5a2a8a810e800e89e9a0475:/apt-inst/filelist.cc diff --git a/apt-inst/filelist.cc b/apt-inst/filelist.cc index ee8cbbf73..a55416d6b 100644 --- a/apt-inst/filelist.cc +++ b/apt-inst/filelist.cc @@ -1,18 +1,18 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: filelist.cc,v 1.5 2004/01/07 20:39:37 mdz Exp $ +// $Id: filelist.cc,v 1.4.2.1 2004/01/16 18:58:50 mdz Exp $ /* ###################################################################### File Listing - Manages a Cache of File -> Package names. - Diversions add some signficant complexity to the system. To keep + Diversions add some significant complexity to the system. To keep storage space down in the very special case of a diverted file no extra bytes are allocated in the Node structure. Instead a diversion is inserted directly into the hash table and its flag bit set. Every lookup for that filename will always return the diversion. The hash buckets are stored in sorted form, with diversions having - the higest sort order. Identical files are assigned the same file + the highest sort order. Identical files are assigned the same file pointer, thus after a search all of the nodes owning that file can be found by iterating down the bucket. @@ -32,17 +32,13 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#ifdef __GNUG__ -#pragma implementation "apt-pkg/filelist.h" -#endif +#include #include #include #include #include -#include -#include #include #include #include @@ -89,7 +85,7 @@ pkgFLCache::Header::Header() // FLCache::Header::CheckSizes - Check if the two headers have same *sz /*{{{*/ // --------------------------------------------------------------------- /* Compare to make sure we are matching versions */ -bool pkgFLCache::Header::CheckSizes(Header &Against) const +APT_PURE bool pkgFLCache::Header::CheckSizes(Header &Against) const { if (HeaderSz == Against.HeaderSz && NodeSz == Against.NodeSz && @@ -357,7 +353,7 @@ pkgFLCache::NodeIterator pkgFLCache::GetNode(const char *Name, // --------------------------------------------------------------------- /* This is one of two hashing functions. The other is inlined into the GetNode routine. */ -pkgFLCache::Node *pkgFLCache::HashNode(NodeIterator const &Nde) +APT_PURE pkgFLCache::Node *pkgFLCache::HashNode(NodeIterator const &Nde) { // Hash the node unsigned long HashPos = 0; @@ -465,14 +461,14 @@ bool pkgFLCache::AddDiversion(PkgIterator const &Owner, // Should never happen if ((FromN->Flags & Node::Diversion) != Node::Diversion || (ToN->Flags & Node::Diversion) != Node::Diversion) - return _error->Error(_("Internal Error in AddDiversion")); + return _error->Error(_("Internal error in AddDiversion")); // Now, try to reclaim an existing diversion.. map_ptrloc Diver = 0; if (FromN->Pointer != 0) Diver = FromN->Pointer; - /* Make sure from and to point to the same diversion, if they dont + /* Make sure from and to point to the same diversion, if they don't then we are trying to intermix diversions - very bad */ if (ToN->Pointer != 0 && ToN->Pointer != Diver) { @@ -574,7 +570,7 @@ bool pkgFLCache::AddConfFile(const char *Name,const char *NameEnd, // --------------------------------------------------------------------- /* Since the package pointer is indirected in all sorts of interesting ways this is used to get a pointer to the owning package */ -pkgFLCache::Package *pkgFLCache::NodeIterator::RealPackage() const +APT_PURE pkgFLCache::Package *pkgFLCache::NodeIterator::RealPackage() const { if (Nde->Pointer == 0) return 0;