diff --git a/.clang-format b/.clang-format index 2580761a88..5772a80f40 100644 --- a/.clang-format +++ b/.clang-format @@ -101,3 +101,4 @@ TabWidth: 4 UseTab: Never StatementMacros: - META_Object + - META_StateAttribute diff --git a/CMakeLists.txt b/CMakeLists.txt index 55f9641672..706353e0d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -582,7 +582,7 @@ endif() if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) - set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wundef -Wno-unused-parameter -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}") + set(OPENMW_CXX_FLAGS "-Wall -Wextra -Wundef -Wextra-semi -Wno-unused-parameter -pedantic -Wno-long-long ${OPENMW_CXX_FLAGS}") add_definitions( -DBOOST_NO_CXX11_SCOPED_ENUMS=ON ) if (APPLE) @@ -592,12 +592,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(CMAKE_CXX_FLAGS "${CMAKE_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(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter") + set(${OPENMW_CXX_FLAGS} "${OPENMW_CXX_FLAGS} -Wno-unused-but-set-parameter") endif() endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 9a7592b316..2d989bf797 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -937,7 +937,7 @@ public: { if (Settings::Manager::getInt("lua num threads", "Lua") > 0) mThread = std::thread([this] { threadBody(); }); - }; + } ~LuaWorker() { @@ -969,7 +969,7 @@ public: } else update(); - }; + } void join() { diff --git a/apps/openmw/mwbase/luamanager.hpp b/apps/openmw/mwbase/luamanager.hpp index bc0f16048a..bcd30420ba 100644 --- a/apps/openmw/mwbase/luamanager.hpp +++ b/apps/openmw/mwbase/luamanager.hpp @@ -84,7 +84,7 @@ namespace MWBase virtual void setupPlayer(const MWWorld::Ptr&) = 0; // Saving - int countSavedGameRecords() const { return 1; }; + int countSavedGameRecords() const { return 1; } virtual void write(ESM::ESMWriter& writer, Loading::Listener& progress) = 0; virtual void saveLocalScripts(const MWWorld::Ptr& ptr, ESM::LuaScripts& data) = 0; diff --git a/apps/openmw/mwgui/container.hpp b/apps/openmw/mwgui/container.hpp index 7c625c488f..a2c2587222 100644 --- a/apps/openmw/mwgui/container.hpp +++ b/apps/openmw/mwgui/container.hpp @@ -36,7 +36,7 @@ namespace MWGui void onDeleteCustomData(const MWWorld::Ptr& ptr) override; - void treatNextOpenAsLoot() { mTreatNextOpenAsLoot = true; }; + void treatNextOpenAsLoot() { mTreatNextOpenAsLoot = true; } private: DragAndDrop* mDragAndDrop; diff --git a/apps/openmw/mwgui/messagebox.hpp b/apps/openmw/mwgui/messagebox.hpp index 78f3df0d84..220d3e1204 100644 --- a/apps/openmw/mwgui/messagebox.hpp +++ b/apps/openmw/mwgui/messagebox.hpp @@ -68,7 +68,7 @@ namespace MWGui { public: MessageBox(MessageBoxManager& parMessageBoxManager, std::string_view message); - const std::string& getMessage() { return mMessage; }; + const std::string& getMessage() { return mMessage; } int getHeight(); void update(int height); void setVisible(bool value); diff --git a/apps/openmw/mwinput/actionmanager.hpp b/apps/openmw/mwinput/actionmanager.hpp index 6b8fc1ed6b..ab30400b64 100644 --- a/apps/openmw/mwinput/actionmanager.hpp +++ b/apps/openmw/mwinput/actionmanager.hpp @@ -48,8 +48,8 @@ namespace MWInput void resetIdleTime(); float getIdleTime() const { return mTimeIdle; } - bool isAlwaysRunActive() const { return mAlwaysRunActive; }; - bool isSneaking() const { return mSneaking; }; + bool isAlwaysRunActive() const { return mAlwaysRunActive; } + bool isSneaking() const { return mSneaking; } void setAttemptJump(bool enabled) { mAttemptJump = enabled; } diff --git a/apps/openmw/mwmechanics/aipackage.hpp b/apps/openmw/mwmechanics/aipackage.hpp index 97a56b9c5a..be46315203 100644 --- a/apps/openmw/mwmechanics/aipackage.hpp +++ b/apps/openmw/mwmechanics/aipackage.hpp @@ -89,7 +89,7 @@ namespace MWMechanics virtual MWWorld::Ptr getTarget() const; /// Get the destination point of the AI package (not applicable to all AI packages, default return (0, 0, 0)) - virtual osg::Vec3f getDestination(const MWWorld::Ptr& actor) const { return osg::Vec3f(0, 0, 0); }; + virtual osg::Vec3f getDestination(const MWWorld::Ptr& actor) const { return osg::Vec3f(0, 0, 0); } /// Return true if having this AiPackage makes the actor side with the target in fights (default false) bool sideWithTarget() const { return mOptions.mSideWithTarget; } diff --git a/apps/openmw/mwmechanics/stat.hpp b/apps/openmw/mwmechanics/stat.hpp index c37cf61990..f4f28685b0 100644 --- a/apps/openmw/mwmechanics/stat.hpp +++ b/apps/openmw/mwmechanics/stat.hpp @@ -24,14 +24,14 @@ namespace MWMechanics Stat(); Stat(T base, T modified); - const T& getBase() const { return mBase; }; + const T& getBase() const { return mBase; } T getModified(bool capped = true) const; - T getModifier() const { return mModifier; }; + T getModifier() const { return mModifier; } - void setBase(const T& value) { mBase = value; }; + void setBase(const T& value) { mBase = value; } - void setModifier(const T& modifier) { mModifier = modifier; }; + void setModifier(const T& modifier) { mModifier = modifier; } void writeState(ESM::StatState& state) const; void readState(const ESM::StatState& state); @@ -63,13 +63,13 @@ namespace MWMechanics DynamicStat(T base, T modified, T current); DynamicStat(const Stat& stat, T current); - const T& getBase() const { return mStatic.getBase(); }; - T getModified(bool capped = true) const { return mStatic.getModified(capped); }; - const T& getCurrent() const { return mCurrent; }; + const T& getBase() const { return mStatic.getBase(); } + T getModified(bool capped = true) const { return mStatic.getModified(capped); } + const T& getCurrent() const { return mCurrent; } T getRatio(bool nanIsZero = true) const; /// Set base and adjust current accordingly. - void setBase(const T& value) { mStatic.setBase(value); }; + void setBase(const T& value) { mStatic.setBase(value); } void setCurrent(const T& value, bool allowDecreaseBelowZero = false, bool allowIncreaseAboveModified = false); diff --git a/apps/openmw/mwrender/actoranimation.hpp b/apps/openmw/mwrender/actoranimation.hpp index d82dc41540..b6586d4eab 100644 --- a/apps/openmw/mwrender/actoranimation.hpp +++ b/apps/openmw/mwrender/actoranimation.hpp @@ -57,7 +57,7 @@ namespace MWRender { osg::Vec4f stubColor = osg::Vec4f(0, 0, 0, 0); return attachMesh(model, bonename, false, &stubColor); - }; + } osg::ref_ptr attach( const std::string& model, std::string_view bonename, std::string_view bonefilter, bool isLight); diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 756f7534b7..d7d99dc303 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -155,7 +155,7 @@ namespace MWRender void setTextKeyListener(TextKeyListener* listener); - virtual bool updateCarriedLeftVisible(const int weaptype) const { return false; }; + virtual bool updateCarriedLeftVisible(const int weaptype) const { return false; } typedef std::unordered_map, Misc::StringUtils::CiHash, Misc::StringUtils::CiEqual> diff --git a/apps/openmw/mwrender/bulletdebugdraw.hpp b/apps/openmw/mwrender/bulletdebugdraw.hpp index 017d3af90a..662fc9f14e 100644 --- a/apps/openmw/mwrender/bulletdebugdraw.hpp +++ b/apps/openmw/mwrender/bulletdebugdraw.hpp @@ -32,7 +32,9 @@ namespace MWRender CollisionView(btVector3 orig, btVector3 normal) : mOrig(orig) , mEnd(orig + normal * 20) - , mCreated(std::chrono::steady_clock::now()){}; + , mCreated(std::chrono::steady_clock::now()) + { + } }; std::vector mCollisionViews; osg::ref_ptr mShapesRoot; @@ -69,7 +71,9 @@ namespace MWRender void showCollisions(); void drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, - const btVector3& color) override{}; + const btVector3& color) override + { + } void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color) override; void reportErrorWarning(const char* warningString) override; diff --git a/apps/openmw/mwrender/cell.hpp b/apps/openmw/mwrender/cell.hpp index e6175f6ffd..7fe7e08a5b 100644 --- a/apps/openmw/mwrender/cell.hpp +++ b/apps/openmw/mwrender/cell.hpp @@ -8,7 +8,7 @@ namespace MWRender class CellRender { public: - virtual ~CellRender(){}; + virtual ~CellRender() = default; /// Make the cell visible. Load the cell if necessary. virtual void show() = 0; diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 452fd31188..7d74d3cfc6 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -185,7 +185,7 @@ namespace MWRender camera->setNodeMask(Mask_RenderToTexture); camera->addChild(mGroup); - }; + } void apply(osg::Camera* camera) override { @@ -195,7 +195,7 @@ namespace MWRender if (shouldDoTextureArray()) Stereo::setMultiviewMatrices(mGroup->getOrCreateStateSet(), { mPerspectiveMatrix, mPerspectiveMatrix }); - }; + } void addChild(osg::Node* node) { mGroup->addChild(node); } diff --git a/apps/openmw_test_suite/mwscript/test_utils.hpp b/apps/openmw_test_suite/mwscript/test_utils.hpp index f158ac62d5..029d201a96 100644 --- a/apps/openmw_test_suite/mwscript/test_utils.hpp +++ b/apps/openmw_test_suite/mwscript/test_utils.hpp @@ -92,17 +92,17 @@ namespace mFloats.clear(); } - int getShort(std::size_t index) const { return getLocal(index, mShorts); }; + int getShort(std::size_t index) const { return getLocal(index, mShorts); } - int getLong(std::size_t index) const { return getLocal(index, mLongs); }; + int getLong(std::size_t index) const { return getLocal(index, mLongs); } - float getFloat(std::size_t index) const { return getLocal(index, mFloats); }; + float getFloat(std::size_t index) const { return getLocal(index, mFloats); } - void setShort(std::size_t index, int value) { setLocal(value, index, mShorts); }; + void setShort(std::size_t index, int value) { setLocal(value, index, mShorts); } - void setLong(std::size_t index, int value) { setLocal(value, index, mLongs); }; + void setLong(std::size_t index, int value) { setLocal(value, index, mLongs); } - void setFloat(std::size_t index, float value) { setLocal(value, index, mFloats); }; + void setFloat(std::size_t index, float value) { setLocal(value, index, mFloats); } }; class GlobalVariables @@ -128,17 +128,17 @@ namespace mFloats.clear(); } - int getShort(std::string_view name) const { return getGlobal(name, mShorts); }; + int getShort(std::string_view name) const { return getGlobal(name, mShorts); } - int getLong(std::string_view name) const { return getGlobal(name, mLongs); }; + int getLong(std::string_view name) const { return getGlobal(name, mLongs); } - float getFloat(std::string_view name) const { return getGlobal(name, mFloats); }; + float getFloat(std::string_view name) const { return getGlobal(name, mFloats); } - void setShort(std::string_view name, int value) { mShorts[std::string(name)] = value; }; + void setShort(std::string_view name, int value) { mShorts[std::string(name)] = value; } - void setLong(std::string_view name, int value) { mLongs[std::string(name)] = value; }; + void setLong(std::string_view name, int value) { mLongs[std::string(name)] = value; } - void setFloat(std::string_view name, float value) { mFloats[std::string(name)] = value; }; + void setFloat(std::string_view name, float value) { mFloats[std::string(name)] = value; } }; class TestInterpreterContext : public Interpreter::Context @@ -147,65 +147,65 @@ namespace std::map> mMembers; public: - std::string_view getTarget() const override { return {}; }; + std::string_view getTarget() const override { return {}; } - int getLocalShort(int index) const override { return mLocals.getShort(index); }; + int getLocalShort(int index) const override { return mLocals.getShort(index); } - int getLocalLong(int index) const override { return mLocals.getLong(index); }; + int getLocalLong(int index) const override { return mLocals.getLong(index); } - float getLocalFloat(int index) const override { return mLocals.getFloat(index); }; + float getLocalFloat(int index) const override { return mLocals.getFloat(index); } - void setLocalShort(int index, int value) override { mLocals.setShort(index, value); }; + void setLocalShort(int index, int value) override { mLocals.setShort(index, value); } - void setLocalLong(int index, int value) override { mLocals.setLong(index, value); }; + void setLocalLong(int index, int value) override { mLocals.setLong(index, value); } - void setLocalFloat(int index, float value) override { mLocals.setFloat(index, value); }; + void setLocalFloat(int index, float value) override { mLocals.setFloat(index, value); } - void messageBox(std::string_view message, const std::vector& buttons) override{}; + void messageBox(std::string_view message, const std::vector& buttons) override {} - void report(const std::string& message) override{}; + void report(const std::string& message) override {} - int getGlobalShort(std::string_view name) const override { return {}; }; + int getGlobalShort(std::string_view name) const override { return {}; } - int getGlobalLong(std::string_view name) const override { return {}; }; + int getGlobalLong(std::string_view name) const override { return {}; } - float getGlobalFloat(std::string_view name) const override { return {}; }; + float getGlobalFloat(std::string_view name) const override { return {}; } - void setGlobalShort(std::string_view name, int value) override{}; + void setGlobalShort(std::string_view name, int value) override {} - void setGlobalLong(std::string_view name, int value) override{}; + void setGlobalLong(std::string_view name, int value) override {} - void setGlobalFloat(std::string_view name, float value) override{}; + void setGlobalFloat(std::string_view name, float value) override {} - std::vector getGlobals() const override { return {}; }; + std::vector getGlobals() const override { return {}; } - char getGlobalType(std::string_view name) const override { return ' '; }; + char getGlobalType(std::string_view name) const override { return ' '; } - std::string getActionBinding(std::string_view action) const override { return {}; }; + std::string getActionBinding(std::string_view action) const override { return {}; } - std::string_view getActorName() const override { return {}; }; + std::string_view getActorName() const override { return {}; } - std::string_view getNPCRace() const override { return {}; }; + std::string_view getNPCRace() const override { return {}; } - std::string_view getNPCClass() const override { return {}; }; + std::string_view getNPCClass() const override { return {}; } - std::string_view getNPCFaction() const override { return {}; }; + std::string_view getNPCFaction() const override { return {}; } - std::string_view getNPCRank() const override { return {}; }; + std::string_view getNPCRank() const override { return {}; } - std::string_view getPCName() const override { return {}; }; + std::string_view getPCName() const override { return {}; } - std::string_view getPCRace() const override { return {}; }; + std::string_view getPCRace() const override { return {}; } - std::string_view getPCClass() const override { return {}; }; + std::string_view getPCClass() const override { return {}; } - std::string_view getPCRank() const override { return {}; }; + std::string_view getPCRank() const override { return {}; } - std::string_view getPCNextRank() const override { return {}; }; + std::string_view getPCNextRank() const override { return {}; } - int getPCBounty() const override { return {}; }; + int getPCBounty() const override { return {}; } - std::string_view getCurrentCellName() const override { return {}; }; + std::string_view getCurrentCellName() const override { return {}; } int getMemberShort(std::string_view id, std::string_view name, bool global) const override { @@ -213,7 +213,7 @@ namespace if (it != mMembers.end()) return it->second.getShort(name); return {}; - }; + } int getMemberLong(std::string_view id, std::string_view name, bool global) const override { @@ -221,7 +221,7 @@ namespace if (it != mMembers.end()) return it->second.getLong(name); return {}; - }; + } float getMemberFloat(std::string_view id, std::string_view name, bool global) const override { @@ -229,22 +229,22 @@ namespace if (it != mMembers.end()) return it->second.getFloat(name); return {}; - }; + } void setMemberShort(std::string_view id, std::string_view name, int value, bool global) override { mMembers[std::string(id)].setShort(name, value); - }; + } void setMemberLong(std::string_view id, std::string_view name, int value, bool global) override { mMembers[std::string(id)].setLong(name, value); - }; + } void setMemberFloat(std::string_view id, std::string_view name, float value, bool global) override { mMembers[std::string(id)].setFloat(name, value); - }; + } }; struct CompiledScript diff --git a/components/bsa/bsa_file.hpp b/components/bsa/bsa_file.hpp index 8c27e9548e..bc77819567 100644 --- a/components/bsa/bsa_file.hpp +++ b/components/bsa/bsa_file.hpp @@ -65,7 +65,7 @@ namespace Bsa Hash hash; // Zero-terminated file name - const char* name() const { return &(*namesBuffer)[namesOffset]; }; + const char* name() const { return &(*namesBuffer)[namesOffset]; } uint32_t namesOffset = 0; std::vector* namesBuffer = nullptr; diff --git a/components/compiler/scanner.hpp b/components/compiler/scanner.hpp index c11381e9df..2c8a64e31a 100644 --- a/components/compiler/scanner.hpp +++ b/components/compiler/scanner.hpp @@ -149,7 +149,7 @@ namespace Compiler in.seekg(p_orig); return true; - }; + } void blank() { diff --git a/components/debug/gldebug.hpp b/components/debug/gldebug.hpp index 1e1cd71a0c..adeef0afa5 100644 --- a/components/debug/gldebug.hpp +++ b/components/debug/gldebug.hpp @@ -53,7 +53,7 @@ namespace Debug DebugGroup(const DebugGroup& debugGroup, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); - META_StateAttribute(Debug, DebugGroup, osg::StateAttribute::Type(101)); + META_StateAttribute(Debug, DebugGroup, osg::StateAttribute::Type(101)) void apply(osg::State& state) const override; diff --git a/components/esm3/esmreader.hpp b/components/esm3/esmreader.hpp index c07518ea56..a430736728 100644 --- a/components/esm3/esmreader.hpp +++ b/components/esm3/esmreader.hpp @@ -35,10 +35,10 @@ namespace ESM const std::string& getDesc() const { return mHeader.mData.desc; } const std::vector& getGameFiles() const { return mHeader.mMaster; } const Header& getHeader() const { return mHeader; } - int getFormat() const { return mHeader.mFormat; }; + int getFormat() const { return mHeader.mFormat; } const NAME& retSubName() const { return mCtx.subName; } uint32_t getSubSize() const { return mCtx.leftSub; } - const std::filesystem::path& getName() const { return mCtx.filename; }; + const std::filesystem::path& getName() const { return mCtx.filename; } bool isOpen() const { return mEsm != nullptr; } /************************************************************************* @@ -73,7 +73,7 @@ namespace ESM void openRaw(const std::filesystem::path& filename); /// Get the current position in the file. Make sure that the file has been opened! - size_t getFileOffset() const { return mEsm->tellg(); }; + size_t getFileOffset() const { return mEsm->tellg(); } // This is a quick hack for multiple esm/esp files. Each plugin introduces its own // terrain palette, but ESMReader does not pass a reference to the correct plugin @@ -200,7 +200,7 @@ namespace ESM bool peekNextSub(NAME name); // Store the current subrecord name for the next call of getSubName() - void cacheSubName() { mCtx.subCached = true; }; + void cacheSubName() { mCtx.subCached = true; } // Read subrecord name. This gets called a LOT, so I've optimized it // slightly. @@ -283,7 +283,7 @@ namespace ESM [[noreturn]] void fail(const std::string& msg); /// Sets font encoder for ESM strings - void setEncoder(ToUTF8::Utf8Encoder* encoder) { mEncoder = encoder; }; + void setEncoder(ToUTF8::Utf8Encoder* encoder) { mEncoder = encoder; } /// Get record flags of last record unsigned int getRecordFlags() { return mRecordFlags; } diff --git a/components/esm3/loadweap.hpp b/components/esm3/loadweap.hpp index b54f5e8327..2d1acb3f78 100644 --- a/components/esm3/loadweap.hpp +++ b/components/esm3/loadweap.hpp @@ -123,7 +123,9 @@ namespace ESM , mSkill(skill) , mWeaponClass(weaponClass) , mAmmoType(ammoType) - , mFlags(flags){}; + , mFlags(flags) + { + } }; } diff --git a/components/esm4/reader.hpp b/components/esm4/reader.hpp index 1af583e13c..f9ceddfeea 100644 --- a/components/esm4/reader.hpp +++ b/components/esm4/reader.hpp @@ -147,16 +147,16 @@ namespace ESM4 inline bool isEsm4() const { return true; } - inline void setEncoder(const ToUTF8::StatelessUtf8Encoder* encoder) { mEncoder = encoder; }; + inline void setEncoder(const ToUTF8::StatelessUtf8Encoder* encoder) { mEncoder = encoder; } const std::vector& getGameFiles() const { return mHeader.mMaster; } inline int getRecordCount() const { return mHeader.mData.records; } inline const std::string getAuthor() const { return mHeader.mAuthor; } - inline int getFormat() const { return 0; }; // prob. not relevant for ESM4 + inline int getFormat() const { return 0; } // prob. not relevant for ESM4 inline const std::string getDesc() const { return mHeader.mDesc; } - inline std::filesystem::path getFileName() const { return mCtx.filename; }; // not used + inline std::filesystem::path getFileName() const { return mCtx.filename; } // not used inline bool hasMoreRecs() const { return (mFileSize - mCtx.fileRead) > 0; } diff --git a/components/lua_ui/layers.hpp b/components/lua_ui/layers.hpp index 029ac2454a..50fab79d6a 100644 --- a/components/lua_ui/layers.hpp +++ b/components/lua_ui/layers.hpp @@ -21,7 +21,7 @@ namespace LuaUi { } - const std::string& name() const noexcept { return mName; }; + const std::string& name() const noexcept { return mName; } const osg::Vec2f size() { MyGUI::ILayer* p = refresh(); diff --git a/components/lua_ui/widget.hpp b/components/lua_ui/widget.hpp index 3f34f6ec80..86f4529404 100644 --- a/components/lua_ui/widget.hpp +++ b/components/lua_ui/widget.hpp @@ -96,7 +96,7 @@ namespace LuaUi virtual void updateTemplate(); virtual void updateProperties(); - virtual void updateChildren(){}; + virtual void updateChildren() {} lua_State* lua() const { return mLua; } diff --git a/components/sceneutil/clearcolor.hpp b/components/sceneutil/clearcolor.hpp old mode 100755 new mode 100644 index 17766bf6d1..bb335d7281 --- a/components/sceneutil/clearcolor.hpp +++ b/components/sceneutil/clearcolor.hpp @@ -28,7 +28,7 @@ namespace SceneUtil META_StateAttribute(fx, ClearColor, static_cast(100)) - int compare(const StateAttribute& sa) const override + int compare(const StateAttribute& sa) const override { COMPARE_StateAttribute_Types(ClearColor, sa); diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index 68e2a3cf8f..71eb06f0f8 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -318,10 +318,7 @@ namespace SceneUtil META_StateAttribute(SceneUtil, DisableLight, osg::StateAttribute::LIGHT) - unsigned int getMember() const override - { - return mIndex; - } + unsigned int getMember() const override { return mIndex; } bool getModeUsage(ModeUsage& usage) const override { @@ -387,7 +384,7 @@ namespace SceneUtil META_StateAttribute(SceneUtil, FFPLightStateAttribute, osg::StateAttribute::LIGHT) - void apply(osg::State& state) const override + void apply(osg::State& state) const override { if (mLights.empty()) return; diff --git a/components/sceneutil/lightmanager.hpp b/components/sceneutil/lightmanager.hpp index 905e0d0516..3c6ccf6350 100644 --- a/components/sceneutil/lightmanager.hpp +++ b/components/sceneutil/lightmanager.hpp @@ -178,7 +178,7 @@ namespace SceneUtil META_StateAttribute(SceneUtil, UBOManager, osg::StateAttribute::LIGHT) - void apply(osg::State& state) const override; + void apply(osg::State& state) const override; auto& getLightBuffer(size_t frameNum) { return mLightBuffers[frameNum % 2]; } diff --git a/components/sceneutil/mwshadowtechnique.hpp b/components/sceneutil/mwshadowtechnique.hpp index 14cb885591..36cf83c68a 100644 --- a/components/sceneutil/mwshadowtechnique.hpp +++ b/components/sceneutil/mwshadowtechnique.hpp @@ -44,7 +44,7 @@ namespace SceneUtil { MWShadowTechnique(const MWShadowTechnique& vdsm, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); - META_Object(SceneUtil, MWShadowTechnique); + META_Object(SceneUtil, MWShadowTechnique) /** initialize the ShadowedScene and local cached data structures.*/ void init() override; diff --git a/components/sceneutil/osgacontroller.hpp b/components/sceneutil/osgacontroller.hpp index 5beee601f2..8739d68b99 100644 --- a/components/sceneutil/osgacontroller.hpp +++ b/components/sceneutil/osgacontroller.hpp @@ -48,7 +48,7 @@ namespace SceneUtil { public: /// @brief Handles the animation for osgAnimation formats - OsgAnimationController(){}; + OsgAnimationController() = default; OsgAnimationController(const OsgAnimationController& copy, const osg::CopyOp& copyop); diff --git a/components/sceneutil/riggeometryosgaextension.hpp b/components/sceneutil/riggeometryosgaextension.hpp index dd22e5fa80..c8c575e913 100644 --- a/components/sceneutil/riggeometryosgaextension.hpp +++ b/components/sceneutil/riggeometryosgaextension.hpp @@ -20,7 +20,7 @@ namespace SceneUtil OsgaRigGeometry(const OsgaRigGeometry& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); - META_Object(SceneUtil, OsgaRigGeometry); + META_Object(SceneUtil, OsgaRigGeometry) void computeMatrixFromRootSkeleton(osg::MatrixList mtxList); }; @@ -36,7 +36,7 @@ namespace SceneUtil RigGeometryHolder(const osgAnimation::RigGeometry& copy, const osg::CopyOp& copyop); - META_Object(SceneUtil, RigGeometryHolder); + META_Object(SceneUtil, RigGeometryHolder) void setSourceRigGeometry(osg::ref_ptr sourceRigGeometry); osg::ref_ptr getSourceRigGeometry() const; diff --git a/components/sceneutil/rtt.hpp b/components/sceneutil/rtt.hpp index f46d6c813e..8b4ca160f3 100644 --- a/components/sceneutil/rtt.hpp +++ b/components/sceneutil/rtt.hpp @@ -62,12 +62,12 @@ namespace SceneUtil osg::Camera* getCamera(osgUtil::CullVisitor* cv); /// Set default settings - optionally override in derived classes - virtual void setDefaults(osg::Camera* camera){}; + virtual void setDefaults(osg::Camera* camera) {} /// Apply state - to override in derived classes /// @note Due to the view mapping approach you *have* to apply all camera settings, even if they have not /// changed since the last frame. - virtual void apply(osg::Camera* camera){}; + virtual void apply(osg::Camera* camera) {} /// Apply any state specific to the Left view. Default implementation does nothing. Called after apply() virtual void applyLeft(osg::Camera* camera) {} diff --git a/components/shader/removedalphafunc.hpp b/components/shader/removedalphafunc.hpp index 31f7305293..c87ee771db 100644 --- a/components/shader/removedalphafunc.hpp +++ b/components/shader/removedalphafunc.hpp @@ -30,7 +30,7 @@ namespace Shader { } - META_StateAttribute(Shader, RemovedAlphaFunc, ALPHAFUNC); + META_StateAttribute(Shader, RemovedAlphaFunc, ALPHAFUNC) void apply(osg::State& state) const override {} diff --git a/components/stereo/multiview.hpp b/components/stereo/multiview.hpp index f4750a9cea..684d998f7a 100644 --- a/components/stereo/multiview.hpp +++ b/components/stereo/multiview.hpp @@ -67,7 +67,7 @@ namespace Stereo int width() const { return mWidth; } int height() const { return mHeight; } - int samples() const { return mSamples; }; + int samples() const { return mSamples; } private: osg::Texture2D* createTexture(GLint sourceFormat, GLint sourceType, GLint internalFormat); @@ -122,8 +122,8 @@ namespace Stereo void dirty() { mDirtyLayers = true; } - const osg::FrameBufferObject* resolveFbo() const { return mResolveFbo; }; - const osg::FrameBufferObject* msaaFbo() const { return mMsaaFbo; }; + const osg::FrameBufferObject* resolveFbo() const { return mResolveFbo; } + const osg::FrameBufferObject* msaaFbo() const { return mMsaaFbo; } private: void setupLayers(); diff --git a/components/stereo/stereomanager.hpp b/components/stereo/stereomanager.hpp index 159741d77e..53f8e00740 100644 --- a/components/stereo/stereomanager.hpp +++ b/components/stereo/stereomanager.hpp @@ -74,7 +74,7 @@ namespace Stereo //! Sets up any definitions necessary for stereo rendering void shaderStereoDefines(Shader::ShaderManager::DefineMap& defines) const; - const std::shared_ptr& multiviewFramebuffer() { return mMultiviewFramebuffer; }; + const std::shared_ptr& multiviewFramebuffer() { return mMultiviewFramebuffer; } //! Sets rendering resolution of each eye to eyeResolution. //! Once set, there will no longer be any connection between rendering resolution and screen/window resolution. diff --git a/components/terrain/quadtreenode.hpp b/components/terrain/quadtreenode.hpp index ac2dd8d08f..abe92b1ba9 100644 --- a/components/terrain/quadtreenode.hpp +++ b/components/terrain/quadtreenode.hpp @@ -54,7 +54,7 @@ namespace Terrain _children.reserve(4); _children.push_back(child); child->addParent(this); - }; + } float distance(const osg::Vec3f& v) const;