From 26ce92b3526430d4a40b2faccef4facb966d6a0a Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 19 Dec 2011 17:08:25 -0500 Subject: Use std::numeric_limits<> for typesafe INT_MAX/etc --- src/bignum.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bignum.h') diff --git a/src/bignum.h b/src/bignum.h index f5d545f07e..135eade679 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -115,9 +115,9 @@ public: { unsigned long n = BN_get_word(this); if (!BN_is_negative(this)) - return (n > INT_MAX ? INT_MAX : n); + return (n > std::numeric_limits::max() ? std::numeric_limits::max() : n); else - return (n > INT_MAX ? INT_MIN : -(int)n); + return (n > std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); } void setint64(int64 n) -- cgit v1.2.3