File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -254,8 +254,8 @@ void CRollingBloomFilter::insert(const std::vector<unsigned char>& vKey)
254
254
if (nGeneration == 4 ) {
255
255
nGeneration = 1 ;
256
256
}
257
- uint64_t nGenerationMask1 = - (uint64_t )(nGeneration & 1 );
258
- uint64_t nGenerationMask2 = - (uint64_t )(nGeneration >> 1 );
257
+ uint64_t nGenerationMask1 = 0 - (uint64_t )(nGeneration & 1 );
258
+ uint64_t nGenerationMask2 = 0 - (uint64_t )(nGeneration >> 1 );
259
259
/* Wipe old entries that used this generation number. */
260
260
for (uint32_t p = 0 ; p < data.size (); p += 2 ) {
261
261
uint64_t p1 = data[p], p2 = data[p + 1 ];
Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE(test_ParseInt32)
321
321
BOOST_CHECK (ParseInt32 (" 1234" , &n) && n == 1234 );
322
322
BOOST_CHECK (ParseInt32 (" 01234" , &n) && n == 1234 ); // no octal
323
323
BOOST_CHECK (ParseInt32 (" 2147483647" , &n) && n == 2147483647 );
324
- BOOST_CHECK (ParseInt32 (" -2147483648" , &n) && n == - 2147483648 );
324
+ BOOST_CHECK (ParseInt32 (" -2147483648" , &n) && n == (- 2147483647 - 1 )); // (-2147483647 - 1) equals INT_MIN
325
325
BOOST_CHECK (ParseInt32 (" -1234" , &n) && n == -1234 );
326
326
// Invalid values
327
327
BOOST_CHECK (!ParseInt32 (" " , &n));
You can’t perform that action at this time.
0 commit comments