From e2f6569a70502dd931cfec0f91378855d01ca5fd 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: Sun, 28 May 2023 13:49:32 +0300 Subject: [PATCH] mdbx: fix GCC 13.x minor warnings (backport). --- src/core.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core.c b/src/core.c index f41ad8e0..cd2207f9 100644 --- a/src/core.c +++ b/src/core.c @@ -14902,7 +14902,7 @@ int mdbx_cursor_get(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data, if (unlikely(rc != MDBX_SUCCESS)) return rc; - int (*mfunc)(MDBX_cursor * mc, MDBX_val * key, MDBX_val * data); + int (*mfunc)(MDBX_cursor *mc, MDBX_val *key, MDBX_val *data); switch (op) { case MDBX_GET_CURRENT: { if (unlikely(!(mc->mc_flags & C_INITIALIZED))) @@ -15278,7 +15278,7 @@ static int mdbx_cursor_touch(MDBX_cursor *mc) { } int mdbx_cursor_put(MDBX_cursor *mc, const MDBX_val *key, MDBX_val *data, - unsigned flags) { + MDBX_put_flags_t flags) { MDBX_env *env; MDBX_page *sub_root = NULL; MDBX_val xdata, *rdata, dkey, olddata; @@ -15807,7 +15807,7 @@ int mdbx_cursor_put(MDBX_cursor *mc, const MDBX_val *key, MDBX_val *data, } else { /* Data is on sub-page */ fp = olddata.iov_base; - switch (flags) { + switch ((unsigned)flags) { default: if (!(mc->mc_db->md_flags & MDBX_DUPFIXED)) { offset = node_size(data, nullptr) + sizeof(indx_t); @@ -19082,7 +19082,7 @@ done: } int mdbx_put(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data, - unsigned flags) { + MDBX_put_flags_t flags) { int rc = check_txn_rw(txn, MDBX_TXN_BLOCKED); if (unlikely(rc != MDBX_SUCCESS)) return rc; @@ -19705,7 +19705,7 @@ __cold static int mdbx_env_copy_asis(MDBX_env *env, MDBX_txn *read_txn, } __cold int mdbx_env_copy2fd(MDBX_env *env, mdbx_filehandle_t fd, - unsigned flags) { + MDBX_copy_flags_t flags) { int rc = check_env(env, true); if (unlikely(rc != MDBX_SUCCESS)) return rc; @@ -21073,7 +21073,8 @@ mdbx_cleanup_dead_readers(MDBX_env *env, int rdt_locked, int *dead) { return rc; } -__cold int mdbx_setup_debug(int loglevel, int flags, MDBX_debug_func *logger) { +__cold int mdbx_setup_debug(MDBX_log_level_t loglevel, MDBX_debug_flags_t flags, + MDBX_debug_func *logger) { const int rc = mdbx_runtime_flags | (mdbx_loglevel << 16); if (loglevel != MDBX_LOG_DONTCHANGE) @@ -22550,11 +22551,11 @@ int64_t mdbx_int64_from_key(const MDBX_val v) { UINT64_C(0x8000000000000000)); } -__cold MDBX_cmp_func *mdbx_get_keycmp(unsigned flags) { +__cold MDBX_cmp_func *mdbx_get_keycmp(MDBX_db_flags_t flags) { return get_default_keycmp(flags); } -__cold MDBX_cmp_func *mdbx_get_datacmp(unsigned flags) { +__cold MDBX_cmp_func *mdbx_get_datacmp(MDBX_db_flags_t flags) { return get_default_datacmp(flags); }