1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-31 22:59:54 +02:00

Fix std::abs warning

Recent clang wants std::abs instead of plain abs
This commit is contained in:
Vadim Markovtsev 2015-10-12 17:08:18 +03:00
parent e4b1ef1405
commit d24fd10e21
3 changed files with 4 additions and 4 deletions

View File

@ -432,7 +432,7 @@ bool boundaryBetweenTwoPoints (int3 pos1, int3 pos2, CCallback * cbp) //determin
for (int y = yMin; y <= yMax; ++y)
{
int3 tile = int3(x, y, pos1.z); //use only on same level, ofc
if (abs(pos1.dist2d(tile) - pos2.dist2d(tile)) < 1.5)
if (std::abs(pos1.dist2d(tile) - pos2.dist2d(tile)) < 1.5)
{
if (!(cbp->isVisible(tile) && cbp->getTile(tile)->blocked)) //if there's invisible or unblocked tile between, it's good
return false;
@ -509,4 +509,4 @@ bool compareArtifacts(const CArtifactInstance *a1, const CArtifactInstance *a2)
return true;
else
return art1->price > art2->price;
}
}

View File

@ -782,7 +782,7 @@ bool CShootingAnimation::init()
spi.catapultInfo.reset(new CatapultProjectileInfo(Point(spi.x, spi.y), destPos));
double animSpeed = AnimationControls::getProjectileSpeed() / 10;
spi.lastStep = abs((destPos.x - spi.x) / animSpeed);
spi.lastStep = std::abs((destPos.x - spi.x) / animSpeed);
spi.dx = animSpeed;
spi.dy = 0;

View File

@ -113,7 +113,7 @@ template<typename IntType>
std::string makeNumberShort(IntType number, IntType maxLength = 3) //the output is a string containing at most 5 characters [4 if positive] (eg. intead 10000 it gives 10k)
{
IntType max = pow(10, maxLength);
if (abs(number) < max)
if (std::abs(number) < max)
return boost::lexical_cast<std::string>(number);
std::string symbols = " kMGTPE";