mdbx: misc refines (minor).

Change-Id: Ia58e2d75e320bbd47dd352e082cf6f41afde075f
This commit is contained in:
Leo Yuriev
2017-07-26 12:23:01 +03:00
parent 1b09605a06
commit 88ca23caa5
3 changed files with 72 additions and 36 deletions

View File

@@ -208,13 +208,13 @@ int mdbx_asprintf(char **strp, const char *fmt, ...) {
va_end(ap);
if (unlikely(needed < 0 || needed >= INT_MAX)) {
*strp = NULL;
*strp = nullptr;
va_end(ones);
return needed;
}
*strp = malloc(needed + 1);
if (unlikely(*strp == NULL)) {
if (unlikely(*strp == nullptr)) {
va_end(ones);
SetLastError(MDBX_ENOMEM);
return -1;
@@ -231,7 +231,7 @@ int mdbx_asprintf(char **strp, const char *fmt, ...) {
assert(actual == needed);
if (unlikely(actual < 0)) {
free(*strp);
*strp = NULL;
*strp = nullptr;
}
return actual;
}
@@ -246,7 +246,7 @@ int mdbx_memalign_alloc(size_t alignment, size_t bytes, void **result) {
*result = memalign(alignment, bytes);
return *result ? MDBX_SUCCESS : errno;
#elif _POSIX_VERSION >= 200112L
*result = NULL;
*result = nullptr;
return posix_memalign(result, alignment, bytes);
#else
#error FIXME