summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2018-07-31 03:53:59 +0200
committerGuillem Jover <guillem@debian.org>2018-08-01 06:00:39 +0200
commitc0c457246d25e7c64f65d1b37f976b7e804b10ab (patch)
treeaf766dec7ccbd3cfe258448f0d838129d2c3900f
parent3d4be1a816d1d3b9c3068d9c3008e0ee093034f3 (diff)
downloaddpkg-c0c457246d25e7c64f65d1b37f976b7e804b10ab.tar.gz
dselect: Use override attribute for virtual methods in derived classes
C++11 makes it possible to use these attributes so that errors can be avoided, by helping the compiler know when we mean methods to override the ones from the parent class. Warned-by: cppcheck
-rw-r--r--dselect/method.h18
-rw-r--r--dselect/pkglist.h20
-rw-r--r--scripts/t/Dpkg_Shlibs/patterns.cpp2
3 files changed, 20 insertions, 20 deletions
diff --git a/dselect/method.h b/dselect/method.h
index c21e5da0e..f9593ec27 100644
--- a/dselect/method.h
+++ b/dselect/method.h
@@ -62,15 +62,15 @@ protected:
void itd_description();
// Define these virtuals
- void redraw1itemsel(int index, int selected);
- void redrawcolheads();
- void redrawthisstate();
- void redrawinfo();
- void redrawtitle();
- void setwidths();
- void setheights();
- const char *itemname(int index);
- const struct helpmenuentry *helpmenulist();
+ void redraw1itemsel(int index, int selected) override;
+ void redrawcolheads() override;
+ void redrawthisstate() override;
+ void redrawinfo() override;
+ void redrawtitle() override;
+ void setwidths() override;
+ void setheights() override;
+ const char *itemname(int index) override;
+ const struct helpmenuentry *helpmenulist() override;
public:
// Keybinding functions */
diff --git a/dselect/pkglist.h b/dselect/pkglist.h
index 077cabb88..f60a93169 100644
--- a/dselect/pkglist.h
+++ b/dselect/pkglist.h
@@ -149,16 +149,16 @@ protected:
int deselect_one_of(pkginfo *er, pkginfo *ed, dependency *dep);
// Define these virtuals
- bool checksearch(char *str);
- bool matchsearch(int index);
- void redraw1itemsel(int index, int selected);
- void redrawcolheads();
- void redrawthisstate();
- void redrawinfo();
- void redrawtitle();
- void setwidths();
- const char *itemname(int index);
- const struct helpmenuentry *helpmenulist();
+ bool checksearch(char *str) override;
+ bool matchsearch(int index) override;
+ void redraw1itemsel(int index, int selected) override;
+ void redrawcolheads() override;
+ void redrawthisstate() override;
+ void redrawinfo() override;
+ void redrawtitle() override;
+ void setwidths() override;
+ const char *itemname(int index) override;
+ const struct helpmenuentry *helpmenulist() override;
// Miscellaneous internal routines
diff --git a/scripts/t/Dpkg_Shlibs/patterns.cpp b/scripts/t/Dpkg_Shlibs/patterns.cpp
index 3beee43e0..8bfcb4dad 100644
--- a/scripts/t/Dpkg_Shlibs/patterns.cpp
+++ b/scripts/t/Dpkg_Shlibs/patterns.cpp
@@ -75,7 +75,7 @@ namespace NSB
public:
ClassD();
virtual ~ClassD();
- virtual void generate_vt(const char *) const;
+ virtual void generate_vt(const char *) const override;
};
EXPORT(ClassD::ClassD());