aboutsummaryrefslogtreecommitdiff
path: root/src/bignum.h
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2011-12-19 17:08:25 -0500
committerGavin Andresen <gavinandresen@gmail.com>2011-12-19 19:10:34 -0500
commit26ce92b3526430d4a40b2faccef4facb966d6a0a (patch)
treee23a92f6152c3abcf8cf3c42bf5a5b50ecc5dc42 /src/bignum.h
parentbd846c0e565ca0db276cb6b7eac7763bebe19b84 (diff)
Use std::numeric_limits<> for typesafe INT_MAX/etc
Diffstat (limited to 'src/bignum.h')
-rw-r--r--src/bignum.h4
1 files changed, 2 insertions, 2 deletions
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<int>::max() ? std::numeric_limits<int>::max() : n);
else
- return (n > INT_MAX ? INT_MIN : -(int)n);
+ return (n > std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
}
void setint64(int64 n)