From c3587c0d9de852eca11d9bbc004095d54115eda4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 24 Feb 2020 17:08:34 +0100 Subject: Replace map_pointer_t with map_pointer This is a first step to a type safe cache, adding typing information everywhere. Next, we'll replace map_pointer implementation with a type safe one. --- apt-private/private-cachefile.cc | 4 ++-- apt-private/private-cachefile.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'apt-private') diff --git a/apt-private/private-cachefile.cc b/apt-private/private-cachefile.cc index ab25338ff..4becc147e 100644 --- a/apt-private/private-cachefile.cc +++ b/apt-private/private-cachefile.cc @@ -22,7 +22,7 @@ using namespace std; static bool SortPackagesByName(pkgCache * const Owner, - map_pointer_t const A, map_pointer_t const B) + map_pointer const A, map_pointer const B) { if (A == 0) return false; @@ -42,7 +42,7 @@ void SortedPackageUniverse::LazyInit() const return; pkgCache * const Owner = data(); // In Multi-Arch systems Grps are easier to sort than Pkgs - std::vector GrpList; + std::vector> GrpList; List.reserve(Owner->Head().GroupCount); for (pkgCache::GrpIterator I{Owner->GrpBegin()}; I.end() != true; ++I) GrpList.emplace_back(I - Owner->GrpP); diff --git a/apt-private/private-cachefile.h b/apt-private/private-cachefile.h index 5086ceaeb..ccd47107b 100644 --- a/apt-private/private-cachefile.h +++ b/apt-private/private-cachefile.h @@ -13,7 +13,7 @@ class APT_PUBLIC CacheFile : public pkgCacheFile { public: - std::vector UniverseList; + std::vector> UniverseList; bool CheckDeps(bool AllowBroken = false); bool BuildCaches(bool WithLock = true) @@ -40,13 +40,13 @@ class APT_PUBLIC CacheFile : public pkgCacheFile class SortedPackageUniverse : public APT::PackageUniverse { - std::vector &List; + std::vector> &List; void LazyInit() const; public: explicit SortedPackageUniverse(CacheFile &Cache); - class const_iterator : public APT::Container_iterator_base::const_iterator, pkgCache::PkgIterator> + class const_iterator : public APT::Container_iterator_base>::const_iterator, pkgCache::PkgIterator> { pkgCache * const Cache; public: @@ -55,8 +55,8 @@ public: if (*_iter == 0) return pkgCache::PkgIterator(*Cache); return pkgCache::PkgIterator(*Cache, Cache->PkgP + *_iter); } - explicit const_iterator(pkgCache * const Owner, std::vector::const_iterator i): - Container_iterator_base::const_iterator, pkgCache::PkgIterator>(i), Cache(Owner) {} + explicit const_iterator(pkgCache * const Owner, std::vector>::const_iterator i): + Container_iterator_base>::const_iterator, pkgCache::PkgIterator>(i), Cache(Owner) {} }; typedef const_iterator iterator; -- cgit v1.2.3-70-g09d2