From f35c9b7a69442f4dc7cbd317420f284aa050424c Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 27 Jan 2015 01:40:36 +0100 Subject: [PATCH] Clang warning fixes (thanks hemite) --- apps/essimporter/converter.hpp | 2 +- apps/openmw/mwmechanics/aicombat.cpp | 4 ++-- apps/openmw/mwmechanics/character.cpp | 2 +- apps/openmw/mwmechanics/obstacle.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/essimporter/converter.hpp b/apps/essimporter/converter.hpp index a5b2b1a66..c5ee0e3a9 100644 --- a/apps/essimporter/converter.hpp +++ b/apps/essimporter/converter.hpp @@ -209,7 +209,7 @@ public: else { int index = npcc.mNPDT.mIndex; - mContext->mNpcChanges.insert(std::make_pair(std::make_pair(index,id), npcc)).second; + mContext->mNpcChanges.insert(std::make_pair(std::make_pair(index,id), npcc)); } } }; diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index f7e285ff5..f2b125add 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -58,7 +58,7 @@ namespace // magnitude of pits/obstacles is defined by PATHFIND_Z_REACH bool checkWayIsClear(const Ogre::Vector3& from, const Ogre::Vector3& to, float offsetXY) { - if((to - from).length() >= PATHFIND_CAUTION_DIST || abs(from.z - to.z) <= PATHFIND_Z_REACH) + if((to - from).length() >= PATHFIND_CAUTION_DIST || std::abs(from.z - to.z) <= PATHFIND_Z_REACH) { Ogre::Vector3 dir = to - from; dir.z = 0; @@ -69,7 +69,7 @@ namespace // cast up-down ray and find height in world space of hit float h = _from.z - MWBase::Environment::get().getWorld()->getDistToNearestRayHit(_from, -Ogre::Vector3::UNIT_Z, verticalOffset + PATHFIND_Z_REACH + 1); - if(abs(from.z - h) <= PATHFIND_Z_REACH) + if(std::abs(from.z - h) <= PATHFIND_Z_REACH) return true; } diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index fa7e52af2..8d438c703 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1372,7 +1372,7 @@ void CharacterController::update(float duration) //Force Jump Logic - bool isMoving = (std::abs(cls.getMovementSettings(mPtr).mPosition[0]) > .5 || abs(cls.getMovementSettings(mPtr).mPosition[1]) > .5); + bool isMoving = (std::abs(cls.getMovementSettings(mPtr).mPosition[0]) > .5 || std::abs(cls.getMovementSettings(mPtr).mPosition[1]) > .5); if(!inwater && !flying) { //Force Jump diff --git a/apps/openmw/mwmechanics/obstacle.cpp b/apps/openmw/mwmechanics/obstacle.cpp index 55ebfeab5..6bf81e861 100644 --- a/apps/openmw/mwmechanics/obstacle.cpp +++ b/apps/openmw/mwmechanics/obstacle.cpp @@ -115,8 +115,8 @@ namespace MWMechanics if(mDistSameSpot == -1) mDistSameSpot = DIST_SAME_SPOT * (cls.getSpeed(actor) / 150); - bool samePosition = (abs(pos.pos[0] - mPrevX) < mDistSameSpot) && - (abs(pos.pos[1] - mPrevY) < mDistSameSpot); + bool samePosition = (std::abs(pos.pos[0] - mPrevX) < mDistSameSpot) && + (std::abs(pos.pos[1] - mPrevY) < mDistSameSpot); // update position mPrevX = pos.pos[0]; mPrevY = pos.pos[1];