more
This commit is contained in:
parent
2d4cd0fd44
commit
6c777907c0
|
@ -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) {
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue