From 7ea1a4e0e84348fc6b7e3b3385980e40f6c1a83c Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 28 Jan 2020 01:47:50 +0300 Subject: [PATCH] mdbx: fix key_from_jsonInteger() for MSVC. Change-Id: I3fc6a6da57707750cb2e8429bbaf10ff1de2dde2 --- src/elements/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index 18b7d18d..78418c40 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -17808,14 +17808,14 @@ static __inline int clz64(uint64_t value) { unsigned long index; #if defined(_M_AMD64) || defined(_M_ARM64) || defined(_M_X64) _BitScanReverse64(&index, value); - return index; + return 63 - index; #else if (value > UINT32_MAX) { _BitScanReverse(&index, (uint32_t)(value >> 32)); - return index; + return 31 - index; } _BitScanReverse(&index, (uint32_t)value); - return index + 32; + return 63 - index; #endif #endif /* MSVC */