From d7f1d200ab5d385c727261621c069dfbc6170e78 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Fri, 24 Jun 2011 20:09:24 +0200 Subject: fix warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] Don't check for a negative parameter count, because not only will it never happen, it doesn't make any sense either. Invalid sockets (as returned by socket(2)) are always exactly -1 (not just negative as negative file descriptors are technically not prohibited by POSIX) on POSIX systems. Since we store them in SOCKET (unsigned int), however, that really is ~0U (or MAX_UINT) which happens to be what INVALID_SOCKET is already defined to, so an additional check for being negative is not only unnecessary (unsigned integers aren't *ever* negative) its redundant as well (the INVALID_SOCKET comparison is enough). Signed-off-by: Giel van Schijndel --- src/rpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/rpc.cpp') diff --git a/src/rpc.cpp b/src/rpc.cpp index fbed626a8..e71c5bcb4 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -706,7 +706,7 @@ int64 GetAccountBalance(const string& strAccount, int nMinDepth) Value getbalance(const Array& params, bool fHelp) { - if (fHelp || params.size() < 0 || params.size() > 2) + if (fHelp || params.size() > 2) throw runtime_error( "getbalance [account] [minconf=1]\n" "If [account] is not specified, returns the server's total available balance.\n" -- cgit v1.2.3 From 858cebed7dee2e9801e754a9969844b7969254ee Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Fri, 24 Jun 2011 22:00:59 +0200 Subject: fix warning: unused variable 'X' [-Wunused-variable] Remove several unused variables. Signed-off-by: Giel van Schijndel --- src/rpc.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/rpc.cpp') diff --git a/src/rpc.cpp b/src/rpc.cpp index e71c5bcb4..4016d265c 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -2419,7 +2419,6 @@ int CommandLineRPC(int argc, char *argv[]) // Parse reply const Value& result = find_value(reply, "result"); const Value& error = find_value(reply, "error"); - const Value& id = find_value(reply, "id"); if (error.type() != null_type) { -- cgit v1.2.3