From 51e7ffa6c341b07c474f44822e99852c70d03a55 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sat, 27 Jul 2024 18:46:30 +0800 Subject: [PATCH] refact return code --- include/util/tbuffer.h | 6 ++-- include/util/tbuffer.inc | 11 ++----- source/dnode/vnode/src/tsdb/tsdbCache.c | 6 ++-- source/dnode/vnode/src/tsdb/tsdbDataFileRW.c | 18 ++++++------ source/dnode/vnode/src/tsdb/tsdbIter.c | 12 ++++---- source/dnode/vnode/src/tsdb/tsdbMergeTree.c | 16 +++++----- source/dnode/vnode/src/tsdb/tsdbSnapshot.c | 6 ++-- source/dnode/vnode/src/tsdb/tsdbSttFileRW.c | 10 +++---- source/dnode/vnode/src/tsdb/tsdbUpgrade.c | 2 +- source/dnode/vnode/src/tsdb/tsdbUtil2.c | 31 +++++++------------- source/dnode/vnode/src/tsdb/tsdbUtil2.h | 6 ++-- 11 files changed, 57 insertions(+), 67 deletions(-) diff --git a/include/util/tbuffer.h b/include/util/tbuffer.h index 094d0e37ba..2c77ea2e30 100644 --- a/include/util/tbuffer.h +++ b/include/util/tbuffer.h @@ -27,9 +27,9 @@ typedef struct SBufferReader SBufferReader; // SBuffer #define BUFFER_INITIALIZER ((SBuffer){0, 0, NULL}) -static int32_t tBufferInit(SBuffer *buffer); -static int32_t tBufferDestroy(SBuffer *buffer); -static int32_t tBufferClear(SBuffer *buffer); +static void tBufferInit(SBuffer *buffer); +static void tBufferDestroy(SBuffer *buffer); +static void tBufferClear(SBuffer *buffer); static int32_t tBufferEnsureCapacity(SBuffer *buffer, uint32_t capacity); static int32_t tBufferPut(SBuffer *buffer, const void *data, uint32_t size); static int32_t tBufferPutAt(SBuffer *buffer, uint32_t offset, const void *data, uint32_t size); diff --git a/include/util/tbuffer.inc b/include/util/tbuffer.inc index 595c1e0827..39090fb7fa 100644 --- a/include/util/tbuffer.inc +++ b/include/util/tbuffer.inc @@ -29,27 +29,22 @@ struct SBufferReader { }; // SBuffer -static FORCE_INLINE int32_t tBufferInit(SBuffer *buffer) { +static FORCE_INLINE void tBufferInit(SBuffer *buffer) { buffer->size = 0; buffer->capacity = 0; buffer->data = NULL; - return 0; } -static FORCE_INLINE int32_t tBufferDestroy(SBuffer *buffer) { +static FORCE_INLINE void tBufferDestroy(SBuffer *buffer) { buffer->size = 0; buffer->capacity = 0; if (buffer->data) { taosMemoryFree(buffer->data); buffer->data = NULL; } - return 0; } -static FORCE_INLINE int32_t tBufferClear(SBuffer *buffer) { - buffer->size = 0; - return 0; -} +static FORCE_INLINE void tBufferClear(SBuffer *buffer) { buffer->size = 0; } static FORCE_INLINE int32_t tBufferEnsureCapacity(SBuffer *buffer, uint32_t capacity) { if (buffer->capacity < capacity) { diff --git a/source/dnode/vnode/src/tsdb/tsdbCache.c b/source/dnode/vnode/src/tsdb/tsdbCache.c index 7b785e0844..5073b3e9ee 100644 --- a/source/dnode/vnode/src/tsdb/tsdbCache.c +++ b/source/dnode/vnode/src/tsdb/tsdbCache.c @@ -2419,7 +2419,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie if (!state->pBrinBlock) { state->pBrinBlock = &state->brinBlock; } else { - tBrinBlockClear(&state->brinBlock); + (void)tBrinBlockClear(&state->brinBlock); } TAOS_CHECK_GOTO(tsdbDataFileReadBrinBlock(state->pr->pFileReader, pBrinBlk, &state->brinBlock), &lino, _err); @@ -2431,7 +2431,7 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie if (SFSNEXTROW_BRINBLOCK == state->state) { _next_brinrecord: if (state->iBrinRecord < 0) { // empty brin block, goto _next_brinindex - tBrinBlockClear(&state->brinBlock); + (void)tBrinBlockClear(&state->brinBlock); goto _next_brinindex; } @@ -2691,7 +2691,7 @@ int32_t clearNextRowFromFS(void *iter) { } if (state->pBrinBlock) { - tBrinBlockDestroy(state->pBrinBlock); + (void)tBrinBlockDestroy(state->pBrinBlock); state->pBrinBlock = NULL; } diff --git a/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c b/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c index 72379449fc..28598f23f7 100644 --- a/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c +++ b/source/dnode/vnode/src/tsdb/tsdbDataFileRW.c @@ -230,7 +230,7 @@ int32_t tsdbDataFileReadBrinBlock(SDataFileReader *reader, const SBrinBlk *brinB // decode brin block SBufferReader br = BUFFER_READER_INITIALIZER(0, buffer); - tBrinBlockClear(brinBlock); + (void)tBrinBlockClear(brinBlock); brinBlock->numOfPKs = brinBlk->numOfPKs; brinBlock->numOfRecords = brinBlk->numRec; for (int32_t i = 0; i < 10; i++) { // int64_t @@ -673,12 +673,12 @@ static int32_t tsdbDataFileWriterDoClose(SDataFileWriter *writer) { tTombBlockDestroy(writer->tombBlock); TARRAY2_DESTROY(writer->tombBlkArray, NULL); tBlockDataDestroy(writer->blockData); - tBrinBlockDestroy(writer->brinBlock); + (void)tBrinBlockDestroy(writer->brinBlock); TARRAY2_DESTROY(writer->brinBlkArray, NULL); tTombBlockDestroy(writer->ctx->tombBlock); tBlockDataDestroy(writer->ctx->blockData); - tBrinBlockDestroy(writer->ctx->brinBlock); + (void)tBrinBlockDestroy(writer->ctx->brinBlock); for (int32_t i = 0; i < ARRAY_SIZE(writer->local); ++i) { tBufferDestroy(writer->local + i); @@ -838,7 +838,7 @@ int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, uint32_t cmpr for (int i = 0; i < brinBlock->numOfRecords; i++) { SBrinRecord record; - tBrinBlockGet(brinBlock, i, &record); + (void)tBrinBlockGet(brinBlock, i, &record); if (i == 0) { brinBlk.minTbid.suid = record.suid; brinBlk.minTbid.uid = record.uid; @@ -918,7 +918,7 @@ int32_t tsdbFileWriteBrinBlock(STsdbFD *fd, SBrinBlock *brinBlock, uint32_t cmpr // append to brinBlkArray TAOS_CHECK_RETURN(TARRAY2_APPEND_PTR(brinBlkArray, &brinBlk)); - tBrinBlockClear(brinBlock); + (void)tBrinBlockClear(brinBlock); return 0; } @@ -1147,7 +1147,7 @@ static int32_t tsdbDataFileDoWriteTableOldData(SDataFileWriter *writer, const ST for (; writer->ctx->brinBlockIdx < writer->ctx->brinBlock->numOfRecords; writer->ctx->brinBlockIdx++) { SBrinRecord record; - tBrinBlockGet(writer->ctx->brinBlock, writer->ctx->brinBlockIdx, &record); + (void)tBrinBlockGet(writer->ctx->brinBlock, writer->ctx->brinBlockIdx, &record); if (record.uid != writer->ctx->tbid->uid) { writer->ctx->tbHasOldData = false; goto _exit; @@ -1157,7 +1157,7 @@ static int32_t tsdbDataFileDoWriteTableOldData(SDataFileWriter *writer, const ST goto _exit; } else { SBrinRecord record[1]; - tBrinBlockGet(writer->ctx->brinBlock, writer->ctx->brinBlockIdx, record); + (void)tBrinBlockGet(writer->ctx->brinBlock, writer->ctx->brinBlockIdx, record); if (tsdbRowKeyCmprNullAsLargest(key, &record->lastKey) > 0) { // key > record->lastKey if (writer->blockData->nRow > 0) { TAOS_CHECK_GOTO(tsdbDataFileDoWriteBlockData(writer, writer->blockData), &lino, _exit); @@ -1351,7 +1351,7 @@ int32_t tsdbFileWriteTombBlock(STsdbFD *fd, STombBlock *tombBlock, int8_t cmprAl }; for (int i = 0; i < TOMB_BLOCK_SIZE(tombBlock); i++) { STombRecord record; - tTombBlockGet(tombBlock, i, &record); + TAOS_UNUSED(tTombBlockGet(tombBlock, i, &record)); if (i == 0) { tombBlk.minTbid.suid = record.suid; @@ -1506,7 +1506,7 @@ static int32_t tsdbDataFileDoWriteTombRecord(SDataFileWriter *writer, const STom while (writer->ctx->hasOldTomb) { for (; writer->ctx->tombBlockIdx < TOMB_BLOCK_SIZE(writer->ctx->tombBlock); writer->ctx->tombBlockIdx++) { STombRecord record1[1]; - tTombBlockGet(writer->ctx->tombBlock, writer->ctx->tombBlockIdx, record1); + TAOS_UNUSED(tTombBlockGet(writer->ctx->tombBlock, writer->ctx->tombBlockIdx, record1)); int32_t c = tTombRecordCompare(record, record1); if (c < 0) { diff --git a/source/dnode/vnode/src/tsdb/tsdbIter.c b/source/dnode/vnode/src/tsdb/tsdbIter.c index d97a5153f3..3b5bd6d02f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbIter.c +++ b/source/dnode/vnode/src/tsdb/tsdbIter.c @@ -153,7 +153,7 @@ static int32_t tsdbDataIterNext(STsdbIter *iter, const TABLEID *tbid) { for (; iter->dataData->brinBlockIdx < iter->dataData->brinBlock->numOfRecords; iter->dataData->brinBlockIdx++) { SBrinRecord record[1]; - tBrinBlockGet(iter->dataData->brinBlock, iter->dataData->brinBlockIdx, record); + (void)tBrinBlockGet(iter->dataData->brinBlock, iter->dataData->brinBlockIdx, record); if (iter->filterByVersion && (record->maxVer < iter->range[0] || record->minVer > iter->range[1])) { continue; @@ -254,7 +254,8 @@ _exit: static int32_t tsdbDataTombIterNext(STsdbIter *iter, const TABLEID *tbid) { while (!iter->noMoreData) { for (; iter->dataTomb->tombBlockIdx < TOMB_BLOCK_SIZE(iter->dataTomb->tombBlock); iter->dataTomb->tombBlockIdx++) { - tTombBlockGet(iter->dataTomb->tombBlock, iter->dataTomb->tombBlockIdx, iter->record); + int32_t code = tTombBlockGet(iter->dataTomb->tombBlock, iter->dataTomb->tombBlockIdx, iter->record); + if (code) return code; if (iter->filterByVersion && (iter->record->version < iter->range[0] || iter->record->version > iter->range[1])) { continue; @@ -372,7 +373,7 @@ static int32_t tsdbDataIterOpen(STsdbIter *iter) { iter->dataData->brinBlkArrayIdx = 0; // SBrinBlock - tBrinBlockInit(iter->dataData->brinBlock); + (void)tBrinBlockInit(iter->dataData->brinBlock); iter->dataData->brinBlockIdx = 0; // SBlockData @@ -429,7 +430,7 @@ static int32_t tsdbMemTombIterOpen(STsdbIter *iter) { } static int32_t tsdbDataIterClose(STsdbIter *iter) { - tBrinBlockDestroy(iter->dataData->brinBlock); + (void)tBrinBlockDestroy(iter->dataData->brinBlock); tBlockDataDestroy(iter->dataData->blockData); return 0; } @@ -439,7 +440,8 @@ static int32_t tsdbMemTableIterClose(STsdbIter *iter) { return 0; } static int32_t tsdbSttTombIterNext(STsdbIter *iter, const TABLEID *tbid) { while (!iter->noMoreData) { for (; iter->sttTomb->tombBlockIdx < TOMB_BLOCK_SIZE(iter->sttTomb->tombBlock); iter->sttTomb->tombBlockIdx++) { - tTombBlockGet(iter->sttTomb->tombBlock, iter->sttTomb->tombBlockIdx, iter->record); + int32_t code = tTombBlockGet(iter->sttTomb->tombBlock, iter->sttTomb->tombBlockIdx, iter->record); + if (code) return code; if (iter->filterByVersion && (iter->record->version < iter->range[0] || iter->record->version > iter->range[1])) { continue; diff --git a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c index 2c03603d73..198a010a77 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMergeTree.c +++ b/source/dnode/vnode/src/tsdb/tsdbMergeTree.c @@ -63,8 +63,8 @@ int32_t tCreateSttBlockLoadInfo(STSchema *pSchema, int16_t *colList, int32_t num return code; } -static void freeItem(void* pValue) { - SValue* p = (SValue*) pValue; +static void freeItem(void *pValue) { + SValue *p = (SValue *)pValue; if (IS_VAR_DATA_TYPE(p->type)) { taosMemoryFree(p->pData); } @@ -120,7 +120,7 @@ void destroySttBlockReader(SArray *pLDataIterArray, SSttBlockLoadCostInfo *pLoad continue; } - SSttBlockLoadCostInfo* pCost = &pIter->pBlockLoadInfo->cost; + SSttBlockLoadCostInfo *pCost = &pIter->pBlockLoadInfo->cost; if (pLoadCost != NULL) { pLoadCost->loadBlocks += pCost->loadBlocks; pLoadCost->loadStatisBlocks += pCost->loadStatisBlocks; @@ -380,7 +380,7 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl pBlockLoadInfo->cost.loadStatisBlocks += num; STbStatisBlock block; - tStatisBlockInit(&block); + TAOS_UNUSED(tStatisBlockInit(&block)); int64_t st = taosGetTimestampUs(); @@ -436,7 +436,7 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl } } else { SValue vFirst = {0}; - for(int32_t j = 0; j < size; ++j) { + for (int32_t j = 0; j < size; ++j) { taosArrayPush(pBlockLoadInfo->info.pFirstKey, &vFirst); taosArrayPush(pBlockLoadInfo->info.pLastKey, &vFirst); } @@ -445,7 +445,7 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl STbStatisRecord record = {0}; while (i < rows) { - tStatisBlockGet(&block, i, &record); + (void)tStatisBlockGet(&block, i, &record); if (record.suid != suid) { break; } @@ -476,7 +476,7 @@ static int32_t loadSttStatisticsBlockData(SSttFileReader *pSttFileReader, SSttBl } } - tStatisBlockDestroy(&block); + (void)tStatisBlockDestroy(&block); double el = (taosGetTimestampUs() - st) / 1000.0; pBlockLoadInfo->cost.statisElapsedTime += el; @@ -712,7 +712,7 @@ static void findNextValidRow(SLDataIter *pIter, const char *idStr) { } int64_t ts = pData->aTSKEY[i]; - if (!pIter->backward) { // asc + if (!pIter->backward) { // asc if (ts > pIter->timeWindow.ekey) { // no more data break; } else { diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index c7c0135270..741549fad8 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -1022,7 +1022,8 @@ static int32_t tsdbSnapWriteTombData(STsdbSnapWriter* writer, SSnapDataHdr* hdr) code = tsdbSnapWriteDecmprTombBlock(hdr, tombBlock); TSDB_CHECK_CODE(code, lino, _exit); - tTombBlockGet(tombBlock, 0, &record); + code = tTombBlockGet(tombBlock, 0, &record); + TSDB_CHECK_CODE(code, lino, _exit); int32_t fid = tsdbKeyFid(record.skey, writer->minutes, writer->precision); if (!writer->ctx->fsetWriteBegin || fid != writer->ctx->fid) { code = tsdbSnapWriteFileSetEnd(writer); @@ -1045,7 +1046,8 @@ static int32_t tsdbSnapWriteTombData(STsdbSnapWriter* writer, SSnapDataHdr* hdr) ASSERT(writer->ctx->hasData == false); for (int32_t i = 0; i < TOMB_BLOCK_SIZE(tombBlock); ++i) { - tTombBlockGet(tombBlock, i, &record); + code = tTombBlockGet(tombBlock, i, &record); + TSDB_CHECK_CODE(code, lino, _exit); code = tsdbSnapWriteTombRecord(writer, &record); TSDB_CHECK_CODE(code, lino, _exit); diff --git a/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c b/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c index a552f9bcca..d39adaac41 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c +++ b/source/dnode/vnode/src/tsdb/tsdbSttFileRW.c @@ -401,7 +401,7 @@ int32_t tsdbSttFileReadStatisBlock(SSttFileReader *reader, const SStatisBlk *sta &lino, _exit); // decode data - tStatisBlockClear(statisBlock); + TAOS_UNUSED(tStatisBlockClear(statisBlock)); statisBlock->numOfPKs = statisBlk->numOfPKs; statisBlock->numOfRecords = statisBlk->numRec; SBufferReader br = BUFFER_READER_INITIALIZER(0, buffer0); @@ -574,11 +574,11 @@ static int32_t tsdbSttFileDoWriteStatisBlock(SSttFileWriter *writer) { statisBlk.cmprAlg = writer->config->cmprAlg; statisBlk.numOfPKs = statisBlock->numOfPKs; - tStatisBlockGet(statisBlock, 0, &record); + (void)tStatisBlockGet(statisBlock, 0, &record); statisBlk.minTbid.suid = record.suid; statisBlk.minTbid.uid = record.uid; - tStatisBlockGet(statisBlock, statisBlock->numOfRecords - 1, &record); + (void)tStatisBlockGet(statisBlock, statisBlock->numOfRecords - 1, &record); statisBlk.maxTbid.suid = record.suid; statisBlk.maxTbid.uid = record.uid; @@ -636,7 +636,7 @@ static int32_t tsdbSttFileDoWriteStatisBlock(SSttFileWriter *writer) { TAOS_CHECK_GOTO(TARRAY2_APPEND_PTR(writer->statisBlkArray, &statisBlk), &lino, _exit); - tStatisBlockClear(writer->staticBlock); + TAOS_UNUSED(tStatisBlockClear(writer->staticBlock)); _exit: if (code) { @@ -822,7 +822,7 @@ static void tsdbSttFWriterDoClose(SSttFileWriter *writer) { tDestroyTSchema(writer->skmRow->pTSchema); tDestroyTSchema(writer->skmTb->pTSchema); tTombBlockDestroy(writer->tombBlock); - tStatisBlockDestroy(writer->staticBlock); + (void)tStatisBlockDestroy(writer->staticBlock); tBlockDataDestroy(writer->blockData); TARRAY2_DESTROY(writer->tombBlkArray, NULL); TARRAY2_DESTROY(writer->statisBlkArray, NULL); diff --git a/source/dnode/vnode/src/tsdb/tsdbUpgrade.c b/source/dnode/vnode/src/tsdb/tsdbUpgrade.c index ef116e2642..6d2006eaa1 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUpgrade.c +++ b/source/dnode/vnode/src/tsdb/tsdbUpgrade.c @@ -167,7 +167,7 @@ _exit: tsdbError("vgId:%d %s failed at %s:%d since %s", TD_VID(tsdb->pVnode), __func__, __FILE__, lino, tstrerror(code)); } TARRAY2_DESTROY(ctx->brinBlkArray, NULL); - tBrinBlockDestroy(ctx->brinBlock); + (void)tBrinBlockDestroy(ctx->brinBlock); tBlockDataDestroy(ctx->blockData); tMapDataClear(ctx->mDataBlk); taosArrayDestroy(ctx->aBlockIdx); diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil2.c b/source/dnode/vnode/src/tsdb/tsdbUtil2.c index 97fea598cd..7ada3085b1 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil2.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil2.c @@ -16,35 +16,26 @@ #include "tsdbUtil2.h" // SDelBlock ---------- -int32_t tTombBlockInit(STombBlock *tombBlock) { - int32_t code; - +void tTombBlockInit(STombBlock *tombBlock) { tombBlock->numOfRecords = 0; for (int32_t i = 0; i < TOMB_RECORD_ELEM_NUM; ++i) { - TAOS_CHECK_GOTO(tBufferInit(&tombBlock->buffers[i]), NULL, _exit); + tBufferInit(&tombBlock->buffers[i]); } - -_exit: - if (code) { - TAOS_UNUSED(tTombBlockDestroy(tombBlock)); - } - return code; + return; } -int32_t tTombBlockDestroy(STombBlock *tombBlock) { +void tTombBlockDestroy(STombBlock *tombBlock) { tombBlock->numOfRecords = 0; for (int32_t i = 0; i < TOMB_RECORD_ELEM_NUM; ++i) { - TAOS_UNUSED(tBufferDestroy(&tombBlock->buffers[i])); + tBufferDestroy(&tombBlock->buffers[i]); } - return 0; } -int32_t tTombBlockClear(STombBlock *tombBlock) { +void tTombBlockClear(STombBlock *tombBlock) { tombBlock->numOfRecords = 0; for (int32_t i = 0; i < TOMB_RECORD_ELEM_NUM; ++i) { - TAOS_UNUSED(tBufferClear(&tombBlock->buffers[i])); + tBufferClear(&tombBlock->buffers[i]); } - return 0; } int32_t tTombBlockPut(STombBlock *tombBlock, const STombRecord *record) { @@ -79,12 +70,12 @@ int32_t tTombRecordCompare(const STombRecord *r1, const STombRecord *r2) { // STbStatisBlock ---------- int32_t tStatisBlockInit(STbStatisBlock *statisBlock) { - int32_t code; + int32_t code = 0; statisBlock->numOfPKs = 0; statisBlock->numOfRecords = 0; for (int32_t i = 0; i < ARRAY_SIZE(statisBlock->buffers); ++i) { - TAOS_CHECK_GOTO(tBufferInit(&statisBlock->buffers[i]), NULL, _exit); + tBufferInit(&statisBlock->buffers[i]); } for (int32_t i = 0; i < TD_MAX_PK_COLS; ++i) { TAOS_CHECK_GOTO(tValueColumnInit(&statisBlock->firstKeyPKs[i]), NULL, _exit); @@ -244,7 +235,7 @@ int32_t tBrinBlockInit(SBrinBlock *brinBlock) { brinBlock->numOfPKs = 0; brinBlock->numOfRecords = 0; for (int32_t i = 0; i < ARRAY_SIZE(brinBlock->buffers); ++i) { - TAOS_CHECK_GOTO(tBufferInit(&brinBlock->buffers[i]), NULL, _exit); + tBufferInit(&brinBlock->buffers[i]); } for (int32_t i = 0; i < TD_MAX_PK_COLS; ++i) { TAOS_CHECK_GOTO(tValueColumnInit(&brinBlock->firstKeyPKs[i]), NULL, _exit); @@ -253,7 +244,7 @@ int32_t tBrinBlockInit(SBrinBlock *brinBlock) { _exit: if (code) { - TAOS_UNUSED(tBrinBlockDestroy(brinBlock)); + (void)tBrinBlockDestroy(brinBlock); } return code; } diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil2.h b/source/dnode/vnode/src/tsdb/tsdbUtil2.h index 71f47a5f8e..d9d2892165 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil2.h +++ b/source/dnode/vnode/src/tsdb/tsdbUtil2.h @@ -65,9 +65,9 @@ typedef TARRAY2(STombBlk) TTombBlkArray; #define TOMB_BLOCK_SIZE(db) ((db)->numOfRecords) -int32_t tTombBlockInit(STombBlock *tombBlock); -int32_t tTombBlockDestroy(STombBlock *tombBlock); -int32_t tTombBlockClear(STombBlock *tombBlock); +void tTombBlockInit(STombBlock *tombBlock); +void tTombBlockDestroy(STombBlock *tombBlock); +void tTombBlockClear(STombBlock *tombBlock); int32_t tTombBlockPut(STombBlock *tombBlock, const STombRecord *record); int32_t tTombBlockGet(STombBlock *tombBlock, int32_t idx, STombRecord *record); int32_t tTombRecordCompare(const STombRecord *record1, const STombRecord *record2);