mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
(YYPOINTER): New macro.
(YYSTACK_RELOCATE): Use it to avoid a GCC warning. (yystpcpy): Use prototype if __STDC__ is defined, not just if __cplusplus is defined.
This commit is contained in:
@@ -102,6 +102,12 @@ 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
|
||||||
@@ -113,7 +119,7 @@ union yyalloc
|
|||||||
YYSIZE_T yynewbytes; \
|
YYSIZE_T yynewbytes; \
|
||||||
yymemcpy (yyptr, (char *) (Stack), \
|
yymemcpy (yyptr, (char *) (Stack), \
|
||||||
yysize * (YYSIZE_T) sizeof (Type)); \
|
yysize * (YYSIZE_T) sizeof (Type)); \
|
||||||
(Stack) = (Type *) yyptr; \
|
(Stack) = (Type *) (YYPOINTER) yyptr; \
|
||||||
yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
|
yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
|
||||||
yynewbytes -= yynewbytes % sizeof (union yyalloc); \
|
yynewbytes -= yynewbytes % sizeof (union yyalloc); \
|
||||||
yyptr += yynewbytes; \
|
yyptr += yynewbytes; \
|
||||||
@@ -301,12 +307,12 @@ yystrlen (yystr)
|
|||||||
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
|
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
|
||||||
YYDEST. */
|
YYDEST. */
|
||||||
static char *
|
static char *
|
||||||
# ifndef __cplusplus
|
# if defined (__STDC__) || defined (__cplusplus)
|
||||||
|
yystpcpy (char *yydest, const char *yysrc)
|
||||||
|
# else
|
||||||
yystpcpy (yydest, yysrc)
|
yystpcpy (yydest, yysrc)
|
||||||
char *yydest;
|
char *yydest;
|
||||||
const char *yysrc;
|
const char *yysrc;
|
||||||
# else
|
|
||||||
yystpcpy (char *yydest, const char *yysrc)
|
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
register char *yyd = yydest;
|
register char *yyd = yydest;
|
||||||
@@ -797,7 +803,7 @@ yyerrlab:
|
|||||||
yyerror ("parse error; also virtual memory exhausted");
|
yyerror ("parse error; also virtual memory exhausted");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* YYERROR_VERBOSE */
|
#endif /* defined (YYERROR_VERBOSE) */
|
||||||
yyerror ("parse error");
|
yyerror ("parse error");
|
||||||
}
|
}
|
||||||
goto yyerrlab1;
|
goto yyerrlab1;
|
||||||
|
|||||||
Reference in New Issue
Block a user