This commit is contained in:
Hongze Cheng 2020-08-04 13:10:58 +08:00
parent 2d4cd0fd44
commit 6c777907c0
2 changed files with 3 additions and 6 deletions

View File

@ -52,14 +52,11 @@
#include "tscompression.h" #include "tscompression.h"
#include "taosdef.h" #include "taosdef.h"
const int TEST_NUMBER = 1; static const int TEST_NUMBER = 1;
#define is_bigendian() ((*(char *)&TEST_NUMBER) == 0) #define is_bigendian() ((*(char *)&TEST_NUMBER) == 0)
#define SIMPLE8B_MAX_INT64 ((uint64_t)2305843009213693951L) #define SIMPLE8B_MAX_INT64 ((uint64_t)2305843009213693951L)
bool safeInt64Add(int64_t a, int64_t b) { #define safeInt64Add(a, b) (((a >= 0) && (b <= INT64_MAX - a)) || ((a < 0) && (b >= INT64_MIN - a)))
if ((a > 0 && b > INT64_MAX - a) || (a < 0 && b < INT64_MIN - a)) return false;
return true;
}
/* /*
* Compress Integer (Simple8B). * Compress Integer (Simple8B).

View File

@ -535,7 +535,7 @@ static int tdRestoreKVStore(SKVStore *pStore) {
buf = malloc(maxBufSize); buf = malloc(maxBufSize);
if (buf == NULL) { if (buf == NULL) {
uError("failed to allocate %d bytes in KV store %s", maxBufSize, pStore->fname); uError("failed to allocate %" PRId64 " bytes in KV store %s", maxBufSize, pStore->fname);
terrno = TAOS_SYSTEM_ERROR(errno); terrno = TAOS_SYSTEM_ERROR(errno);
goto _err; goto _err;
} }