提交 6c777907 编写于 作者: H Hongze Cheng

more

上级 2d4cd0fd
...@@ -52,14 +52,11 @@ ...@@ -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).
......
...@@ -535,7 +535,7 @@ static int tdRestoreKVStore(SKVStore *pStore) { ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册