minor changes

This commit is contained in:
Shengliang Guan 2022-02-28 14:36:50 +08:00
parent 4cbfc4f82b
commit 87b63a9fbe
4 changed files with 8 additions and 9 deletions

View File

@ -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))

View File

@ -16,6 +16,8 @@
#ifndef _TD_UTIL_VERSION_H_
#define _TD_UTIL_VERSION_H_
#include "os.h"
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -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);

View File

@ -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) {