1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-23 07:25:48 +01:00

wmaker: replaced macro 'store_modifier' by an inline function, in X Modifier initialisation

A macro can be a source of problems, because the compiler has no type on
the arguments to make checks. Using an inline function allows to do those
checks, meaning clearer error messages, it provides clear info in case of
name collision, it is easier to maintain (no need for the hacky '\' for
multi-lines) and the scope of visibility can be controlled more easily (no
need for #undef).

The macro store_modifier had to face a slight change because its 2nd
parameter is used as a reference, which is now clearly visible in the
prototype of the function.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-12-07 17:10:19 +01:00
committed by Carlos R. Mafra
parent de00154fa1
commit 34d82e5462
2 changed files with 36 additions and 31 deletions

View File

@@ -140,7 +140,7 @@ misc.hack_nf.c: misc.c $(top_srcdir)/script/nested-func-to-macro.sh
xmodifier.hack_nf.c: xmodifier.c $(top_srcdir)/script/nested-func-to-macro.sh
$(AM_V_GEN)$(top_srcdir)/script/nested-func-to-macro.sh \
$(srcdir)/xmodifier.c -o $(builddir)/xmodifier.hack_nf.c \
-f "modwarn" -f "modbarf" -f "check_modifier"
-f "modwarn" -f "modbarf" -f "check_modifier" -f "store_modifier"
endif