diff --git a/include/util/taoserror.h b/include/util/taoserror.h index 2663084103afc0c0c77c2486558505abd0b43b35..2b569a491a859a348d943d126395c59a467145d6 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -20,8 +20,6 @@ extern "C" { #endif -// clang-format off - #define TAOS_DEF_ERROR_CODE(mod, code) ((int32_t)((0x80000000 | ((mod)<<16) | (code)))) #define TAOS_SYSTEM_ERROR(code) (0x80ff0000 | (code)) diff --git a/include/util/tversion.h b/include/util/tversion.h index 1774059cf1a3c2b5049fbfcb716c348440b6fc30..c924752a01f52f01f2cb40dbc6e16770f23d1ea2 100644 --- a/include/util/tversion.h +++ b/include/util/tversion.h @@ -16,6 +16,8 @@ #ifndef _TD_UTIL_VERSION_H_ #define _TD_UTIL_VERSION_H_ +#include "os.h" + #ifdef __cplusplus extern "C" { #endif diff --git a/source/util/src/talgo.c b/source/util/src/talgo.c index 6c5f2a05be78327904ec3b90267801707bfa19a1..cb0a2d25a90a8999399e2e3bbfc3b4a4c838b0bd 100644 --- a/source/util/src/talgo.c +++ b/source/util/src/talgo.c @@ -158,12 +158,12 @@ void taosqsort(void *src, int64_t numOfElem, int64_t size, const void *param, __ tfree(buf); } -void *taosbsearch(const void *key, const void *base, int64_t nmemb, int64_t size, __compar_fn_t compar, int flags) { +void *taosbsearch(const void *key, const void *base, int64_t nmemb, int64_t size, __compar_fn_t compar, int32_t flags) { // TODO: need to check the correctness of this function - int l = 0; - int r = (int)nmemb; - int idx = 0; - int comparison; + int32_t l = 0; + int32_t r = (int32_t)nmemb; + int32_t idx = 0; + int32_t comparison; if (flags == TD_EQ) { return bsearch(key, base, nmemb, size, compar); diff --git a/source/util/src/tversion.c b/source/util/src/tversion.c index 8409637e80227b7a5c4e28a209cc71c659ce2e41..c70fdc87a6363b1a9fd08bddef3e1b3d0439162e 100644 --- a/source/util/src/tversion.c +++ b/source/util/src/tversion.c @@ -14,9 +14,8 @@ */ #define _DEFAULT_SOURCE -#include "os.h" +#include "tversion.h" #include "taoserror.h" -#include "tdef.h" int32_t taosVersionStrToInt(const char *vstr, int32_t *vint) { if (vstr == NULL) {