allow modification on retrieved code_props.

The logic to compute the %printer or %destructor to used (i.e., a
code_props) is implemented twice: one, of course, in
symbol_code_props_get, and another time in symbol_check_defined to
record the fact that a code_props is used (so that we can reported
unused ones).  Let the former use the latter.

I would probably use "mutable" in C++ and keep these guys const,
but this is C.  And casting away constness triggers warnings.

* src/scan-code.h, src/scan-code.l (code_props_none): Is not const.
* src/symtab.h, src/symtab.c (symbol_code_props_get): The symbol
is not const.
(symbol_check_defined): Use it.
This commit is contained in:
Akim Demaille
2012-07-22 17:46:34 +02:00
parent a943967010
commit 70946cff5e
4 changed files with 7 additions and 15 deletions

View File

@@ -890,7 +890,7 @@ code_props_none_init (code_props *self)
*self = code_props_none;
}
code_props const code_props_none = CODE_PROPS_NONE_INIT;
code_props code_props_none = CODE_PROPS_NONE_INIT;
void
code_props_plain_init (code_props *self, char const *code,