mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 19:58:57 +02:00
Fix remaining compiler warnings (MSVC). Move disabling of specific warnings from /nowarn to project file.
This commit is contained in:
@@ -144,7 +144,7 @@ public:
|
||||
*lockingSuccess = true;
|
||||
}
|
||||
|
||||
return reinterpret_cast<void*>(0x08000000 + (count<<24)); // Fake address, do not actually use this memory
|
||||
return reinterpret_cast<void*>(uint64_t{static_cast<uint64_t>(0x08000000) + (count << 24)}); // Fake address, do not actually use this memory
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ BOOST_AUTO_TEST_CASE(countbits_tests)
|
||||
// Check handling of zero.
|
||||
BOOST_CHECK_EQUAL(CountBits(0), 0U);
|
||||
} else if (i < 10) {
|
||||
for (uint64_t j = 1 << (i - 1); (j >> i) == 0; ++j) {
|
||||
for (uint64_t j = (uint64_t)1 << (i - 1); (j >> i) == 0; ++j) {
|
||||
// Exhaustively test up to 10 bits
|
||||
BOOST_CHECK_EQUAL(CountBits(j), i);
|
||||
}
|
||||
|
||||
@@ -184,11 +184,12 @@ void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScript
|
||||
stream << tx2;
|
||||
int libconsensus_flags = flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL;
|
||||
if (libconsensus_flags == flags) {
|
||||
int expectedSuccessCode = expect ? 1 : 0;
|
||||
if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) {
|
||||
BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect, message);
|
||||
BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expectedSuccessCode, message);
|
||||
} else {
|
||||
BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect, message);
|
||||
BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect,message);
|
||||
BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expectedSuccessCode, message);
|
||||
BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expectedSuccessCode, message);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user