Tue, 09 Jul 2013 02:57:11 +0300
apply the c++11 'override' keyword to overriding virtual functions
src/config.h | file | annotate | diff | comparison | revisions | |
src/configDialog.h | file | annotate | diff | comparison | revisions | |
src/history.h | file | annotate | diff | comparison | revisions | |
src/ldtypes.h | file | annotate | diff | comparison | revisions |
--- a/src/config.h Mon Jul 08 02:46:55 2013 +0300 +++ b/src/config.h Tue Jul 09 02:57:11 2013 +0300 @@ -132,7 +132,7 @@ { \ return value; \ } \ - config::Type getType() const \ + config::Type getType() const override \ { \ return config::Type_##T; \ } \
--- a/src/configDialog.h Mon Jul 08 02:46:55 2013 +0300 +++ b/src/configDialog.h Tue Jul 09 02:57:11 2013 +0300 @@ -115,7 +115,7 @@ void updateOutput(); private slots: - virtual void keyPressEvent( QKeyEvent* ev ); + virtual void keyPressEvent( QKeyEvent* ev ) override; }; #endif // CONFIGDIALOG_H
--- a/src/history.h Mon Jul 08 02:46:55 2013 +0300 +++ b/src/history.h Tue Jul 09 02:57:11 2013 +0300 @@ -24,9 +24,9 @@ #define IMPLEMENT_HISTORY_TYPE(N) \ virtual ~N##History(); \ - virtual void undo() const; \ - virtual void redo() const; \ - virtual History::Type type() { return History::N; } + virtual void undo() const override; \ + virtual void redo() const override; \ + virtual History::Type getType() const override { return History::N; } class AbstractHistoryEntry; @@ -82,7 +82,7 @@ virtual void undo () const {} virtual void redo () const {} virtual ~AbstractHistoryEntry () {} - virtual History::Type type () { return (History::Type) 0; } + virtual History::Type getType () const { return (History::Type) 0; } }; // =============================================================================
--- a/src/ldtypes.h Mon Jul 08 02:46:55 2013 +0300 +++ b/src/ldtypes.h Tue Jul 09 02:57:11 2013 +0300 @@ -24,7 +24,7 @@ #define LDOBJ(T) \ virtual ~LD##T () {} \ - virtual LDObject::Type getType () const { \ + virtual LDObject::Type getType () const override { \ return LDObject::T; \ } \ virtual str raw (); \ @@ -34,17 +34,17 @@ virtual void move (vertex vVector); \ virtual void invert (); -#define LDOBJ_NAME( N ) virtual str typeName() const { return #N; } -#define LDOBJ_VERTICES( V ) virtual short vertices() const { return V; } -#define LDOBJ_SETCOLORED( V ) virtual bool isColored() const { return V; } +#define LDOBJ_NAME( N ) virtual str typeName() const override { return #N; } +#define LDOBJ_VERTICES( V ) virtual short vertices() const override { return V; } +#define LDOBJ_SETCOLORED( V ) virtual bool isColored() const override { return V; } #define LDOBJ_COLORED LDOBJ_SETCOLORED( true ) #define LDOBJ_UNCOLORED LDOBJ_SETCOLORED( false ) -#define LDOBJ_CUSTOM_SCEMANTIC virtual bool isScemantic() const +#define LDOBJ_CUSTOM_SCEMANTIC virtual bool isScemantic() const override #define LDOBJ_SCEMANTIC LDOBJ_CUSTOM_SCEMANTIC { return true; } #define LDOBJ_NON_SCEMANTIC LDOBJ_CUSTOM_SCEMANTIC { return false; } -#define LDOBJ_SETMATRIX(V) virtual bool hasMatrix() const { return V; } +#define LDOBJ_SETMATRIX(V) virtual bool hasMatrix() const override { return V; } #define LDOBJ_HAS_MATRIX LDOBJ_SETMATRIX( true ) #define LDOBJ_NO_MATRIX LDOBJ_SETMATRIX( false )