From 5a824d03334240cc01dfe65a13c627bad5f7b2f7 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Thu, 22 Oct 2020 23:57:53 +0200 Subject: [PATCH] components/compiler cleanup; also cleaned up related cascading warnings; fixed up final/override issues --- apps/opencs/view/render/terrainshapemode.hpp | 32 ++++++------ apps/opencs/view/render/terrainstorage.hpp | 10 ++-- .../opencs/view/render/terraintexturemode.hpp | 32 ++++++------ apps/openmw/mwclass/creature.hpp | 6 +-- apps/openmw/mwclass/npc.hpp | 6 +-- apps/openmw/mwdialogue/dialoguemanagerimp.hpp | 4 +- apps/openmw/mwgui/backgroundimage.hpp | 4 +- apps/openmw/mwgui/bookpage.cpp | 28 +++++------ apps/openmw/mwgui/controllers.hpp | 12 ++--- apps/openmw/mwgui/cursor.hpp | 6 +-- apps/openmw/mwgui/itemchargeview.hpp | 6 +-- apps/openmw/mwgui/itemview.hpp | 8 +-- apps/openmw/mwgui/itemwidget.hpp | 2 +- apps/openmw/mwgui/mapwindow.cpp | 4 +- apps/openmw/mwgui/resourceskin.hpp | 2 +- apps/openmw/mwgui/spellview.hpp | 6 +-- apps/openmw/mwgui/widgets.hpp | 12 ++--- apps/openmw/mwmechanics/aiactivate.hpp | 8 +-- apps/openmw/mwmechanics/aiavoiddoor.hpp | 4 +- apps/openmw/mwmechanics/aibreathe.hpp | 2 +- apps/openmw/mwmechanics/aicast.hpp | 4 +- apps/openmw/mwmechanics/aicombat.hpp | 10 ++-- apps/openmw/mwmechanics/aiescort.hpp | 8 +-- apps/openmw/mwmechanics/aiface.hpp | 2 +- apps/openmw/mwmechanics/aifollow.hpp | 8 +-- apps/openmw/mwmechanics/aipursue.hpp | 6 +-- apps/openmw/mwmechanics/aitravel.hpp | 12 ++--- apps/openmw/mwmechanics/aiwander.hpp | 12 ++--- .../mwphysics/hasspherecollisioncallback.hpp | 2 +- apps/openmw/mwphysics/physicssystem.hpp | 8 +-- .../openmw_test_suite/misc/test_stringops.cpp | 4 +- .../mwdialogue/test_keywordsearch.cpp | 4 +- apps/openmw_test_suite/mwworld/test_store.cpp | 20 ++++---- components/compiler/context.hpp | 2 +- components/compiler/controlparser.cpp | 3 +- components/compiler/errorhandler.cpp | 2 +- components/compiler/errorhandler.hpp | 2 +- components/compiler/exception.hpp | 4 +- components/compiler/exprparser.cpp | 31 ++++++------ components/compiler/exprparser.hpp | 2 +- components/compiler/extensions.cpp | 20 +++----- components/compiler/generator.cpp | 6 +-- components/compiler/lineparser.cpp | 2 +- components/compiler/literals.cpp | 17 +++---- components/compiler/locals.cpp | 3 +- components/compiler/opcodes.cpp | 5 +- components/compiler/output.cpp | 1 - components/compiler/parser.cpp | 2 +- components/compiler/scanner.cpp | 3 +- components/compiler/scanner.hpp | 10 ++-- components/compiler/scriptparser.hpp | 1 - components/compiler/streamerrorhandler.cpp | 4 +- components/compiler/stringparser.cpp | 1 - components/compiler/tokenloc.hpp | 2 +- components/detournavigator/navigatorimpl.hpp | 6 +-- components/detournavigator/navigatorstub.hpp | 4 +- components/esm/containerstate.hpp | 8 +-- components/esm/creaturelevliststate.hpp | 8 +-- components/esm/creaturestate.hpp | 10 ++-- components/esm/doorstate.hpp | 8 +-- components/esm/npcstate.hpp | 10 ++-- components/esm/objectstate.hpp | 2 +- components/myguiplatform/additivelayer.hpp | 4 +- components/myguiplatform/scalinglayer.hpp | 10 ++-- components/widgets/box.hpp | 50 +++++++++---------- components/widgets/imagebutton.hpp | 14 +++--- components/widgets/list.hpp | 4 +- components/widgets/numericeditbox.hpp | 8 +-- components/widgets/sharedstatebutton.hpp | 12 ++--- components/widgets/windowcaption.hpp | 8 +-- 70 files changed, 275 insertions(+), 308 deletions(-) diff --git a/apps/opencs/view/render/terrainshapemode.hpp b/apps/opencs/view/render/terrainshapemode.hpp index d0fec764f..a88e60c9c 100644 --- a/apps/opencs/view/render/terrainshapemode.hpp +++ b/apps/opencs/view/render/terrainshapemode.hpp @@ -59,38 +59,38 @@ namespace CSVRender /// Editmode for terrain shape grid TerrainShapeMode(WorldspaceWidget*, osg::Group* parentNode, QWidget* parent = nullptr); - void primaryOpenPressed (const WorldspaceHitResult& hit) final; + void primaryOpenPressed (const WorldspaceHitResult& hit) override; /// Create single command for one-click shape editing - void primaryEditPressed (const WorldspaceHitResult& hit) final; + void primaryEditPressed (const WorldspaceHitResult& hit) override; /// Open brush settings window - void primarySelectPressed(const WorldspaceHitResult&) final; + void primarySelectPressed(const WorldspaceHitResult&) override; - void secondarySelectPressed(const WorldspaceHitResult&) final; + void secondarySelectPressed(const WorldspaceHitResult&) override; - void activate(CSVWidget::SceneToolbar*) final; - void deactivate(CSVWidget::SceneToolbar*) final; + void activate(CSVWidget::SceneToolbar*) override; + void deactivate(CSVWidget::SceneToolbar*) override; /// Start shape editing command macro - bool primaryEditStartDrag (const QPoint& pos) final; + bool primaryEditStartDrag (const QPoint& pos) override; - bool secondaryEditStartDrag (const QPoint& pos) final; - bool primarySelectStartDrag (const QPoint& pos) final; - bool secondarySelectStartDrag (const QPoint& pos) final; + bool secondaryEditStartDrag (const QPoint& pos) override; + bool primarySelectStartDrag (const QPoint& pos) override; + bool secondarySelectStartDrag (const QPoint& pos) override; /// Handle shape edit behavior during dragging - void drag (const QPoint& pos, int diffX, int diffY, double speedFactor) final; + void drag (const QPoint& pos, int diffX, int diffY, double speedFactor) override; /// End shape editing command macro - void dragCompleted(const QPoint& pos) final; + void dragCompleted(const QPoint& pos) override; /// Cancel shape editing, and reset all pending changes - void dragAborted() final; + void dragAborted() override; - void dragWheel (int diff, double speedFactor) final; - void dragMoveEvent (QDragMoveEvent *event) final; - void mouseMoveEvent (QMouseEvent *event) final; + void dragWheel (int diff, double speedFactor) override; + void dragMoveEvent (QDragMoveEvent *event) override; + void mouseMoveEvent (QMouseEvent *event) override; private: diff --git a/apps/opencs/view/render/terrainstorage.hpp b/apps/opencs/view/render/terrainstorage.hpp index 21faf9b64..762eb8003 100644 --- a/apps/opencs/view/render/terrainstorage.hpp +++ b/apps/opencs/view/render/terrainstorage.hpp @@ -27,10 +27,10 @@ namespace CSVRender const CSMWorld::Data& mData; std::array mAlteredHeight; - osg::ref_ptr getLand (int cellX, int cellY) final; - const ESM::LandTexture* getLandTexture(int index, short plugin) final; + osg::ref_ptr getLand (int cellX, int cellY) override; + const ESM::LandTexture* getLandTexture(int index, short plugin) override; - void getBounds(float& minX, float& maxX, float& minY, float& maxY) final; + void getBounds(float& minX, float& maxX, float& minY, float& maxY) override; int getThisHeight(int col, int row, const ESM::Land::LandData *heightData) const; int getLeftHeight(int col, int row, const ESM::Land::LandData *heightData) const; @@ -44,8 +44,8 @@ namespace CSVRender bool leftOrUpIsOverTheLimit(int col, int row, int heightWarningLimit, const ESM::Land::LandData *heightData) const; bool rightOrDownIsOverTheLimit(int col, int row, int heightWarningLimit, const ESM::Land::LandData *heightData) const; - void adjustColor(int col, int row, const ESM::Land::LandData *heightData, osg::Vec4ub& color) const final; - float getAlteredHeight(int col, int row) const final; + void adjustColor(int col, int row, const ESM::Land::LandData *heightData, osg::Vec4ub& color) const override; + float getAlteredHeight(int col, int row) const override; }; } diff --git a/apps/opencs/view/render/terraintexturemode.hpp b/apps/opencs/view/render/terraintexturemode.hpp index 0d8c4a94a..31932df21 100644 --- a/apps/opencs/view/render/terraintexturemode.hpp +++ b/apps/opencs/view/render/terraintexturemode.hpp @@ -53,37 +53,37 @@ namespace CSVRender /// \brief Editmode for terrain texture grid TerrainTextureMode(WorldspaceWidget*, osg::Group* parentNode, QWidget* parent = nullptr); - void primaryOpenPressed (const WorldspaceHitResult& hit) final; + void primaryOpenPressed (const WorldspaceHitResult& hit) override; /// \brief Create single command for one-click texture editing - void primaryEditPressed (const WorldspaceHitResult& hit) final; + void primaryEditPressed (const WorldspaceHitResult& hit) override; /// \brief Open brush settings window - void primarySelectPressed(const WorldspaceHitResult&) final; + void primarySelectPressed(const WorldspaceHitResult&) override; - void secondarySelectPressed(const WorldspaceHitResult&) final; + void secondarySelectPressed(const WorldspaceHitResult&) override; - void activate(CSVWidget::SceneToolbar*) final; - void deactivate(CSVWidget::SceneToolbar*) final; + void activate(CSVWidget::SceneToolbar*) override; + void deactivate(CSVWidget::SceneToolbar*) override; /// \brief Start texture editing command macro - bool primaryEditStartDrag (const QPoint& pos) final; + bool primaryEditStartDrag (const QPoint& pos) override; - bool secondaryEditStartDrag (const QPoint& pos) final; - bool primarySelectStartDrag (const QPoint& pos) final; - bool secondarySelectStartDrag (const QPoint& pos) final; + bool secondaryEditStartDrag (const QPoint& pos) override; + bool primarySelectStartDrag (const QPoint& pos) override; + bool secondarySelectStartDrag (const QPoint& pos) override; /// \brief Handle texture edit behavior during dragging - void drag (const QPoint& pos, int diffX, int diffY, double speedFactor) final; + void drag (const QPoint& pos, int diffX, int diffY, double speedFactor) override; /// \brief End texture editing command macro - void dragCompleted(const QPoint& pos) final; + void dragCompleted(const QPoint& pos) override; - void dragAborted() final; - void dragWheel (int diff, double speedFactor) final; - void dragMoveEvent (QDragMoveEvent *event) final; + void dragAborted() override; + void dragWheel (int diff, double speedFactor) override; + void dragMoveEvent (QDragMoveEvent *event) override; - void mouseMoveEvent (QMouseEvent *event) final; + void mouseMoveEvent (QMouseEvent *event) override; private: /// \brief Handle brush mechanics, maths regarding worldspace hit etc. diff --git a/apps/openmw/mwclass/creature.hpp b/apps/openmw/mwclass/creature.hpp index 0df782eaf..5bb503034 100644 --- a/apps/openmw/mwclass/creature.hpp +++ b/apps/openmw/mwclass/creature.hpp @@ -132,11 +132,11 @@ namespace MWClass void modifyBaseInventory(const std::string& actorId, const std::string& itemId, int amount) const override; - float getWalkSpeed(const MWWorld::Ptr& ptr) const final; + float getWalkSpeed(const MWWorld::Ptr& ptr) const override; - float getRunSpeed(const MWWorld::Ptr& ptr) const final; + float getRunSpeed(const MWWorld::Ptr& ptr) const override; - float getSwimSpeed(const MWWorld::Ptr& ptr) const final; + float getSwimSpeed(const MWWorld::Ptr& ptr) const override; }; } diff --git a/apps/openmw/mwclass/npc.hpp b/apps/openmw/mwclass/npc.hpp index dc5fee73a..612763d12 100644 --- a/apps/openmw/mwclass/npc.hpp +++ b/apps/openmw/mwclass/npc.hpp @@ -166,11 +166,11 @@ namespace MWClass void modifyBaseInventory(const std::string& actorId, const std::string& itemId, int amount) const override; - float getWalkSpeed(const MWWorld::Ptr& ptr) const final; + float getWalkSpeed(const MWWorld::Ptr& ptr) const override; - float getRunSpeed(const MWWorld::Ptr& ptr) const final; + float getRunSpeed(const MWWorld::Ptr& ptr) const override; - float getSwimSpeed(const MWWorld::Ptr& ptr) const final; + float getSwimSpeed(const MWWorld::Ptr& ptr) const override; }; } diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.hpp b/apps/openmw/mwdialogue/dialoguemanagerimp.hpp index 6c6eb9a9d..b35bee6d4 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.hpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.hpp @@ -73,9 +73,9 @@ namespace MWDialogue bool startDialogue (const MWWorld::Ptr& actor, ResponseCallback* callback) override; std::list getAvailableTopics() override; - int getTopicFlag(const std::string& topicId) final; + int getTopicFlag(const std::string& topicId) override; - bool inJournal (const std::string& topicId, const std::string& infoId) final; + bool inJournal (const std::string& topicId, const std::string& infoId) override; void addTopic (const std::string& topic) override; diff --git a/apps/openmw/mwgui/backgroundimage.hpp b/apps/openmw/mwgui/backgroundimage.hpp index 3ea8b3bba..32cdf1a65 100644 --- a/apps/openmw/mwgui/backgroundimage.hpp +++ b/apps/openmw/mwgui/backgroundimage.hpp @@ -22,8 +22,8 @@ namespace MWGui */ void setBackgroundImage (const std::string& image, bool fixedRatio=true, bool stretch=true); - void setSize (const MyGUI::IntSize &_value) final; - void setCoord (const MyGUI::IntCoord &_value) final; + void setSize (const MyGUI::IntSize &_value) override; + void setCoord (const MyGUI::IntCoord &_value) override; private: MyGUI::ImageBox* mChild; diff --git a/apps/openmw/mwgui/bookpage.cpp b/apps/openmw/mwgui/bookpage.cpp index a346526eb..16541dbf0 100644 --- a/apps/openmw/mwgui/bookpage.cpp +++ b/apps/openmw/mwgui/bookpage.cpp @@ -1152,7 +1152,7 @@ public: i->second->createDrawItem (mNode); } - void setVisible (bool newVisible) final + void setVisible (bool newVisible) override { if (mVisible == newVisible) return; @@ -1174,7 +1174,7 @@ public: } } - void createDrawItem(MyGUI::ITexture* texture, MyGUI::ILayerNode* node) final + void createDrawItem(MyGUI::ITexture* texture, MyGUI::ILayerNode* node) override { mNode = node; @@ -1242,9 +1242,9 @@ public: // ISubWidget should not necessarily be a drawitem // in this case, it is not... - void doRender() final { } + void doRender() override { } - void _updateView () final + void _updateView () override { _checkMargin(); @@ -1253,7 +1253,7 @@ public: mNode->outOfDate (i->second->mRenderItem); } - void _correctView() final + void _correctView() override { _checkMargin (); @@ -1263,7 +1263,7 @@ public: } - void destroyDrawItem() final + void destroyDrawItem() override { for (ActiveTextFormats::iterator i = mActiveTextFormats.begin (); i != mActiveTextFormats.end (); ++i) i->second->destroyDrawItem (mNode); @@ -1283,24 +1283,24 @@ public: { } - void showPage (TypesetBook::Ptr book, size_t page) final + void showPage (TypesetBook::Ptr book, size_t page) override { mPageDisplay->showPage (book, page); } - void adviseLinkClicked (std::function linkClicked) final + void adviseLinkClicked (std::function linkClicked) override { mPageDisplay->mLinkClicked = linkClicked; } - void unadviseLinkClicked () final + void unadviseLinkClicked () override { mPageDisplay->mLinkClicked = std::function (); } protected: - void initialiseOverride() final + void initialiseOverride() override { Base::initialiseOverride(); @@ -1314,24 +1314,24 @@ protected: } } - void onMouseLostFocus(Widget* _new) final + void onMouseLostFocus(Widget* _new) override { // NOTE: MyGUI also fires eventMouseLostFocus for widgets that are about to be destroyed (if they had focus). // Child widgets may already be destroyed! So be careful. mPageDisplay->onMouseLostFocus (); } - void onMouseMove(int left, int top) final + void onMouseMove(int left, int top) override { mPageDisplay->onMouseMove (left, top); } - void onMouseButtonPressed (int left, int top, MyGUI::MouseButton id) final + void onMouseButtonPressed (int left, int top, MyGUI::MouseButton id) override { mPageDisplay->onMouseButtonPressed (left, top, id); } - void onMouseButtonReleased(int left, int top, MyGUI::MouseButton id) final + void onMouseButtonReleased(int left, int top, MyGUI::MouseButton id) override { mPageDisplay->onMouseButtonReleased (left, top, id); } diff --git a/apps/openmw/mwgui/controllers.hpp b/apps/openmw/mwgui/controllers.hpp index bd9646ec2..416f104d9 100644 --- a/apps/openmw/mwgui/controllers.hpp +++ b/apps/openmw/mwgui/controllers.hpp @@ -9,21 +9,17 @@ namespace MyGUI class Widget; } -namespace MWGui -{ - namespace Controllers +namespace MWGui::Controllers { /// Automatically positions a widget below the mouse cursor. - class ControllerFollowMouse final : - public MyGUI::ControllerItem + class ControllerFollowMouse final : public MyGUI::ControllerItem { MYGUI_RTTI_DERIVED( ControllerFollowMouse ) private: - bool addTime(MyGUI::Widget* _widget, float _time) final; - void prepareItem(MyGUI::Widget* _widget) final; + bool addTime(MyGUI::Widget* _widget, float _time) override; + void prepareItem(MyGUI::Widget* _widget) override; }; } -} #endif diff --git a/apps/openmw/mwgui/cursor.hpp b/apps/openmw/mwgui/cursor.hpp index ef5099ef8..7e1f9adba 100644 --- a/apps/openmw/mwgui/cursor.hpp +++ b/apps/openmw/mwgui/cursor.hpp @@ -20,10 +20,10 @@ namespace MWGui ResourceImageSetPointerFix(); virtual ~ResourceImageSetPointerFix(); - void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) final; + void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) override; - void setImage(MyGUI::ImageBox* _image) final; - void setPosition(MyGUI::ImageBox* _image, const MyGUI::IntPoint& _point) final; + void setImage(MyGUI::ImageBox* _image) override; + void setPosition(MyGUI::ImageBox* _image, const MyGUI::IntPoint& _point) override; //and now for the whole point of this class, allow us to get //the hot spot, the image and the size of the cursor. diff --git a/apps/openmw/mwgui/itemchargeview.hpp b/apps/openmw/mwgui/itemchargeview.hpp index 2522f55d1..039dcaf4e 100644 --- a/apps/openmw/mwgui/itemchargeview.hpp +++ b/apps/openmw/mwgui/itemchargeview.hpp @@ -36,7 +36,7 @@ namespace MWGui /// Register needed components with MyGUI's factory manager static void registerComponents(); - void initialiseOverride() final; + void initialiseOverride() override; /// Takes ownership of \a model void setModel(ItemModel* model); @@ -47,8 +47,8 @@ namespace MWGui void layoutWidgets(); void resetScrollbars(); - void setSize(const MyGUI::IntSize& value) final; - void setCoord(const MyGUI::IntCoord& value) final; + void setSize(const MyGUI::IntSize& value) override; + void setCoord(const MyGUI::IntCoord& value) override; MyGUI::delegates::CMultiDelegate2 eventItemClicked; diff --git a/apps/openmw/mwgui/itemview.hpp b/apps/openmw/mwgui/itemview.hpp index a5e537aa0..4074e55e4 100644 --- a/apps/openmw/mwgui/itemview.hpp +++ b/apps/openmw/mwgui/itemview.hpp @@ -13,7 +13,7 @@ namespace MWGui MYGUI_RTTI_DERIVED(ItemView) public: ItemView(); - virtual ~ItemView(); + ~ItemView() override; /// Register needed components with MyGUI's factory manager static void registerComponents (); @@ -33,12 +33,12 @@ namespace MWGui void resetScrollBars(); private: - void initialiseOverride() final; + void initialiseOverride() override; void layoutWidgets(); - void setSize(const MyGUI::IntSize& _value) final; - void setCoord(const MyGUI::IntCoord& _value) final; + void setSize(const MyGUI::IntSize& _value) override; + void setCoord(const MyGUI::IntCoord& _value) override; void onSelectedItem (MyGUI::Widget* sender); void onSelectedBackground (MyGUI::Widget* sender); diff --git a/apps/openmw/mwgui/itemwidget.hpp b/apps/openmw/mwgui/itemwidget.hpp index 748a44445..550d73643 100644 --- a/apps/openmw/mwgui/itemwidget.hpp +++ b/apps/openmw/mwgui/itemwidget.hpp @@ -41,7 +41,7 @@ namespace MWGui void setFrame (const std::string& frame, const MyGUI::IntCoord& coord); protected: - void initialiseOverride() final; + void initialiseOverride() override; MyGUI::ImageBox* mItem; MyGUI::ImageBox* mItemShadow; diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index f0ece76d5..acf131926 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -74,12 +74,12 @@ namespace MyGUI::Colour mNormalColour; MyGUI::Colour mHoverColour; - void onMouseLostFocus(MyGUI::Widget* _new) final + void onMouseLostFocus(MyGUI::Widget* _new) override { setColour(mNormalColour); } - void onMouseSetFocus(MyGUI::Widget* _old) final + void onMouseSetFocus(MyGUI::Widget* _old) override { setColour(mHoverColour); } diff --git a/apps/openmw/mwgui/resourceskin.hpp b/apps/openmw/mwgui/resourceskin.hpp index bdf0d2f0b..fd1977e66 100644 --- a/apps/openmw/mwgui/resourceskin.hpp +++ b/apps/openmw/mwgui/resourceskin.hpp @@ -10,7 +10,7 @@ namespace MWGui MYGUI_RTTI_DERIVED( AutoSizedResourceSkin ) public: - void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) final; + void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) override; }; } diff --git a/apps/openmw/mwgui/spellview.hpp b/apps/openmw/mwgui/spellview.hpp index a387cac39..6b3effc45 100644 --- a/apps/openmw/mwgui/spellview.hpp +++ b/apps/openmw/mwgui/spellview.hpp @@ -47,10 +47,10 @@ namespace MWGui /// Fired when a spell was clicked EventHandle_ModelIndex eventSpellClicked; - void initialiseOverride() final; + void initialiseOverride() override; - void setSize(const MyGUI::IntSize& _value) final; - void setCoord(const MyGUI::IntCoord& _value) final; + void setSize(const MyGUI::IntSize& _value) override; + void setCoord(const MyGUI::IntCoord& _value) override; void resetScrollbars(); diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp index ff3b2311a..731a41a35 100644 --- a/apps/openmw/mwgui/widgets.hpp +++ b/apps/openmw/mwgui/widgets.hpp @@ -116,7 +116,7 @@ namespace MWGui protected: virtual ~MWSkill(); - void initialiseOverride() final; + void initialiseOverride() override; void onClicked(MyGUI::Widget* _sender); @@ -156,7 +156,7 @@ namespace MWGui protected: virtual ~MWAttribute(); - void initialiseOverride() final; + void initialiseOverride() override; void onClicked(MyGUI::Widget* _sender); @@ -199,7 +199,7 @@ namespace MWGui protected: virtual ~MWSpell(); - void initialiseOverride() final; + void initialiseOverride() override; private: void updateWidgets(); @@ -241,7 +241,7 @@ namespace MWGui protected: virtual ~MWEffectList(); - void initialiseOverride() final; + void initialiseOverride() override; private: void updateWidgets(); @@ -265,7 +265,7 @@ namespace MWGui protected: virtual ~MWSpellEffect(); - void initialiseOverride() final; + void initialiseOverride() override; private: static const int sIconOffset = 24; @@ -294,7 +294,7 @@ namespace MWGui protected: virtual ~MWDynamicStat(); - void initialiseOverride() final; + void initialiseOverride() override; private: diff --git a/apps/openmw/mwmechanics/aiactivate.hpp b/apps/openmw/mwmechanics/aiactivate.hpp index c53744e88..dc7e0bb26 100644 --- a/apps/openmw/mwmechanics/aiactivate.hpp +++ b/apps/openmw/mwmechanics/aiactivate.hpp @@ -24,15 +24,15 @@ namespace MWMechanics public: /// Constructor /** \param objectId Reference to object to activate **/ - AiActivate(const std::string &objectId); + explicit AiActivate(const std::string &objectId); - AiActivate(const ESM::AiSequence::AiActivate* activate); + explicit AiActivate(const ESM::AiSequence::AiActivate* activate); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Activate; } - void writeState(ESM::AiSequence::AiSequence& sequence) const final; + void writeState(ESM::AiSequence::AiSequence& sequence) const override; private: const std::string mObjectId; diff --git a/apps/openmw/mwmechanics/aiavoiddoor.hpp b/apps/openmw/mwmechanics/aiavoiddoor.hpp index cd0718e2e..1781c5e4a 100644 --- a/apps/openmw/mwmechanics/aiavoiddoor.hpp +++ b/apps/openmw/mwmechanics/aiavoiddoor.hpp @@ -20,9 +20,9 @@ namespace MWMechanics { public: /// Avoid door until the door is fully open - AiAvoidDoor(const MWWorld::ConstPtr& doorPtr); + explicit AiAvoidDoor(const MWWorld::ConstPtr& doorPtr); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::AvoidDoor; } diff --git a/apps/openmw/mwmechanics/aibreathe.hpp b/apps/openmw/mwmechanics/aibreathe.hpp index 7e9ac69da..b84c0eb76 100644 --- a/apps/openmw/mwmechanics/aibreathe.hpp +++ b/apps/openmw/mwmechanics/aibreathe.hpp @@ -10,7 +10,7 @@ namespace MWMechanics class AiBreathe final : public TypedAiPackage { public: - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Breathe; } diff --git a/apps/openmw/mwmechanics/aicast.hpp b/apps/openmw/mwmechanics/aicast.hpp index 1175dccd2..9758c2b94 100644 --- a/apps/openmw/mwmechanics/aicast.hpp +++ b/apps/openmw/mwmechanics/aicast.hpp @@ -15,11 +15,11 @@ namespace MWMechanics public: AiCast(const std::string& targetId, const std::string& spellId, bool manualSpell=false); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Cast; } - MWWorld::Ptr getTarget() const final; + MWWorld::Ptr getTarget() const override; static constexpr Options makeDefaultOptions() { diff --git a/apps/openmw/mwmechanics/aicombat.hpp b/apps/openmw/mwmechanics/aicombat.hpp index ff8a0e081..64645ca94 100644 --- a/apps/openmw/mwmechanics/aicombat.hpp +++ b/apps/openmw/mwmechanics/aicombat.hpp @@ -96,13 +96,13 @@ namespace MWMechanics public: ///Constructor /** \param actor Actor to fight **/ - AiCombat(const MWWorld::Ptr& actor); + explicit AiCombat(const MWWorld::Ptr& actor); - AiCombat (const ESM::AiSequence::AiCombat* combat); + explicit AiCombat (const ESM::AiSequence::AiCombat* combat); void init(); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Combat; } @@ -116,9 +116,9 @@ namespace MWMechanics } ///Returns target ID - MWWorld::Ptr getTarget() const final; + MWWorld::Ptr getTarget() const override; - void writeState(ESM::AiSequence::AiSequence &sequence) const final; + void writeState(ESM::AiSequence::AiSequence &sequence) const override; private: /// Returns true if combat should end diff --git a/apps/openmw/mwmechanics/aiescort.hpp b/apps/openmw/mwmechanics/aiescort.hpp index edfd0ca3f..27a177893 100644 --- a/apps/openmw/mwmechanics/aiescort.hpp +++ b/apps/openmw/mwmechanics/aiescort.hpp @@ -30,7 +30,7 @@ namespace MWMechanics AiEscort(const ESM::AiSequence::AiEscort* escort); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Escort; } @@ -42,11 +42,11 @@ namespace MWMechanics return options; } - void writeState(ESM::AiSequence::AiSequence &sequence) const final; + void writeState(ESM::AiSequence::AiSequence &sequence) const override; - void fastForward(const MWWorld::Ptr& actor, AiState& state) final; + void fastForward(const MWWorld::Ptr& actor, AiState& state) override; - osg::Vec3f getDestination() const final { return osg::Vec3f(mX, mY, mZ); } + osg::Vec3f getDestination() const override { return osg::Vec3f(mX, mY, mZ); } private: const std::string mCellId; diff --git a/apps/openmw/mwmechanics/aiface.hpp b/apps/openmw/mwmechanics/aiface.hpp index a5ee67a14..e176eb52e 100644 --- a/apps/openmw/mwmechanics/aiface.hpp +++ b/apps/openmw/mwmechanics/aiface.hpp @@ -10,7 +10,7 @@ namespace MWMechanics public: AiFace(float targetX, float targetY); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Face; } diff --git a/apps/openmw/mwmechanics/aifollow.hpp b/apps/openmw/mwmechanics/aifollow.hpp index d0c2cec97..e6aeebb24 100644 --- a/apps/openmw/mwmechanics/aifollow.hpp +++ b/apps/openmw/mwmechanics/aifollow.hpp @@ -53,7 +53,7 @@ namespace MWMechanics AiFollow(const ESM::AiSequence::AiFollow* follow); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Follow; } @@ -69,15 +69,15 @@ namespace MWMechanics /// Returns the actor being followed std::string getFollowedActor(); - void writeState (ESM::AiSequence::AiSequence& sequence) const final; + void writeState (ESM::AiSequence::AiSequence& sequence) const override; bool isCommanded() const; int getFollowIndex() const; - void fastForward(const MWWorld::Ptr& actor, AiState& state) final; + void fastForward(const MWWorld::Ptr& actor, AiState& state) override; - osg::Vec3f getDestination() const final + osg::Vec3f getDestination() const override { MWWorld::Ptr target = getTarget(); if (target.isEmpty()) diff --git a/apps/openmw/mwmechanics/aipursue.hpp b/apps/openmw/mwmechanics/aipursue.hpp index 64465f530..2fbc13b87 100644 --- a/apps/openmw/mwmechanics/aipursue.hpp +++ b/apps/openmw/mwmechanics/aipursue.hpp @@ -26,7 +26,7 @@ namespace MWMechanics AiPursue(const ESM::AiSequence::AiPursue* pursue); - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Pursue; } @@ -38,9 +38,9 @@ namespace MWMechanics return options; } - MWWorld::Ptr getTarget() const final; + MWWorld::Ptr getTarget() const override; - void writeState (ESM::AiSequence::AiSequence& sequence) const final; + void writeState (ESM::AiSequence::AiSequence& sequence) const override; }; } #endif diff --git a/apps/openmw/mwmechanics/aitravel.hpp b/apps/openmw/mwmechanics/aitravel.hpp index 0c19572d2..2ea2a8f71 100644 --- a/apps/openmw/mwmechanics/aitravel.hpp +++ b/apps/openmw/mwmechanics/aitravel.hpp @@ -25,14 +25,14 @@ namespace MWMechanics AiTravel(float x, float y, float z); - AiTravel(const ESM::AiSequence::AiTravel* travel); + explicit AiTravel(const ESM::AiSequence::AiTravel* travel); /// Simulates the passing of time - void fastForward(const MWWorld::Ptr& actor, AiState& state) final; + void fastForward(const MWWorld::Ptr& actor, AiState& state) override; - void writeState(ESM::AiSequence::AiSequence &sequence) const final; + void writeState(ESM::AiSequence::AiSequence &sequence) const override; - bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Travel; } @@ -44,7 +44,7 @@ namespace MWMechanics return options; } - osg::Vec3f getDestination() const final { return osg::Vec3f(mX, mY, mZ); } + osg::Vec3f getDestination() const override { return osg::Vec3f(mX, mY, mZ); } private: const float mX; @@ -62,7 +62,7 @@ namespace MWMechanics static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::InternalTravel; } - std::unique_ptr clone() const final; + std::unique_ptr clone() const override; }; } diff --git a/apps/openmw/mwmechanics/aiwander.hpp b/apps/openmw/mwmechanics/aiwander.hpp index 4165cebbd..68bcddf22 100644 --- a/apps/openmw/mwmechanics/aiwander.hpp +++ b/apps/openmw/mwmechanics/aiwander.hpp @@ -89,9 +89,9 @@ namespace MWMechanics \param repeat Repeat wander or not **/ AiWander(int distance, int duration, int timeOfDay, const std::vector& idle, bool repeat); - AiWander (const ESM::AiSequence::AiWander* wander); + explicit AiWander (const ESM::AiSequence::AiWander* wander); - bool execute(const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) final; + bool execute(const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration) override; static constexpr AiPackageTypeId getTypeId() { return AiPackageTypeId::Wander; } @@ -103,13 +103,13 @@ namespace MWMechanics return options; } - void writeState(ESM::AiSequence::AiSequence &sequence) const final; + void writeState(ESM::AiSequence::AiSequence &sequence) const override; - void fastForward(const MWWorld::Ptr& actor, AiState& state) final; + void fastForward(const MWWorld::Ptr& actor, AiState& state) override; - osg::Vec3f getDestination(const MWWorld::Ptr& actor) const final; + osg::Vec3f getDestination(const MWWorld::Ptr& actor) const override; - osg::Vec3f getDestination() const final + osg::Vec3f getDestination() const override { if (!mHasDestination) return osg::Vec3f(0, 0, 0); diff --git a/apps/openmw/mwphysics/hasspherecollisioncallback.hpp b/apps/openmw/mwphysics/hasspherecollisioncallback.hpp index 58e7373e5..275325cf6 100644 --- a/apps/openmw/mwphysics/hasspherecollisioncallback.hpp +++ b/apps/openmw/mwphysics/hasspherecollisioncallback.hpp @@ -35,7 +35,7 @@ namespace MWPhysics { } - bool process(const btBroadphaseProxy* proxy) final + bool process(const btBroadphaseProxy* proxy) override { if (mResult) return false; diff --git a/apps/openmw/mwphysics/physicssystem.hpp b/apps/openmw/mwphysics/physicssystem.hpp index 3198c5d44..96aba99c4 100644 --- a/apps/openmw/mwphysics/physicssystem.hpp +++ b/apps/openmw/mwphysics/physicssystem.hpp @@ -156,17 +156,17 @@ namespace MWPhysics /// target vector hits the collision shape and then calculates distance from the intersection point. /// This can be used to find out how much nearer we need to move to the target for a "getHitContact" to be successful. /// \note Only Actor targets are supported at the moment. - float getHitDistance(const osg::Vec3f& point, const MWWorld::ConstPtr& target) const final; + float getHitDistance(const osg::Vec3f& point, const MWWorld::ConstPtr& target) const override; /// @param me Optional, a Ptr to ignore in the list of results. targets are actors to filter for, ignoring all other actors. RayCastingResult castRay(const osg::Vec3f &from, const osg::Vec3f &to, const MWWorld::ConstPtr& ignore = MWWorld::ConstPtr(), std::vector targets = std::vector(), - int mask = CollisionType_World|CollisionType_HeightMap|CollisionType_Actor|CollisionType_Door, int group=0xff) const final; + int mask = CollisionType_World|CollisionType_HeightMap|CollisionType_Actor|CollisionType_Door, int group=0xff) const override; - RayCastingResult castSphere(const osg::Vec3f& from, const osg::Vec3f& to, float radius) const final; + RayCastingResult castSphere(const osg::Vec3f& from, const osg::Vec3f& to, float radius) const override; /// Return true if actor1 can see actor2. - bool getLineOfSight(const MWWorld::ConstPtr& actor1, const MWWorld::ConstPtr& actor2) const final; + bool getLineOfSight(const MWWorld::ConstPtr& actor1, const MWWorld::ConstPtr& actor2) const override; bool isOnGround (const MWWorld::Ptr& actor); diff --git a/apps/openmw_test_suite/misc/test_stringops.cpp b/apps/openmw_test_suite/misc/test_stringops.cpp index 081ca8da6..086908692 100644 --- a/apps/openmw_test_suite/misc/test_stringops.cpp +++ b/apps/openmw_test_suite/misc/test_stringops.cpp @@ -5,14 +5,14 @@ struct PartialBinarySearchTest : public ::testing::Test { protected: std::vector mDataVec; - virtual void SetUp() + void SetUp() override { const char* data[] = { "Head", "Chest", "Tri Head", "Tri Chest", "Bip01", "Tri Bip01" }; mDataVec = std::vector(data, data+sizeof(data)/sizeof(data[0])); std::sort(mDataVec.begin(), mDataVec.end(), Misc::StringUtils::ciLess); } - virtual void TearDown() + void TearDown() override { } diff --git a/apps/openmw_test_suite/mwdialogue/test_keywordsearch.cpp b/apps/openmw_test_suite/mwdialogue/test_keywordsearch.cpp index e0e1871d2..431725be2 100644 --- a/apps/openmw_test_suite/mwdialogue/test_keywordsearch.cpp +++ b/apps/openmw_test_suite/mwdialogue/test_keywordsearch.cpp @@ -4,11 +4,11 @@ struct KeywordSearchTest : public ::testing::Test { protected: - virtual void SetUp() + void SetUp() override { } - virtual void TearDown() + void TearDown() override { } }; diff --git a/apps/openmw_test_suite/mwworld/test_store.cpp b/apps/openmw_test_suite/mwworld/test_store.cpp index 60f60adb3..77aaccfdd 100644 --- a/apps/openmw_test_suite/mwworld/test_store.cpp +++ b/apps/openmw_test_suite/mwworld/test_store.cpp @@ -22,7 +22,7 @@ struct ContentFileTest : public ::testing::Test { protected: - virtual void SetUp() + void SetUp() override { readContentFiles(); @@ -31,13 +31,13 @@ struct ContentFileTest : public ::testing::Test readerList.resize(mContentFiles.size()); int index=0; - for (std::vector::const_iterator it = mContentFiles.begin(); it != mContentFiles.end(); ++it) + for (const auto & mContentFile : mContentFiles) { ESM::ESMReader lEsm; lEsm.setEncoder(nullptr); lEsm.setIndex(index); lEsm.setGlobalReaderList(&readerList); - lEsm.open(it->string()); + lEsm.open(mContentFile.string()); readerList[index] = lEsm; mEsmStore.load(readerList[index], &dummyListener); @@ -47,7 +47,7 @@ struct ContentFileTest : public ::testing::Test mEsmStore.setUp(); } - virtual void TearDown() + void TearDown() override { } @@ -86,8 +86,8 @@ struct ContentFileTest : public ::testing::Test Files::Collections collections (dataDirs, true); std::vector contentFiles = variables["content"].as >(); - for (std::vector::iterator it = contentFiles.begin(); it != contentFiles.end(); ++it) - mContentFiles.push_back(collections.getPath(*it)); + for (auto & contentFile : contentFiles) + mContentFiles.push_back(collections.getPath(contentFile)); } protected: @@ -111,14 +111,12 @@ TEST_F(ContentFileTest, dialogue_merging_test) stream.open(file); const MWWorld::Store& dialStore = mEsmStore.get(); - for (MWWorld::Store::iterator it = dialStore.begin(); it != dialStore.end(); ++it) + for (const auto & dial : dialStore) { - const ESM::Dialogue& dial = *it; stream << "Dialogue: " << dial.mId << std::endl; - for (ESM::Dialogue::InfoContainer::const_iterator infoIt = dial.mInfo.begin(); infoIt != dial.mInfo.end(); ++infoIt) + for (const auto & info : dial.mInfo) { - const ESM::DialInfo& info = *infoIt; stream << info.mId << std::endl; } stream << std::endl; @@ -229,7 +227,7 @@ template Files::IStreamPtr getEsmFile(T record, bool deleted) { ESM::ESMWriter writer; - std::stringstream* stream = new std::stringstream; + auto* stream = new std::stringstream; writer.setFormat(0); writer.save(*stream); writer.startRecord(T::sRecordId); diff --git a/components/compiler/context.hpp b/components/compiler/context.hpp index 84bb89bdc..2d6af0e45 100644 --- a/components/compiler/context.hpp +++ b/components/compiler/context.hpp @@ -15,7 +15,7 @@ namespace Compiler Context() : mExtensions (0) {} - virtual ~Context() {} + virtual ~Context() = default; virtual bool canDeclareLocals() const = 0; ///< Is the compiler allowed to declare local variables? diff --git a/components/compiler/controlparser.cpp b/components/compiler/controlparser.cpp index ebadcbbc6..634180f62 100644 --- a/components/compiler/controlparser.cpp +++ b/components/compiler/controlparser.cpp @@ -1,7 +1,6 @@ #include "controlparser.hpp" #include -#include #include #include "scanner.hpp" @@ -33,7 +32,7 @@ namespace Compiler // store code for if-cascade Codes codes; - for (IfCodes::reverse_iterator iter (mIfCode.rbegin()); + for (auto iter (mIfCode.rbegin()); iter!=mIfCode.rend(); ++iter) { Codes block; diff --git a/components/compiler/errorhandler.cpp b/components/compiler/errorhandler.cpp index 7f02255db..f02097736 100644 --- a/components/compiler/errorhandler.cpp +++ b/components/compiler/errorhandler.cpp @@ -5,7 +5,7 @@ namespace Compiler ErrorHandler::ErrorHandler() : mWarnings (0), mErrors (0), mWarningsMode (1), mDowngradeErrors (false) {} - ErrorHandler::~ErrorHandler() {} + ErrorHandler::~ErrorHandler() = default; // Was compiling successful? diff --git a/components/compiler/errorhandler.hpp b/components/compiler/errorhandler.hpp index ea904e385..dfd29f273 100644 --- a/components/compiler/errorhandler.hpp +++ b/components/compiler/errorhandler.hpp @@ -83,7 +83,7 @@ namespace Compiler public: - ErrorDowngrade (ErrorHandler& handler); + explicit ErrorDowngrade (ErrorHandler& handler); ~ErrorDowngrade(); }; diff --git a/components/compiler/exception.hpp b/components/compiler/exception.hpp index f21f2e586..3aa8997c7 100644 --- a/components/compiler/exception.hpp +++ b/components/compiler/exception.hpp @@ -21,7 +21,7 @@ namespace Compiler { public: - const char *what() const noexcept final { return "Can't read file"; } + const char *what() const noexcept override { return "Can't read file"; } ///< Return error message }; @@ -31,7 +31,7 @@ namespace Compiler { public: - const char *what() const noexcept final { return "End of file"; } + const char *what() const noexcept override { return "End of file"; } ///< Return error message }; } diff --git a/components/compiler/exprparser.cpp b/components/compiler/exprparser.cpp index 8c8fe640e..7c0635d76 100644 --- a/components/compiler/exprparser.cpp +++ b/components/compiler/exprparser.cpp @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include @@ -21,7 +19,7 @@ namespace Compiler { - int ExprParser::getPriority (char op) const + int ExprParser::getPriority (char op) { switch (op) { @@ -654,28 +652,27 @@ namespace Compiler std::stack > stack; - for (std::string::const_iterator iter (arguments.begin()); iter!=arguments.end(); - ++iter) + for (char argument : arguments) { - if (*iter=='/') + if (argument=='/') { optional = true; } - else if (*iter=='S' || *iter=='c' || *iter=='x') + else if (argument=='S' || argument=='c' || argument=='x') { stringParser.reset(); - if (optional || *iter=='x') + if (optional || argument=='x') stringParser.setOptional (true); - if (*iter=='c') stringParser.smashCase(); - if (*iter=='x') stringParser.discard(); + if (argument=='c') stringParser.smashCase(); + if (argument=='x') stringParser.discard(); scanner.scan (stringParser); - if ((optional || *iter=='x') && stringParser.isEmpty()) + if ((optional || argument=='x') && stringParser.isEmpty()) break; - if (*iter!='x') + if (argument!='x') { std::vector tmp; stringParser.append (tmp); @@ -689,7 +686,7 @@ namespace Compiler getErrorHandler().warning ("Extra argument", stringParser.getTokenLoc()); } - else if (*iter=='X') + else if (argument=='X') { parser.reset(); @@ -702,7 +699,7 @@ namespace Compiler else getErrorHandler().warning("Extra argument", parser.getTokenLoc()); } - else if (*iter=='z') + else if (argument=='z') { discardParser.reset(); discardParser.setOptional (true); @@ -714,7 +711,7 @@ namespace Compiler else getErrorHandler().warning("Extra argument", discardParser.getTokenLoc()); } - else if (*iter=='j') + else if (argument=='j') { /// \todo disable this when operating in strict mode junkParser.reset(); @@ -737,8 +734,8 @@ namespace Compiler char type = parser.append (tmp); - if (type!=*iter) - Generator::convert (tmp, type, *iter); + if (type!=argument) + Generator::convert (tmp, type, argument); stack.push (tmp); diff --git a/components/compiler/exprparser.hpp b/components/compiler/exprparser.hpp index 0e8ad88c6..2f3eaa8a9 100644 --- a/components/compiler/exprparser.hpp +++ b/components/compiler/exprparser.hpp @@ -28,7 +28,7 @@ namespace Compiler bool mRefOp; bool mMemberOp; - int getPriority (char op) const; + static int getPriority (char op) ; char getOperandType (int Index = 0) const; diff --git a/components/compiler/extensions.cpp b/components/compiler/extensions.cpp index dbb953e20..9646d54a7 100644 --- a/components/compiler/extensions.cpp +++ b/components/compiler/extensions.cpp @@ -12,8 +12,7 @@ namespace Compiler int Extensions::searchKeyword (const std::string& keyword) const { - std::map::const_iterator iter = mKeywords.find (keyword); - + auto iter = mKeywords.find (keyword); if (iter==mKeywords.end()) return 0; @@ -23,8 +22,7 @@ namespace Compiler bool Extensions::isFunction (int keyword, ScriptReturn& returnType, ScriptArgs& argumentType, bool& explicitReference) const { - std::map::const_iterator iter = mFunctions.find (keyword); - + auto iter = mFunctions.find (keyword); if (iter==mFunctions.end()) return false; @@ -39,8 +37,7 @@ namespace Compiler bool Extensions::isInstruction (int keyword, ScriptArgs& argumentType, bool& explicitReference) const { - std::map::const_iterator iter = mInstructions.find (keyword); - + auto iter = mInstructions.find (keyword); if (iter==mInstructions.end()) return false; @@ -115,8 +112,7 @@ namespace Compiler { assert (optionalArguments>=0); - std::map::const_iterator iter = mFunctions.find (keyword); - + auto iter = mFunctions.find (keyword); if (iter==mFunctions.end()) throw std::logic_error ("unknown custom function keyword"); @@ -164,8 +160,7 @@ namespace Compiler { assert (optionalArguments>=0); - std::map::const_iterator iter = mInstructions.find (keyword); - + auto iter = mInstructions.find (keyword); if (iter==mInstructions.end()) throw std::logic_error ("unknown custom instruction keyword"); @@ -209,8 +204,7 @@ namespace Compiler void Extensions::listKeywords (std::vector& keywords) const { - for (std::map::const_iterator iter (mKeywords.begin()); - iter!=mKeywords.end(); ++iter) - keywords.push_back (iter->first); + for (const auto & mKeyword : mKeywords) + keywords.push_back (mKeyword.first); } } diff --git a/components/compiler/generator.cpp b/components/compiler/generator.cpp index 2787488c2..717f05980 100644 --- a/components/compiler/generator.cpp +++ b/components/compiler/generator.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include "literals.hpp" @@ -283,9 +282,7 @@ namespace } } -namespace Compiler -{ - namespace Generator +namespace Compiler::Generator { void pushInt (CodeContainer& code, Literals& literals, int value) { @@ -732,4 +729,3 @@ namespace Compiler } } } -} diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 829ad6f08..77afaee8b 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -260,7 +260,7 @@ namespace Compiler /// \todo add option to disable this std::unique_ptr errorDowngrade (nullptr); if (Misc::StringUtils::lowerCase (loc.mLiteral)=="positioncell") - errorDowngrade.reset (new ErrorDowngrade (getErrorHandler())); + errorDowngrade = std::make_unique (getErrorHandler()); std::vector code; int optionals = mExprParser.parseArguments (argumentType, scanner, code, keyword); diff --git a/components/compiler/literals.cpp b/components/compiler/literals.cpp index ee2c4d345..774ca4ca7 100644 --- a/components/compiler/literals.cpp +++ b/components/compiler/literals.cpp @@ -30,13 +30,11 @@ namespace Compiler void Literals::append (std::vector& code) const { - for (std::vector::const_iterator iter (mIntegers.begin()); - iter!=mIntegers.end(); ++iter) - code.push_back (*reinterpret_cast (&*iter)); + for (const int & mInteger : mIntegers) + code.push_back (*reinterpret_cast (&mInteger)); - for (std::vector::const_iterator iter (mFloats.begin()); - iter!=mFloats.end(); ++iter) - code.push_back (*reinterpret_cast (&*iter)); + for (const float & mFloat : mFloats) + code.push_back (*reinterpret_cast (&mFloat)); int stringBlockSize = getStringSize(); int size = static_cast (code.size()); @@ -45,12 +43,11 @@ namespace Compiler int offset = 0; - for (std::vector::const_iterator iter (mStrings.begin()); - iter!=mStrings.end(); ++iter) + for (const auto & mString : mStrings) { - int stringSize = iter->size()+1; + int stringSize = mString.size()+1; - std::copy (iter->c_str(), iter->c_str()+stringSize, + std::copy (mString.c_str(), mString.c_str()+stringSize, reinterpret_cast (&code[size]) + offset); offset += stringSize; } diff --git a/components/compiler/locals.cpp b/components/compiler/locals.cpp index a7102c38d..9b233b8f5 100644 --- a/components/compiler/locals.cpp +++ b/components/compiler/locals.cpp @@ -25,8 +25,7 @@ namespace Compiler { const std::vector& collection = get (type); - std::vector::const_iterator iter = - std::find (collection.begin(), collection.end(), name); + auto iter = std::find (collection.begin(), collection.end(), name); if (iter==collection.end()) return -1; diff --git a/components/compiler/opcodes.cpp b/components/compiler/opcodes.cpp index 03081dff9..9e2356d0e 100644 --- a/components/compiler/opcodes.cpp +++ b/components/compiler/opcodes.cpp @@ -1,8 +1,6 @@ #include "opcodes.hpp" -namespace Compiler -{ - namespace Control +namespace Compiler::Control { const char *controls[numberOfControls] = { @@ -10,4 +8,3 @@ namespace Compiler "playerviewswitch", "vanitymode" }; } -} diff --git a/components/compiler/output.cpp b/components/compiler/output.cpp index 785b2ce84..a78c44b8d 100644 --- a/components/compiler/output.cpp +++ b/components/compiler/output.cpp @@ -2,7 +2,6 @@ #include #include -#include #include "locals.hpp" diff --git a/components/compiler/parser.cpp b/components/compiler/parser.cpp index 62265d8a1..ffa393a29 100644 --- a/components/compiler/parser.cpp +++ b/components/compiler/parser.cpp @@ -58,7 +58,7 @@ namespace Compiler // destructor - Parser::~Parser() {} + Parser::~Parser() = default; // Handle an int token. // \return fetch another token? diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index 9f2865868..14745ac98 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -1,7 +1,6 @@ #include "scanner.hpp" #include -#include #include "exception.hpp" #include "errorhandler.hpp" @@ -266,7 +265,7 @@ namespace Compiler "messagebox", "set", "to", "getsquareroot", - 0 + nullptr }; bool Scanner::scanName (MultiChar& c, Parser& parser, bool& cont) diff --git a/components/compiler/scanner.hpp b/components/compiler/scanner.hpp index b6321a92d..2139f04b2 100644 --- a/components/compiler/scanner.hpp +++ b/components/compiler/scanner.hpp @@ -28,7 +28,7 @@ namespace Compiler blank(); } - MultiChar(const char ch) + explicit MultiChar(const char ch) { blank(); mData[0] = ch; @@ -36,7 +36,7 @@ namespace Compiler mLength = getCharLength(ch); } - int getCharLength(const char ch) + static int getCharLength(const char ch) { unsigned char c = ch; if (c<=127) return 0; @@ -170,8 +170,8 @@ namespace Compiler } private: - char mData[4]; - int mLength; + char mData[4]{}; + int mLength{}; }; class Scanner @@ -251,7 +251,7 @@ namespace Compiler public: Scanner (ErrorHandler& errorHandler, std::istream& inputStream, - const Extensions *extensions = 0); + const Extensions *extensions = nullptr); ///< constructor void scan (Parser& parser); diff --git a/components/compiler/scriptparser.hpp b/components/compiler/scriptparser.hpp index d6dfe768c..0433a23a3 100644 --- a/components/compiler/scriptparser.hpp +++ b/components/compiler/scriptparser.hpp @@ -1,7 +1,6 @@ #ifndef COMPILER_SCRIPTPARSER_H_INCLUDED #define COMPILER_SCRIPTPARSER_H_INCLUDED - #include "parser.hpp" #include "lineparser.hpp" #include "controlparser.hpp" diff --git a/components/compiler/streamerrorhandler.cpp b/components/compiler/streamerrorhandler.cpp index 1c41d3f7f..e48e69894 100644 --- a/components/compiler/streamerrorhandler.cpp +++ b/components/compiler/streamerrorhandler.cpp @@ -1,7 +1,5 @@ #include "streamerrorhandler.hpp" -#include - #include #include "tokenloc.hpp" @@ -61,7 +59,7 @@ namespace Compiler mContext = context; } - StreamErrorHandler::StreamErrorHandler() {} + StreamErrorHandler::StreamErrorHandler() = default; ContextOverride::ContextOverride(StreamErrorHandler& handler, const std::string& context) : mHandler(handler), mContext(handler.mContext) { diff --git a/components/compiler/stringparser.cpp b/components/compiler/stringparser.cpp index 1bacf7941..f4f612d6f 100644 --- a/components/compiler/stringparser.cpp +++ b/components/compiler/stringparser.cpp @@ -1,7 +1,6 @@ #include "stringparser.hpp" #include -#include #include diff --git a/components/compiler/tokenloc.hpp b/components/compiler/tokenloc.hpp index 62b5cdee5..ff715c5e9 100644 --- a/components/compiler/tokenloc.hpp +++ b/components/compiler/tokenloc.hpp @@ -13,7 +13,7 @@ namespace Compiler int mLine; std::string mLiteral; - TokenLoc() : mColumn (0), mLine (0), mLiteral ("") {} + TokenLoc() : mColumn (0), mLine (0), mLiteral () {} }; } diff --git a/components/detournavigator/navigatorimpl.hpp b/components/detournavigator/navigatorimpl.hpp index a1d66463c..e197c71b7 100644 --- a/components/detournavigator/navigatorimpl.hpp +++ b/components/detournavigator/navigatorimpl.hpp @@ -15,7 +15,7 @@ namespace DetourNavigator * @brief Navigator constructor initializes all internal data. Constructed object is ready to build a scene. * @param settings allows to customize navigator work. Constructor is only place to set navigator settings. */ - NavigatorImpl(const Settings& settings); + explicit NavigatorImpl(const Settings& settings); void addAgent(const osg::Vec3f& agentHalfExtents) override; @@ -40,9 +40,9 @@ namespace DetourNavigator bool removeWater(const osg::Vec2i& cellPosition) override; - void addPathgrid(const ESM::Cell& cell, const ESM::Pathgrid& pathgrid) final; + void addPathgrid(const ESM::Cell& cell, const ESM::Pathgrid& pathgrid) override; - void removePathgrid(const ESM::Pathgrid& pathgrid) final; + void removePathgrid(const ESM::Pathgrid& pathgrid) override; void update(const osg::Vec3f& playerPosition) override; diff --git a/components/detournavigator/navigatorstub.hpp b/components/detournavigator/navigatorstub.hpp index 9279e77e3..8b81bde19 100644 --- a/components/detournavigator/navigatorstub.hpp +++ b/components/detournavigator/navigatorstub.hpp @@ -60,9 +60,9 @@ namespace DetourNavigator return false; } - void addPathgrid(const ESM::Cell& /*cell*/, const ESM::Pathgrid& /*pathgrid*/) final {} + void addPathgrid(const ESM::Cell& /*cell*/, const ESM::Pathgrid& /*pathgrid*/) override {} - void removePathgrid(const ESM::Pathgrid& /*pathgrid*/) final {} + void removePathgrid(const ESM::Pathgrid& /*pathgrid*/) override {} void update(const osg::Vec3f& /*playerPosition*/) override {} diff --git a/components/esm/containerstate.hpp b/components/esm/containerstate.hpp index b0c4da2d1..7f1afd077 100644 --- a/components/esm/containerstate.hpp +++ b/components/esm/containerstate.hpp @@ -12,14 +12,14 @@ namespace ESM { InventoryState mInventory; - void load (ESMReader &esm) final; - void save (ESMWriter &esm, bool inInventory = false) const final; + void load (ESMReader &esm) override; + void save (ESMWriter &esm, bool inInventory = false) const override; - ContainerState& asContainerState() final + ContainerState& asContainerState() override { return *this; } - const ContainerState& asContainerState() const final + const ContainerState& asContainerState() const override { return *this; } diff --git a/components/esm/creaturelevliststate.hpp b/components/esm/creaturelevliststate.hpp index ec0bc8667..2ee9e511f 100644 --- a/components/esm/creaturelevliststate.hpp +++ b/components/esm/creaturelevliststate.hpp @@ -12,14 +12,14 @@ namespace ESM int mSpawnActorId; bool mSpawn; - void load (ESMReader &esm) final; - void save (ESMWriter &esm, bool inInventory = false) const final; + void load (ESMReader &esm) override; + void save (ESMWriter &esm, bool inInventory = false) const override; - CreatureLevListState& asCreatureLevListState() final + CreatureLevListState& asCreatureLevListState() override { return *this; } - const CreatureLevListState& asCreatureLevListState() const final + const CreatureLevListState& asCreatureLevListState() const override { return *this; } diff --git a/components/esm/creaturestate.hpp b/components/esm/creaturestate.hpp index 3e9a44d56..4b4c59d71 100644 --- a/components/esm/creaturestate.hpp +++ b/components/esm/creaturestate.hpp @@ -15,16 +15,16 @@ namespace ESM CreatureStats mCreatureStats; /// Initialize to default state - void blank(); + void blank() override; - void load (ESMReader &esm) final; - void save (ESMWriter &esm, bool inInventory = false) const final; + void load (ESMReader &esm) override; + void save (ESMWriter &esm, bool inInventory = false) const override; - CreatureState& asCreatureState() final + CreatureState& asCreatureState() override { return *this; } - const CreatureState& asCreatureState() const final + const CreatureState& asCreatureState() const override { return *this; } diff --git a/components/esm/doorstate.hpp b/components/esm/doorstate.hpp index 04ad110d6..c3aeb42e3 100644 --- a/components/esm/doorstate.hpp +++ b/components/esm/doorstate.hpp @@ -11,14 +11,14 @@ namespace ESM { int mDoorState = 0; - void load (ESMReader &esm) final; - void save (ESMWriter &esm, bool inInventory = false) const final; + void load (ESMReader &esm) override; + void save (ESMWriter &esm, bool inInventory = false) const override; - DoorState& asDoorState() final + DoorState& asDoorState() override { return *this; } - const DoorState& asDoorState() const final + const DoorState& asDoorState() const override { return *this; } diff --git a/components/esm/npcstate.hpp b/components/esm/npcstate.hpp index 6c0469050..fc6b91764 100644 --- a/components/esm/npcstate.hpp +++ b/components/esm/npcstate.hpp @@ -17,16 +17,16 @@ namespace ESM CreatureStats mCreatureStats; /// Initialize to default state - void blank(); + void blank() override; - void load (ESMReader &esm) final; - void save (ESMWriter &esm, bool inInventory = false) const final; + void load (ESMReader &esm) override; + void save (ESMWriter &esm, bool inInventory = false) const override; - NpcState& asNpcState() final + NpcState& asNpcState() override { return *this; } - const NpcState& asNpcState() const final + const NpcState& asNpcState() const override { return *this; } diff --git a/components/esm/objectstate.hpp b/components/esm/objectstate.hpp index 1079d6c72..6b0fca5ea 100644 --- a/components/esm/objectstate.hpp +++ b/components/esm/objectstate.hpp @@ -49,7 +49,7 @@ namespace ESM virtual void save (ESMWriter &esm, bool inInventory = false) const; - /// Initialize to default state + virtual /// Initialize to default state void blank(); virtual ~ObjectState(); diff --git a/components/myguiplatform/additivelayer.hpp b/components/myguiplatform/additivelayer.hpp index f0cfc1b41..f89e1d007 100644 --- a/components/myguiplatform/additivelayer.hpp +++ b/components/myguiplatform/additivelayer.hpp @@ -20,9 +20,9 @@ namespace osgMyGUI MYGUI_RTTI_DERIVED( AdditiveLayer ) AdditiveLayer(); - ~AdditiveLayer(); + ~AdditiveLayer() override; - void renderToTarget(MyGUI::IRenderTarget* _target, bool _update) final; + void renderToTarget(MyGUI::IRenderTarget* _target, bool _update) override; private: osg::ref_ptr mStateSet; diff --git a/components/myguiplatform/scalinglayer.hpp b/components/myguiplatform/scalinglayer.hpp index 7ce5f84f7..f9fd92a78 100644 --- a/components/myguiplatform/scalinglayer.hpp +++ b/components/myguiplatform/scalinglayer.hpp @@ -13,13 +13,13 @@ namespace osgMyGUI public: MYGUI_RTTI_DERIVED(ScalingLayer) - void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) final; + void deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version) override; - MyGUI::ILayerItem* getLayerItemByPoint(int _left, int _top) const final; - MyGUI::IntPoint getPosition(int _left, int _top) const final; - void renderToTarget(MyGUI::IRenderTarget* _target, bool _update) final; + MyGUI::ILayerItem* getLayerItemByPoint(int _left, int _top) const override; + MyGUI::IntPoint getPosition(int _left, int _top) const override; + void renderToTarget(MyGUI::IRenderTarget* _target, bool _update) override; - void resizeView(const MyGUI::IntSize& _viewSize) final; + void resizeView(const MyGUI::IntSize& _viewSize) override; private: void screenToLayerCoords(int& _left, int& _top) const; diff --git a/components/widgets/box.hpp b/components/widgets/box.hpp index e84c3bb1f..60d0ea67a 100644 --- a/components/widgets/box.hpp +++ b/components/widgets/box.hpp @@ -46,11 +46,11 @@ namespace Gui MYGUI_RTTI_DERIVED( AutoSizedTextBox ) public: - MyGUI::IntSize getRequestedSize() final; - void setCaption(const MyGUI::UString& _value) final; + MyGUI::IntSize getRequestedSize() override; + void setCaption(const MyGUI::UString& _value) override; protected: - void setPropertyOverride(const std::string& _key, const std::string& _value) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; std::string mFontSize; }; @@ -60,13 +60,13 @@ namespace Gui public: - MyGUI::IntSize getRequestedSize() final; - void setCaption(const MyGUI::UString& _value) final; + MyGUI::IntSize getRequestedSize() override; + void setCaption(const MyGUI::UString& _value) override; - void initialiseOverride() final; + void initialiseOverride() override; protected: - void setPropertyOverride(const std::string& _key, const std::string& _value) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; int getWidth(); std::string mFontSize; bool mShrink = false; @@ -79,11 +79,11 @@ namespace Gui MYGUI_RTTI_DERIVED( AutoSizedButton ) public: - MyGUI::IntSize getRequestedSize() final; - void setCaption(const MyGUI::UString& _value) final; + MyGUI::IntSize getRequestedSize() override; + void setCaption(const MyGUI::UString& _value) override; protected: - void setPropertyOverride(const std::string& _key, const std::string& _value) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; std::string mFontSize; }; @@ -118,7 +118,7 @@ namespace Gui public: Spacer(); - MyGUI::IntSize getRequestedSize() final { return MyGUI::IntSize(0,0); } + MyGUI::IntSize getRequestedSize() override { return MyGUI::IntSize(0,0); } }; class HBox : public Box, public MyGUI::Widget @@ -126,18 +126,18 @@ namespace Gui MYGUI_RTTI_DERIVED( HBox ) public: - void setSize (const MyGUI::IntSize &_value) final; - void setCoord (const MyGUI::IntCoord &_value) final; + void setSize (const MyGUI::IntSize &_value) override; + void setCoord (const MyGUI::IntCoord &_value) override; protected: - void initialiseOverride() final; + void initialiseOverride() override; - void align() final; - MyGUI::IntSize getRequestedSize() final; + void align() override; + MyGUI::IntSize getRequestedSize() override; - void setPropertyOverride(const std::string& _key, const std::string& _value) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; - void onWidgetCreated(MyGUI::Widget* _widget) final; + void onWidgetCreated(MyGUI::Widget* _widget) override; }; class VBox : public Box, public MyGUI::Widget @@ -145,18 +145,18 @@ namespace Gui MYGUI_RTTI_DERIVED( VBox) public: - void setSize (const MyGUI::IntSize &_value) final; - void setCoord (const MyGUI::IntCoord &_value) final; + void setSize (const MyGUI::IntSize &_value) override; + void setCoord (const MyGUI::IntCoord &_value) override; protected: - void initialiseOverride() final; + void initialiseOverride() override; - void align() final; - MyGUI::IntSize getRequestedSize() final; + void align() override; + MyGUI::IntSize getRequestedSize() override; - void setPropertyOverride(const std::string& _key, const std::string& _value) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; - void onWidgetCreated(MyGUI::Widget* _widget) final; + void onWidgetCreated(MyGUI::Widget* _widget) override; }; } diff --git a/components/widgets/imagebutton.hpp b/components/widgets/imagebutton.hpp index 160f24e99..6e3fc1733 100644 --- a/components/widgets/imagebutton.hpp +++ b/components/widgets/imagebutton.hpp @@ -31,13 +31,13 @@ namespace Gui static bool sDefaultNeedKeyFocus; protected: - void setPropertyOverride(const std::string& _key, const std::string& _value) final; - void onMouseLostFocus(MyGUI::Widget* _new) final; - void onMouseSetFocus(MyGUI::Widget* _old) final; - void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id) final; - void onMouseButtonReleased(int _left, int _top, MyGUI::MouseButton _id) final; - void onKeySetFocus(MyGUI::Widget* _old) final; - void onKeyLostFocus(MyGUI::Widget* _new) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; + void onMouseLostFocus(MyGUI::Widget* _new) override; + void onMouseSetFocus(MyGUI::Widget* _old) override; + void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id) override; + void onMouseButtonReleased(int _left, int _top, MyGUI::MouseButton _id) override; + void onKeySetFocus(MyGUI::Widget* _old) override; + void onKeyLostFocus(MyGUI::Widget* _new) override; std::string mImageHighlighted; std::string mImageNormal; diff --git a/components/widgets/list.hpp b/components/widgets/list.hpp index 604d5dada..be0339f33 100644 --- a/components/widgets/list.hpp +++ b/components/widgets/list.hpp @@ -48,10 +48,10 @@ namespace Gui void scrollToTop(); - void setPropertyOverride(const std::string& _key, const std::string& _value) final; + void setPropertyOverride(const std::string& _key, const std::string& _value) override; protected: - void initialiseOverride() final; + void initialiseOverride() override; void redraw(bool scrollbarShown = false); diff --git a/components/widgets/numericeditbox.hpp b/components/widgets/numericeditbox.hpp index ff16424d0..e1f33e887 100644 --- a/components/widgets/numericeditbox.hpp +++ b/components/widgets/numericeditbox.hpp @@ -22,8 +22,8 @@ namespace Gui { } - void initialiseOverride() final; - void shutdownOverride() final; + void initialiseOverride() override; + void shutdownOverride() override; typedef MyGUI::delegates::CMultiDelegate1 EventHandle_ValueChanged; EventHandle_ValueChanged eventValueChanged; @@ -36,8 +36,8 @@ namespace Gui void setMaxValue(int maxValue); private: void onEditTextChange(MyGUI::EditBox* sender); - void onKeyLostFocus(MyGUI::Widget* _new) final; - void onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character) final; + void onKeyLostFocus(MyGUI::Widget* _new) override; + void onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character) override; int mValue; diff --git a/components/widgets/sharedstatebutton.hpp b/components/widgets/sharedstatebutton.hpp index 859543d20..42c6424b2 100644 --- a/components/widgets/sharedstatebutton.hpp +++ b/components/widgets/sharedstatebutton.hpp @@ -23,13 +23,13 @@ namespace Gui protected: void updateButtonState(); - void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id) final; - void onMouseButtonReleased(int _left, int _top, MyGUI::MouseButton _id) final; - void onMouseSetFocus(MyGUI::Widget* _old) final; - void onMouseLostFocus(MyGUI::Widget* _new) final; - void baseUpdateEnable() final; + void onMouseButtonPressed(int _left, int _top, MyGUI::MouseButton _id) override; + void onMouseButtonReleased(int _left, int _top, MyGUI::MouseButton _id) override; + void onMouseSetFocus(MyGUI::Widget* _old) override; + void onMouseLostFocus(MyGUI::Widget* _new) override; + void baseUpdateEnable() override; - void shutdownOverride() final; + void shutdownOverride() override; bool _setState(const std::string &_value); diff --git a/components/widgets/windowcaption.hpp b/components/widgets/windowcaption.hpp index f8c1a310c..256c82831 100644 --- a/components/widgets/windowcaption.hpp +++ b/components/widgets/windowcaption.hpp @@ -14,11 +14,11 @@ namespace Gui public: WindowCaption(); - void setCaption(const MyGUI::UString &_value) final; - void initialiseOverride() final; + void setCaption(const MyGUI::UString &_value) override; + void initialiseOverride() override; - void setSize(const MyGUI::IntSize& _value) final; - void setCoord(const MyGUI::IntCoord& _value) final; + void setSize(const MyGUI::IntSize& _value) override; + void setCoord(const MyGUI::IntCoord& _value) override; private: MyGUI::Widget* mLeft;