From e5bd1a6d6fc7b0a9a1adfb3d3b4cde26c0b20988 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 10 Oct 2019 00:57:22 +0300 Subject: [PATCH] mdbx-test: fix MSVC warnings (minor). --- test/append.cc | 1 - test/test.cc | 14 +++++++------- test/test.h | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/test/append.cc b/test/append.cc index a7856f5a..9f567c7e 100644 --- a/test/append.cc +++ b/test/append.cc @@ -15,7 +15,6 @@ #include "test.h" bool testcase_append::run() { - MDBX_dbi dbi; int err = db_open__begin__table_create_open_clean(dbi); if (unlikely(err != MDBX_SUCCESS)) { log_notice("append: bailout-prepare due '%s'", mdbx_strerror(err)); diff --git a/test/test.cc b/test/test.cc index f4fd8a8a..73e32c8c 100644 --- a/test/test.cc +++ b/test/test.cc @@ -232,18 +232,18 @@ void testcase::txn_end(bool abort) { log_trace("<< txn_end(%s)", abort ? "abort" : "commit"); } -void testcase::cursor_open(unsigned dbi) { - log_trace(">> cursor_open(%u)", dbi); +void testcase::cursor_open(MDBX_dbi handle) { + log_trace(">> cursor_open(%u)", handle); assert(!cursor_guard); assert(txn_guard); MDBX_cursor *cursor = nullptr; - int rc = mdbx_cursor_open(txn_guard.get(), dbi, &cursor); + int rc = mdbx_cursor_open(txn_guard.get(), handle, &cursor); if (unlikely(rc != MDBX_SUCCESS)) failure_perror("mdbx_cursor_open()", rc); cursor_guard.reset(cursor); - log_trace("<< cursor_open(%u)", dbi); + log_trace("<< cursor_open(%u)", handle); } void testcase::cursor_close() { @@ -435,14 +435,14 @@ void testcase::update_canary(uint64_t increment) { log_trace("<< update_canary: sequence = %" PRIu64, canary_now.y); } -int testcase::db_open__begin__table_create_open_clean(MDBX_dbi &dbi) { +int testcase::db_open__begin__table_create_open_clean(MDBX_dbi &handle) { db_open(); int err, retry_left = 42; for (;;) { txn_begin(false); - dbi = db_table_open(true); - db_table_clear(dbi); + handle = db_table_open(true); + db_table_clear(handle); err = breakable_commit(); if (likely(err == MDBX_SUCCESS)) { txn_begin(false); diff --git a/test/test.h b/test/test.h index 0ca71754..ecd4a867 100644 --- a/test/test.h +++ b/test/test.h @@ -175,7 +175,7 @@ protected: void txn_end(bool abort); int breakable_restart(); void txn_restart(bool abort, bool readonly, unsigned flags = 0); - void cursor_open(unsigned dbi); + void cursor_open(MDBX_dbi handle); void cursor_close(); void txn_inject_writefault(void); void txn_inject_writefault(MDBX_txn *txn); @@ -189,7 +189,7 @@ protected: void db_table_drop(MDBX_dbi handle); void db_table_clear(MDBX_dbi handle, MDBX_txn *txn = nullptr); void db_table_close(MDBX_dbi handle); - int db_open__begin__table_create_open_clean(MDBX_dbi &dbi); + int db_open__begin__table_create_open_clean(MDBX_dbi &handle); bool wait4start(); void report(size_t nops_done);