From 2e7712a390828dafec7ef7fd43be44d7f0d1547a Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 26 Mar 2020 12:07:32 +0400 Subject: [PATCH] Fix C5204 warnings by adding default virtual destructors --- apps/openmw/mwgui/bookpage.hpp | 5 +++-- apps/openmw/mwgui/journalviewmodel.hpp | 9 ++++++++- apps/openmw/mwgui/windowbase.hpp | 1 + apps/openmw/mwrender/animation.hpp | 2 ++ apps/openmw/mwworld/cellpreloader.cpp | 2 ++ apps/openmw/mwworld/cellstore.hpp | 1 + apps/openmw/mwworld/containerstore.hpp | 1 + apps/openmw/mwworld/inventorystore.hpp | 1 + components/debug/debugging.hpp | 2 ++ components/detournavigator/navmeshtilescache.hpp | 4 ++++ components/loadinglistener/loadinglistener.hpp | 2 ++ components/widgets/box.hpp | 4 ++++ extern/oics/ICSChannelListener.h | 4 +++- extern/oics/ICSControlListener.h | 4 +++- extern/oics/ICSInputControlSystem.h | 4 ++++ 15 files changed, 41 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwgui/bookpage.hpp b/apps/openmw/mwgui/bookpage.hpp index 7f7dfd20af..4e49b8f67e 100644 --- a/apps/openmw/mwgui/bookpage.hpp +++ b/apps/openmw/mwgui/bookpage.hpp @@ -34,6 +34,8 @@ namespace MWGui /// right edge. The second integer is the height of all /// text combined prior to pagination. virtual std::pair getSize () const = 0; + + virtual ~TypesetBook() = default; }; struct GlyphInfo @@ -87,8 +89,7 @@ namespace MWGui typedef uint8_t const * Utf8Point; typedef std::pair Utf8Span; - - + virtual ~BookTypesetter() = default; enum Alignment { AlignLeft = -1, diff --git a/apps/openmw/mwgui/journalviewmodel.hpp b/apps/openmw/mwgui/journalviewmodel.hpp index fa40902250..3a93721303 100644 --- a/apps/openmw/mwgui/journalviewmodel.hpp +++ b/apps/openmw/mwgui/journalviewmodel.hpp @@ -39,6 +39,8 @@ namespace MWGui /// and end of the span relative to the body, and a valid topic ID if /// the span represents a keyword, or zero if not. virtual void visitSpans (std::function visitor) const = 0; + + virtual ~Entry() = default; }; /// An interface to topic data. @@ -47,6 +49,8 @@ namespace MWGui /// Returns a pre-formatted span of UTF8 encoded text representing /// the name of the NPC this portion of dialog was heard from. virtual Utf8Span source () const = 0; + + virtual ~TopicEntry() = default; }; /// An interface to journal data. @@ -55,8 +59,9 @@ namespace MWGui /// Returns a pre-formatted span of UTF8 encoded text representing /// the in-game date this entry was added to the journal. virtual Utf8Span timestamp () const = 0; - }; + virtual ~JournalEntry() = default; + }; /// called prior to journal opening virtual void load () = 0; @@ -85,6 +90,8 @@ namespace MWGui // create an instance of the default journal view model implementation static Ptr create (); + + virtual ~JournalViewModel() = default; }; } diff --git a/apps/openmw/mwgui/windowbase.hpp b/apps/openmw/mwgui/windowbase.hpp index 56249d77dc..a729a79209 100644 --- a/apps/openmw/mwgui/windowbase.hpp +++ b/apps/openmw/mwgui/windowbase.hpp @@ -81,6 +81,7 @@ namespace MWGui void onFrame(float dt); virtual void setAlpha(float alpha); + virtual ~NoDrop() = default; private: MyGUI::Widget* mWidget; diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index b4d4ac6648..17e13f0474 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -149,6 +149,8 @@ public: public: virtual void handleTextKey(const std::string &groupname, const std::multimap::const_iterator &key, const std::multimap& map) = 0; + + virtual ~TextKeyListener() = default; }; void setTextKeyListener(TextKeyListener* listener); diff --git a/apps/openmw/mwworld/cellpreloader.cpp b/apps/openmw/mwworld/cellpreloader.cpp index 77f522ea65..9a96e98060 100644 --- a/apps/openmw/mwworld/cellpreloader.cpp +++ b/apps/openmw/mwworld/cellpreloader.cpp @@ -40,6 +40,8 @@ namespace MWWorld return true; } + virtual ~ListModelsVisitor() = default; + std::vector& mOut; }; diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index 9529de8555..371867631b 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -382,6 +382,7 @@ namespace MWWorld public: ///@note must return nullptr if the cell is not found virtual CellStore* getCellStore(const ESM::CellId& cellId) = 0; + virtual ~GetCellStoreCallback() = default; }; /// @param callback to use for retrieving of additional CellStore objects by ID (required for resolving moved references) diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp index bbe031d1ae..f2858c5aa8 100644 --- a/apps/openmw/mwworld/containerstore.hpp +++ b/apps/openmw/mwworld/containerstore.hpp @@ -43,6 +43,7 @@ namespace MWWorld public: virtual void itemAdded(const ConstPtr& item, int count) {} virtual void itemRemoved(const ConstPtr& item, int count) {} + virtual ~ContainerStoreListener() = default; }; class ContainerStore diff --git a/apps/openmw/mwworld/inventorystore.hpp b/apps/openmw/mwworld/inventorystore.hpp index 663e7a2d35..e18132f4b8 100644 --- a/apps/openmw/mwworld/inventorystore.hpp +++ b/apps/openmw/mwworld/inventorystore.hpp @@ -34,6 +34,7 @@ namespace MWWorld */ virtual void permanentEffectAdded (const ESM::MagicEffect *magicEffect, bool isNew) {} + virtual ~InventoryStoreListener() = default; }; ///< \brief Variant of the ContainerStore for NPCs diff --git a/components/debug/debugging.hpp b/components/debug/debugging.hpp index e815543a12..1cae4b0065 100644 --- a/components/debug/debugging.hpp +++ b/components/debug/debugging.hpp @@ -38,6 +38,8 @@ namespace Debug virtual std::streamsize write(const char *str, std::streamsize size); + virtual ~DebugOutputBase() = default; + protected: static Level getLevelMarker(const char *str); diff --git a/components/detournavigator/navmeshtilescache.hpp b/components/detournavigator/navmeshtilescache.hpp index 5d5db47a8f..57f57a56f8 100644 --- a/components/detournavigator/navmeshtilescache.hpp +++ b/components/detournavigator/navmeshtilescache.hpp @@ -118,6 +118,8 @@ namespace DetourNavigator public: KeyView() = default; + virtual ~KeyView() = default; + KeyView(const std::string& value) : mValue(&value) {} @@ -161,6 +163,8 @@ namespace DetourNavigator return compare(other.getValue()) < 0; } + virtual ~RecastMeshKeyView() = default; + private: std::reference_wrapper mRecastMesh; std::reference_wrapper> mOffMeshConnections; diff --git a/components/loadinglistener/loadinglistener.hpp b/components/loadinglistener/loadinglistener.hpp index f5cfa5cf37..93467c1414 100644 --- a/components/loadinglistener/loadinglistener.hpp +++ b/components/loadinglistener/loadinglistener.hpp @@ -29,6 +29,8 @@ namespace Loading virtual void setProgress (size_t value) {} /// Increase current progress, default by 1. virtual void increaseProgress (size_t increase = 1) {} + + virtual ~Listener() = default; }; /// @brief Used for stopping a loading sequence when the object goes out of scope diff --git a/components/widgets/box.hpp b/components/widgets/box.hpp index 59bb7f88b3..e84c3bb1f9 100644 --- a/components/widgets/box.hpp +++ b/components/widgets/box.hpp @@ -33,6 +33,8 @@ namespace Gui virtual MyGUI::IntSize getRequestedSize() = 0; + virtual ~AutoSizedWidget() = default; + protected: void notifySizeChange(MyGUI::Widget* w); @@ -94,6 +96,8 @@ namespace Gui public: Box(); + virtual ~Box() = default; + void notifyChildrenSizeChanged(); protected: diff --git a/extern/oics/ICSChannelListener.h b/extern/oics/ICSChannelListener.h index a202e7e220..1f50d0e31d 100644 --- a/extern/oics/ICSChannelListener.h +++ b/extern/oics/ICSChannelListener.h @@ -38,9 +38,11 @@ namespace ICS { public: virtual void channelChanged(Channel* channel, float currentValue, float previousValue) = 0; + + virtual ~ChannelListener() = default; }; } -#endif +#endif diff --git a/extern/oics/ICSControlListener.h b/extern/oics/ICSControlListener.h index 97b3940be6..73fd06cb15 100644 --- a/extern/oics/ICSControlListener.h +++ b/extern/oics/ICSControlListener.h @@ -38,9 +38,11 @@ namespace ICS { public: virtual void controlChanged(Control* control, float currentValue, float previousValue) = 0; + + virtual ~ControlListener() = default; }; } -#endif +#endif diff --git a/extern/oics/ICSInputControlSystem.h b/extern/oics/ICSInputControlSystem.h index 3e808dd2e9..43e659d0a0 100644 --- a/extern/oics/ICSInputControlSystem.h +++ b/extern/oics/ICSInputControlSystem.h @@ -45,6 +45,8 @@ namespace ICS { public: virtual void logMessage(const char* text) = 0; + + virtual ~InputControlSystemLog() = default; }; class DllExport InputControlSystem @@ -262,6 +264,8 @@ namespace ICS InputControlSystem::MouseWheelClick click, Control::ControlChangingDirection direction); + virtual ~DetectingBindingListener() = default; + /* OPENMW CODE ENDS HERE * ------------------------------------------------------------------------------------- */ };