aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
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/bitcoinrpc.cpp
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/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 206347faf8..2262923911 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -999,7 +999,7 @@ Value addmultisigaddress(const Array& params, bool fHelp)
strAccount = AccountFromValue(params[2]);
// Gather public keys
- if (nRequired < 1 || keys.size() < nRequired)
+ if ((nRequired < 1) || ((int)keys.size() < nRequired))
throw runtime_error(
strprintf("wrong number of keys"
"(got %d, need at least %d)", keys.size(), nRequired));
@@ -1331,8 +1331,10 @@ Value listtransactions(const Array& params, bool fHelp)
}
// ret is newest to oldest
- if (nFrom > ret.size()) nFrom = ret.size();
- if (nFrom+nCount > ret.size()) nCount = ret.size()-nFrom;
+ if (nFrom > (int)ret.size())
+ nFrom = ret.size();
+ if ((nFrom + nCount) > (int)ret.size())
+ nCount = ret.size() - nFrom;
Array::iterator first = ret.begin();
std::advance(first, nFrom);
Array::iterator last = ret.begin();
@@ -2202,7 +2204,7 @@ int ReadHTTP(std::basic_istream<char>& stream, map<string, string>& mapHeadersRe
// Read header
int nLen = ReadHTTPHeader(stream, mapHeadersRet);
- if (nLen < 0 || nLen > MAX_SIZE)
+ if (nLen < 0 || nLen > (int)MAX_SIZE)
return 500;
// Read message