From: Joel E. Denny Date: Fri, 8 Dec 2006 01:04:39 +0000 (+0000) Subject: * data/push.c (yypvarsinit): Change return type from void* to struct X-Git-Tag: v2.3b~231 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/ea17f233e6841d9b71753ef9b46ddbd226a31e66?ds=sidebyside * data/push.c (yypvarsinit): Change return type from void* to struct yypvars*. No longer cast to void* on return. (struct yypvars): Remove yylen since it need not be remembered between yypushparse invocations. (yypushparse): Don't copy between yylen and pv->yylen. --- diff --git a/ChangeLog b/ChangeLog index b47fd8d5..017f6686 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-12-07 Bob Rossi + and Joel Denny + + * data/push.c (yypvarsinit): Change return type from void* to struct + yypvars*. No longer cast to void* on return. + (struct yypvars): Remove yylen since it need not be remembered between + yypushparse invocations. + (yypushparse): Don't copy between yylen and pv->yylen. + 2006-12-05 Bob Rossi * data/push.c (yychar_set, yylval_set, yylloc_set): Delete. diff --git a/data/push.c b/data/push.c index d8c98150..2e6165b5 100644 --- a/data/push.c +++ b/data/push.c @@ -970,7 +970,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar) ]b4_push_if([ struct yypvars; enum { YYPUSH_MORE = 4 }; -]b4_c_function_decl([yypvarsinit], [void *], [[void], []])[ +]b4_c_function_decl([yypvarsinit], [struct yypvars *], [[void], []])[ ]b4_c_function_decl([yypushparse], [int], [[struct yypvars *yypvars], [yypvars]], [[int yynchar], [yynchar]], @@ -1038,7 +1038,6 @@ m4_define([b4_declare_yyparse_variables], /* The locations where the error started and ended. */ YYLTYPE yyerror_range[2];]]])[ YYSIZE_T yystacksize; - int yylen; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1048,7 +1047,7 @@ m4_define([b4_declare_yyparse_variables], }; /* Initialize the parser data structure. */ -void * +struct yypvars* yypvarsinit (void) { struct yypvars *pv = (struct yypvars *) malloc (sizeof *pv); @@ -1071,7 +1070,7 @@ yypvarsinit (void) ]b4_locations_if([ pv->yylsp = pv->yyls;])[ - return (void *) pv; + return pv; }]) m4_divert_pop([KILL])dnl# ====================== End of M4 code. @@ -1208,7 +1207,6 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc; yylsp = pv->yylsp;]])[ yystacksize = pv->yystacksize; - yylen = pv->yylen; yyval = pv->yyval; ]b4_locations_if([yyloc = pv->yyloc;])[ if (pv->yynew == 0) @@ -1339,7 +1337,6 @@ yybackup: pv->yylsp = yylsp;]])[ pv->yystacksize = yystacksize; - pv->yylen = yylen; pv->yyval = yyval; ]b4_locations_if([pv->yyloc = yyloc;])[ goto yypushreturn;