From fd021d793ab422559b2773cd1a7ae7095d707207 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 9 Mar 2021 12:59:48 +0300 Subject: [PATCH] mdbx: fix MSVC warning. More for https://github.com/erthink/libmdbx/issues/166 Change-Id: I47a2ec72831c06695e7ef4c52a77039e52a718e2 --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 701f9733..6e395136 100644 --- a/src/core.c +++ b/src/core.c @@ -68,7 +68,7 @@ MDBX_NOTHROW_CONST_FUNCTION static __inline uint16_t v2me(size_t v, unsigned e) { assert(v > (e ? me2v(2047, e - 1) : 32768)); assert(v <= me2v(2047, e)); - size_t m = (v - 32768 + (1 << (e + 5)) - 1) >> (e + 5); + size_t m = (v - 32768 + ((size_t)1 << (e + 5)) - 1) >> (e + 5); m -= m > 0; assert(m < 2048 && e < 8); // f e d c b a 9 8 7 6 5 4 3 2 1 0