diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-07-09 00:35:40 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-10 17:27:17 +0200 |
commit | 3b3028467ceccca0b73a8f53051c0fa4de313111 (patch) | |
tree | ff51789a82630e3fb61a25f8b7c970854b753dc9 /apt-private | |
parent | 2893325927f6e4d55dc4bd148093351d4f8300f9 (diff) |
add c++11 override marker to overridden methods
C++11 adds the 'override' specifier to mark that a method is overriding
a base class method and error out if not. We hide it in the APT_OVERRIDE
macro to ensure that we keep compiling in pre-c++11 standards.
Reported-By: clang-modernize -add-override -override-macros
Git-Dch: Ignore
Diffstat (limited to 'apt-private')
-rw-r--r-- | apt-private/acqprogress.h | 18 | ||||
-rw-r--r-- | apt-private/private-cacheset.h | 16 | ||||
-rw-r--r-- | apt-private/private-moo.h | 2 |
3 files changed, 19 insertions, 17 deletions
diff --git a/apt-private/acqprogress.h b/apt-private/acqprogress.h index cbb06fbec..6b6d555b1 100644 --- a/apt-private/acqprogress.h +++ b/apt-private/acqprogress.h @@ -28,15 +28,15 @@ class APT_PUBLIC AcqTextStatus : public pkgAcquireStatus public: - virtual bool MediaChange(std::string Media,std::string Drive); - virtual void IMSHit(pkgAcquire::ItemDesc &Itm); - virtual void Fetch(pkgAcquire::ItemDesc &Itm); - virtual void Done(pkgAcquire::ItemDesc &Itm); - virtual void Fail(pkgAcquire::ItemDesc &Itm); - virtual void Start(); - virtual void Stop(); - - bool Pulse(pkgAcquire *Owner); + virtual bool MediaChange(std::string Media,std::string Drive) APT_OVERRIDE; + virtual void IMSHit(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Fetch(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Done(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Fail(pkgAcquire::ItemDesc &Itm) APT_OVERRIDE; + virtual void Start() APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; + + bool Pulse(pkgAcquire *Owner) APT_OVERRIDE; AcqTextStatus(std::ostream &out, unsigned int &ScreenWidth,unsigned int const Quiet); }; diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h index 0eb22b788..518f179f3 100644 --- a/apt-private/private-cacheset.h +++ b/apt-private/private-cacheset.h @@ -81,13 +81,13 @@ class CacheSetHelperVirtuals: public APT::CacheSetHelper { public: APT::PackageSet virtualPkgs; - virtual pkgCache::VerIterator canNotGetVersion(enum CacheSetHelper::VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual pkgCache::VerIterator canNotGetVersion(enum CacheSetHelper::VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { if (select == NEWEST || select == CANDIDATE || select == ALL) virtualPkgs.insert(Pkg); return CacheSetHelper::canNotGetVersion(select, Cache, Pkg); } - virtual void canNotFindVersion(enum CacheSetHelper::VerSelector const select, APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual void canNotFindVersion(enum CacheSetHelper::VerSelector const select, APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { if (select == NEWEST || select == CANDIDATE || select == ALL) virtualPkgs.insert(Pkg); return CacheSetHelper::canNotFindVersion(select, vci, Cache, Pkg); @@ -113,23 +113,23 @@ public: explicitlyNamed = true; } - virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } - virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + virtual void showFnmatchSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { ioprintf(out, _("Note, selecting '%s' for glob '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } - virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) { + virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, std::string const &pattern) APT_OVERRIDE { ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } virtual void showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/, pkgCache::VerIterator const Ver, - std::string const &ver, bool const /*verIsRel*/) { + std::string const &ver, bool const /*verIsRel*/) APT_OVERRIDE { if (ver == Ver.VerStr()) return; selectedByRelease.push_back(make_pair(Ver, ver)); @@ -191,7 +191,7 @@ public: return false; } - virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE); if (verset.empty() == false) return *(verset.begin()); @@ -202,7 +202,7 @@ public: return pkgCache::VerIterator(Cache, 0); } - virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) APT_OVERRIDE { if (Pkg->ProvidesList != 0) { APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::NEWEST); diff --git a/apt-private/private-moo.h b/apt-private/private-moo.h index b8e1cfed6..bc8b3e7dd 100644 --- a/apt-private/private-moo.h +++ b/apt-private/private-moo.h @@ -1,6 +1,8 @@ #ifndef APT_PRIVATE_MOO_H #define APT_PRIVATE_MOO_H +#include <apt-pkg/macros.h> + class CommandLine; APT_PUBLIC bool DoMoo(CommandLine &CmdL); |