From 3b3028467ceccca0b73a8f53051c0fa4de313111 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 9 Jul 2015 00:35:40 +0200 Subject: 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 --- cmdline/apt-cdrom.cc | 8 ++++---- cmdline/apt-extracttemplates.h | 4 ++-- cmdline/apt-get.cc | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index d95c169cd..c0541d196 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -44,12 +44,12 @@ protected: OpTextProgress Progress; void Prompt(const char *Text); string PromptLine(const char *Text); - bool AskCdromName(string &name); + bool AskCdromName(string &name) APT_OVERRIDE; public: - virtual void Update(string text, int current); - virtual bool ChangeCdrom(); - virtual OpProgress* GetOpProgress(); + virtual void Update(string text, int current) APT_OVERRIDE; + virtual bool ChangeCdrom() APT_OVERRIDE; + virtual OpProgress* GetOpProgress() APT_OVERRIDE; }; void pkgCdromTextStatus::Prompt(const char *Text) diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h index b129a2d51..91e385e70 100644 --- a/cmdline/apt-extracttemplates.h +++ b/cmdline/apt-extracttemplates.h @@ -26,9 +26,9 @@ class DebFile : public pkgDirStream public: explicit DebFile(const char *FileName); ~DebFile(); - bool DoItem(Item &I, int &fd); + bool DoItem(Item &I, int &fd) APT_OVERRIDE; bool Process(pkgDirStream::Item &I, const unsigned char *data, - unsigned long long size, unsigned long long pos); + unsigned long long size, unsigned long long pos) APT_OVERRIDE; bool Go(); bool ParseInfo(); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 10d4b3cc5..9232e1505 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -572,7 +572,7 @@ static bool DoClean(CommandLine &) class LogCleaner : public pkgArchiveCleaner { protected: - virtual void Erase(const char *File,string Pkg,string Ver,struct stat &St) + virtual void Erase(const char *File,string Pkg,string Ver,struct stat &St) APT_OVERRIDE { c1out << "Del " << Pkg << " " << Ver << " [" << SizeToStr(St.st_size) << "B]" << endl; -- cgit v1.2.3