From 1628abfd0f6c8c3940bbd7301a1924d78115686c Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 26 Feb 2019 19:08:47 +0300 Subject: [PATCH] calm down -Wdelete-non-virtual-dtor warnings remove -Wno-non-virtual-dtor from makefile (what does it do anyway? -Wdelete-non-virtual-dtor is part of -Wall) --- Makefile | 2 +- libs/archivelib.h | 4 ++-- libs/entitylib.h | 2 +- libs/imagelib.h | 2 +- libs/script/scripttokeniser.h | 2 +- libs/script/scripttokenwriter.h | 2 +- plugins/archivepak/archive.cpp | 2 +- plugins/archivewad/archive.cpp | 2 +- plugins/archivezip/archive.cpp | 6 +++--- plugins/entity/skincache.cpp | 4 ++-- plugins/mapq3/plugin.cpp | 14 +++++++------- plugins/mapxml/plugin.cpp | 2 +- plugins/md3model/model.h | 2 +- plugins/model/model.cpp | 2 +- plugins/vfspk3/archive.cpp | 2 +- radiant/build.cpp | 8 ++++---- radiant/dialog.cpp | 2 +- radiant/entityinspector.cpp | 19 ++++++++++--------- radiant/feedback.h | 4 ++-- radiant/renderstate.cpp | 4 ++-- radiant/scenegraph.cpp | 2 +- radiant/selection.cpp | 4 ++-- radiant/textures.cpp | 2 +- 23 files changed, 48 insertions(+), 47 deletions(-) diff --git a/Makefile b/Makefile index 95404b59..c6389303 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fn CPPFLAGS_COMMON = LDFLAGS_COMMON = LIBS_COMMON = -CXXFLAGS_COMMON = -std=c++11 -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti +CXXFLAGS_COMMON = -std=c++11 -Wreorder -fno-exceptions -fno-rtti ifeq ($(BUILD),debug) ifeq ($(findstring $(CFLAGS),-g),) diff --git a/libs/archivelib.h b/libs/archivelib.h index 78fc7eb5..2f69734d 100644 --- a/libs/archivelib.h +++ b/libs/archivelib.h @@ -157,7 +157,7 @@ TextInputStream& getInputStream(){ }; /// \brief An ArchiveFile which is stored as a single file on disk. -class DirectoryArchiveFile : public ArchiveFile +class DirectoryArchiveFile final : public ArchiveFile { CopiedString m_name; FileInputStream m_istream; @@ -196,7 +196,7 @@ InputStream& getInputStream(){ }; /// \brief An ArchiveTextFile which is stored as a single file on disk. -class DirectoryArchiveTextFile : public ArchiveTextFile +class DirectoryArchiveTextFile final : public ArchiveTextFile { CopiedString m_name; TextFileInputStream m_inputStream; diff --git a/libs/entitylib.h b/libs/entitylib.h index d12c7ed6..1dffe27e 100644 --- a/libs/entitylib.h +++ b/libs/entitylib.h @@ -308,7 +308,7 @@ void render( RenderStateFlags state ) const { /// /// - Notifies observers when value changes - value changes to "" on destruction. /// - Provides undo support through the global undo system. -class KeyValue : public EntityKeyValue +class KeyValue final : public EntityKeyValue { typedef UnsortedSet KeyObservers; diff --git a/libs/imagelib.h b/libs/imagelib.h index c3e9c1c9..c8f6b2ef 100644 --- a/libs/imagelib.h +++ b/libs/imagelib.h @@ -43,7 +43,7 @@ unsigned int width, height; RGBAImage( unsigned int _width, unsigned int _height ) : pixels( new RGBAPixel[_width * _height] ), width( _width ), height( _height ){ } -~RGBAImage(){ +virtual ~RGBAImage(){ delete[] pixels; } diff --git a/libs/script/scripttokeniser.h b/libs/script/scripttokeniser.h index 17d0779c..c3ff2b03 100644 --- a/libs/script/scripttokeniser.h +++ b/libs/script/scripttokeniser.h @@ -24,7 +24,7 @@ #include "iscriplib.h" -class ScriptTokeniser : public Tokeniser +class ScriptTokeniser final : public Tokeniser { enum CharType { diff --git a/libs/script/scripttokenwriter.h b/libs/script/scripttokenwriter.h index 49ee57af..27252313 100644 --- a/libs/script/scripttokenwriter.h +++ b/libs/script/scripttokenwriter.h @@ -24,7 +24,7 @@ #include "iscriplib.h" -class SimpleTokenWriter : public TokenWriter +class SimpleTokenWriter final : public TokenWriter { public: SimpleTokenWriter( TextOutputStream& ostream ) diff --git a/plugins/archivepak/archive.cpp b/plugins/archivepak/archive.cpp index 60ea4247..d99ac858 100644 --- a/plugins/archivepak/archive.cpp +++ b/plugins/archivepak/archive.cpp @@ -50,7 +50,7 @@ inline void buffer_findreplace( char* buffer, char find, char replace ){ #include "pak.h" -class PakArchive : public Archive +class PakArchive final : public Archive { class PakRecord { diff --git a/plugins/archivewad/archive.cpp b/plugins/archivewad/archive.cpp index 793cb0e7..2f3e7134 100644 --- a/plugins/archivewad/archive.cpp +++ b/plugins/archivewad/archive.cpp @@ -38,7 +38,7 @@ #include "wad.h" -class WadArchive : public Archive +class WadArchive final : public Archive { class wad_record_t { diff --git a/plugins/archivezip/archive.cpp b/plugins/archivezip/archive.cpp index 8b6fc07e..5d1bf25c 100644 --- a/plugins/archivezip/archive.cpp +++ b/plugins/archivezip/archive.cpp @@ -32,7 +32,7 @@ #include "archivelib.h" #include "zlibstream.h" -class DeflatedArchiveFile : public ArchiveFile +class DeflatedArchiveFile final : public ArchiveFile { CopiedString m_name; FileInputStream m_istream; @@ -61,7 +61,7 @@ InputStream& getInputStream(){ } }; -class DeflatedArchiveTextFile : public ArchiveTextFile +class DeflatedArchiveTextFile final : public ArchiveTextFile { CopiedString m_name; FileInputStream m_istream; @@ -91,7 +91,7 @@ TextInputStream& getInputStream(){ #include "fs_filesystem.h" -class ZipArchive : public Archive +class ZipArchive final : public Archive { class ZipRecord { diff --git a/plugins/entity/skincache.cpp b/plugins/entity/skincache.cpp index fce3c1a1..4517f48c 100644 --- a/plugins/entity/skincache.cpp +++ b/plugins/entity/skincache.cpp @@ -177,7 +177,7 @@ void unrealise(){ GlobalSkins g_skins; -class Doom3ModelSkinCacheElement : public ModelSkin +class Doom3ModelSkinCacheElement final : public ModelSkin { ModuleObservers m_observers; Doom3ModelSkin* m_skin; @@ -219,7 +219,7 @@ void forEachRemap( const SkinRemapCallback& callback ) const { } }; -class Doom3ModelSkinCache : public ModelSkinCache, public ModuleObserver +class Doom3ModelSkinCache final : public ModelSkinCache, public ModuleObserver { class CreateDoom3ModelSkin { diff --git a/plugins/mapq3/plugin.cpp b/plugins/mapq3/plugin.cpp index 328e6d29..125020ca 100644 --- a/plugins/mapq3/plugin.cpp +++ b/plugins/mapq3/plugin.cpp @@ -67,7 +67,7 @@ PatchCreator& getPatchDef2Doom3(){ } }; -class MapDoom3API : public TypeSystemRef, public MapFormat, public PrimitiveParser +class MapDoom3API final : public TypeSystemRef, public MapFormat, public PrimitiveParser { MapDoom3Dependencies& m_dependencies; public: @@ -138,7 +138,7 @@ MapDoom3Module; MapDoom3Module g_MapDoom3Module; -class MapQuake4API : public TypeSystemRef, public MapFormat, public PrimitiveParser +class MapQuake4API final : public TypeSystemRef, public MapFormat, public PrimitiveParser { MapDoom3Dependencies& m_dependencies; public: @@ -226,7 +226,7 @@ MapDependencies() : } }; -class MapQ3API : public TypeSystemRef, public MapFormat, public PrimitiveParser +class MapQ3API final : public TypeSystemRef, public MapFormat, public PrimitiveParser { mutable bool m_formatDetected; public: @@ -308,7 +308,7 @@ typedef SingletonModule MapQ3Module; MapQ3Module g_MapQ3Module; -class MapQ1API : public TypeSystemRef, public MapFormat, public PrimitiveParser +class MapQ1API final : public TypeSystemRef, public MapFormat, public PrimitiveParser { mutable bool m_formatDetected; public: @@ -385,7 +385,7 @@ typedef SingletonModule MapQ1Module; MapQ1Module g_MapQ1Module; -class MapHalfLifeAPI : public TypeSystemRef, public MapFormat, public PrimitiveParser +class MapHalfLifeAPI final : public TypeSystemRef, public MapFormat, public PrimitiveParser { public: typedef MapFormat Type; @@ -428,7 +428,7 @@ typedef SingletonModule MapHalfLifeModule; MapHalfLifeModule g_MapHalfLifeModule; -class MapQ2API : public TypeSystemRef, public MapFormat, public PrimitiveParser +class MapQ2API final : public TypeSystemRef, public MapFormat, public PrimitiveParser { mutable bool m_formatDetected; public: @@ -632,7 +632,7 @@ void VMF_Read( scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTab globalOutputStream() << g_vmf_brushes << " brushes\n"; } -class MapVMFAPI : public TypeSystemRef, public MapFormat +class MapVMFAPI final : public TypeSystemRef, public MapFormat { public: typedef MapFormat Type; diff --git a/plugins/mapxml/plugin.cpp b/plugins/mapxml/plugin.cpp index 4eced49d..179236d6 100644 --- a/plugins/mapxml/plugin.cpp +++ b/plugins/mapxml/plugin.cpp @@ -61,7 +61,7 @@ PatchCreator& getPatchDef2Doom3(){ } }; -class MapXMLAPI : public TypeSystemRef, public MapFormat +class MapXMLAPI final : public TypeSystemRef, public MapFormat { public: typedef MapFormat Type; diff --git a/plugins/md3model/model.h b/plugins/md3model/model.h index 0cef7b72..a00e894e 100644 --- a/plugins/md3model/model.h +++ b/plugins/md3model/model.h @@ -72,7 +72,7 @@ inline void parseTextureName( CopiedString& name, const char* token ){ } // generic renderable triangle surface -class Surface : +class Surface final : public OpenGLRenderable { public: diff --git a/plugins/model/model.cpp b/plugins/model/model.cpp index 4cf53124..32e2c230 100644 --- a/plugins/model/model.cpp +++ b/plugins/model/model.cpp @@ -65,7 +65,7 @@ void forEachLight( const RendererLightCallback& callback ) const { } }; -class PicoSurface : +class PicoSurface final : public OpenGLRenderable { AABB m_aabb_local; diff --git a/plugins/vfspk3/archive.cpp b/plugins/vfspk3/archive.cpp index a77b0728..de398777 100644 --- a/plugins/vfspk3/archive.cpp +++ b/plugins/vfspk3/archive.cpp @@ -40,7 +40,7 @@ #include "vfspk3.h" -class DirectoryArchive : public Archive +class DirectoryArchive final : public Archive { CopiedString m_root; public: diff --git a/radiant/build.cpp b/radiant/build.cpp index 972318df..808ea968 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -176,7 +176,7 @@ virtual XMLElementParser& pushElement( const XMLElement& element ) = 0; virtual void popElement( const char* name ) = 0; }; -class VariableStringXMLConstructor : public XMLElementParser +class VariableStringXMLConstructor final : public XMLElementParser { StringBuffer m_buffer; VariableString& m_variableString; @@ -198,7 +198,7 @@ void popElement( const char* name ){ } }; -class ConditionalXMLConstructor : public XMLElementParser +class ConditionalXMLConstructor final : public XMLElementParser { StringBuffer m_buffer; Conditional& m_conditional; @@ -220,7 +220,7 @@ void popElement( const char* name ){ } }; -class ToolXMLConstructor : public XMLElementParser +class ToolXMLConstructor final : public XMLElementParser { StringBuffer m_buffer; Tool& m_tool; @@ -266,7 +266,7 @@ void flush(){ typedef VariableString BuildCommand; typedef std::list Build; -class BuildXMLConstructor : public XMLElementParser +class BuildXMLConstructor final : public XMLElementParser { VariableStringXMLConstructor* m_variableString; Build& m_build; diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index dd16b5b8..006948b2 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -246,7 +246,7 @@ typedef ImportExport IntComboI template -class CallbackDialogData : public DLG_DATA +class CallbackDialogData final : public DLG_DATA { public: typedef Callback1 ImportCallback; diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 78befaa2..6c9bdf92 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -126,7 +126,7 @@ virtual void update() = 0; virtual void release() = 0; }; -class BooleanAttribute : public EntityAttribute +class BooleanAttribute final : public EntityAttribute { CopiedString m_key; GtkCheckButton* m_check; @@ -191,6 +191,7 @@ StringAttribute( const char* key ) : m_entry = entry; m_nonModal.connect( m_entry ); } +virtual ~StringAttribute() = default; GtkWidget* getWidget() const { return GTK_WIDGET( m_entry ); } @@ -236,7 +237,7 @@ TextureAttribute( const char* key ) : StringAttribute( key ){ }; -class ColorAttribute : public EntityAttribute +class ColorAttribute final : public EntityAttribute { CopiedString m_key; BrowsedPathEntry m_entry; @@ -280,7 +281,7 @@ typedef MemberCaller1 Passes; Passes m_passes; @@ -1140,7 +1140,7 @@ inline void setFogState( const OpenGLFogState& state ){ #define DEBUG_SHADERS 0 void OpenGLState_apply( const OpenGLState& self, OpenGLState& current, unsigned int globalstate ); -class OpenGLShaderCache : public ShaderCache, public TexturesCacheObserver, public ModuleObserver +class OpenGLShaderCache final : public ShaderCache, public TexturesCacheObserver, public ModuleObserver { class CreateOpenGLShader { diff --git a/radiant/scenegraph.cpp b/radiant/scenegraph.cpp index 1f885cff..5ff09e30 100644 --- a/radiant/scenegraph.cpp +++ b/radiant/scenegraph.cpp @@ -65,7 +65,7 @@ TypeId getTypeId( const char* name ){ } }; -class CompiledGraph : public scene::Graph, public scene::Instantiable::Observer +class CompiledGraph final : public scene::Graph, public scene::Instantiable::Observer { typedef std::map InstanceMap; diff --git a/radiant/selection.cpp b/radiant/selection.cpp index b35beda1..d465d774 100644 --- a/radiant/selection.cpp +++ b/radiant/selection.cpp @@ -4667,7 +4667,7 @@ public: // RadiantSelectionSystem -class RadiantSelectionSystem : +class RadiantSelectionSystem final : public SelectionSystem, public Translatable, public Rotatable, @@ -6271,7 +6271,7 @@ void highlight( DeviceVector position ){ -class RadiantWindowObserver : public SelectionSystemWindowObserver +class RadiantWindowObserver final : public SelectionSystemWindowObserver { DeviceVector m_epsilon; ModifierFlags m_state; diff --git a/radiant/textures.cpp b/radiant/textures.cpp index 7071cf7e..e374bdbc 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -377,7 +377,7 @@ hash_t operator()( const TextureKey& key ) const { #define DEBUG_TEXTURES 0 -class TexturesMap : public TexturesCache +class TexturesMap final : public TexturesCache { class TextureConstructor {