X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=skeleton.c;h=fb399a4bd5bd35456d65db24a07b7b7e35738913;hb=d3613397480d95ca222512ea4be3814fc6726b5f;hp=dc86e3c0d714af0f7e7d0a3b348215ee9506112a;hpb=30c125a1e41107d7f8a5cabcbdebb427364152bd;p=platform%2Fupstream%2Fbyacc.git diff --git a/skeleton.c b/skeleton.c index dc86e3c..fb399a4 100644 --- a/skeleton.c +++ b/skeleton.c @@ -1,4 +1,4 @@ -/* $Id: skeleton.c,v 1.27 2010/11/26 17:24:00 tom Exp $ */ +/* $Id: skeleton.c,v 1.30 2010/12/29 20:57:21 tom Exp $ */ #include "defs.h" @@ -14,7 +14,7 @@ /* the body either are not useful outside of semantic actions or */ /* are conditional. */ -const char *banner[] = +const char *const banner[] = { "#ifndef lint", "static const char yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";", @@ -35,15 +35,14 @@ const char *banner[] = 0 }; -const char *xdecls[] = +const char *const xdecls[] = { "extern int YYPARSE_DECL();", - "extern int YYLEX_DECL();", "", 0 }; -const char *tables[] = +const char *const tables[] = { "extern short yylhs[];", "extern short yylen[];", @@ -62,7 +61,7 @@ const char *tables[] = 0 }; -const char *hdr_defs[] = +const char *const hdr_defs[] = { "/* define the initial stack-sizes */", "#ifdef YYSTACKSIZE", @@ -93,7 +92,7 @@ const char *hdr_defs[] = 0 }; -const char *hdr_vars[] = +const char *const hdr_vars[] = { "int yyerrflag;", "int yychar;", @@ -105,7 +104,7 @@ const char *hdr_vars[] = 0 }; -const char *body_vars[] = +const char *const body_vars[] = { " int yyerrflag;", " int yychar;", @@ -117,7 +116,7 @@ const char *body_vars[] = 0 }; -const char *body_1[] = +const char *const body_1[] = { "", "#if YYDEBUG", @@ -143,18 +142,14 @@ const char *body_1[] = " newsize = YYMAXDEPTH;", "", " i = data->s_mark - data->s_base;", - " newss = (data->s_base != 0)", - " ? (short *)realloc(data->s_base, newsize * sizeof(*newss))", - " : (short *)malloc(newsize * sizeof(*newss));", + " newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));", " if (newss == 0)", " return -1;", "", " data->s_base = newss;", " data->s_mark = newss + i;", "", - " newvs = (data->l_base != 0)", - " ? (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs))", - " : (YYSTYPE *)malloc(newsize * sizeof(*newvs));", + " newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));", " if (newvs == 0)", " return -1;", "", @@ -188,7 +183,7 @@ const char *body_1[] = 0 }; -const char *body_2[] = +const char *const body_2[] = { " int yym, yyn, yystate;", "#if YYDEBUG", @@ -263,7 +258,7 @@ const char *body_2[] = 0 }; -const char *body_3[] = +const char *const body_3[] = { "", " goto yyerrlab;", @@ -342,7 +337,7 @@ const char *body_3[] = 0 }; -const char *trailer[] = +const char *const trailer[] = { " }", " yystack.s_mark -= yym;", @@ -398,7 +393,7 @@ const char *trailer[] = 0 }; -const char *trailer_2[] = +const char *const trailer_2[] = { "", "yyabort:", @@ -413,7 +408,7 @@ const char *trailer_2[] = }; void -write_section(const char *section[]) +write_section(const char *const section[]) { int c; int i;