From bd7f56ddb45b8e1b5442e8054f1caadd0b26ed2c Mon Sep 17 00:00:00 2001 From: elsid Date: Wed, 6 Jul 2022 13:09:19 +0200 Subject: [PATCH] Don't rely on virtual dispatch in constructor apps/openmw/mwrender/animation.cpp:1841:60: warning: Call to virtual method 'ObjectAnimation::canBeHarvested' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall] if (ptr.getRefData().getCustomData() != nullptr && canBeHarvested()) ^~~~~~~~~~~~~~~~ apps/openmw/mwrender/bulletdebugdraw.cpp:33:5: warning: Call to virtual method 'DebugDrawer::setDebugMode' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall] setDebugMode(debugMode); ^~~~~~~~~~~~~~~~~~~~~~~ openmw/mwinput/controllermanager.cpp:63:17: warning: Call to virtual method 'ControllerManager::controllerAdded' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall] controllerAdded(fakeDeviceID, evt); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- apps/openmw/mwinput/controllermanager.cpp | 2 +- apps/openmw/mwrender/animation.cpp | 2 +- apps/openmw/mwrender/bulletdebugdraw.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwinput/controllermanager.cpp b/apps/openmw/mwinput/controllermanager.cpp index 4db9fad595..adc62a80c5 100644 --- a/apps/openmw/mwinput/controllermanager.cpp +++ b/apps/openmw/mwinput/controllermanager.cpp @@ -60,7 +60,7 @@ namespace MWInput SDL_ControllerDeviceEvent evt; evt.which = i; static const int fakeDeviceID = 1; - controllerAdded(fakeDeviceID, evt); + ControllerManager::controllerAdded(fakeDeviceID, evt); Log(Debug::Info) << "Detected game controller: " << SDL_GameControllerNameForIndex(i); } else diff --git a/apps/openmw/mwrender/animation.cpp b/apps/openmw/mwrender/animation.cpp index f50ef156b9..0684550fb3 100644 --- a/apps/openmw/mwrender/animation.cpp +++ b/apps/openmw/mwrender/animation.cpp @@ -1838,7 +1838,7 @@ namespace MWRender mObjectRoot->accept(visitor); } - if (ptr.getRefData().getCustomData() != nullptr && canBeHarvested()) + if (ptr.getRefData().getCustomData() != nullptr && ObjectAnimation::canBeHarvested()) { const MWWorld::ContainerStore& store = ptr.getClass().getContainerStore(ptr); if (!store.hasVisibleItems()) diff --git a/apps/openmw/mwrender/bulletdebugdraw.cpp b/apps/openmw/mwrender/bulletdebugdraw.cpp index b169251465..b14b64e771 100644 --- a/apps/openmw/mwrender/bulletdebugdraw.cpp +++ b/apps/openmw/mwrender/bulletdebugdraw.cpp @@ -30,7 +30,7 @@ DebugDrawer::DebugDrawer(osg::ref_ptr parentNode, btCollisionWorld * : mParentNode(parentNode), mWorld(world) { - setDebugMode(debugMode); + DebugDrawer::setDebugMode(debugMode); } void DebugDrawer::createGeometry()