From 8c8c86038a634559c7ec856a4cdad5f0e31bc400 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Tue, 12 May 2020 23:32:06 +0300 Subject: [PATCH] mdbx: fix unsigned-to-ptrdiff casting inside estimate(). Fixup after a238179c23e7378b2019de5229b2166cdfe515c7 Change-Id: I316e4aa1f41462fd0017f8e0a7f6d6e82aa4f3db --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 395f49fb..c11f8b04 100644 --- a/src/core.c +++ b/src/core.c @@ -17670,7 +17670,7 @@ __hot static ptrdiff_t estimate(const MDBX_db *db, * level-N: branch-page(s) => scale = leaf-factor * leaf-level: leaf-page(s) => scale = 1 */ - ptrdiff_t btree_power = db->md_depth - 2 - dr->level; + ptrdiff_t btree_power = (ptrdiff_t)db->md_depth - 2 - (ptrdiff_t)dr->level; if (btree_power < 0) return dr->diff;