summaryrefslogtreecommitdiff
path: root/apt-pkg/edsp
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-02-24 17:46:10 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-02-24 18:29:07 +0100
commit4fad7262291a8af1415fb9a3693678bd9610f0d6 (patch)
tree39226545753b5f0910547747fb5c691398c7341a /apt-pkg/edsp
parent1f4e2ab7462f5e05e452fb8505185895d91651c2 (diff)
Make map_pointer<T> typesafe
Instead of just using uint32_t, which would allow you to assign e.g. a map_pointer<Version> to a map_pointer<Package>, use our own smarter struct that has strict type checking. We allow creating a map_pointer from a nullptr, and we allow comparing map_pointer to nullptr, which also deals with comparisons against 0 which are often used, as 0 will be implictly converted to nullptr.
Diffstat (limited to 'apt-pkg/edsp')
-rw-r--r--apt-pkg/edsp/edsplistparser.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc
index 45abdbc61..34b9ec934 100644
--- a/apt-pkg/edsp/edsplistparser.cc
+++ b/apt-pkg/edsp/edsplistparser.cc
@@ -87,7 +87,7 @@ bool edspListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
if (state != 0)
{
Pkg->CurrentState = pkgCache::State::Installed;
- Pkg->CurrentVer = Ver.Index();
+ Pkg->CurrentVer = Ver.MapPointer();
}
if (Section.FindB("APT-Automatic", false))
@@ -162,7 +162,7 @@ bool eippListParser::ParseStatus(pkgCache::PkgIterator &Pkg,
case pkgCache::State::TriggersAwaited:
case pkgCache::State::TriggersPending:
case pkgCache::State::Installed:
- Pkg->CurrentVer = Ver.Index();
+ Pkg->CurrentVer = Ver.MapPointer();
break;
}
break;