diff --git a/source/libs/index/test/index_executor_tests.cpp b/source/libs/index/test/index_executor_tests.cpp index a0ac79a2976243a2097f3e4290951322b2b65f9a..8b03f3b251da4ae8698bf976753f6f7e3a86ab96 100644 --- a/source/libs/index/test/index_executor_tests.cpp +++ b/source/libs/index/test/index_executor_tests.cpp @@ -48,7 +48,7 @@ double sifLeftVd = 21.0, sifRightVd = 10.0; void sifFreeDataBlock(void *block) { blockDataDestroy(*(SSDataBlock **)block); } void sifInitLogFile() { - const char * defaultLogFileNamePrefix = "taoslog"; + const char *defaultLogFileNamePrefix = "taoslog"; const int32_t maxLogFileNum = 10; tsAsyncLog = 0; @@ -96,7 +96,7 @@ void sifAppendReservedSlot(SArray *pBlockList, int16_t *dataBlockId, int16_t *sl } void sifMakeValueNode(SNode **pNode, int32_t dataType, void *value) { - SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_VALUE); + SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_VALUE); SValueNode *vnode = (SValueNode *)node; vnode->node.resType.type = dataType; @@ -113,7 +113,7 @@ void sifMakeValueNode(SNode **pNode, int32_t dataType, void *value) { } void sifMakeColumnNode(SNode **pNode, const char *db, const char *colName, EColumnType colType, uint8_t colValType) { - SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_COLUMN); + SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_COLUMN); SColumnNode *rnode = (SColumnNode *)node; memcpy(rnode->dbName, db, strlen(db)); memcpy(rnode->colName, colName, strlen(colName)); @@ -125,7 +125,7 @@ void sifMakeColumnNode(SNode **pNode, const char *db, const char *colName, EColu } void sifMakeOpNode(SNode **pNode, EOperatorType opType, int32_t resType, SNode *pLeft, SNode *pRight) { - SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_OPERATOR); + SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_OPERATOR); SOperatorNode *onode = (SOperatorNode *)node; onode->node.resType.type = resType; onode->node.resType.bytes = tDataTypes[resType].bytes; @@ -138,7 +138,7 @@ void sifMakeOpNode(SNode **pNode, EOperatorType opType, int32_t resType, SNode * } void sifMakeListNode(SNode **pNode, SNodeList *list, int32_t resType) { - SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_NODE_LIST); + SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_NODE_LIST); SNodeListNode *lnode = (SNodeListNode *)node; lnode->dataType.type = resType; lnode->pNodeList = list; @@ -147,7 +147,7 @@ void sifMakeListNode(SNode **pNode, SNodeList *list, int32_t resType) { } void sifMakeLogicNode(SNode **pNode, ELogicConditionType opType, SNode **nodeList, int32_t nodeNum) { - SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); + SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_LOGIC_CONDITION); SLogicConditionNode *onode = (SLogicConditionNode *)node; onode->condType = opType; onode->node.resType.type = TSDB_DATA_TYPE_BOOL; @@ -162,7 +162,7 @@ void sifMakeLogicNode(SNode **pNode, ELogicConditionType opType, SNode **nodeLis } void sifMakeTargetNode(SNode **pNode, int16_t dataBlockId, int16_t slotId, SNode *snode) { - SNode * node = (SNode *)nodesMakeNode(QUERY_NODE_TARGET); + SNode *node = (SNode *)nodesMakeNode(QUERY_NODE_TARGET); STargetNode *onode = (STargetNode *)node; onode->pExpr = snode; onode->dataBlockId = dataBlockId; diff --git a/source/libs/monitor/src/monMain.c b/source/libs/monitor/src/monMain.c index d387a432e13d12a55a03af089aab2228f6863ab0..eab5a334508765f876a2289af90190ec2648df2b 100644 --- a/source/libs/monitor/src/monMain.c +++ b/source/libs/monitor/src/monMain.c @@ -556,7 +556,7 @@ void monSendReport() { char *pCont = tjsonToString(pMonitor->pJson); // uDebugL("report cont:%s\n", pCont); - if (pCont != NULL) { + if (pCont != NULL) { EHttpCompFlag flag = tsMonitor.cfg.comp ? HTTP_GZIP : HTTP_FLAT; if (taosSendHttpReport(tsMonitor.cfg.server, tsMonitor.cfg.port, pCont, strlen(pCont), flag) != 0) { uError("failed to send monitor msg"); diff --git a/source/libs/parser/inc/parInsertData.h b/source/libs/parser/inc/parInsertData.h index ddfcd3a249afe1767cd50bdb433ce2f712354af8..6d0ba29eb71357b82371566f3e5024e2fcaff239 100644 --- a/source/libs/parser/inc/parInsertData.h +++ b/source/libs/parser/inc/parInsertData.h @@ -18,9 +18,9 @@ #include "catalog.h" #include "os.h" +#include "query.h" #include "tname.h" #include "ttypes.h" -#include "query.h" #define IS_DATA_COL_ORDERED(spd) ((spd->orderStatus) == (int8_t)ORDER_STATUS_ORDERED) diff --git a/source/libs/stream/src/streamUpdate.c b/source/libs/stream/src/streamUpdate.c index 332f7ad2fd7be60f532b1394eb2d72adf985b82a..7c4aaba6ce117be00b00259254029bc9982db49e 100644 --- a/source/libs/stream/src/streamUpdate.c +++ b/source/libs/stream/src/streamUpdate.c @@ -174,13 +174,14 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) { if (res == TSDB_CODE_SUCCESS) { return false; } else { - qDebug("===stream===Update close window sbf. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, - maxTs, *pMapMaxTs, ts); + qDebug("===stream===Update close window sbf. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 + ", ts:%" PRIu64, + tableId, maxTs, *pMapMaxTs, ts); return true; } } - qDebug("===stream===Update close window. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, - maxTs, *pMapMaxTs, ts); + qDebug("===stream===Update close window. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, + tableId, maxTs, *pMapMaxTs, ts); return true; } @@ -202,8 +203,8 @@ bool updateInfoIsUpdated(SUpdateInfo *pInfo, uint64_t tableId, TSKEY ts) { } if (ts < pInfo->minTS) { - qDebug("===stream===Update min ts. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, tableId, - maxTs, *pMapMaxTs, ts); + qDebug("===stream===Update min ts. tableId:%" PRIu64 ", maxTs:%" PRIu64 ", mapMaxTs:%" PRIu64 ", ts:%" PRIu64, + tableId, maxTs, *pMapMaxTs, ts); return true; } else if (res == TSDB_CODE_SUCCESS) { return false; diff --git a/source/libs/stream/test/tstreamUpdateTest.cpp b/source/libs/stream/test/tstreamUpdateTest.cpp index 933549b8a6b423bc5a3a497ecdbee13ffc7fb448..adfd7cf87675cc18020bdfaa99fa69e6cc3ca00d 100644 --- a/source/libs/stream/test/tstreamUpdateTest.cpp +++ b/source/libs/stream/test/tstreamUpdateTest.cpp @@ -4,17 +4,17 @@ #include "ttime.h" using namespace std; -#define MAX_NUM_SCALABLE_BF 100000 +#define MAX_NUM_SCALABLE_BF 100000 -bool equalSBF(SScalableBf* left, SScalableBf* right) { +bool equalSBF(SScalableBf *left, SScalableBf *right) { if (left->growth != right->growth) return false; if (left->numBits != right->numBits) return false; int lsize = taosArrayGetSize(left->bfArray); int rsize = taosArrayGetSize(right->bfArray); if (lsize != rsize) return false; for (int32_t i = 0; i < lsize; i++) { - SBloomFilter* pLeftBF = (SBloomFilter*)taosArrayGetP(left->bfArray, i); - SBloomFilter* pRightBF = (SBloomFilter*)taosArrayGetP(right->bfArray, i); + SBloomFilter *pLeftBF = (SBloomFilter *)taosArrayGetP(left->bfArray, i); + SBloomFilter *pRightBF = (SBloomFilter *)taosArrayGetP(right->bfArray, i); if (pLeftBF->errorRate != pRightBF->errorRate) return false; if (pLeftBF->expectedEntries != pRightBF->expectedEntries) return false; if (pLeftBF->hashFn1 != pRightBF->hashFn1) return false; @@ -23,8 +23,8 @@ bool equalSBF(SScalableBf* left, SScalableBf* right) { if (pLeftBF->numBits != pRightBF->numBits) return false; if (pLeftBF->numUnits != pRightBF->numUnits) return false; if (pLeftBF->size != pRightBF->size) return false; - uint64_t* leftUint = (uint64_t*) pLeftBF->buffer; - uint64_t* rightUint = (uint64_t*) pRightBF->buffer; + uint64_t *leftUint = (uint64_t *)pLeftBF->buffer; + uint64_t *rightUint = (uint64_t *)pRightBF->buffer; for (int32_t j = 0; j < pLeftBF->numUnits; j++) { if (leftUint[j] != rightUint[j]) return false; } @@ -35,86 +35,86 @@ bool equalSBF(SScalableBf* left, SScalableBf* right) { TEST(TD_STREAM_UPDATE_TEST, update) { const int64_t interval = 20 * 1000; const int64_t watermark = 10 * 60 * 1000; - SUpdateInfo *pSU = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark); - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,1, 0), false); - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,1, -1), true); + SUpdateInfo *pSU = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark); + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, 1, 0), false); + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, 1, -1), true); - for(int i=0; i < 1024; i++) { - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 1), false); + for (int i = 0; i < 1024; i++) { + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 1), false); } - for(int i=0; i < 1024; i++) { - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 1), true); + for (int i = 0; i < 1024; i++) { + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 1), true); } - for(int i=0; i < 1024; i++) { - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 2), false); + for (int i = 0; i < 1024; i++) { + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 2), false); } - for(int i=0; i < 1024; i++) { - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 2), true); + for (int i = 0; i < 1024; i++) { + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 2), true); } - for(int i=0; i < 1024; i++) { - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU,i, 1), true); + for (int i = 0; i < 1024; i++) { + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, i, 1), true); } TSKEY uid = 0; - for(int i=3; i < 1024; i++) { + for (int i = 3; i < 1024; i++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, uid, i), false); } - GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023); + GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023); - for(int i=3; i < 1024; i++) { + for (int i = 3; i < 1024; i++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU, uid, i), true); } - GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023); + GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU->pMap, &uid, sizeof(uint64_t)), 1023); SUpdateInfo *pSU1 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark); - for(int i=1; i <= watermark / interval; i++) { + for (int i = 1; i <= watermark / interval; i++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU1, 1, i * interval + 5), false); GTEST_ASSERT_EQ(pSU1->minTS, interval); GTEST_ASSERT_EQ(pSU1->numSBFs, watermark / interval); } - for(int i=0; i < pSU1->numSBFs; i++) { - SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, i); + for (int i = 0; i < pSU1->numSBFs; i++) { + SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, i); SBloomFilter *pBF = (SBloomFilter *)taosArrayGetP(pSBF->bfArray, 0); GTEST_ASSERT_EQ(pBF->size, 1); } - for(int i= watermark / interval + 1, j = 2 ; i <= watermark / interval + 10; i++,j++) { + for (int i = watermark / interval + 1, j = 2; i <= watermark / interval + 10; i++, j++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU1, 1, i * interval + 5), false); - GTEST_ASSERT_EQ(pSU1->minTS, interval*j); + GTEST_ASSERT_EQ(pSU1->minTS, interval * j); GTEST_ASSERT_EQ(pSU1->numSBFs, watermark / interval); - SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, pSU1->numSBFs - 1); + SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU1->pTsSBFs, pSU1->numSBFs - 1); SBloomFilter *pBF = (SBloomFilter *)taosArrayGetP(pSBF->bfArray, 0); GTEST_ASSERT_EQ(pBF->size, 1); } - - for(int i= watermark / interval * 100, j = 0; j < 10; i+= (watermark / interval * 2), j++) { + + for (int i = watermark / interval * 100, j = 0; j < 10; i += (watermark / interval * 2), j++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU1, 1, i * interval + 5), false); - GTEST_ASSERT_EQ(pSU1->minTS, (i-(pSU1->numSBFs-1))*interval); + GTEST_ASSERT_EQ(pSU1->minTS, (i - (pSU1->numSBFs - 1)) * interval); GTEST_ASSERT_EQ(pSU1->numSBFs, watermark / interval); } SUpdateInfo *pSU2 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark); GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU2, 1, 1 * interval + 5), false); GTEST_ASSERT_EQ(pSU2->minTS, interval); - for(int i= watermark / interval * 100, j = 0; j < 10; i+= (watermark / interval * 10), j++) { + for (int i = watermark / interval * 100, j = 0; j < 10; i += (watermark / interval * 10), j++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU2, 1, i * interval + 5), false); - GTEST_ASSERT_EQ(pSU2->minTS, (i-(pSU2->numSBFs-1))*interval); + GTEST_ASSERT_EQ(pSU2->minTS, (i - (pSU2->numSBFs - 1)) * interval); GTEST_ASSERT_EQ(pSU2->numSBFs, watermark / interval); TSKEY uid2 = 1; - GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU2->pMap, &uid2, sizeof(uint64_t)), i * interval + 5); + GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU2->pMap, &uid2, sizeof(uint64_t)), i * interval + 5); } - + SUpdateInfo *pSU3 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark); - for(int j = 1; j < 100; j++) { - for(int i = 0; i < pSU3->numSBFs; i++) { + for (int j = 1; j < 100; j++) { + for (int i = 0; i < pSU3->numSBFs; i++) { GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU3, i, i * interval + 5 * j), false); GTEST_ASSERT_EQ(pSU3->minTS, 0); GTEST_ASSERT_EQ(pSU3->numSBFs, watermark / interval); uint64_t uid3 = i; - GTEST_ASSERT_EQ(*(TSKEY*)taosHashGet(pSU3->pMap, &uid3, sizeof(uint64_t)), i * interval + 5 * j); - SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU3->pTsSBFs, i); + GTEST_ASSERT_EQ(*(TSKEY *)taosHashGet(pSU3->pMap, &uid3, sizeof(uint64_t)), i * interval + 5 * j); + SScalableBf *pSBF = (SScalableBf *)taosArrayGetP(pSU3->pTsSBFs, i); SBloomFilter *pBF = (SBloomFilter *)taosArrayGetP(pSBF->bfArray, 0); GTEST_ASSERT_EQ(pBF->size, j); } @@ -130,19 +130,19 @@ TEST(TD_STREAM_UPDATE_TEST, update) { SUpdateInfo *pSU7 = updateInfoInit(interval, TSDB_TIME_PRECISION_MILLI, watermark); updateInfoAddCloseWindowSBF(pSU7); - for(int64_t i = 1; i < 2048000; i++) { - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,i, i), false); + for (int64_t i = 1; i < 2048000; i++) { + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, i, i), false); } - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,100, 1), true); - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,110, 10), true); - GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7,200, 20), true); + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, 100, 1), true); + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, 110, 10), true); + GTEST_ASSERT_EQ(updateInfoIsUpdated(pSU7, 200, 20), true); int32_t bufLen = updateInfoSerialize(NULL, 0, pSU7); - void* buf = taosMemoryCalloc(1, bufLen); + void *buf = taosMemoryCalloc(1, bufLen); int32_t resSize = updateInfoSerialize(buf, bufLen, pSU7); SUpdateInfo *pSU6 = updateInfoInit(0, TSDB_TIME_PRECISION_MILLI, 0); - int32_t desSize = updateInfoDeserialize(buf, bufLen, pSU6); + int32_t desSize = updateInfoDeserialize(buf, bufLen, pSU6); GTEST_ASSERT_EQ(desSize, 0); GTEST_ASSERT_EQ(pSU7->interval, pSU6->interval); @@ -150,7 +150,7 @@ TEST(TD_STREAM_UPDATE_TEST, update) { GTEST_ASSERT_EQ(pSU7->minTS, pSU6->minTS); GTEST_ASSERT_EQ(pSU7->numBuckets, pSU6->numBuckets); GTEST_ASSERT_EQ(pSU7->numSBFs, pSU6->numSBFs); - GTEST_ASSERT_EQ(pSU7->scanGroupId, pSU6->scanGroupId); + GTEST_ASSERT_EQ(pSU7->scanGroupId, pSU6->scanGroupId); GTEST_ASSERT_EQ(pSU7->scanWindow.ekey, pSU6->scanWindow.ekey); GTEST_ASSERT_EQ(pSU7->scanWindow.skey, pSU6->scanWindow.skey); GTEST_ASSERT_EQ(pSU7->watermark, pSU6->watermark); @@ -158,27 +158,27 @@ TEST(TD_STREAM_UPDATE_TEST, update) { int32_t mapSize = taosHashGetSize(pSU7->pMap); GTEST_ASSERT_EQ(mapSize, taosHashGetSize(pSU6->pMap)); - void* pIte = NULL; + void *pIte = NULL; size_t keyLen = 0; while ((pIte = taosHashIterate(pSU7->pMap, pIte)) != NULL) { - void* key = taosHashGetKey(pIte, &keyLen); - void* value6 = taosHashGet(pSU6->pMap, key, keyLen); - GTEST_ASSERT_EQ(*(TSKEY*)pIte, *(TSKEY*)value6); + void *key = taosHashGetKey(pIte, &keyLen); + void *value6 = taosHashGet(pSU6->pMap, key, keyLen); + GTEST_ASSERT_EQ(*(TSKEY *)pIte, *(TSKEY *)value6); } int32_t buSize = taosArrayGetSize(pSU7->pTsBuckets); GTEST_ASSERT_EQ(buSize, taosArrayGetSize(pSU6->pTsBuckets)); for (int32_t i = 0; i < buSize; i++) { - TSKEY ts1 = *(TSKEY*)taosArrayGet(pSU7->pTsBuckets, i); - TSKEY ts2 = *(TSKEY*)taosArrayGet(pSU6->pTsBuckets, i); + TSKEY ts1 = *(TSKEY *)taosArrayGet(pSU7->pTsBuckets, i); + TSKEY ts2 = *(TSKEY *)taosArrayGet(pSU6->pTsBuckets, i); GTEST_ASSERT_EQ(ts1, ts2); } int32_t lSize = taosArrayGetSize(pSU7->pTsSBFs); int32_t rSize = taosArrayGetSize(pSU6->pTsSBFs); GTEST_ASSERT_EQ(lSize, rSize); for (int32_t i = 0; i < lSize; i++) { - SScalableBf* pLeftSBF = (SScalableBf*)taosArrayGetP(pSU7->pTsSBFs, i); - SScalableBf* pRightSBF = (SScalableBf*)taosArrayGetP(pSU6->pTsSBFs, i); + SScalableBf *pLeftSBF = (SScalableBf *)taosArrayGetP(pSU7->pTsSBFs, i); + SScalableBf *pRightSBF = (SScalableBf *)taosArrayGetP(pSU6->pTsSBFs, i); GTEST_ASSERT_EQ(equalSBF(pLeftSBF, pRightSBF), true); } @@ -190,10 +190,9 @@ TEST(TD_STREAM_UPDATE_TEST, update) { updateInfoDestroy(pSU5); updateInfoDestroy(pSU6); updateInfoDestroy(pSU7); - } -int main(int argc, char* argv[]) { +int main(int argc, char *argv[]) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } \ No newline at end of file diff --git a/source/libs/transport/test/transUT.cpp b/source/libs/transport/test/transUT.cpp index b55f771ebd5181503d1f85cd1dccb986218f88d1..92f0bf11cf8fae8670cf625f3f0453f66ba5aef4 100644 --- a/source/libs/transport/test/transUT.cpp +++ b/source/libs/transport/test/transUT.cpp @@ -99,7 +99,7 @@ class Client { private: tsem_t sem; SRpcInit rpcInit_; - void * transCli; + void *transCli; SRpcMsg resp; }; class Server { @@ -146,7 +146,7 @@ class Server { private: SRpcInit rpcInit_; - void * transSrv; + void *transSrv; }; static void processReq(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) { SRpcMsg rpcMsg = {0}; @@ -330,7 +330,7 @@ TEST_F(TransEnv, clientUserDefined) { TEST_F(TransEnv, cliPersistHandle) { SRpcMsg resp = {0}; - void * handle = NULL; + void *handle = NULL; for (int i = 0; i < 10; i++) { SRpcMsg req = {0}; req.info = resp.info; @@ -366,7 +366,7 @@ TEST_F(TransEnv, srvReleaseHandle) { SRpcMsg resp = {0}; tr->SetSrvContinueSend(processReleaseHandleCb); // tr->Restart(processReleaseHandleCb); - void * handle = NULL; + void *handle = NULL; SRpcMsg req = {0}; for (int i = 0; i < 1; i++) { memset(&req, 0, sizeof(req)); diff --git a/source/libs/transport/test/uv.c b/source/libs/transport/test/uv.c index 1d99bf8fef2a2882d6d59bee4ce04af0a3b3b556..a44f1ca4357b4376891f8f941cfcf29799fd4f2e 100644 --- a/source/libs/transport/test/uv.c +++ b/source/libs/transport/test/uv.c @@ -11,23 +11,23 @@ typedef struct SThreadObj { TdThread thread; - uv_pipe_t * pipe; - uv_loop_t * loop; + uv_pipe_t *pipe; + uv_loop_t *loop; uv_async_t *workerAsync; // int fd; } SThreadObj; typedef struct SServerObj { uv_tcp_t server; - uv_loop_t * loop; + uv_loop_t *loop; int workerIdx; int numOfThread; SThreadObj **pThreadObj; - uv_pipe_t ** pipe; + uv_pipe_t **pipe; } SServerObj; typedef struct SConnCtx { - uv_tcp_t * pClient; + uv_tcp_t *pClient; uv_timer_t *pTimer; uv_async_t *pWorkerAsync; int ref; diff --git a/tools/scripts/codeFormat.sh b/tools/scripts/codeFormat.sh index 94a8e15aceaaeb504b78d5496471c4da7f2588a4..e2fef0bb93ce52f06b5feb329ca6570b911cc7e2 100644 --- a/tools/scripts/codeFormat.sh +++ b/tools/scripts/codeFormat.sh @@ -8,35 +8,42 @@ ORIGIN_DIR=$(pwd) cd ${PRJ_ROOT_DIR} FORMAT_DIR_LIST=( - "include" - "source/os" - "source/util" - "source/common" - "source/libs/cache" - "source/libs/catalog" - "source/libs/command" - "source/libs/executor" - # "source/libs/function" - # "source/libs/index" - # "source/libs/monitor" - # "source/libs/nodes" - # "source/libs/parser" - # "source/libs/planner" - # "source/libs/qcom" - # "source/libs/qworker" - # "source/libs/scalar" - # "source/libs/stream" - # "source/libs/sync" - "source/libs/tdb" - "source/libs/tfs" - # "source/libs/transport" - "source/libs/wal" - # "source/client" - "source/dnode" + "${PRJ_ROOT_DIR}/include" + "${PRJ_ROOT_DIR}/source/os" + "${PRJ_ROOT_DIR}/source/util" + "${PRJ_ROOT_DIR}/source/common" + "${PRJ_ROOT_DIR}/source/libs/cache" + "${PRJ_ROOT_DIR}/source/libs/catalog" + "${PRJ_ROOT_DIR}/source/libs/command" + "${PRJ_ROOT_DIR}/source/libs/executor" + # "${PRJ_ROOT_DIR}/source/libs/function" + "${PRJ_ROOT_DIR}/source/libs/index" + "${PRJ_ROOT_DIR}/source/libs/monitor" + "${PRJ_ROOT_DIR}/source/libs/nodes" + # "${PRJ_ROOT_DIR}/source/libs/parser" + "${PRJ_ROOT_DIR}/source/libs/planner" + # "${PRJ_ROOT_DIR}/source/libs/qcom" + # "${PRJ_ROOT_DIR}/source/libs/qworker" + # "${PRJ_ROOT_DIR}/source/libs/scalar" + "${PRJ_ROOT_DIR}/source/libs/stream" + # "${PRJ_ROOT_DIR}/source/libs/sync" + "${PRJ_ROOT_DIR}/source/libs/tdb" + "${PRJ_ROOT_DIR}/source/libs/tfs" + "${PRJ_ROOT_DIR}/source/libs/transport" + "${PRJ_ROOT_DIR}/source/libs/wal" + # "${PRJ_ROOT_DIR}/source/client" + "${PRJ_ROOT_DIR}/source/dnode" +) + +EXCLUDE_DIR_LIST=( +) + +EXCLUDE_FILE_LIST=( + "source/libs/parser/sql.c" ) for d in ${FORMAT_DIR_LIST[@]}; do - for f in $(find ${PRJ_ROOT_DIR}/$d/ -regex '.*\.\(cpp\|hpp\|c\|h\)'); do + for f in $(find $d -regex '.*\.\(cpp\|hpp\|c\|h\)'); do ${FORMAT_BIN} -i $f done done