diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-16 04:43:49 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-09-16 04:47:55 +0200 |
commit | dc54e9db982118ec71cc11b8d027e5a569810cba (patch) | |
tree | 34b0ca1ab9f4c153a551750dae6fea3b2dbf286a /src/key.cpp | |
parent | 7388b74cd2c5e3b71e991d26953c89c059ba6f2f (diff) | |
parent | 8d657a651735426388c5f7462e2dbf24225a26cb (diff) |
Merge pull request #4825
8d657a6 Fixing compiler warning C4800: 'type' forcing value to bool 'true' or 'false' (ENikS)
Diffstat (limited to 'src/key.cpp')
-rw-r--r-- | src/key.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/key.cpp b/src/key.cpp index a058ef05e5..8ed787654a 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -172,9 +172,9 @@ public: bool ret; BIGNUM bn; BN_init(&bn); - ret = BN_bin2bn(vch, 32, &bn); + ret = BN_bin2bn(vch, 32, &bn) != NULL; assert(ret); - ret = EC_KEY_regenerate_key(pkey, &bn); + ret = EC_KEY_regenerate_key(pkey, &bn) != 0; assert(ret); BN_clear_free(&bn); } @@ -217,7 +217,7 @@ public: bool SetPubKey(const CPubKey &pubkey) { const unsigned char* pbegin = pubkey.begin(); - return o2i_ECPublicKey(&pkey, &pbegin, pubkey.size()); + return o2i_ECPublicKey(&pkey, &pbegin, pubkey.size()) != NULL; } bool Sign(const uint256 &hash, std::vector<unsigned char>& vchSig) { @@ -553,7 +553,7 @@ bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector<unsigned cha if (vchSig.size() != 65) return false; int recid = (vchSig[0] - 27) & 3; - bool fComp = (vchSig[0] - 27) & 4; + bool fComp = ((vchSig[0] - 27) & 4) != 0; #ifdef USE_SECP256K1 int pubkeylen = 65; if (!secp256k1_ecdsa_recover_compact((const unsigned char*)&hash, 32, &vchSig[1], (unsigned char*)begin(), &pubkeylen, fComp, recid)) |