mdbx: refine type-casting inside mdbx_thread_self() to avoid warning.

2 of 2 for https://github.com/erthink/libmdbx/issues/88

Change-Id: Ic4994141d23a5417b18f6b03a3e4038859fb9210
This commit is contained in:
Leo Yuriev 2020-04-04 15:56:52 +03:00
parent 089d7212e7
commit 75de63dff1

View File

@ -633,12 +633,14 @@ static __maybe_unused __inline uint32_t mdbx_getpid(void) {
} }
static __maybe_unused __inline size_t mdbx_thread_self(void) { static __maybe_unused __inline size_t mdbx_thread_self(void) {
STATIC_ASSERT(sizeof(mdbx_tid_t) <= sizeof(size_t)); mdbx_tid_t thunk;
STATIC_ASSERT(sizeof(size_t) >= sizeof(thunk));
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
return GetCurrentThreadId(); thunk = GetCurrentThreadId();
#else #else
return (size_t)pthread_self(); thunk = pthread_self();
#endif #endif
return (size_t)thunk;
} }
MDBX_INTERNAL_FUNC void __maybe_unused mdbx_osal_jitter(bool tiny); MDBX_INTERNAL_FUNC void __maybe_unused mdbx_osal_jitter(bool tiny);