From c2ec729727aa8c31897366ee60184494a42b0da7 Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Wed, 5 Aug 2020 18:02:29 +0800 Subject: [PATCH] resolve compiler warning in windows --- src/client/inc/tsclient.h | 2 +- src/client/src/tscPrepare.c | 2 +- src/inc/taos.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 7a44870938..b38e6377a9 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -157,7 +157,7 @@ typedef struct SParamInfo { int32_t idx; char type; uint8_t timePrec; - short bytes; + int16_t bytes; uint32_t offset; } SParamInfo; diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index 3ddfc1c341..0df1c7ddc5 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -298,7 +298,7 @@ static int doBindParam(char* data, SParamInfo* param, TAOS_BIND* bind) { break; case TSDB_DATA_TYPE_BINARY: - if ((*bind->length) > param->bytes) { + if ((*bind->length) > (uintptr_t)param->bytes) { return TSDB_CODE_TSC_INVALID_VALUE; } size = (short)*bind->length; diff --git a/src/inc/taos.h b/src/inc/taos.h index 1d609bc7db..f3cc9bb4d7 100644 --- a/src/inc/taos.h +++ b/src/inc/taos.h @@ -72,8 +72,8 @@ DLL_EXPORT void taos_close(TAOS *taos); typedef struct TAOS_BIND { int buffer_type; void * buffer; - unsigned long buffer_length; // unused - unsigned long *length; + uintptr_t buffer_length; // unused + uintptr_t *length; int * is_null; int is_unsigned; // unused int * error; // unused -- GitLab