mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 01:44:13 +08:00
mdbx: add few __fallthrough and __unreachable.
Change-Id: Ife18986a3a6391c76f63d12f8102bd6670ae63eb
This commit is contained in:
parent
aec2445161
commit
866ca18970
11
src/mdbx.c
11
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user