diff --git a/arangod/Agency/Supervision.cpp b/arangod/Agency/Supervision.cpp index f866f4403c..6f10af52d4 100644 --- a/arangod/Agency/Supervision.cpp +++ b/arangod/Agency/Supervision.cpp @@ -462,7 +462,7 @@ void Supervision::run() { } } } - _cv.wait(1000000 * _frequency); + _cv.wait(static_cast(1000000 * _frequency)); } } if (shutdown) { diff --git a/arangod/Aql/EnumerateCollectionBlock.cpp b/arangod/Aql/EnumerateCollectionBlock.cpp index fdf236b701..4e4948ba01 100644 --- a/arangod/Aql/EnumerateCollectionBlock.cpp +++ b/arangod/Aql/EnumerateCollectionBlock.cpp @@ -135,7 +135,7 @@ int EnumerateCollectionBlock::initialize() { inSync = std::find(followers.begin(), followers.end(), ServerState::instance()->getId()) != followers.end(); if (!inSync) { if (endTime - now < waitInterval) { - waitInterval = endTime - now; + waitInterval = static_cast(endTime - now); } usleep(waitInterval); } diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index 46edfa6b94..7613ae72f3 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -2733,7 +2733,7 @@ static void JS_DecodeRev(v8::FunctionCallbackInfo const& args) { #endif char buffer[32]; strftime(buffer, 32, "%Y-%m-%dT%H:%M:%S.000Z", &date); - buffer[20] = (millis / 100) + '0'; + buffer[20] = static_cast(millis / 100) + '0'; buffer[21] = ((millis / 10) % 10) + '0'; buffer[22] = (millis % 10) + '0'; buffer[24] = 0; @@ -2742,7 +2742,7 @@ static void JS_DecodeRev(v8::FunctionCallbackInfo const& args) { result->Set(TRI_V8_ASCII_STRING("date"), TRI_V8_ASCII_STRING(buffer)); result->Set(TRI_V8_ASCII_STRING("count"), - v8::Number::New(isolate, count)); + v8::Number::New(isolate, static_cast(count))); TRI_V8_RETURN(result); diff --git a/lib/Basics/fasthash.cpp b/lib/Basics/fasthash.cpp index ceaee8262a..c5ca3360ef 100644 --- a/lib/Basics/fasthash.cpp +++ b/lib/Basics/fasthash.cpp @@ -24,6 +24,8 @@ */ #include "fasthash.h" + +static constexpr uint64_t m = 0x880355f21e6d1965ULL; // Compression function for Merkle-Damgard construction. // This function is generated using the framework provided. @@ -37,9 +39,7 @@ static inline uint64_t mix(uint64_t h) { } uint64_t fasthash64_uint64(uint64_t value, uint64_t seed) { - size_t const len = sizeof(uint64_t); - uint64_t const m = 0x880355f21e6d1965ULL; - uint64_t h = seed ^ (len * m); + uint64_t h = seed ^ 4619197404915747624ULL; // this is h = seed ^ (sizeof(uint64_t) * m), but prevents VS warning C4307: integral constant overflow h ^= mix(value); h *= m; @@ -51,7 +51,6 @@ uint64_t fasthash64(const void* buf, size_t len, uint64_t seed) { // byte-wise hashing to support platforms that don't permit // unaligned accesses of uint64_t values (which is the default // memory access strategy of fasthash64) - uint64_t const m = 0x880355f21e6d1965ULL; uint8_t const* pos = (uint8_t const*)buf; uint8_t const* end = pos + len; uint64_t h = seed ^ (len * m); @@ -92,7 +91,6 @@ uint64_t fasthash64(const void* buf, size_t len, uint64_t seed) { // uint64_t-wise hashing for platforms that allow dereferencing // unaligned pointers to uint64_t memory // this is the original version of fasthash64 - uint64_t const m = 0x880355f21e6d1965ULL; uint64_t const* pos = (uint64_t const*)buf; uint64_t const* end = pos + (len / 8); const unsigned char* pos2; @@ -104,7 +102,7 @@ uint64_t fasthash64(const void* buf, size_t len, uint64_t seed) { h ^= mix(v); h *= m; } - + pos2 = (const unsigned char*)pos; v = 0;