From f3e2ba31dd767fa66f3d3f614693ff7cad5886a5 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 15 Jul 2024 19:29:27 +0800 Subject: [PATCH] change the macro --- include/util/tutil.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/util/tutil.h b/include/util/tutil.h index d3003c27ba..d1fc11d0fe 100644 --- a/include/util/tutil.h +++ b/include/util/tutil.h @@ -160,14 +160,15 @@ static FORCE_INLINE int32_t taosGetTbHashVal(const char *tbname, int32_t tblen, } \ } while (0) -#define TAOS_CHECK_GOTO(CODE, LINO, LABEL) \ - do { \ - if ((CODE) != TSDB_CODE_SUCCESS) { \ - if (LINO) { \ - *((int32_t *)(LINO)) = __LINE__; \ - } \ - goto LABEL; \ - } \ +#define TAOS_CHECK_GOTO(CMD, LINO, LABEL) \ + do { \ + code = (CMD); \ + if (code != TSDB_CODE_SUCCESS) { \ + if (LINO) { \ + *((int32_t *)(LINO)) = __LINE__; \ + } \ + goto LABEL; \ + } \ } while (0) #ifdef __cplusplus