[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5] glr.c: scope reduction
From: |
Akim Demaille |
Subject: |
[PATCH 2/5] glr.c: scope reduction |
Date: |
Wed, 12 Dec 2012 14:15:27 +0100 |
* data/glr.c (yyreportSyntaxError): Reduce the scope of yysize1 (now
yysz).
---
data/glr.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/data/glr.c b/data/glr.c
index cdefd50..e55a2df 100644
--- a/data/glr.c
+++ b/data/glr.c
@@ -2016,7 +2016,6 @@ yyreportSyntaxError (yyGLRStack*
yystackp]b4_user_formals[)
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
size_t yysize0 = yytnamerr (YY_NULL, yytokenName (yytoken));
size_t yysize = yysize0;
- size_t yysize1;
yybool yysize_overflow = yyfalse;
char* yymsg = YY_NULL;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
@@ -2076,9 +2075,11 @@ yyreportSyntaxError (yyGLRStack*
yystackp]b4_user_formals[)
break;
}
yyarg[yycount++] = yytokenName (yyx);
- yysize1 = yysize + yytnamerr (YY_NULL, yytokenName (yyx));
- yysize_overflow |= yysize1 < yysize;
- yysize = yysize1;
+ {
+ size_t yysz = yysize + yytnamerr (YY_NULL, yytokenName
(yyx));
+ yysize_overflow |= yysz < yysize;
+ yysize = yysz;
+ }
}
}
}
@@ -2098,9 +2099,11 @@ yyreportSyntaxError (yyGLRStack*
yystackp]b4_user_formals[)
#undef YYCASE_
}
- yysize1 = yysize + strlen (yyformat);
- yysize_overflow |= yysize1 < yysize;
- yysize = yysize1;
+ {
+ size_t yysz = yysize + strlen (yyformat);
+ yysize_overflow |= yysz < yysize;
+ yysize = yysz;
+ }
if (!yysize_overflow)
yymsg = (char *) YYMALLOC (yysize);
--
1.8.0.1
- [PATCH 0/5] {maint} restore C90 compliance, Akim Demaille, 2012/12/12
- [PATCH 1/5] gnulib: update, Akim Demaille, 2012/12/12
- [PATCH 5/5] yacc.c: scope reduction, Akim Demaille, 2012/12/12
- [PATCH 4/5] tests: C90 compliance, Akim Demaille, 2012/12/12
- [PATCH 2/5] glr.c: scope reduction,
Akim Demaille <=
- [PATCH 3/5] fix C90 compliance, Akim Demaille, 2012/12/12
- Re: [PATCH 0/5] {maint} restore C90 compliance, Paul Eggert, 2012/12/12