aboutsummaryrefslogtreecommitdiff
path: root/src/bignum.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-04-22 13:51:16 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-04-23 14:14:36 -0400
commit1d8c7a9557d596d4c7edee801a724db7a908bce5 (patch)
tree5181d28a1c69ecc7c58ba4b0b15417d6817aa949 /src/bignum.h
parentc0a0a93d02251390b482d4a147531989641c5a98 (diff)
Add casts for unavoidable signed/unsigned comparisons
At these code sites, it is preferable to cast rather than change a variable's type.
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 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<int>::max() ? std::numeric_limits<int>::max() : n);
+ return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::max() : n);
else
- return (n > std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
+ return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n);
}
void setint64(int64 n)