1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Use standard (f)abs functions

This commit is contained in:
2014-07-22 23:26:54 -07:00
parent fced942020
commit 751d760772
14 changed files with 68 additions and 54 deletions

View File

@ -134,7 +134,7 @@ void plSynchedObject::IAppendSynchedValueFriend(plSynchedValueBase* v)
uint8_t plSynchedObject::RegisterSynchedValue(plSynchedValueBase* v)
{
int32_t addrOff = ((int32_t)v - (int32_t)this)>>2;
hsAssert(hsABS(addrOff) < (uint32_t)(1<<(sizeof(AddrOffsetType)<<3)), "address offset overflow");
hsAssert(abs(addrOff) < (uint32_t)(1<<(sizeof(AddrOffsetType)<<3)), "address offset overflow");
IAppendSynchedValueAddrOffset((AddrOffsetType)addrOff);
int32_t idx = fNumSynchedValues-1;
hsAssert(idx<256, "index too big");

View File

@ -87,7 +87,7 @@ protected:
// is set to his address so we can automatically get at it during construction.
fFlags=0;
int32_t off = (int32_t)plSynchedObject::GetStaticSynchedObject() - (int32_t)this;
if ( hsABS(off) < (1<<(sizeof(fSynchedObjectAddrOffset)<<3)) )
if ( abs(off) < (1<<(sizeof(fSynchedObjectAddrOffset)<<3)) )
fSynchedObjectAddrOffset = (int16_t)off;
else
fSynchedObjectAddrOffset=-1;