Merge pull request #16080 from minggo/use-std_abs

use std::abs instead
This commit is contained in:
minggo 2016-07-11 12:02:10 +08:00 committed by GitHub
commit 9c7d44ccd7
3 changed files with 6 additions and 6 deletions

View File

@ -200,8 +200,8 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu
CCLOGWARN("cocos2d: WARNING: originalWidth/Height not found on the SpriteFrame. AnchorPoint won't work as expected. Regenerate the .plist");
}
// abs ow/oh
ow = abs(ow);
oh = abs(oh);
ow = std::abs(ow);
oh = std::abs(oh);
// create frame
spriteFrame = SpriteFrame::createWithTexture(texture,
Rect(x, y, w, h),
@ -635,8 +635,8 @@ void SpriteFrameCache::reloadSpriteFramesWithDictionary(ValueMap& dictionary, Te
CCLOGWARN("cocos2d: WARNING: originalWidth/Height not found on the SpriteFrame. AnchorPoint won't work as expected. Regenrate the .plist");
}
// abs ow/oh
ow = abs(ow);
oh = abs(oh);
ow = std::abs(ow);
oh = std::abs(oh);
// create frame
spriteFrame = SpriteFrame::createWithTexture(texture,
Rect(x, y, w, h),

View File

@ -390,7 +390,7 @@ void TextureAtlas::insertQuadFromIndex(ssize_t oldIndex, ssize_t newIndex)
return;
}
// because it is ambiguous in iphone, so we implement abs ourselves
// unsigned int howMany = abs( oldIndex - newIndex);
// unsigned int howMany = std::abs( oldIndex - newIndex);
auto howMany = (oldIndex - newIndex) > 0 ? (oldIndex - newIndex) : (newIndex - oldIndex);
auto dst = oldIndex;
auto src = oldIndex + 1;

View File

@ -72,7 +72,7 @@ extern int lua_isusertype (lua_State* L, int lo, const char* type);
bool luaval_is_usertype(lua_State* L,int lo,const char* type, int def)
{
if (def && lua_gettop(L)<abs(lo))
if (def && lua_gettop(L)<std::abs(lo))
return true;
if (lua_isnil(L,lo) || lua_isusertype(L,lo,type))