提交 381399e3 编写于 作者: H Haojun Liao

Merge branch 'develop' into feature/query

...@@ -117,7 +117,7 @@ extern "C" { ...@@ -117,7 +117,7 @@ extern "C" {
#define POW2(x) ((x) * (x)) #define POW2(x) ((x) * (x))
int taosRand(void); uint32_t taosRand(void);
int32_t strdequote(char *src); int32_t strdequote(char *src);
......
...@@ -449,6 +449,7 @@ static int tdRestoreKVStore(SKVStore *pStore) { ...@@ -449,6 +449,7 @@ static int tdRestoreKVStore(SKVStore *pStore) {
void * buf = NULL; void * buf = NULL;
int maxBufSize = 0; int maxBufSize = 0;
SKVRecord rInfo = {0}; SKVRecord rInfo = {0};
SHashMutableIterator *pIter = NULL;
ASSERT(TD_KVSTORE_HEADER_SIZE == lseek(pStore->fd, 0, SEEK_CUR)); ASSERT(TD_KVSTORE_HEADER_SIZE == lseek(pStore->fd, 0, SEEK_CUR));
...@@ -497,7 +498,7 @@ static int tdRestoreKVStore(SKVStore *pStore) { ...@@ -497,7 +498,7 @@ static int tdRestoreKVStore(SKVStore *pStore) {
goto _err; goto _err;
} }
SHashMutableIterator *pIter = taosHashCreateIter(pStore->map); pIter = taosHashCreateIter(pStore->map);
if (pIter == NULL) { if (pIter == NULL) {
uError("failed to create hash iter while opening KV store %s", pStore->fname); uError("failed to create hash iter while opening KV store %s", pStore->fname);
terrno = TSDB_CODE_COM_OUT_OF_MEMORY; terrno = TSDB_CODE_COM_OUT_OF_MEMORY;
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
#ifdef WINDOWS #ifdef WINDOWS
int taosRand(void) uint32_t taosRand(void)
{ {
return rand(); return rand();
} }
#else #else
int taosRand(void) uint32_t taosRand(void)
{ {
int fd; int fd;
int seed; int seed;
...@@ -50,7 +50,7 @@ int taosRand(void) ...@@ -50,7 +50,7 @@ int taosRand(void)
close(fd); close(fd);
} }
return seed; return (uint32_t)seed;
} }
#endif #endif
...@@ -475,8 +475,8 @@ void taosRandStr(char* str, int32_t size) { ...@@ -475,8 +475,8 @@ void taosRandStr(char* str, int32_t size) {
const char* set = "abcdefghijklmnopqrstuvwxyz0123456789-_."; const char* set = "abcdefghijklmnopqrstuvwxyz0123456789-_.";
int32_t len = 39; int32_t len = 39;
for(int32_t i = 0; i < size; ++i) { for (int32_t i = 0; i < size; ++i) {
str[i] = set[taosRand()%len]; str[i] = set[taosRand() % len];
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册