mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-19 09:13:04 +00:00
(union yyalloc): Change member names to be the same as the stack names.
(YYPOINTER): Remove. (yyparse): yyptr is now union yyalloc *, not char *. (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning, and may generate better code on some machines.
This commit is contained in:
@@ -141,10 +141,10 @@ typedef struct yyltype
|
|||||||
/* A type that is properly aligned for any stack member. */
|
/* A type that is properly aligned for any stack member. */
|
||||||
union yyalloc
|
union yyalloc
|
||||||
{
|
{
|
||||||
short yys;
|
short yyss;
|
||||||
YYSTYPE yyv;
|
YYSTYPE yyvs;
|
||||||
# if YYLSP_NEEDED
|
# if YYLSP_NEEDED
|
||||||
YYLTYPE yyl;
|
YYLTYPE yyls;
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -163,12 +163,6 @@ union yyalloc
|
|||||||
+ YYSTACK_GAP_MAX)
|
+ YYSTACK_GAP_MAX)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined (__STDC__) || defined (__cplusplus)
|
|
||||||
# define YYPOINTER void *
|
|
||||||
# else
|
|
||||||
# define YYPOINTER char *
|
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Relocate the TYPE STACK from its old location to the new one. The
|
/* Relocate the TYPE STACK from its old location to the new one. The
|
||||||
local variables YYSIZE and YYSTACKSIZE give the old and new number of
|
local variables YYSIZE and YYSTACKSIZE give the old and new number of
|
||||||
elements in the stack, and YYPTR gives the new location of the
|
elements in the stack, and YYPTR gives the new location of the
|
||||||
@@ -178,12 +172,11 @@ union yyalloc
|
|||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
YYSIZE_T yynewbytes; \
|
YYSIZE_T yynewbytes; \
|
||||||
yymemcpy (yyptr, (char *) (Stack), \
|
yymemcpy ((char *) yyptr, (char *) (Stack), \
|
||||||
yysize * (YYSIZE_T) sizeof (Type)); \
|
yysize * (YYSIZE_T) sizeof (Type)); \
|
||||||
(Stack) = (Type *) (YYPOINTER) yyptr; \
|
Stack = &yyptr->Stack; \
|
||||||
yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
|
yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
|
||||||
yynewbytes -= yynewbytes % sizeof (union yyalloc); \
|
yyptr += yynewbytes / sizeof (*yyptr); \
|
||||||
yyptr += yynewbytes; \
|
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
||||||
@@ -691,7 +684,8 @@ yyparse (YYPARSE_PARAM_ARG)
|
|||||||
|
|
||||||
{
|
{
|
||||||
short *yyss1 = yyss;
|
short *yyss1 = yyss;
|
||||||
char *yyptr = (char *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
union yyalloc *yyptr =
|
||||||
|
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
|
||||||
if (! yyptr)
|
if (! yyptr)
|
||||||
goto yyoverflowlab;
|
goto yyoverflowlab;
|
||||||
YYSTACK_RELOCATE (short, yyss);
|
YYSTACK_RELOCATE (short, yyss);
|
||||||
|
|||||||
Reference in New Issue
Block a user