From: Aki Tuomi Date: Fri, 19 Feb 2021 13:20:07 +0000 (+0200) Subject: lib-lua: Reformat macros in dlua-script-private.h X-Git-Tag: 2.3.15~168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c3ec087bf2df96644fa365b6cd127d51aeece4d;p=thirdparty%2Fdovecot%2Fcore.git lib-lua: Reformat macros in dlua-script-private.h --- diff --git a/src/lib-lua/dlua-script-private.h b/src/lib-lua/dlua-script-private.h index 2beee6190d..750ff46b2f 100644 --- a/src/lib-lua/dlua-script-private.h +++ b/src/lib-lua/dlua-script-private.h @@ -7,17 +7,23 @@ #include "dlua-compat.h" /* consistency helpers */ -#define lua_isstring(L, n) (lua_isstring(L, n) == 1) -#define lua_isnumber(L, n) (lua_isnumber(L, n) == 1) -#define lua_toboolean(L, n) (lua_toboolean(L, n) == 1) +#define lua_isstring(L, n) (lua_isstring((L), (n)) == 1) +#define lua_isnumber(L, n) (lua_isnumber((L), (n)) == 1) +#define lua_toboolean(L, n) (lua_toboolean((L), (n)) == 1) #define lua_pushboolean(L, b) lua_pushboolean((L), (b) ? 1 : 0) -#define DLUA_TABLE_STRING(n, val) { .name = (n), .type = DLUA_TABLE_VALUE_STRING, .v.s = (val) } -#define DLUA_TABLE_INTEGER(n, val) { .name = (n), .type = DLUA_TABLE_VALUE_INTEGER, .v.i = (val) } -#define DLUA_TABLE_ENUM(n) { .name = #n, .type = DLUA_TABLE_VALUE_INTEGER, .v.i = (n) } -#define DLUA_TABLE_DOUBLE(n, val) { .name = (n), .type = DLUA_TABLE_VALUE_DOUBLE, .v.d = (val) } -#define DLUA_TABLE_BOOLEAN(n, val) { .name = (n), .type = DLUA_TABLE_VALUE_BOOLEAN, .v.b = (val) } -#define DLUA_TABLE_NULL(n, s) { .name = (n), .type = DLUA_TABLE_VALUE_NULL } +#define DLUA_TABLE_STRING(n, val) { .name = (n),\ + .type = DLUA_TABLE_VALUE_STRING, .v.s = (val) } +#define DLUA_TABLE_INTEGER(n, val) { .name = (n), \ + .type = DLUA_TABLE_VALUE_INTEGER, .v.i = (val) } +#define DLUA_TABLE_ENUM(n) { .name = #n, \ + .type = DLUA_TABLE_VALUE_INTEGER, .v.i = (n) } +#define DLUA_TABLE_DOUBLE(n, val) { .name = (n), \ + .type = DLUA_TABLE_VALUE_DOUBLE, .v.d = (val) } +#define DLUA_TABLE_BOOLEAN(n, val) { .name = (n), \ + .type = DLUA_TABLE_VALUE_BOOLEAN, .v.b = (val) } +#define DLUA_TABLE_NULL(n, s) { .name = (n), \ + .type = DLUA_TABLE_VALUE_NULL } #define DLUA_TABLE_END { .name = NULL } #define DLUA_REQUIRE_ARGS_IN(L, x, y) \