mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-13 22:33:03 +00:00
* NEWS: Reword %destructor vs YYABORT etc.
* data/glr.c: Use American spacing, for consistency. * data/glr.cc: Likewise. * data/lalr1.cc: Likewise. * data/yacc.c: Likewise. * data/yacc.c: Reformat comments slightly. * doc/bison.texinfo: Replace "non-" with "non" when that makes sense, for consistency. Fix some spelling errors and reword recently-included text slightly. * tests/cxx-type.at: Cast results of malloc, for C++.
This commit is contained in:
@@ -231,7 +231,7 @@ yyerror (ERROR_PARAMETERS)
|
||||
static Node *
|
||||
new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
|
||||
{
|
||||
Node *node = malloc (sizeof (Node));
|
||||
Node *node = (Node *) malloc (sizeof (Node));
|
||||
node->nterm.type = 1;
|
||||
node->nterm.parents = 0;
|
||||
node->nterm.form = form;
|
||||
@@ -250,7 +250,7 @@ new_nterm (char const *form, Node *child0, Node *child1, Node *child2)
|
||||
static Node *
|
||||
new_term (char *text)
|
||||
{
|
||||
Node *node = malloc (sizeof (Node));
|
||||
Node *node = (Node *) malloc (sizeof (Node));
|
||||
node->term.type = 0;
|
||||
node->term.parents = 0;
|
||||
node->term.text = text;
|
||||
@@ -286,7 +286,7 @@ node_to_string (Node *node)
|
||||
char *buffer;
|
||||
if (!node)
|
||||
{
|
||||
buffer = malloc (1);
|
||||
buffer = (char *) malloc (1);
|
||||
buffer[0] = 0;
|
||||
}
|
||||
else if (node->node_info.type == 1)
|
||||
@@ -294,8 +294,8 @@ node_to_string (Node *node)
|
||||
child0 = node_to_string (node->nterm.children[0]);
|
||||
child1 = node_to_string (node->nterm.children[1]);
|
||||
child2 = node_to_string (node->nterm.children[2]);
|
||||
buffer = malloc (strlen (node->nterm.form) + strlen (child0)
|
||||
+ strlen (child1) + strlen (child2) + 1);
|
||||
buffer = (char *) malloc (strlen (node->nterm.form) + strlen (child0)
|
||||
+ strlen (child1) + strlen (child2) + 1);
|
||||
sprintf (buffer, node->nterm.form, child0, child1, child2);
|
||||
free (child0);
|
||||
free (child1);
|
||||
|
||||
Reference in New Issue
Block a user