mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
resulting parsers are compilable with C++.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
|
||||||
|
|
||||||
|
* data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
|
||||||
|
resulting parsers are compilable with C++.
|
||||||
|
|
||||||
2003-12-23 Paul Eggert <eggert@twinsun.com>
|
2003-12-23 Paul Eggert <eggert@twinsun.com>
|
||||||
|
|
||||||
* config/depcomp, config/install-sh: Sync with Automake 1.8.
|
* config/depcomp, config/install-sh: Sync with Automake 1.8.
|
||||||
|
|||||||
12
data/glr.c
12
data/glr.c
@@ -876,7 +876,7 @@ yyinitStateSet (yyGLRStateSet* yyset)
|
|||||||
{
|
{
|
||||||
yyset->yysize = 1;
|
yyset->yysize = 1;
|
||||||
yyset->yycapacity = 16;
|
yyset->yycapacity = 16;
|
||||||
yyset->yystates = YYMALLOC (16 * sizeof yyset->yystates[0]);
|
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
|
||||||
yyset->yystates[0] = NULL;
|
yyset->yystates[0] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -895,7 +895,7 @@ yyinitGLRStack (yyGLRStack* yystack, size_t yysize)
|
|||||||
yynerrs = 0;
|
yynerrs = 0;
|
||||||
yystack->yyspaceLeft = yysize;
|
yystack->yyspaceLeft = yysize;
|
||||||
yystack->yynextFree = yystack->yyitems =
|
yystack->yynextFree = yystack->yyitems =
|
||||||
YYMALLOC (yysize * sizeof yystack->yynextFree[0]);
|
(yyGLRStackItem*) YYMALLOC (yysize * sizeof yystack->yynextFree[0]);
|
||||||
yystack->yysplitPoint = NULL;
|
yystack->yysplitPoint = NULL;
|
||||||
yystack->yylastDeleted = NULL;
|
yystack->yylastDeleted = NULL;
|
||||||
yyinitStateSet (&yystack->yytops);
|
yyinitStateSet (&yystack->yytops);
|
||||||
@@ -1237,9 +1237,9 @@ yysplitStack (yyGLRStack* yystack, int yyk)
|
|||||||
{
|
{
|
||||||
yystack->yytops.yycapacity *= 2;
|
yystack->yytops.yycapacity *= 2;
|
||||||
yystack->yytops.yystates =
|
yystack->yytops.yystates =
|
||||||
YYREALLOC (yystack->yytops.yystates,
|
(yyGLRState**) YYREALLOC (yystack->yytops.yystates,
|
||||||
(yystack->yytops.yycapacity
|
(yystack->yytops.yycapacity
|
||||||
* sizeof yystack->yytops.yystates[0]));
|
* sizeof yystack->yytops.yystates[0]));
|
||||||
}
|
}
|
||||||
yystack->yytops.yystates[yystack->yytops.yysize]
|
yystack->yytops.yystates[yystack->yytops.yysize]
|
||||||
= yystack->yytops.yystates[yyk];
|
= yystack->yytops.yystates[yyk];
|
||||||
@@ -1649,7 +1649,7 @@ yyreportSyntaxError (yyGLRStack* yystack,
|
|||||||
}
|
}
|
||||||
yysize += (sizeof ("syntax error, unexpected ")
|
yysize += (sizeof ("syntax error, unexpected ")
|
||||||
+ strlen (yytokenName (*yytokenp)));
|
+ strlen (yytokenName (*yytokenp)));
|
||||||
yymsg = YYMALLOC (yysize);
|
yymsg = (char*) YYMALLOC (yysize);
|
||||||
if (yymsg != 0)
|
if (yymsg != 0)
|
||||||
{
|
{
|
||||||
char* yyp = yymsg;
|
char* yyp = yymsg;
|
||||||
|
|||||||
Reference in New Issue
Block a user