From 866ca1897054760f633452678828bf498d049fc2 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Sun, 29 Oct 2017 00:58:02 +0300 Subject: [PATCH] mdbx: add few __fallthrough and __unreachable. Change-Id: Ife18986a3a6391c76f63d12f8102bd6670ae63eb --- src/mdbx.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mdbx.c b/src/mdbx.c index db096513..7ecb5900 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -1452,15 +1452,19 @@ static __inline bool mdbx_meta_ot(const enum meta_choise_mode mode, switch (mode) { default: assert(false); - /* fall through */ + __unreachable(); + /* fall through */ + __fallthrough; case prefer_steady: if (META_IS_STEADY(a) != META_IS_STEADY(b)) return META_IS_STEADY(b); - /* fall through */ + /* fall through */ + __fallthrough; case prefer_noweak: if (META_IS_WEAK(a) != META_IS_WEAK(b)) return !META_IS_WEAK(b); - /* fall through */ + /* fall through */ + __fallthrough; case prefer_last: mdbx_jitter4testing(true); if (txnid_a == txnid_b) @@ -10907,6 +10911,7 @@ static int __cold mdbx_env_walk(mdbx_walk_ctx_t *ctx, const char *dbi, break; case P_META: case P_OVERFLOW: + __fallthrough; default: return MDBX_CORRUPTED; }