From 50bfe1a19d26d99b6ee10236771bd8c7cd38be01 Mon Sep 17 00:00:00 2001 From: skidd13 Date: Mon, 19 Nov 2007 18:58:04 +0000 Subject: (svn r11476) -Codechange: rename the function myabs to abs to get rid of an unneeded define --- src/helpers.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/helpers.hpp') diff --git a/src/helpers.hpp b/src/helpers.hpp index 4163be4ac..b69f17ae9 100644 --- a/src/helpers.hpp +++ b/src/helpers.hpp @@ -39,8 +39,6 @@ template void Swap(T& a, T& b) } -/** returns the absolute value of (scalar) variable. @note assumes variable to be signed */ -template static inline T myabs(T a) { return a < (T)0 ? -a : a; } /** returns the (absolute) difference between two (scalar) variables */ template static inline T delta(T a, T b) { return a < b ? b - a : a - b; } @@ -198,7 +196,7 @@ public: */ FORCEINLINE OverflowSafeInt& operator += (const OverflowSafeInt& other) { - if ((T_MAX - myabs(other.m_value)) < myabs(this->m_value) && + if ((T_MAX - abs(other.m_value)) < abs(this->m_value) && (this->m_value < 0) == (other.m_value < 0)) { this->m_value = (this->m_value < 0) ? T_MIN : T_MAX ; } else { @@ -229,7 +227,7 @@ public: */ FORCEINLINE OverflowSafeInt& operator *= (const int factor) { - if (factor != 0 && (T_MAX / myabs(factor)) < myabs(this->m_value)) { + if (factor != 0 && (T_MAX / abs(factor)) < abs(this->m_value)) { this->m_value = ((this->m_value < 0) == (factor < 0)) ? T_MAX : T_MIN ; } else { this->m_value *= factor ; -- cgit v1.2.3-54-g00ecf