diff --git a/src/inc/sdb.h b/src/inc/sdb.h
index b1c07054ca96475695021eee28d453b06ffe80f2..7dd1549f8791b126e6a416a1a2e30ba655fbcd6d 100644
--- a/src/inc/sdb.h
+++ b/src/inc/sdb.h
@@ -23,7 +23,6 @@ extern "C" {
#include "taosmsg.h"
#include "tsdb.h"
-extern uint32_t sdbDebugFlag;
extern short sdbPeerPort;
extern short sdbSyncPort;
extern int sdbMaxNodes;
diff --git a/src/inc/tcache.h b/src/inc/tcache.h
index e8726321f5056b6e208b28c0f99907fe9c0f86d1..93bbf22cd3752589731375a32da3da78c635b956 100644
--- a/src/inc/tcache.h
+++ b/src/inc/tcache.h
@@ -49,10 +49,10 @@ void *taosAddDataIntoCache(void *handle, char *key, char *pData, int dataSize, i
* if it is referenced by other object, it will be remain in cache
* @param handle cache object
* @param data not the key, actually referenced data
- * @param remove force model, reduce the ref count and move the data into
+ * @param _remove force model, reduce the ref count and move the data into
* pTrash
*/
-void taosRemoveDataFromCache(void *handle, void **data, bool remove);
+void taosRemoveDataFromCache(void *handle, void **data, bool _remove);
/**
* update data in cache
diff --git a/src/inc/textbuffer.h b/src/inc/textbuffer.h
index f86e14ec8b87c1fea5701b836fa1a94da43bdf7c..e8f829bb55380f99e4f9e37ea9a5e2b55542c0cd 100644
--- a/src/inc/textbuffer.h
+++ b/src/inc/textbuffer.h
@@ -26,10 +26,10 @@ extern "C" {
#include "tutil.h"
#include "taosmsg.h"
-#define DEFAULT_PAGE_SIZE 16384 // 16k larger than the SHistoInfo
-#define MIN_BUFFER_SIZE (1 << 19)
-#define MAX_TMPFILE_PATH_LENGTH 512
-#define INITIAL_ALLOCATION_BUFFER_SIZE 64
+#define DEFAULT_PAGE_SIZE 16384 // 16k larger than the SHistoInfo
+#define MIN_BUFFER_SIZE (1 << 19)
+#define MAX_TMPFILE_PATH_LENGTH PATH_MAX
+#define INITIAL_ALLOCATION_BUFFER_SIZE 64
// forward declare
struct tTagSchema;
diff --git a/src/inc/tkey.h b/src/inc/tkey.h
index e4917423860f0402fa06a7ff05b0e03dfd0ac187..c8b3c87f5e9c6549c23ff1918348c34393bdf63b 100644
--- a/src/inc/tkey.h
+++ b/src/inc/tkey.h
@@ -12,9 +12,12 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+#ifndef TDENGINE_TKEY_H
+#define TDENGINE_TKEY_H
-#ifndef _TAOS_KEY_H_
-#define _TAOS_KEY_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
#include
#include
@@ -27,4 +30,8 @@ char *base64_encode(const unsigned char *value, int vlen);
char *taosDesEncode(int64_t key, char *src, int len);
char *taosDesDecode(int64_t key, char *src, int len);
+#ifdef __cplusplus
+}
#endif
+
+#endif
\ No newline at end of file
diff --git a/src/inc/ttypes.h b/src/inc/ttypes.h
index 8b31a446d30ba405d56e9a767dee5dc274064ce8..b0f8044404a40a0e85ac90d3df4ae5f9ad0d7e35 100644
--- a/src/inc/ttypes.h
+++ b/src/inc/ttypes.h
@@ -53,8 +53,7 @@ void setNullN(char *val, int32_t type, int32_t bytes, int32_t numOfElems);
void assignVal(char *val, char *src, int32_t len, int32_t type);
void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
-// variant, each number/string/field_id has a corresponding struct during
-// parsing sql
+// variant, each number/string/field_id has a corresponding struct during parsing sql
typedef struct tVariant {
uint32_t nType;
int32_t nLen; // only used for string, for number, it is useless