From 1d8c7a9557d596d4c7edee801a724db7a908bce5 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 22 Apr 2012 13:51:16 -0400 Subject: Add casts for unavoidable signed/unsigned comparisons At these code sites, it is preferable to cast rather than change a variable's type. --- 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 b6ae32fec1..f0971e8850 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -117,9 +117,9 @@ public: { unsigned long n = BN_get_word(this); if (!BN_is_negative(this)) - return (n > std::numeric_limits::max() ? std::numeric_limits::max() : n); + return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::max() : n); else - return (n > std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); + return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n); } void setint64(int64 n) -- cgit v1.2.3