mdbx: partial fix MSVC level-4 warnings.

This commit is contained in:
Leonid Yuriev 2017-06-05 22:46:15 +03:00 committed by Leo Yuriev
parent 90b30e7584
commit 318646794e
3 changed files with 12 additions and 10 deletions

View File

@ -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"

View File

@ -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;
}

View File

@ -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)