diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index 2d913b2f20064be0a358d0419bf221b4e8e54f92..de7716db4d920f693dca6031dffe55f173b02596 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -13,8 +13,6 @@ * along with this program. If not, see . */ -#pragma GCC diagnostic ignored "-Wincompatible-pointer-types" - #include "os.h" #include "taosmsg.h" #include "tast.h" diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 6317decbe020e52e0b3747b67892d09cca8fb3e4..bf2b88c9958fbd1725305904c6ce8a6af0f09adc 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -18,9 +18,6 @@ #define _XOPEN_SOURCE -#pragma GCC diagnostic ignored "-Woverflow" -#pragma GCC diagnostic ignored "-Wunused-variable" - #include "os.h" #include "ihash.h" #include "tscSecondaryMerge.h" diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 752c5d123f78155bd501d0c008560edca8da2a40..1bd710f2fba810dc1c06b5733486f06cc3e1b6eb 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -28,8 +28,6 @@ #include "tsclient.h" #include "tscSQLParser.h" -#pragma GCC diagnostic ignored "-Wunused-variable" - #define DEFAULT_PRIMARY_TIMESTAMP_COL_NAME "_c0" // -1 is tbname column index, so here use the -2 as the initial value diff --git a/src/system/detail/inc/mgmt.h b/src/system/detail/inc/mgmt.h index 75ec841076518beef66587b9ba41d3a1b05fe242..c75422e23ee7a69323bef151a8dbb4544a4a1a76 100644 --- a/src/system/detail/inc/mgmt.h +++ b/src/system/detail/inc/mgmt.h @@ -419,7 +419,7 @@ void mgmtCleanupBalance(); int mgmtAllocVnodes(SVgObj *pVgroup); void mgmtSetDnodeShellRemoving(SDnodeObj *pDnode); void mgmtSetDnodeUnRemove(SDnodeObj *pDnode); -void mgmtStartBalanceTimer(int mseconds); +void mgmtStartBalanceTimer(int64_t mseconds); void mgmtSetDnodeOfflineOnSdbChanged(); void mgmtUpdateVgroupState(SVgObj *pVgroup, int lbStatus, int srcIp); bool mgmtAddVnode(SVgObj *pVgroup, SDnodeObj *pSrcDnode, SDnodeObj *pDestDnode); diff --git a/src/system/detail/src/mgmtShell.c b/src/system/detail/src/mgmtShell.c index d00f4eaf06746415e47433cd7f89a277476a9ef2..f6b2d7ba9b321d70e6e9240005607421ebc67917 100644 --- a/src/system/detail/src/mgmtShell.c +++ b/src/system/detail/src/mgmtShell.c @@ -1363,5 +1363,3 @@ void mgmtInitProcessShellMsg() { mgmtProcessShellMsg[TSDB_MSG_TYPE_KILL_STREAM] = mgmtProcessKillStreamMsg; mgmtProcessShellMsg[TSDB_MSG_TYPE_KILL_CONNECTION] = mgmtProcessKillConnectionMsg; } - -#pragma GCC diagnostic pop diff --git a/src/system/lite/src/dnodeMgmt.spec.c b/src/system/lite/src/dnodeMgmt.spec.c index e40b21ab8340aace1198d3e8b632b61f78602adb..576dbcb337b329571296d331e043e2ab1bc8d92c 100644 --- a/src/system/lite/src/dnodeMgmt.spec.c +++ b/src/system/lite/src/dnodeMgmt.spec.c @@ -50,7 +50,7 @@ char *taosBuildReqMsgToMnode(SMgmtObj *pObj, char type) { } int taosSendMsgToMnode(SMgmtObj *pObj, char *msg, int msgLen) { - dTrace("msg:%s is sent to mnode", taosMsg[*(msg-1)]); + dTrace("msg:%s is sent to mnode", taosMsg[(uint8_t)(*(msg-1))]); /* * Lite version has no message header, so minus one @@ -81,7 +81,7 @@ void vnodeProcessMsgFromMgmtSpec(SSchedMsg *sched) { char msgType = *sched->msg; char *content = sched->msg + 1; - dTrace("msg:%s is received from mgmt", taosMsg[msgType]); + dTrace("msg:%s is received from mgmt", taosMsg[(uint8_t)msgType]); vnodeProcessMsgFromMgmt(content, 0, msgType, 0); diff --git a/src/system/lite/src/mgmtBalance.spec.c b/src/system/lite/src/mgmtBalance.spec.c index 3d2f10dcbbc45e21ec0195067797d7dd439e4e94..109f36af1878f0b9e5ad661661989c745e9c015c 100644 --- a/src/system/lite/src/mgmtBalance.spec.c +++ b/src/system/lite/src/mgmtBalance.spec.c @@ -17,7 +17,7 @@ #include "mgmtBalance.h" #include "tstatus.h" -void mgmtStartBalanceTimer(int mseconds) {} +void mgmtStartBalanceTimer(int64_t mseconds) {} int mgmtInitBalance() { return 0; } diff --git a/src/system/lite/src/mgmtDnodeInt.spec.c b/src/system/lite/src/mgmtDnodeInt.spec.c index b99815844d6fe4e2e50a0bb1d9d6a5f1bc5411af..a914d630c2114a2278568b3883bab1eb5eb2aa4f 100644 --- a/src/system/lite/src/mgmtDnodeInt.spec.c +++ b/src/system/lite/src/mgmtDnodeInt.spec.c @@ -61,7 +61,7 @@ char *taosBuildReqMsgToDnode(SDnodeObj *pObj, char type) { int taosSendSimpleRspToDnode(SDnodeObj *pObj, char rsptype, char code) { return 0; } int taosSendMsgToDnode(SDnodeObj *pObj, char *msg, int msgLen) { - mTrace("msg:%s is sent to dnode", taosMsg[*(msg-1)]); + mTrace("msg:%s is sent to dnode", taosMsg[(uint8_t)(*(msg-1))]); /* * Lite version has no message header, so minus one @@ -142,7 +142,7 @@ void mgmtProcessDnodeStatus(void *handle, void *tmrId) { void mgmtProcessMsgFromDnodeSpec(SSchedMsg *sched) { char msgType = *sched->msg; char *content = sched->msg + 1; - mTrace("msg:%s is received from dnode", taosMsg[msgType]); + mTrace("msg:%s is received from dnode", taosMsg[(uint8_t)msgType]); mgmtProcessMsgFromDnode(content, 0, msgType, mgmtGetDnode(0)); free(sched->msg); diff --git a/src/system/lite/src/vnodeFile.spec.c b/src/system/lite/src/vnodeFile.spec.c index 7b26ed6c9f22ed563e6ed529ba51d9711bccb852..4ad624d2ad74b7ded307c014586552ef4f0a6e4e 100644 --- a/src/system/lite/src/vnodeFile.spec.c +++ b/src/system/lite/src/vnodeFile.spec.c @@ -24,7 +24,7 @@ char* vnodeGetDataDir(int vnode, int fileId) { return dataDir; } void vnodeAdustVnodeFile(SVnodeObj *pVnode) { // Retention policy here int fileId = pVnode->fileId - pVnode->numOfFiles + 1; - int cfile = taosGetTimestamp(pVnode->cfg.precision)/pVnode->cfg.daysPerFile/tsMsPerDay[pVnode->cfg.precision]; + int cfile = taosGetTimestamp(pVnode->cfg.precision)/pVnode->cfg.daysPerFile/tsMsPerDay[(uint8_t)pVnode->cfg.precision]; while (fileId <= cfile - pVnode->maxFiles) { vnodeRemoveFile(pVnode->vnode, fileId); pVnode->numOfFiles--; diff --git a/src/util/src/tcompression.c b/src/util/src/tcompression.c index 1ac42377fb62c9f9da1186d068da6ce603a77eea..2425bc4d2477b9834bc7133031737949d87300ae 100644 --- a/src/util/src/tcompression.c +++ b/src/util/src/tcompression.c @@ -355,16 +355,16 @@ int tsCompressINTImp(const char *const input, const int nelements, char *const o tmp_bit = (LONG_BYTES * BITS_PER_BYTE) - BUILDIN_CLZL(zigzag_value); } - if (elems + 1 <= selector_to_elems[selector] && elems + 1 <= selector_to_elems[bit_to_selector[tmp_bit]]) { + if (elems + 1 <= selector_to_elems[(uint8_t)selector] && elems + 1 <= selector_to_elems[(uint8_t)bit_to_selector[(uint8_t)tmp_bit]]) { // If can hold another one. - selector = selector > bit_to_selector[tmp_bit] ? selector : bit_to_selector[tmp_bit]; + selector = selector > bit_to_selector[(uint8_t)tmp_bit] ? selector : bit_to_selector[(uint8_t)tmp_bit]; elems++; - bit = bit_per_integer[selector]; + bit = bit_per_integer[(uint8_t)selector]; } else { // if cannot hold another one. - while (elems < selector_to_elems[selector]) selector++; - elems = selector_to_elems[selector]; - bit = bit_per_integer[selector]; + while (elems < selector_to_elems[(uint8_t)selector]) selector++; + elems = selector_to_elems[(uint8_t)selector]; + bit = bit_per_integer[(uint8_t)selector]; break; } prev_value_tmp = curr_value; @@ -455,8 +455,8 @@ int tsDecompressINTImp(const char *const input, const int nelements, char *const memcpy(&w, ip, LONG_BYTES); char selector = (char)(w & INT64MASK(4)); // selector = 4 - char bit = bit_per_integer[selector]; // bit = 3 - int elems = selector_to_elems[selector]; + char bit = bit_per_integer[(uint8_t)selector]; // bit = 3 + int elems = selector_to_elems[(uint8_t)selector]; for (int i = 0; i < elems; i++) { uint64_t zigzag_value; diff --git a/src/util/src/tcrc32c.c b/src/util/src/tcrc32c.c index c67773f1ca6f3fee8502e3cf8b0d83c83e333b38..546693c4bbc82750b7bbc1a117469fb816fd0362 100644 --- a/src/util/src/tcrc32c.c +++ b/src/util/src/tcrc32c.c @@ -25,8 +25,6 @@ #include #include "tcrc32c.h" -//todo : use the original source code -//#pragma GCC diagnostic ignored "-Wunused-function" #define POLY 0x82f63b78 #define LONG_SHIFT 8192 diff --git a/src/util/src/textbuffer.c b/src/util/src/textbuffer.c index 42c2cc1ed01b8608169cabe85cb1497820d702d7..984164bfd21b41c90b697aac6d0760c63abf6833 100644 --- a/src/util/src/textbuffer.c +++ b/src/util/src/textbuffer.c @@ -23,8 +23,6 @@ #include "ttypes.h" #include "tutil.h" -//#pragma GCC diagnostic ignored "-Wformat" - #define COLMODEL_GET_VAL(data, schema, allrow, rowId, colId) \ (data + (schema)->colOffset[colId] * (allrow) + (rowId) * (schema)->pFields[colId].bytes) diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index f402963049a71fd8d8b7329db84a99520751e775..d23b0ab27cdeb13fb8bb7c83d69c2a185a459836 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -510,7 +510,7 @@ uint32_t tSQLGetToken(char* z, uint32_t* tokenType) { if ((z[i] == 'a' || z[i] == 's' || z[i] == 'm' || z[i] == 'h' || z[i] == 'd' || z[i] == 'n' || z[i] == 'y' || z[i] == 'w' || z[i] == 'A' || z[i] == 'S' || z[i] == 'M' || z[i] == 'H' || z[i] == 'D' || z[i] == 'N' || z[i] == 'Y' || z[i] == 'W') && - (isIdChar[z[i + 1]] == 0)) { + (isIdChar[(uint8_t)z[i + 1]] == 0)) { *tokenType = TK_VARIABLE; i += 1; return i; @@ -551,7 +551,7 @@ uint32_t tSQLGetToken(char* z, uint32_t* tokenType) { case 't': case 'F': case 'f': { - for (i = 1; ((z[i] & 0x80) == 0) && isIdChar[z[i]]; i++) { + for (i = 1; ((z[i] & 0x80) == 0) && isIdChar[(uint8_t)z[i]]; i++) { } if ((i == 4 && strncasecmp(z, "true", 4) == 0) || (i == 5 && strncasecmp(z, "false", 5) == 0)) { @@ -560,10 +560,10 @@ uint32_t tSQLGetToken(char* z, uint32_t* tokenType) { } } default: { - if (((*z & 0x80) != 0) || !isIdChar[*z]) { + if (((*z & 0x80) != 0) || !isIdChar[(uint8_t)(*z)]) { break; } - for (i = 1; ((z[i] & 0x80) == 0) && isIdChar[z[i]]; i++) { + for (i = 1; ((z[i] & 0x80) == 0) && isIdChar[(uint8_t)z[i]]; i++) { } *tokenType = tSQLKeywordCode(z, i); return i;