From 82b881caafa0c82b20db3900f8b76cebd8a393a4 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 12 Jun 2019 13:47:46 +0200 Subject: Adjust code for missing includes/using std::string --- apt-pkg/metaindex.cc | 10 +++++----- apt-pkg/statechanges.cc | 2 ++ apt-private/private-json-hooks.cc | 4 +++- ftparchive/sources.cc | 1 + test/libapt/extracttar_test.cc | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 8cbdb5e01..d0b3f5165 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -83,7 +83,7 @@ APT_PURE time_t metaIndex::GetDate() const { return this->Date; } APT_PURE metaIndex::TriState metaIndex::GetLoadedSuccessfully() const { return LoadedSuccessfully; } APT_PURE std::string metaIndex::GetExpectedDist() const { return Dist; } /*}}}*/ -bool metaIndex::CheckDist(string const &MaybeDist) const /*{{{*/ +bool metaIndex::CheckDist(std::string const &MaybeDist) const /*{{{*/ { if (MaybeDist.empty() || this->Codename == MaybeDist || this->Suite == MaybeDist) return true; @@ -93,7 +93,7 @@ bool metaIndex::CheckDist(string const &MaybeDist) const /*{{{*/ Transformed = "experimental"; auto const pos = Transformed.rfind('/'); - if (pos != string::npos) + if (pos != std::string::npos) Transformed = Transformed.substr(0, pos); if (Transformed == ".") @@ -102,7 +102,7 @@ bool metaIndex::CheckDist(string const &MaybeDist) const /*{{{*/ return Transformed.empty() || this->Codename == Transformed || this->Suite == Transformed; } /*}}}*/ -APT_PURE metaIndex::checkSum *metaIndex::Lookup(string const &MetaKey) const /*{{{*/ +APT_PURE metaIndex::checkSum *metaIndex::Lookup(std::string const &MetaKey) const /*{{{*/ { std::map::const_iterator sum = Entries.find(MetaKey); if (sum == Entries.end()) @@ -110,7 +110,7 @@ APT_PURE metaIndex::checkSum *metaIndex::Lookup(string const &MetaKey) const /*{ return sum->second; } /*}}}*/ -APT_PURE bool metaIndex::Exists(string const &MetaKey) const /*{{{*/ +APT_PURE bool metaIndex::Exists(std::string const &MetaKey) const /*{{{*/ { return Entries.find(MetaKey) != Entries.end(); } @@ -118,7 +118,7 @@ APT_PURE bool metaIndex::Exists(string const &MetaKey) const /*{{{*/ std::vector metaIndex::MetaKeys() const /*{{{*/ { std::vector keys; - std::map::const_iterator I = Entries.begin(); + std::map::const_iterator I = Entries.begin(); while(I != Entries.end()) { keys.push_back((*I).first); ++I; diff --git a/apt-pkg/statechanges.cc b/apt-pkg/statechanges.cc index 258c84885..45468e462 100644 --- a/apt-pkg/statechanges.cc +++ b/apt-pkg/statechanges.cc @@ -1,9 +1,11 @@ #include +#include #include #include #include #include #include +#include #include #include diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc index 3e0d8c93b..480c4f732 100644 --- a/apt-private/private-json-hooks.cc +++ b/apt-private/private-json-hooks.cc @@ -7,7 +7,9 @@ */ #include +#include #include +#include #include #include @@ -356,7 +358,7 @@ bool RunJsonHook(std::string const &option, std::string const &method, const cha SetCloseExec(STDIN_FILENO, false); SetCloseExec(STDERR_FILENO, false); - string hookfd; + std::string hookfd; strprintf(hookfd, "%d", InfoFD); setenv("APT_HOOK_SOCKET", hookfd.c_str(), 1); diff --git a/ftparchive/sources.cc b/ftparchive/sources.cc index 60a86171f..ee6efda05 100644 --- a/ftparchive/sources.cc +++ b/ftparchive/sources.cc @@ -5,6 +5,7 @@ #include #include +#include #include #include "sources.h" diff --git a/test/libapt/extracttar_test.cc b/test/libapt/extracttar_test.cc index 30934144a..67e0461c2 100644 --- a/test/libapt/extracttar_test.cc +++ b/test/libapt/extracttar_test.cc @@ -1,4 +1,5 @@ #include +#include #include #include #include -- cgit v1.2.3