From be16239bf7c03d49673f7651ff3a12a3b0da77d1 Mon Sep 17 00:00:00 2001 From: Paul Hilfinger Date: Wed, 14 Jan 2004 01:40:12 +0000 Subject: [PATCH] data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that resulting parsers are compilable with C++. --- ChangeLog | 5 +++++ data/glr.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03bf7a23..c0c758cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-13 Paul Hilfinger + + * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that + resulting parsers are compilable with C++. + 2003-12-23 Paul Eggert * config/depcomp, config/install-sh: Sync with Automake 1.8. diff --git a/data/glr.c b/data/glr.c index f2173854..eb270a17 100644 --- a/data/glr.c +++ b/data/glr.c @@ -876,7 +876,7 @@ yyinitStateSet (yyGLRStateSet* yyset) { yyset->yysize = 1; yyset->yycapacity = 16; - yyset->yystates = YYMALLOC (16 * sizeof yyset->yystates[0]); + yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]); yyset->yystates[0] = NULL; } @@ -895,7 +895,7 @@ yyinitGLRStack (yyGLRStack* yystack, size_t yysize) yynerrs = 0; yystack->yyspaceLeft = yysize; yystack->yynextFree = yystack->yyitems = - YYMALLOC (yysize * sizeof yystack->yynextFree[0]); + (yyGLRStackItem*) YYMALLOC (yysize * sizeof yystack->yynextFree[0]); yystack->yysplitPoint = NULL; yystack->yylastDeleted = NULL; yyinitStateSet (&yystack->yytops); @@ -1237,9 +1237,9 @@ yysplitStack (yyGLRStack* yystack, int yyk) { yystack->yytops.yycapacity *= 2; yystack->yytops.yystates = - YYREALLOC (yystack->yytops.yystates, - (yystack->yytops.yycapacity - * sizeof yystack->yytops.yystates[0])); + (yyGLRState**) YYREALLOC (yystack->yytops.yystates, + (yystack->yytops.yycapacity + * sizeof yystack->yytops.yystates[0])); } yystack->yytops.yystates[yystack->yytops.yysize] = yystack->yytops.yystates[yyk]; @@ -1649,7 +1649,7 @@ yyreportSyntaxError (yyGLRStack* yystack, } yysize += (sizeof ("syntax error, unexpected ") + strlen (yytokenName (*yytokenp))); - yymsg = YYMALLOC (yysize); + yymsg = (char*) YYMALLOC (yysize); if (yymsg != 0) { char* yyp = yymsg; -- 2.47.2