(svn r11476) -Codechange: rename the function myabs to abs to get rid of an unneeded define

This commit is contained in:
skidd13
2007-11-19 18:58:04 +00:00
parent 8be526e499
commit 50bfe1a19d
11 changed files with 39 additions and 27 deletions

View File

@@ -79,6 +79,10 @@ template<typename T, typename U> static inline T AB(T& x, const uint8 s, const u
#undef max
#endif
#ifdef abs
#undef abs
#endif
/**
* Returns the maximum of two values.
*
@@ -137,6 +141,18 @@ static inline uint minu(const uint a, const uint b)
return a < b ? a : b;
}
/**
* Returns the absolute value of (scalar) variable.
*
* @note assumes variable to be signed
* @param a The value we want to unsign
* @return The unsigned value
*/
template <typename T> static inline T abs(T a)
{
return (a < (T)0) ? -a : a;
}
/**
* Clamp an integer between an interval.
*
@@ -519,8 +535,6 @@ static inline bool CHANCE16I(const uint a, const uint b, const uint32 r)
for (_i = 0; _b != 0; _i++, _b >>= 1) \
if (_b & 1)
#define abs myabs
static inline uint16 ReadLE16Aligned(const void* x)
{