From 262fafd00efc9c742f1c3d72328437fe4077cc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 23 Jul 2022 19:24:56 +0300 Subject: [PATCH] mdbx: fix `unused` warning for case `MDBX_ENABLE_PGOP_STAT=0`. --- src/core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 464f535d..9793580d 100644 --- a/src/core.c +++ b/src/core.c @@ -7417,7 +7417,9 @@ retry:; if (!inside_txn) { if (!locked) { int err; +#if MDBX_ENABLE_PGOP_STAT unsigned wops = 0; +#endif /* MDBX_ENABLE_PGOP_STAT */ /* pre-sync to avoid latency for writer */ if (unsynced_pages > /* FIXME: define threshold */ 16 && (flags & MDBX_SAFE_NOSYNC) == 0) { @@ -7446,8 +7448,10 @@ retry:; if (unlikely(err != MDBX_SUCCESS)) return err; - /* pre-sync done */ +#if MDBX_ENABLE_PGOP_STAT wops = 1; +#endif /* MDBX_ENABLE_PGOP_STAT */ + /* pre-sync done */ rc = MDBX_SUCCESS /* means "some data was synced" */; }