mdbx: more fix MSVC '/Wall' warnings.

Change-Id: I359a3056d6bb5db762fe6b6b8a89e8ed066f8a87
This commit is contained in:
Leonid Yuriev
2017-07-26 15:56:39 +03:00
committed by Leo Yuriev
parent 006f531757
commit a78edd314e
6 changed files with 15 additions and 12 deletions

View File

@@ -86,6 +86,7 @@
#include "../mdbx.h"
#include "../src/defs.h"
#include "../src/osal.h"
#ifdef _MSC_VER
#pragma warning(pop)

View File

@@ -62,7 +62,7 @@ inline time from_seconds(uint64_t seconds) {
inline time from_utc(time_t utc) {
assert(utc >= 0);
return from_seconds(utc);
return from_seconds((uint64_t)utc);
}
inline time infinite() {

View File

@@ -66,8 +66,8 @@ const char *keygencase2str(const keygen_case keycase) {
//-----------------------------------------------------------------------------
static void mdbx_debug_logger(int type, const char *function, int line,
const char *msg, va_list args) {
static void mdbx_logger(int type, const char *function, int line,
const char *msg, va_list args) {
logging::loglevel level = logging::info;
if (type & MDBX_DBG_EXTRA)
level = logging::extra;
@@ -120,7 +120,7 @@ void testcase::db_prepare() {
mdbx_dbg_opts |= MDBX_DBG_TRACE;
if (config.params.loglevel <= logging::verbose)
mdbx_dbg_opts |= MDBX_DBG_PRINT;
int rc = mdbx_setup_debug(mdbx_dbg_opts, mdbx_debug_logger);
int rc = mdbx_setup_debug(mdbx_dbg_opts, mdbx_logger);
log_info("set mdbx debug-opts: 0x%02x", rc);
MDBX_env *env = nullptr;

View File

@@ -229,7 +229,7 @@ static __inline uint64_t mul_32x32_64(uint32_t a, uint32_t b) {
static __inline unsigned add_with_carry(uint64_t *sum, uint64_t addend) {
*sum += addend;
return *sum < addend;
return (*sum < addend) ? 1u : 0u;
}
static __inline uint64_t mul_64x64_128(uint64_t a, uint64_t b, uint64_t *h) {