aboutsummaryrefslogtreecommitdiff
path: root/src/bloom.cpp
diff options
context:
space:
mode:
authorkobake <kobake@users.sourceforge.net>2017-02-14 15:39:51 +0900
committerkobake <kobake@users.sourceforge.net>2017-03-07 02:42:44 +0900
commit292112f87ef1780fee6164063a60af9ee7bf3f86 (patch)
tree19dbb1b92e7d0f7447ce6e1a880026e7f86b9767 /src/bloom.cpp
parentd978c41e1ec4fcf2c4d096f09af035f9e8a7ad81 (diff)
Fix msvc compiler error C4146 (minus operator applied to unsigned type)
On msvc14, the compiler error C4146 (unary minus operator applied to unsigned type, result still unsigned) had been occured. Use '0 - x' styled formula instead of '-x' so as to fix the error.
Diffstat (limited to 'src/bloom.cpp')
-rw-r--r--src/bloom.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bloom.cpp b/src/bloom.cpp
index 8d47cb76e8..ac3e565721 100644
--- a/src/bloom.cpp
+++ b/src/bloom.cpp
@@ -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];