mdbx: fix MSVC warnings, add uint16-range-asserts.

Change-Id: Ie67a728035eeae250efbf962270b5c17c974db23
This commit is contained in:
Leonid Yuriev
2017-07-02 09:07:57 +03:00
committed by Leo Yuriev
parent 2ed74ee78f
commit 3e6a672286
9 changed files with 142 additions and 79 deletions

View File

@@ -37,7 +37,9 @@ static int waitstatus2errcode(DWORD result) {
/* Map a result from an NTAPI call to WIN32 error code. */
static int ntstatus2errcode(NTSTATUS status) {
DWORD dummy;
OVERLAPPED ov = {status};
OVERLAPPED ov;
memset(&ov, 0, sizeof(ov));
ov.Internal = status;
return GetOverlappedResult(NULL, &ov, &dummy, FALSE) ? MDBX_SUCCESS
: GetLastError();
}
@@ -759,7 +761,7 @@ int mdbx_mmap(int flags, mdbx_mmap_param_t *map, size_t length, size_t limit) {
}
map->address = NULL;
size_t ViewSize = limit;
SIZE_T ViewSize = limit;
rc = NtMapViewOfSection(
map->section, GetCurrentProcess(), &map->address,
/* ZeroBits */ 0,