diff --git a/src/bits.h b/src/bits.h index 73bea6f5..de87d85d 100644 --- a/src/bits.h +++ b/src/bits.h @@ -66,12 +66,14 @@ #endif /* __SANITIZE_THREAD__ */ #ifdef _MSC_VER -#pragma warning(disable : 4464) /* C4464: relative include path contains '..' */ -#pragma warning(disable : 4710) /* C4710: 'xyz': function not inlined */ -#pragma warning(disable : 4711) /* C4711: function 'xyz' selected for automatic inline expansion */ -#pragma warning(disable : 4201) /* C4201: nonstandard extension used : nameless struct / union */ -#pragma warning(disable : 4706) /* C4706: assignment within conditional expression */ -#pragma warning(disable : 4127) /* C4127: conditional expression is constant */ +#pragma warning(disable : 4464) /* relative include path contains '..' */ +#pragma warning(disable : 4710) /* 'xyz': function not inlined */ +#pragma warning(disable : 4711) /* function 'xyz' selected for automatic inline expansion */ +#pragma warning(disable : 4201) /* nonstandard extension used : nameless struct / union */ +#pragma warning(disable : 4706) /* assignment within conditional expression */ +#pragma warning(disable : 4127) /* conditional expression is constant */ +#pragma warning(disable : 4324) /* 'xyz': structure was padded due to alignment specifier */ +#pragma warning(disable : 4310) /* cast truncates constant value */ #endif /* _MSC_VER (warnings) */ #include "./osal.h" diff --git a/src/mdbx.c b/src/mdbx.c index 7ba9b54f..2ff871e6 100644 --- a/src/mdbx.c +++ b/src/mdbx.c @@ -3200,8 +3200,8 @@ int mdbx_txn_commit(MDBX_txn *txn) { parent->mt_dbflags[MAIN_DBI] = txn->mt_dbflags[MAIN_DBI]; for (i = CORE_DBS; i < txn->mt_numdbs; i++) { /* preserve parent's DB_NEW status */ - x = parent->mt_dbflags[i] & DB_NEW; - parent->mt_dbflags[i] = txn->mt_dbflags[i] | x; + parent->mt_dbflags[i] = + txn->mt_dbflags[i] | (parent->mt_dbflags[i] & DB_NEW); } dst = parent->mt_rw_dirtylist; @@ -7294,7 +7294,7 @@ MDBX_txn *mdbx_cursor_txn(MDBX_cursor *mc) { MDBX_dbi mdbx_cursor_dbi(MDBX_cursor *mc) { if (unlikely(!mc || mc->mc_signature != MDBX_MC_SIGNATURE)) - return INT_MIN; + return UINT_MAX; return mc->mc_dbi; } diff --git a/test/log.cc b/test/log.cc index 3c0a4b11..ebb859b6 100644 --- a/test/log.cc +++ b/test/log.cc @@ -97,10 +97,10 @@ bool output(const logging::loglevel priority, const char *format, va_list ap) { chrono::time now = chrono::now_realtime(); struct tm tm; - time_t time = now.utc; #ifdef _MSC_VER int rc = _localtime32_s(&tm, (const __time32_t *)&now.utc); #else + time_t time = now.utc; int rc = localtime_r(&time, &tm) ? MDBX_SUCCESS : errno; #endif if (rc != MDBX_SUCCESS)