diff --git a/CMakeLists.txt b/CMakeLists.txt index 787d525cb9..53abdaeff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -594,7 +594,7 @@ endif() if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(OPENMW_CXX_FLAGS "-Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long ${OPENMW_CXX_FLAGS}") + set(OPENMW_CXX_FLAGS "-Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long -Wnon-virtual-dtor -Wunused ${OPENMW_CXX_FLAGS}") add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) if (APPLE) @@ -604,12 +604,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND NOT APPLE) if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.6) - set(${OPENMW_CXX_FLAGS} "${OPENMW_CXX_FLAGS} -Wno-potentially-evaluated-expression") + set(OPENMW_CXX_FLAGS "${OPENMW_CXX_FLAGS} -Wno-potentially-evaluated-expression") endif () endif() - if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6) - set(${OPENMW_CXX_FLAGS} "${OPENMW_CXX_FLAGS} -Wno-unused-but-set-parameter") + if (CMAKE_CXX_COMPILER_ID STREQUAL GNU) + set(OPENMW_CXX_FLAGS "${OPENMW_CXX_FLAGS} -Wno-unused-but-set-parameter -Wduplicated-branches -Wduplicated-cond -Wlogical-op") endif() endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) diff --git a/apps/openmw/mwgui/statswatcher.hpp b/apps/openmw/mwgui/statswatcher.hpp index 639e1bf591..da49eed10b 100644 --- a/apps/openmw/mwgui/statswatcher.hpp +++ b/apps/openmw/mwgui/statswatcher.hpp @@ -15,6 +15,8 @@ namespace MWGui class StatsListener { public: + virtual ~StatsListener() = default; + /// Set value for the given ID. virtual void setValue(std::string_view id, const MWMechanics::AttributeValue& value) {} virtual void setValue(std::string_view id, const MWMechanics::DynamicStat& value) {} diff --git a/apps/openmw/mwphysics/raycasting.hpp b/apps/openmw/mwphysics/raycasting.hpp index a8257ba31d..4a56e9bf33 100644 --- a/apps/openmw/mwphysics/raycasting.hpp +++ b/apps/openmw/mwphysics/raycasting.hpp @@ -21,6 +21,8 @@ namespace MWPhysics class RayCastingInterface { public: + virtual ~RayCastingInterface() = default; + /// Get distance from \a point to the collision shape of \a target. Uses a raycast to find where the /// 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 diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp index 74b4fcaad0..bd63d3de40 100644 --- a/apps/openmw/mwsound/ffmpeg_decoder.cpp +++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp @@ -248,12 +248,11 @@ namespace MWSound mFrame = av_frame_alloc(); - if (mCodecCtx->sample_fmt == AV_SAMPLE_FMT_FLT || mCodecCtx->sample_fmt == AV_SAMPLE_FMT_FLTP) - mOutputSampleFormat = AV_SAMPLE_FMT_S16; // FIXME: Check for AL_EXT_FLOAT32 support - else if (mCodecCtx->sample_fmt == AV_SAMPLE_FMT_U8P) + if (mCodecCtx->sample_fmt == AV_SAMPLE_FMT_U8P) mOutputSampleFormat = AV_SAMPLE_FMT_U8; - else if (mCodecCtx->sample_fmt == AV_SAMPLE_FMT_S16P) - mOutputSampleFormat = AV_SAMPLE_FMT_S16; + // FIXME: Check for AL_EXT_FLOAT32 support + // else if (mCodecCtx->sample_fmt == AV_SAMPLE_FMT_FLT || mCodecCtx->sample_fmt == AV_SAMPLE_FMT_FLTP) + // mOutputSampleFormat = AV_SAMPLE_FMT_S16; else mOutputSampleFormat = AV_SAMPLE_FMT_S16; diff --git a/apps/openmw/mwsound/movieaudiofactory.cpp b/apps/openmw/mwsound/movieaudiofactory.cpp index 8b77ff3f9d..1bb5275c45 100644 --- a/apps/openmw/mwsound/movieaudiofactory.cpp +++ b/apps/openmw/mwsound/movieaudiofactory.cpp @@ -64,10 +64,11 @@ namespace MWSound { if (sampleFormat == AV_SAMPLE_FMT_U8P || sampleFormat == AV_SAMPLE_FMT_U8) sampleFormat = AV_SAMPLE_FMT_U8; - else if (sampleFormat == AV_SAMPLE_FMT_S16P || sampleFormat == AV_SAMPLE_FMT_S16) - sampleFormat = AV_SAMPLE_FMT_S16; - else if (sampleFormat == AV_SAMPLE_FMT_FLTP || sampleFormat == AV_SAMPLE_FMT_FLT) - sampleFormat = AV_SAMPLE_FMT_S16; // FIXME: check for AL_EXT_FLOAT32 support + // else if (sampleFormat == AV_SAMPLE_FMT_S16P || sampleFormat == AV_SAMPLE_FMT_S16) + // sampleFormat = AV_SAMPLE_FMT_S16; + // FIXME: check for AL_EXT_FLOAT32 support + // else if (sampleFormat == AV_SAMPLE_FMT_FLTP || sampleFormat == AV_SAMPLE_FMT_FLT) + // sampleFormat = AV_SAMPLE_FMT_S16; else sampleFormat = AV_SAMPLE_FMT_S16; diff --git a/components/esm3/objectstate.hpp b/components/esm3/objectstate.hpp index 996c912a83..6063a3eb87 100644 --- a/components/esm3/objectstate.hpp +++ b/components/esm3/objectstate.hpp @@ -56,9 +56,8 @@ namespace ESM virtual void save(ESMWriter& esm, bool inInventory = false) const; - virtual /// Initialize to default state - void - blank(); + /// Initialize to default state + virtual void blank(); virtual ~ObjectState(); diff --git a/components/esm4/loadland.hpp b/components/esm4/loadland.hpp index ab5abe4f90..12de4aee31 100644 --- a/components/esm4/loadland.hpp +++ b/components/esm4/loadland.hpp @@ -123,8 +123,8 @@ namespace ESM4 Texture mTextures[4]; // 0 = bottom left, 1 = bottom right, 2 = top left, 3 = top right std::vector mIds; // land texture (LTEX) formids - virtual void load(Reader& reader); - // virtual void save(Writer& writer) const; + void load(Reader& reader); + // void save(Writer& writer) const; // void blank(); }; diff --git a/components/esm4/loadrace.cpp b/components/esm4/loadrace.cpp index 8538c94962..f81130a4ce 100644 --- a/components/esm4/loadrace.cpp +++ b/components/esm4/loadrace.cpp @@ -344,11 +344,11 @@ void ESM4::Race::load(ESM4::Reader& reader) // TES5 seems to have no body parts at all, instead keep EGT models } - else if (curr_part == 2) // egt - { - // std::cout << mEditorId << " egt " << currentIndex << std::endl; // FIXME - reader.skipSubRecordData(); // FIXME TES5 egt - } + // else if (curr_part == 2) // egt + // { + // // std::cout << mEditorId << " egt " << currentIndex << std::endl; // FIXME + // reader.skipSubRecordData(); // FIXME TES5 egt + // } else { // std::cout << mEditorId << " hkx " << currentIndex << std::endl; // FIXME diff --git a/components/esm4/loadsbsp.hpp b/components/esm4/loadsbsp.hpp index 29db8e9c7b..a5bbbde85a 100644 --- a/components/esm4/loadsbsp.hpp +++ b/components/esm4/loadsbsp.hpp @@ -51,8 +51,8 @@ namespace ESM4 std::string mEditorId; Dimension mDimension; - virtual void load(Reader& reader); - // virtual void save(Writer& writer) const; + void load(Reader& reader); + // void save(Writer& writer) const; // void blank(); }; diff --git a/components/lua/storage.hpp b/components/lua/storage.hpp index dcb5c2cdb8..e99fc525ff 100644 --- a/components/lua/storage.hpp +++ b/components/lua/storage.hpp @@ -42,6 +42,7 @@ namespace LuaUtil class Listener { public: + virtual ~Listener() = default; virtual void valueChanged( std::string_view section, std::string_view key, const sol::object& value) const = 0; virtual void sectionReplaced(std::string_view section, const sol::optional& values) const = 0; diff --git a/components/lua_ui/widget.hpp b/components/lua_ui/widget.hpp index 86f4529404..ffa4bc5af8 100644 --- a/components/lua_ui/widget.hpp +++ b/components/lua_ui/widget.hpp @@ -22,6 +22,9 @@ namespace LuaUi { public: WidgetExtension(); + + virtual ~WidgetExtension() = default; + // must be called after creating the underlying MyGUI::Widget void initialize(lua_State* lua, MyGUI::Widget* self); // must be called after before destroying the underlying MyGUI::Widget