* data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to

prevent a name collision in a future patch where these names will
sometimes be #define'd.
(YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
since it no longer has the same name as the existing argument.
(yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
This commit is contained in:
Joel E. Denny
2006-12-19 21:40:14 +00:00
parent e6e704dc78
commit 2d212f8ca6
2 changed files with 18 additions and 9 deletions

View File

@@ -373,9 +373,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
yytype_int16 yyss;
YYSTYPE yyvs;
]b4_locations_if([ YYLTYPE yyls;
yytype_int16 yyss_alloc;
YYSTYPE yyvs_alloc;
]b4_locations_if([ YYLTYPE yyls_alloc;
])dnl
[};
@@ -415,12 +415,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
@@ -1277,9 +1277,9 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
]b4_locations_if([ YYSTACK_RELOCATE (yyls);])[
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
]b4_locations_if([ YYSTACK_RELOCATE (yyls_alloc, yyls);])[
# undef YYSTACK_RELOCATE
if (yyss1 != ]b4_yyssa[)
YYSTACK_FREE (yyss1);