muscle: minor simplification which uncovers a missing warning

* src/muscle-tab.c (muscle_percent_define_ensure): Discover the virtues
of || to factor conditionals.
* NEWS: As api.pure is no longer flagged as "used" by accident,
we now have warnings for useless definitions.
* tests/calc.at: So remove api.pure settings when running C++ tests,
since C++ skeletons use a pure interface.
This commit is contained in:
Akim Demaille
2013-04-14 10:28:26 +02:00
parent d9cfa2bee2
commit bb4b189b9c
3 changed files with 13 additions and 14 deletions

View File

@@ -541,10 +541,8 @@ muscle_percent_define_ensure (char const *variable, location loc,
/* Don't complain is VARIABLE is already defined, but be sure to set
its value to VAL. */
if (!muscle_find_const (name))
muscle_percent_define_insert (variable, loc, muscle_keyword, val,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
if (muscle_percent_define_flag_if (variable) != value)
if (!muscle_find_const (name)
|| muscle_percent_define_flag_if (variable) != value)
muscle_percent_define_insert (variable, loc, muscle_keyword, val,
MUSCLE_PERCENT_DEFINE_GRAMMAR_FILE);
}