fix part of compile error on windows
This commit is contained in:
parent
45ea0c5d8e
commit
2d4cd0fd44
|
@ -196,14 +196,14 @@ static FORCE_INLINE void *taosDecodeFixedI64(void *buf, int64_t *value) {
|
|||
static FORCE_INLINE int taosEncodeVariantU16(void **buf, uint16_t value) {
|
||||
int i = 0;
|
||||
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;
|
||||
i++;
|
||||
ASSERT(i < 3);
|
||||
}
|
||||
|
||||
if (buf != NULL) {
|
||||
((uint8_t *)(*buf))[i] = value;
|
||||
((uint8_t *)(*buf))[i] = (uint8_t)value;
|
||||
*buf = POINTER_SHIFT(*buf, i + 1);
|
||||
}
|
||||
|
||||
|
@ -292,14 +292,14 @@ static FORCE_INLINE void *taosDecodeVariantI32(void *buf, int32_t *value) {
|
|||
static FORCE_INLINE int taosEncodeVariantU64(void **buf, uint64_t value) {
|
||||
int i = 0;
|
||||
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;
|
||||
i++;
|
||||
ASSERT(i < 10);
|
||||
}
|
||||
|
||||
if (buf != NULL) {
|
||||
((uint8_t *)(*buf))[i] = value;
|
||||
((uint8_t *)(*buf))[i] = (uint8_t)value;
|
||||
*buf = POINTER_SHIFT(*buf, i + 1);
|
||||
}
|
||||
|
||||
|
@ -346,7 +346,7 @@ static FORCE_INLINE int taosEncodeString(void **buf, char *value) {
|
|||
memcpy(*buf, value, size);
|
||||
*buf = POINTER_SHIFT(*buf, size);
|
||||
}
|
||||
tlen += size;
|
||||
tlen += (int)size;
|
||||
|
||||
return tlen;
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ int tdDropKVStoreRecord(SKVStore *pStore, uint64_t uid) {
|
|||
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.nDels++;
|
||||
pStore->info.nRecords--;
|
||||
|
@ -485,7 +485,7 @@ static void *tdDecodeKVRecord(void *buf, SKVRecord *pRecord) {
|
|||
static int tdRestoreKVStore(SKVStore *pStore) {
|
||||
char tbuf[128] = "\0";
|
||||
void * buf = NULL;
|
||||
int maxBufSize = 0;
|
||||
int64_t maxBufSize = 0;
|
||||
SKVRecord rInfo = {0};
|
||||
SHashMutableIterator *pIter = NULL;
|
||||
|
||||
|
@ -564,7 +564,7 @@ static int tdRestoreKVStore(SKVStore *pStore) {
|
|||
}
|
||||
|
||||
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
|
||||
" since %s",
|
||||
pRecord->uid, pStore->fname, pRecord->offset, pRecord->size, tstrerror(terrno));
|
||||
|
|
Loading…
Reference in New Issue