From ac6069f3430f867504b1e881c817833fcf01be88 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 20 May 2022 12:45:03 +0800 Subject: [PATCH] fix:compile error in windows --- source/client/src/clientImpl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 0f4e14bbd0..4d8971cb89 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -759,9 +759,9 @@ static char* parseTagDatatoJson(void *p){ char tagJsonKey[256] = {0}; for (int j = 0; j < nCols; ++j) { SColIdx * pColIdx = kvRowColIdxAt(p, j); - void* val = (kvRowColVal(p, pColIdx)); + char* val = (char*)(kvRowColVal(p, pColIdx)); if (j == 0){ - if(*(char*)val == TSDB_DATA_TYPE_NULL){ + if(*val == TSDB_DATA_TYPE_NULL){ string = taosMemoryCalloc(1, 8); sprintf(varDataVal(string), "%s", TSDB_DATA_NULL_STR_L); varDataSetLen(string, strlen(varDataVal(string))); @@ -776,7 +776,7 @@ static char* parseTagDatatoJson(void *p){ // json value val += varDataTLen(val); char* realData = POINTER_SHIFT(val, CHAR_BYTES); - char type = *(char*)val; + char type = *val; if(type == TSDB_DATA_TYPE_NULL) { cJSON* value = cJSON_CreateNull(); if (value == NULL) @@ -790,8 +790,7 @@ static char* parseTagDatatoJson(void *p){ char *tagJsonValue = taosMemoryCalloc(varDataLen(realData), 1); int32_t length = taosUcs4ToMbs((TdUcs4 *)varDataVal(realData), varDataLen(realData), tagJsonValue); if (length < 0) { - tscError("charset:%s to %s. val:%s convert json value failed.", DEFAULT_UNICODE_ENCODEC, tsCharset, - (char*)val); + tscError("charset:%s to %s. val:%s convert json value failed.", DEFAULT_UNICODE_ENCODEC, tsCharset, val); taosMemoryFree(tagJsonValue); goto end; }