mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
examples: fix coding style
* examples/c/glr/c++-types.y: Use snake_case identifiers. Prefer strdup to malloc+strcpy.
This commit is contained in:
@@ -244,7 +244,7 @@ init_table (void)
|
||||
symrec *
|
||||
putsym (char const *name, int sym_type)
|
||||
{
|
||||
symrec *res = (symrec *) malloc (sizeof (symrec));
|
||||
symrec *res = malloc (sizeof *res);
|
||||
res->name = strdup (name);
|
||||
res->type = sym_type;
|
||||
res->value.var = 0; // Set value to 0 even if fun.
|
||||
|
||||
Reference in New Issue
Block a user