diff options
| author | Donald Lee <dlqs@gmx.com> | 2021-07-29 05:50:21 +0800 |
|---|---|---|
| committer | Donald Lee <dlqs@gmx.com> | 2021-07-29 05:52:22 +0800 |
| commit | b5e790ee4d2d94f9dead7914e0de97ac0e0a470e (patch) | |
| tree | ae1ddd055a837d33d4b6f5fff3af718d72f0e206 /lib/frrscript.h | |
| parent | 9e3a277b0442861482a2dae9070fb5a1dd887aeb (diff) | |
lib: Add parens around macro args
Signed-off-by: Donald Lee <dlqs@gmx.com>
Diffstat (limited to 'lib/frrscript.h')
| -rw-r--r-- | lib/frrscript.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/frrscript.h b/lib/frrscript.h index 953c458145..540676c099 100644 --- a/lib/frrscript.h +++ b/lib/frrscript.h @@ -126,7 +126,7 @@ void frrscript_init(const char *scriptdir); * This macro is mapped to every (name, value) in frrscript_call, * so this in turn maps them onto their encoders */ -#define ENCODE_ARGS(name, value) ENCODE_ARGS_WITH_STATE(lfs->L, value) +#define ENCODE_ARGS(name, value) ENCODE_ARGS_WITH_STATE(lfs->L, (value)) /* * This macro is also mapped to every (name, value) in frrscript_call, but @@ -140,11 +140,11 @@ void frrscript_init(const char *scriptdir); */ #define DECODE_ARGS(name, value) \ do { \ - lua_getfield(lfs->L, 1, name); \ + lua_getfield(lfs->L, 1, (name)); \ if (lua_isnil(lfs->L, 2)) { \ lua_pop(lfs->L, 1); \ } else { \ - DECODE_ARGS_WITH_STATE(lfs->L, value); \ + DECODE_ARGS_WITH_STATE(lfs->L, (value)); \ } \ assert(lua_gettop(lfs->L) == 1); \ } while (0) @@ -172,7 +172,7 @@ char * : lua_pushstring_wrapper, \ struct attr * : lua_pushattr, \ struct peer * : lua_pushpeer, \ const struct prefix * : lua_pushprefix \ -)(L, value) +)((L), (value)) #define DECODE_ARGS_WITH_STATE(L, value) \ _Generic((value), \ @@ -188,7 +188,7 @@ char * : lua_decode_stringp, \ struct attr * : lua_decode_attr, \ struct peer * : lua_decode_noop, \ const struct prefix * : lua_decode_noop \ -)(L, -1, value) +)((L), -1, (value)) /* * Call Lua function state (abstraction for a single Lua function) |
