examples: fix coding style

* examples/c/glr/c++-types.y: Use snake_case identifiers.
Prefer strdup to malloc+strcpy.
This commit is contained in:
Akim Demaille
2021-10-23 06:09:31 +02:00
parent 6e6950fbbc
commit 7558cbf373
2 changed files with 38 additions and 41 deletions

View File

@@ -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.