From 895607f0cbf43a18e3d046533864da49c54ffe51 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 28 Jan 2021 15:16:57 +0800 Subject: [PATCH] refact --- src/tsdb/inc/tsdbBuffer.h | 8 -------- src/tsdb/inc/tsdbCommit.h | 8 -------- src/tsdb/inc/tsdbCommitQueue.h | 8 -------- src/tsdb/inc/tsdbFS.h | 8 -------- src/tsdb/inc/tsdbFile.h | 8 -------- src/tsdb/inc/tsdbLog.h | 8 -------- src/tsdb/inc/tsdbMemTable.h | 9 --------- src/tsdb/inc/tsdbMeta.h | 8 -------- src/tsdb/inc/tsdbReadImpl.h | 8 -------- src/tsdb/inc/tsdbint.h | 18 +++++++++--------- 10 files changed, 9 insertions(+), 82 deletions(-) diff --git a/src/tsdb/inc/tsdbBuffer.h b/src/tsdb/inc/tsdbBuffer.h index 8083b44182..414ace0009 100644 --- a/src/tsdb/inc/tsdbBuffer.h +++ b/src/tsdb/inc/tsdbBuffer.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_BUFFER_H_ #define _TD_TSDB_BUFFER_H_ -#ifdef __cplusplus -extern "C" { -#endif - typedef struct { int64_t blockId; int offset; @@ -44,8 +40,4 @@ int tsdbOpenBufPool(STsdbRepo* pRepo); void tsdbCloseBufPool(STsdbRepo* pRepo); SListNode* tsdbAllocBufBlockFromPool(STsdbRepo* pRepo); -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_BUFFER_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbCommit.h b/src/tsdb/inc/tsdbCommit.h index 969733e598..5e740081d1 100644 --- a/src/tsdb/inc/tsdbCommit.h +++ b/src/tsdb/inc/tsdbCommit.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_COMMIT_H_ #define _TD_TSDB_COMMIT_H_ -#ifdef __cplusplus -extern "C" { -#endif - typedef struct { int minFid; int midFid; @@ -50,8 +46,4 @@ static FORCE_INLINE int tsdbGetFidLevel(int fid, SRtn *pRtn) { } } -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_COMMIT_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbCommitQueue.h b/src/tsdb/inc/tsdbCommitQueue.h index f1fd35986d..c2353391f9 100644 --- a/src/tsdb/inc/tsdbCommitQueue.h +++ b/src/tsdb/inc/tsdbCommitQueue.h @@ -16,14 +16,6 @@ #ifndef _TD_TSDB_COMMIT_QUEUE_H_ #define _TD_TSDB_COMMIT_QUEUE_H_ -#ifdef __cplusplus -extern "C" { -#endif - int tsdbScheduleCommit(STsdbRepo *pRepo); -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_COMMIT_QUEUE_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbFS.h b/src/tsdb/inc/tsdbFS.h index 45ff223a17..ef0e0800c5 100644 --- a/src/tsdb/inc/tsdbFS.h +++ b/src/tsdb/inc/tsdbFS.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_FS_H_ #define _TD_TSDB_FS_H_ -#ifdef __cplusplus -extern "C" { -#endif - #define TSDB_FS_VERSION 0 // ================== CURRENT file header info @@ -112,8 +108,4 @@ static FORCE_INLINE int tsdbUnLockFS(STsdbFS* pFs) { return 0; } -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_FS_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbFile.h b/src/tsdb/inc/tsdbFile.h index 46810aa47d..cb5c78ca84 100644 --- a/src/tsdb/inc/tsdbFile.h +++ b/src/tsdb/inc/tsdbFile.h @@ -16,10 +16,6 @@ #ifndef _TS_TSDB_FILE_H_ #define _TS_TSDB_FILE_H_ -#ifdef __cplusplus -extern "C" { -#endif - #define TSDB_FILE_HEAD_SIZE 512 #define TSDB_FILE_DELIMITER 0xF00AFA0F #define TSDB_FILE_INIT_MAGIC 0xFFFFFFFF @@ -350,8 +346,4 @@ static FORCE_INLINE void tsdbGetFidKeyRange(int days, int8_t precision, int fid, *maxKey = *minKey + days * tsMsPerDay[precision] - 1; } -#ifdef __cplusplus -} -#endif - #endif /* _TS_TSDB_FILE_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbLog.h b/src/tsdb/inc/tsdbLog.h index 185474b205..fdd04e968a 100644 --- a/src/tsdb/inc/tsdbLog.h +++ b/src/tsdb/inc/tsdbLog.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_LOG_H_ #define _TD_TSDB_LOG_H_ -#ifdef __cplusplus -extern "C" { -#endif - extern int32_t tsdbDebugFlag; #define tsdbFatal(...) do { if (tsdbDebugFlag & DEBUG_FATAL) { taosPrintLog("TDB FATAL ", 255, __VA_ARGS__); }} while(0) @@ -29,8 +25,4 @@ extern int32_t tsdbDebugFlag; #define tsdbDebug(...) do { if (tsdbDebugFlag & DEBUG_DEBUG) { taosPrintLog("TDB ", tsdbDebugFlag, __VA_ARGS__); }} while(0) #define tsdbTrace(...) do { if (tsdbDebugFlag & DEBUG_TRACE) { taosPrintLog("TDB ", tsdbDebugFlag, __VA_ARGS__); }} while(0) -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_LOG_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbMemTable.h b/src/tsdb/inc/tsdbMemTable.h index a533975b32..3b3f1dd1f6 100644 --- a/src/tsdb/inc/tsdbMemTable.h +++ b/src/tsdb/inc/tsdbMemTable.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_MEMTABLE_H_ #define _TD_TSDB_MEMTABLE_H_ -#ifdef __cplusplus -extern "C" { -#endif - typedef struct { int rowsInserted; int rowsUpdated; @@ -111,9 +107,4 @@ static FORCE_INLINE TKEY tsdbNextIterTKey(SSkipListIterator* pIter) { return dataRowTKey(row); } - -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_MEMTABLE_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbMeta.h b/src/tsdb/inc/tsdbMeta.h index 9efb2ba36a..cc916fa689 100644 --- a/src/tsdb/inc/tsdbMeta.h +++ b/src/tsdb/inc/tsdbMeta.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_META_H_ #define _TD_TSDB_META_H_ -#ifdef __cplusplus -extern "C" { -#endif - #define TSDB_MAX_TABLE_SCHEMAS 16 typedef struct STable { @@ -145,8 +141,4 @@ static FORCE_INLINE TSKEY tsdbGetTableLastKeyImpl(STable* pTable) { return pTable->lastKey; } -#ifdef __cplusplus -} -#endif - #endif /* _TD_TSDB_META_H_ */ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbReadImpl.h b/src/tsdb/inc/tsdbReadImpl.h index 73ae35732a..0efbcc55bb 100644 --- a/src/tsdb/inc/tsdbReadImpl.h +++ b/src/tsdb/inc/tsdbReadImpl.h @@ -16,10 +16,6 @@ #ifndef _TD_TSDB_READ_IMPL_H_ #define _TD_TSDB_READ_IMPL_H_ -#ifdef __cplusplus -extern "C" { -#endif - typedef struct SReadH SReadH; typedef struct { @@ -134,8 +130,4 @@ static FORCE_INLINE int tsdbMakeRoom(void **ppBuf, size_t size) { return 0; } -#ifdef __cplusplus -} -#endif - #endif /*_TD_TSDB_READ_IMPL_H_*/ \ No newline at end of file diff --git a/src/tsdb/inc/tsdbint.h b/src/tsdb/inc/tsdbint.h index a2c6f40b28..074ff20f22 100644 --- a/src/tsdb/inc/tsdbint.h +++ b/src/tsdb/inc/tsdbint.h @@ -16,15 +16,15 @@ #ifndef _TD_TSDB_INT_H_ #define _TD_TSDB_INT_H_ -// TODO: remove the include -#include -#include -#include -#include -#include -#include -#include -#include +// // TODO: remove the include +// #include +// #include +// #include +// #include +// #include +// #include +// #include +// #include #include "os.h" #include "tlog.h" -- GitLab