diff --git a/cmake/define.inc b/cmake/define.inc index 84df6f54055cff0b6fe7f1820d46958787ca3c46..98b54bfb5011283f16259cd032d33da02e10f75e 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -48,6 +48,7 @@ ENDIF () IF (TD_LINUX_64) ADD_DEFINITIONS(-D_M_X64) ADD_DEFINITIONS(-D_TD_LINUX_64) + MESSAGE(STATUS "linux64 is defined") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ADD_DEFINITIONS(-DUSE_LIBICONV) ENDIF () @@ -55,6 +56,7 @@ ENDIF () IF (TD_LINUX_32) ADD_DEFINITIONS(-D_TD_LINUX_32) ADD_DEFINITIONS(-DUSE_LIBICONV) + MESSAGE(STATUS "linux32 is defined") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -munaligned-access -fpack-struct=8 -latomic -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ENDIF () @@ -63,22 +65,26 @@ IF (TD_ARM_64) ADD_DEFINITIONS(-D_TD_ARM_64_) ADD_DEFINITIONS(-D_TD_ARM_) ADD_DEFINITIONS(-DUSE_LIBICONV) + MESSAGE(STATUS "arm64 is defined") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ENDIF () IF (TD_ARM_32) ADD_DEFINITIONS(-D_TD_ARM_32_) ADD_DEFINITIONS(-D_TD_ARM_) - SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") + MESSAGE(STATUS "arm32 is defined") + SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g -fsigned-char -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types ") ENDIF () IF (TD_MIPS_64) ADD_DEFINITIONS(-D_TD_MIPS_64_) + MESSAGE(STATUS "mips64 is defined") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ENDIF () IF (TD_MIPS_32) ADD_DEFINITIONS(-D_TD_MIPS_32_) + MESSAGE(STATUS "mips32 is defined") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -fPIC -g3 -gdwarf-2 -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") ENDIF () @@ -86,6 +92,7 @@ IF (TD_APLHINE) SET(COMMON_FLAGS "${COMMON_FLAGS} -largp") link_libraries(/usr/lib/libargp.a) ADD_DEFINITIONS(-D_ALPINE) + MESSAGE(STATUS "aplhine is defined") ENDIF () IF (TD_LINUX) @@ -118,6 +125,7 @@ IF (TD_DARWIN_64) ADD_DEFINITIONS(-DDARWIN) ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT) ADD_DEFINITIONS(-DUSE_LIBICONV) + MESSAGE(STATUS "darwin64 is defined") SET(COMMON_FLAGS "-std=gnu99 -Wall -Werror -Wno-missing-braces -fPIC -g -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE") SET(DEBUG_FLAGS "-O0 -DDEBUG") SET(RELEASE_FLAGS "-O0") @@ -147,11 +155,13 @@ IF (TD_WINDOWS_64) ADD_DEFINITIONS(-D_M_X64) ADD_DEFINITIONS(-D_TD_WINDOWS_64) ADD_DEFINITIONS(-DUSE_LIBICONV) + MESSAGE(STATUS "windows64 is defined") ENDIF () IF (TD_WINDOWS_32) ADD_DEFINITIONS(-D_TD_WINDOWS_32) ADD_DEFINITIONS(-DUSE_LIBICONV) + MESSAGE(STATUS "windows32 is defined") ENDIF () INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) diff --git a/src/client/src/TSDBJNIConnector.c b/src/client/src/TSDBJNIConnector.c index bd980b75a340dac3e76240e62743a8370b39404c..9368faa0ee961fb8af98df2ddaecf1e9e748bd31 100644 --- a/src/client/src/TSDBJNIConnector.c +++ b/src/client/src/TSDBJNIConnector.c @@ -149,7 +149,7 @@ JNIEXPORT void JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_initImp(JNIEnv *e JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv *env, jobject jobj, jint optionIndex, jstring optionValue) { if (optionValue == NULL) { - jniDebug("option index:%d value is null", optionIndex); + jniDebug("option index:%d value is null", (int32_t)optionIndex); return 0; } @@ -183,7 +183,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv } (*env)->ReleaseStringUTFChars(env, optionValue, tz1); } else { - jniError("option index:%d is not found", optionIndex); + jniError("option index:%d is not found", (int32_t)optionIndex); } return res; @@ -227,10 +227,10 @@ JNIEXPORT jlong JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_connectImp(JNIEn ret = (jlong)taos_connect((char *)host, (char *)user, (char *)pass, (char *)dbname, (uint16_t)jport); if (ret == 0) { jniError("jobj:%p, conn:%p, connect to database failed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret, - (char *)host, (char *)user, (char *)dbname, jport); + (char *)host, (char *)user, (char *)dbname, (int32_t)jport); } else { jniDebug("jobj:%p, conn:%p, connect to database succeed, host=%s, user=%s, dbname=%s, port=%d", jobj, (void *)ret, - (char *)host, (char *)user, (char *)dbname, jport); + (char *)host, (char *)user, (char *)dbname, (int32_t)jport); } if (host != NULL) (*env)->ReleaseStringUTFChars(env, jhost, host); @@ -385,7 +385,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_getAffectedRowsIm } jint ret = taos_affected_rows((SSqlObj *)res); - jniDebug("jobj:%p, conn:%p, sql:%p, res: %p, affect rows:%d", jobj, tscon, (void *)con, (void *)res, ret); + jniDebug("jobj:%p, conn:%p, sql:%p, res: %p, affect rows:%d", jobj, tscon, (void *)con, (void *)res, (int32_t)ret); return ret; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 0a5cfef80a1bd642fb6376712e39369a47e2c798..e3bd30fb71500816b95d74e9b3dfd3d5f21a2c65 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -642,14 +642,14 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { size_t numOfSrcCols = taosArrayGetSize(pQueryInfo->colList); if (numOfSrcCols <= 0 && !tscQueryTags(pQueryInfo)) { - tscError("%p illegal value of numOfCols in query msg: %"PRIu64", table cols:%d", pSql, numOfSrcCols, + tscError("%p illegal value of numOfCols in query msg: %" PRIu64 ", table cols:%d", pSql, (int64_t)numOfSrcCols, tscGetNumOfColumns(pTableMeta)); return TSDB_CODE_TSC_INVALID_SQL; } if (pQueryInfo->interval.interval < 0) { - tscError("%p illegal value of aggregation time interval in query msg: %ld", pSql, pQueryInfo->interval.interval); + tscError("%p illegal value of aggregation time interval in query msg: %" PRId64, pSql, (int64_t)pQueryInfo->interval.interval); return TSDB_CODE_TSC_INVALID_SQL; } diff --git a/src/client/src/tscStream.c b/src/client/src/tscStream.c index 81b8cf7359a93764551cc4765efebc19be4d62ad..d01ede279aaad882e26bada0c8a6bb7069747406 100644 --- a/src/client/src/tscStream.c +++ b/src/client/src/tscStream.c @@ -398,8 +398,8 @@ static void tscSetSlidingWindowInfo(SSqlObj *pSql, SSqlStream *pStream) { SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0); if (pQueryInfo->interval.intervalUnit != 'n' && pQueryInfo->interval.intervalUnit!= 'y' && pQueryInfo->interval.interval < minIntervalTime) { - tscWarn("%p stream:%p, original sample interval:%ld too small, reset to:%" PRId64, pSql, pStream, - pQueryInfo->interval.interval, minIntervalTime); + tscWarn("%p stream:%p, original sample interval:%" PRId64 " too small, reset to:%" PRId64, pSql, pStream, + (int64_t)pQueryInfo->interval.interval, minIntervalTime); pQueryInfo->interval.interval = minIntervalTime; } diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index e7f40442a0b18c07193a10db61452c820e603473..f669803263671a1d8ea6f1b3d92add43ab375e04 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -313,13 +313,13 @@ void dataColSetOffset(SDataCol *pCol, int nEle) { SDataCols *tdNewDataCols(int maxRowSize, int maxCols, int maxRows) { SDataCols *pCols = (SDataCols *)calloc(1, sizeof(SDataCols)); if (pCols == NULL) { - uDebug("malloc failure, size:%"PRId64" failed, reason:%s", sizeof(SDataCols), strerror(errno)); + uDebug("malloc failure, size:%"PRId64" failed, reason:%s", (int64_t)sizeof(SDataCols), strerror(errno)); return NULL; } pCols->cols = (SDataCol *)calloc(maxCols, sizeof(SDataCol)); if (pCols->cols == NULL) { - uDebug("malloc failure, size:%"PRId64" failed, reason:%s", sizeof(SDataCol) * maxCols, strerror(errno)); + uDebug("malloc failure, size:%"PRId64" failed, reason:%s", (int64_t)sizeof(SDataCol) * maxCols, strerror(errno)); tdFreeDataCols(pCols); return NULL; } @@ -331,7 +331,7 @@ SDataCols *tdNewDataCols(int maxRowSize, int maxCols, int maxRows) { pCols->buf = malloc(pCols->bufSize); if (pCols->buf == NULL) { - uDebug("malloc failure, size:%"PRId64" failed, reason:%s", sizeof(SDataCol) * maxCols, strerror(errno)); + uDebug("malloc failure, size:%"PRId64" failed, reason:%s", (int64_t)sizeof(SDataCol) * maxCols, strerror(errno)); tdFreeDataCols(pCols); return NULL; } @@ -716,4 +716,4 @@ SKVRow tdGetKVRowFromBuilder(SKVRowBuilder *pBuilder) { memcpy(kvRowValues(row), pBuilder->buf, pBuilder->size); return row; -} \ No newline at end of file +} diff --git a/src/connector/go b/src/connector/go index 8d7bf743852897110cbdcc7c4322cd7a74d4167b..06ec30a0f1762e8169bf6b9045c82bcaa52bcdf0 160000 --- a/src/connector/go +++ b/src/connector/go @@ -1 +1 @@ -Subproject commit 8d7bf743852897110cbdcc7c4322cd7a74d4167b +Subproject commit 06ec30a0f1762e8169bf6b9045c82bcaa52bcdf0 diff --git a/src/os/inc/os.h b/src/os/inc/os.h index d4b71173a07fe2c36ee1479bc94bbf274b8dd6b6..8ce49d6750cf57bd58ac5d434fd5a26aae0290b8 100644 --- a/src/os/inc/os.h +++ b/src/os/inc/os.h @@ -28,6 +28,10 @@ extern "C" { #include "osArm64.h" #endif +#ifdef _TD_ARM_32_ +#include "osArm32.h" +#endif + #ifdef _TD_LINUX_64 #include "osLinux64.h" #endif diff --git a/src/os/inc/osArm32.h b/src/os/inc/osArm32.h new file mode 100644 index 0000000000000000000000000000000000000000..9a2b8c1b55f32ed0ee9e5279ef61b83bc93523a3 --- /dev/null +++ b/src/os/inc/osArm32.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2019 TAOS Data, Inc. + * + * This program is free software: you can use, redistribute, and/or modify + * it under the terms of the GNU Affero General Public License, version 3 + * or later ("AGPL"), as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef TDENGINE_OS_ARM32_H +#define TDENGINE_OS_ARM32_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TAOS_OS_FUNC_LZ4 +#define BUILDIN_CLZL(val) __builtin_clzll(val) +#define BUILDIN_CTZL(val) __builtin_ctzll(val) +#define BUILDIN_CLZ(val) __builtin_clz(val) +#define BUILDIN_CTZ(val) __builtin_ctz(val) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/os/inc/osWindows.h b/src/os/inc/osWindows.h index d4f3d6d2afd94bcfd2527af9927bf188ba4bf0de..dc1da35037dc06c258856a1a143146492eeed0e5 100644 --- a/src/os/inc/osWindows.h +++ b/src/os/inc/osWindows.h @@ -51,8 +51,6 @@ extern "C" { #endif -#define TAOS_OS_FUNC_ATOMIC - #define TAOS_OS_FUNC_LZ4 int32_t BUILDIN_CLZL(uint64_t val); int32_t BUILDIN_CLZ(uint32_t val); @@ -351,4 +349,4 @@ void wordfree(wordexp_t *pwordexp); #ifdef __cplusplus } #endif -#endif \ No newline at end of file +#endif diff --git a/src/os/src/detail/osSysinfo.c b/src/os/src/detail/osSysinfo.c index 83ecd8580946db628e7a785b5becca87db23118c..f6470fc3e1e84e38013d963d4ea2d3a2ae58833b 100644 --- a/src/os/src/detail/osSysinfo.c +++ b/src/os/src/detail/osSysinfo.c @@ -569,7 +569,6 @@ int taosSystem(const char *cmd) { } } -int _sysctl(struct __sysctl_args *args ); void taosSetCoreDump() { if (0 == tsEnableCoreFile) { return; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index f2d324e376390e27252c22af0d8c07b5e587b20a..d4c1c8560b3ae0351141e4ca5166171efc70cc52 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -5050,8 +5050,8 @@ static void sequentialTableProcess(SQInfo *pQInfo) { } qDebug( - "QInfo %p numOfTables:%"PRIu64", index:%d, numOfGroups:%" PRIzu ", %"PRId64" points returned, total:%"PRId64", offset:%" PRId64, - pQInfo, pQInfo->tableqinfoGroupInfo.numOfTables, pQInfo->tableIndex, numOfGroups, pQuery->rec.rows, pQuery->rec.total, + "QInfo %p numOfTables:%" PRIu64 ", index:%d, numOfGroups:%" PRIzu ", %" PRId64 " points returned, total:%" PRId64 ", offset:%" PRId64, + pQInfo, (uint64_t)pQInfo->tableqinfoGroupInfo.numOfTables, pQInfo->tableIndex, numOfGroups, pQuery->rec.rows, pQuery->rec.total, pQuery->limit.offset); } diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 50b1507a56f8923f507b225838717a62a1e8c9bd..f0b8c996c5aec747e69785c469946f80856e05e5 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -240,7 +240,7 @@ void *rpcOpen(const SRpcInit *pInit) { size_t size = sizeof(SRpcConn) * pRpc->sessions; pRpc->connList = (SRpcConn *)calloc(1, size); if (pRpc->connList == NULL) { - tError("%s failed to allocate memory for taos connections, size:%ld", pRpc->label, size); + tError("%s failed to allocate memory for taos connections, size:%" PRId64, pRpc->label, (int64_t)size); rpcClose(pRpc); return NULL; } diff --git a/src/rpc/src/rpcUdp.c b/src/rpc/src/rpcUdp.c index 8e24aed8f789f03ef324c05922c38ecefe747256..4ea47582b9c93fbd483454a50e1bf6aed5237870 100644 --- a/src/rpc/src/rpcUdp.c +++ b/src/rpc/src/rpcUdp.c @@ -211,7 +211,7 @@ static void *taosRecvUdpData(void *param) { char *tmsg = malloc(dataLen + tsRpcOverhead); if (NULL == tmsg) { - tError("%s failed to allocate memory, size:%ld", pConn->label, dataLen); + tError("%s failed to allocate memory, size:%" PRId64, pConn->label, (int64_t)dataLen); continue; } else { tDebug("UDP malloc mem: %p", tmsg); diff --git a/src/util/src/hash.c b/src/util/src/hash.c index 7427a2e4f345887888afe6a6e2901ef8e0d21252..625d4af1ac981c5d1f5f079f5b15533a4d63ef24 100644 --- a/src/util/src/hash.c +++ b/src/util/src/hash.c @@ -738,7 +738,7 @@ void taosHashTableResize(SHashObj *pHashObj) { int64_t et = taosGetTimestampUs(); - uDebug("hash table resize completed, new capacity:%"PRId64", load factor:%f, elapsed time:%fms", pHashObj->capacity, + uDebug("hash table resize completed, new capacity:%d, load factor:%f, elapsed time:%fms", (int32_t)pHashObj->capacity, ((double)pHashObj->size) / pHashObj->capacity, (et - st) / 1000.0); }