diff --git a/apps/openmw/mwclass/creature.cpp b/apps/openmw/mwclass/creature.cpp index a9b1f461ca..4eeab5a393 100644 --- a/apps/openmw/mwclass/creature.cpp +++ b/apps/openmw/mwclass/creature.cpp @@ -82,7 +82,7 @@ namespace MWClass const Creature::GMST& Creature::getGmst() { - static const GMST gmst = [] + static const GMST staticGmst = [] { GMST gmst; @@ -105,7 +105,7 @@ namespace MWClass return gmst; } (); - return gmst; + return staticGmst; } void Creature::ensureCustomData (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index becfb8719f..ca07d99e3f 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -266,7 +266,7 @@ namespace MWClass const Npc::GMST& Npc::getGmst() { - static const GMST gmst = [] + static const GMST staticGmst = [] { GMST gmst; @@ -296,7 +296,7 @@ namespace MWClass return gmst; } (); - return gmst; + return staticGmst; } void Npc::ensureCustomData (const MWWorld::Ptr& ptr) const diff --git a/apps/openmw/mwphysics/physicssystem.cpp b/apps/openmw/mwphysics/physicssystem.cpp index 6c46fd6d05..2a5bcb58bd 100644 --- a/apps/openmw/mwphysics/physicssystem.cpp +++ b/apps/openmw/mwphysics/physicssystem.cpp @@ -526,10 +526,10 @@ namespace MWPhysics void PhysicsSystem::updatePtr(const MWWorld::Ptr &old, const MWWorld::Ptr &updated) { - if (auto found = mObjects.find(old.mRef); found != mObjects.end()) - found->second->updatePtr(updated); - else if (auto found = mActors.find(old.mRef); found != mActors.end()) - found->second->updatePtr(updated); + if (auto foundObject = mObjects.find(old.mRef); foundObject != mObjects.end()) + foundObject->second->updatePtr(updated); + else if (auto foundActor = mActors.find(old.mRef); foundActor != mActors.end()) + foundActor->second->updatePtr(updated); for (auto& [_, actor] : mActors) { diff --git a/components/detournavigator/navigatorimpl.cpp b/components/detournavigator/navigatorimpl.cpp index f29ae1bb95..9a59ecf6d7 100644 --- a/components/detournavigator/navigatorimpl.cpp +++ b/components/detournavigator/navigatorimpl.cpp @@ -69,8 +69,8 @@ namespace DetourNavigator if (const btCollisionShape* const avoidShape = shapes.mShapeInstance->getAvoidCollisionShape()) { const ObjectId avoidId(avoidShape); - const CollisionShape collisionShape {shapes.mShapeInstance, *avoidShape}; - if (mNavMeshManager.updateObject(avoidId, collisionShape, transform, AreaType_null)) + const CollisionShape avoidCollisionShape {shapes.mShapeInstance, *avoidShape}; + if (mNavMeshManager.updateObject(avoidId, avoidCollisionShape, transform, AreaType_null)) { updateAvoidShapeId(id, avoidId); result = true; diff --git a/components/detournavigator/preparednavmeshdatatuple.hpp b/components/detournavigator/preparednavmeshdatatuple.hpp index 8ff1267370..bcca0ace37 100644 --- a/components/detournavigator/preparednavmeshdatatuple.hpp +++ b/components/detournavigator/preparednavmeshdatatuple.hpp @@ -14,11 +14,11 @@ namespace DetourNavigator constexpr auto makeTuple(const rcPolyMesh& v) noexcept { return std::tuple( - Span(v.verts, getVertsLength(v)), - Span(v.polys, getPolysLength(v)), - Span(v.regs, getRegsLength(v)), - Span(v.flags, getFlagsLength(v)), - Span(v.areas, getAreasLength(v)), + Span(v.verts, static_cast(getVertsLength(v))), + Span(v.polys, static_cast(getPolysLength(v))), + Span(v.regs, static_cast(getRegsLength(v))), + Span(v.flags, static_cast(getFlagsLength(v))), + Span(v.areas, static_cast(getAreasLength(v))), ArrayRef(v.bmin), ArrayRef(v.bmax), v.cs, @@ -31,9 +31,9 @@ namespace DetourNavigator constexpr auto makeTuple(const rcPolyMeshDetail& v) noexcept { return std::tuple( - Span(v.meshes, getMeshesLength(v)), - Span(v.verts, getVertsLength(v)), - Span(v.tris, getTrisLength(v)) + Span(v.meshes, static_cast(getMeshesLength(v))), + Span(v.verts, static_cast(getVertsLength(v))), + Span(v.tris, static_cast(getTrisLength(v))) ); } diff --git a/components/esm/luascripts.cpp b/components/esm/luascripts.cpp index 1dd45ab2b1..7ff841312a 100644 --- a/components/esm/luascripts.cpp +++ b/components/esm/luascripts.cpp @@ -32,7 +32,7 @@ std::string ESM::loadLuaBinaryData(ESMReader& esm) { esm.getSubHeader(); data.resize(esm.getSubSize()); - esm.getExact(data.data(), data.size()); + esm.getExact(data.data(), static_cast(data.size())); } return data; }