aboutsummaryrefslogtreecommitdiff
path: root/src/bignum.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@exmulti.com>2012-04-22 13:22:39 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-04-22 13:22:39 -0400
commitfaf705a42a05197d89abfc31672ced94d268767f (patch)
tree4ebc78c985db96ba9e602b3c6c49ed8ecefc0d9a /src/bignum.h
parent457661f6400030f5979564462e8c625840cc5e58 (diff)
downloadbitcoin-faf705a42a05197d89abfc31672ced94d268767f.tar.xz
Prefer 'unsigned int' for loop index variables tested against ::size()
C++ STL ::size() generally returns unsigned, which implies that "int idx" style of loop variable will generate a signed-vs-unsigned comparison warning when testing the loop exit condition "idx < blah.size()" Update areas of the bitcoin code where loop variables may be more properly and correctly defined as unsigned.
Diffstat (limited to 'src/bignum.h')
-rw-r--r--src/bignum.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bignum.h b/src/bignum.h
index 0d57dc8a8e..b6ae32fec1 100644
--- a/src/bignum.h
+++ b/src/bignum.h
@@ -222,7 +222,7 @@ public:
if (vch.size() > 4)
vch[4] &= 0x7f;
uint256 n = 0;
- for (int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--)
+ for (unsigned int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--)
((unsigned char*)&n)[i] = vch[j];
return n;
}