diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2018-12-04 13:16:30 +0100 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2018-12-04 19:55:04 +0200 |
commit | cf4b0327ed92ca8a1533cdf6c2b0015fd9b56397 (patch) | |
tree | 1ac306ee221382b3ec917a0fba640382a8fcb1d2 /src/test | |
parent | 6b82fc59eb19004e54f910261a40d5e1b9e44b42 (diff) | |
download | bitcoin-cf4b0327ed92ca8a1533cdf6c2b0015fd9b56397.tar.xz |
Use std::numeric_limits<UNSIGNED>::max()) instead of (UNSIGNED)-1
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/serialize_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/sighash_tests.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index e754996d2f..002f61f6a2 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -200,7 +200,7 @@ BOOST_AUTO_TEST_CASE(varints) } for (uint64_t i = 0; i < 100000000000ULL; i += 999999937) { - uint64_t j = -1; + uint64_t j = std::numeric_limits<uint64_t>::max(); ss >> VARINT(j); BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i); } diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index c329844341..773204a00c 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -105,7 +105,7 @@ void static RandomTransaction(CMutableTransaction &tx, bool fSingle) { txin.prevout.hash = InsecureRand256(); txin.prevout.n = InsecureRandBits(2); RandomScript(txin.scriptSig); - txin.nSequence = (InsecureRandBool()) ? InsecureRand32() : (unsigned int)-1; + txin.nSequence = (InsecureRandBool()) ? InsecureRand32() : std::numeric_limits<uint32_t>::max(); } for (int out = 0; out < outs; out++) { tx.vout.push_back(CTxOut()); |