mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
* src/symtab.h (struct symbol): Declare the printer and destructor
as const, to avoid accidental calls to free. (symbol_destructor_set, symbol_printer_set): Adjust. * src/symtab.c: Adjust.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2005-09-16 Akim <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/symtab.h (struct symbol): Declare the printer and destructor
|
||||||
|
as const, to avoid accidental calls to free.
|
||||||
|
(symbol_destructor_set, symbol_printer_set): Adjust.
|
||||||
|
* src/symtab.c: Adjust.
|
||||||
|
|
||||||
2005-09-16 Akim <akim@epita.fr>
|
2005-09-16 Akim <akim@epita.fr>
|
||||||
|
|
||||||
* data/c.m4 (b4_token_enums): New.
|
* data/c.m4 (b4_token_enums): New.
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ symbol_type_set (symbol *sym, uniqstr type_name, location loc)
|
|||||||
`------------------------------------------------------------------*/
|
`------------------------------------------------------------------*/
|
||||||
|
|
||||||
void
|
void
|
||||||
symbol_destructor_set (symbol *sym, char *destructor, location loc)
|
symbol_destructor_set (symbol *sym, const char *destructor, location loc)
|
||||||
{
|
{
|
||||||
if (destructor)
|
if (destructor)
|
||||||
{
|
{
|
||||||
@@ -147,7 +147,7 @@ symbol_destructor_set (symbol *sym, char *destructor, location loc)
|
|||||||
`---------------------------------------------------------------*/
|
`---------------------------------------------------------------*/
|
||||||
|
|
||||||
void
|
void
|
||||||
symbol_printer_set (symbol *sym, char *printer, location loc)
|
symbol_printer_set (symbol *sym, const char *printer, location loc)
|
||||||
{
|
{
|
||||||
if (printer)
|
if (printer)
|
||||||
{
|
{
|
||||||
|
|||||||
10
src/symtab.h
10
src/symtab.h
@@ -60,10 +60,12 @@ struct symbol
|
|||||||
uniqstr type_name;
|
uniqstr type_name;
|
||||||
location type_location;
|
location type_location;
|
||||||
|
|
||||||
char *destructor;
|
/* Does not own the memory. */
|
||||||
|
const char *destructor;
|
||||||
location destructor_location;
|
location destructor_location;
|
||||||
|
|
||||||
char *printer;
|
/* Does not own the memory. */
|
||||||
|
const char *printer;
|
||||||
location printer_location;
|
location printer_location;
|
||||||
|
|
||||||
symbol_number number;
|
symbol_number number;
|
||||||
@@ -109,10 +111,10 @@ void symbol_make_alias (symbol *sym, symbol *symval, location loc);
|
|||||||
void symbol_type_set (symbol *sym, uniqstr type_name, location loc);
|
void symbol_type_set (symbol *sym, uniqstr type_name, location loc);
|
||||||
|
|
||||||
/* Set the DESTRUCTOR associated with SYM. */
|
/* Set the DESTRUCTOR associated with SYM. */
|
||||||
void symbol_destructor_set (symbol *sym, char *destructor, location loc);
|
void symbol_destructor_set (symbol *sym, const char *destructor, location loc);
|
||||||
|
|
||||||
/* Set the PRINTER associated with SYM. */
|
/* Set the PRINTER associated with SYM. */
|
||||||
void symbol_printer_set (symbol *sym, char *printer, location loc);
|
void symbol_printer_set (symbol *sym, const char *printer, location loc);
|
||||||
|
|
||||||
/* Set the PRECEDENCE associated with SYM. Ensure that SYMBOL is a
|
/* Set the PRECEDENCE associated with SYM. Ensure that SYMBOL is a
|
||||||
terminal. Do nothing if invoked with UNDEF_ASSOC as ASSOC. */
|
terminal. Do nothing if invoked with UNDEF_ASSOC as ASSOC. */
|
||||||
|
|||||||
Reference in New Issue
Block a user