From d347f6e89ff850913b2127a5cd12c72659c98761 Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Sat, 1 Nov 2014 11:34:45 +0000 Subject: [PATCH 3/6] -Fix: Warning from abs with clang. --- src/money.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/money.h b/src/money.h index cf32ff3..a9d54f5 100644 --- a/src/money.h +++ b/src/money.h @@ -77,7 +77,7 @@ public: */ inline Money& operator+=(const Money& other) { - if ((INT64_MAX - abs(other.m_value)) < abs(this->m_value) && + if ((INT64_MAX - std::abs(other.m_value)) < std::abs(this->m_value) && (this->m_value < 0) == (other.m_value < 0)) { this->m_value = (this->m_value < 0) ? INT64_MIN : INT64_MAX ; } else { @@ -219,7 +219,7 @@ public: */ inline Money& operator*=(const int factor) { - if (factor != 0 && (INT64_MAX / abs(factor)) < abs(this->m_value)) { + if (factor != 0 && (INT64_MAX / std::abs(factor)) < std::abs(this->m_value)) { this->m_value = ((this->m_value < 0) == (factor < 0)) ? INT64_MAX : INT64_MIN; } else { this->m_value *= factor; -- 2.1.3