提交 2d4cd0fd 编写于 作者: H Hongze Cheng

fix part of compile error on windows

上级 45ea0c5d
...@@ -196,14 +196,14 @@ static FORCE_INLINE void *taosDecodeFixedI64(void *buf, int64_t *value) { ...@@ -196,14 +196,14 @@ static FORCE_INLINE void *taosDecodeFixedI64(void *buf, int64_t *value) {
static FORCE_INLINE int taosEncodeVariantU16(void **buf, uint16_t value) { static FORCE_INLINE int taosEncodeVariantU16(void **buf, uint16_t value) {
int i = 0; int i = 0;
while (value >= ENCODE_LIMIT) { while (value >= ENCODE_LIMIT) {
if (buf != NULL) ((uint8_t *)(*buf))[i] = (value | ENCODE_LIMIT); if (buf != NULL) ((uint8_t *)(*buf))[i] = (uint8_t)(value | ENCODE_LIMIT);
value >>= 7; value >>= 7;
i++; i++;
ASSERT(i < 3); ASSERT(i < 3);
} }
if (buf != NULL) { if (buf != NULL) {
((uint8_t *)(*buf))[i] = value; ((uint8_t *)(*buf))[i] = (uint8_t)value;
*buf = POINTER_SHIFT(*buf, i + 1); *buf = POINTER_SHIFT(*buf, i + 1);
} }
...@@ -292,14 +292,14 @@ static FORCE_INLINE void *taosDecodeVariantI32(void *buf, int32_t *value) { ...@@ -292,14 +292,14 @@ static FORCE_INLINE void *taosDecodeVariantI32(void *buf, int32_t *value) {
static FORCE_INLINE int taosEncodeVariantU64(void **buf, uint64_t value) { static FORCE_INLINE int taosEncodeVariantU64(void **buf, uint64_t value) {
int i = 0; int i = 0;
while (value >= ENCODE_LIMIT) { while (value >= ENCODE_LIMIT) {
if (buf != NULL) ((uint8_t *)(*buf))[i] = (value | ENCODE_LIMIT); if (buf != NULL) ((uint8_t *)(*buf))[i] = (uint8_t)(value | ENCODE_LIMIT);
value >>= 7; value >>= 7;
i++; i++;
ASSERT(i < 10); ASSERT(i < 10);
} }
if (buf != NULL) { if (buf != NULL) {
((uint8_t *)(*buf))[i] = value; ((uint8_t *)(*buf))[i] = (uint8_t)value;
*buf = POINTER_SHIFT(*buf, i + 1); *buf = POINTER_SHIFT(*buf, i + 1);
} }
...@@ -346,7 +346,7 @@ static FORCE_INLINE int taosEncodeString(void **buf, char *value) { ...@@ -346,7 +346,7 @@ static FORCE_INLINE int taosEncodeString(void **buf, char *value) {
memcpy(*buf, value, size); memcpy(*buf, value, size);
*buf = POINTER_SHIFT(*buf, size); *buf = POINTER_SHIFT(*buf, size);
} }
tlen += size; tlen += (int)size;
return tlen; return tlen;
} }
......
...@@ -286,7 +286,7 @@ int tdDropKVStoreRecord(SKVStore *pStore, uint64_t uid) { ...@@ -286,7 +286,7 @@ int tdDropKVStoreRecord(SKVStore *pStore, uint64_t uid) {
return -1; return -1;
} }
pStore->info.magic = taosCalcChecksum(pStore->info.magic, (uint8_t *)buf, POINTER_DISTANCE(pBuf, buf)); pStore->info.magic = taosCalcChecksum(pStore->info.magic, (uint8_t *)buf, (uint32_t)POINTER_DISTANCE(pBuf, buf));
pStore->info.size += POINTER_DISTANCE(pBuf, buf); pStore->info.size += POINTER_DISTANCE(pBuf, buf);
pStore->info.nDels++; pStore->info.nDels++;
pStore->info.nRecords--; pStore->info.nRecords--;
...@@ -485,7 +485,7 @@ static void *tdDecodeKVRecord(void *buf, SKVRecord *pRecord) { ...@@ -485,7 +485,7 @@ static void *tdDecodeKVRecord(void *buf, SKVRecord *pRecord) {
static int tdRestoreKVStore(SKVStore *pStore) { static int tdRestoreKVStore(SKVStore *pStore) {
char tbuf[128] = "\0"; char tbuf[128] = "\0";
void * buf = NULL; void * buf = NULL;
int maxBufSize = 0; int64_t maxBufSize = 0;
SKVRecord rInfo = {0}; SKVRecord rInfo = {0};
SHashMutableIterator *pIter = NULL; SHashMutableIterator *pIter = NULL;
...@@ -564,7 +564,7 @@ static int tdRestoreKVStore(SKVStore *pStore) { ...@@ -564,7 +564,7 @@ static int tdRestoreKVStore(SKVStore *pStore) {
} }
if (pStore->iFunc) { if (pStore->iFunc) {
if ((*pStore->iFunc)(pStore->appH, buf, pRecord->size) < 0) { if ((*pStore->iFunc)(pStore->appH, buf, (int)pRecord->size) < 0) {
uError("failed to restore record uid %" PRIu64 " in kv store %s at offset %" PRId64 " size %" PRId64 uError("failed to restore record uid %" PRIu64 " in kv store %s at offset %" PRId64 " size %" PRId64
" since %s", " since %s",
pRecord->uid, pStore->fname, pRecord->offset, pRecord->size, tstrerror(terrno)); pRecord->uid, pStore->fname, pRecord->offset, pRecord->size, tstrerror(terrno));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册