From c26f9ff6af2ed46f8df72d4fc689a853281fd41d Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Fri, 11 Oct 2019 15:08:16 +0800 Subject: [PATCH] minor style changes --- src/inc/sdb.h | 1 - src/inc/tcache.h | 4 ++-- src/inc/textbuffer.h | 8 ++++---- src/inc/tkey.h | 11 +++++++++-- src/inc/ttypes.h | 3 +-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/inc/sdb.h b/src/inc/sdb.h index b1c07054ca..7dd1549f87 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 e8726321f5..93bbf22cd3 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 f86e14ec8b..e8f829bb55 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 e491742386..c8b3c87f5e 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 8b31a446d3..b0f8044404 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