mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Merge #9916: Fix msvc compiler error C4146 (minus operator applied to unsigned type)
8e0720b
Fix msvc compiler error C4146 (unary minus operator applied to unsigned type) (kobake)292112f
Fix msvc compiler error C4146 (minus operator applied to unsigned type) (kobake) Tree-SHA512: 25f408daf7bf9ffe4b8b4bd62f6f6d326219189a9faf8f8c0a135c5a0cb0511af765aa2b6087a091c8863c701289bda49a2379b00cd9b10854d316a5c3fc3f8e
This commit is contained in:
commit
b403ec5c0f
@ -254,8 +254,8 @@ void CRollingBloomFilter::insert(const std::vector<unsigned char>& vKey)
|
||||
if (nGeneration == 4) {
|
||||
nGeneration = 1;
|
||||
}
|
||||
uint64_t nGenerationMask1 = -(uint64_t)(nGeneration & 1);
|
||||
uint64_t nGenerationMask2 = -(uint64_t)(nGeneration >> 1);
|
||||
uint64_t nGenerationMask1 = 0 - (uint64_t)(nGeneration & 1);
|
||||
uint64_t nGenerationMask2 = 0 - (uint64_t)(nGeneration >> 1);
|
||||
/* Wipe old entries that used this generation number. */
|
||||
for (uint32_t p = 0; p < data.size(); p += 2) {
|
||||
uint64_t p1 = data[p], p2 = data[p + 1];
|
||||
|
@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32)
|
||||
BOOST_CHECK(ParseInt32("1234", &n) && n == 1234);
|
||||
BOOST_CHECK(ParseInt32("01234", &n) && n == 1234); // no octal
|
||||
BOOST_CHECK(ParseInt32("2147483647", &n) && n == 2147483647);
|
||||
BOOST_CHECK(ParseInt32("-2147483648", &n) && n == -2147483648);
|
||||
BOOST_CHECK(ParseInt32("-2147483648", &n) && n == (-2147483647 - 1)); // (-2147483647 - 1) equals INT_MIN
|
||||
BOOST_CHECK(ParseInt32("-1234", &n) && n == -1234);
|
||||
// Invalid values
|
||||
BOOST_CHECK(!ParseInt32("", &n));
|
||||
|
Loading…
Reference in New Issue
Block a user