[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/21] yacc.c: fix more errors from make maintainer-check-g++
From: |
Akim Demaille |
Subject: |
[PATCH 14/21] yacc.c: fix more errors from make maintainer-check-g++ |
Date: |
Wed, 1 Apr 2020 08:37:40 +0200 |
* data/skeletons/yacc.c (yyexpected_tokens): Use casts where needed.
---
data/skeletons/yacc.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/data/skeletons/yacc.c b/data/skeletons/yacc.c
index d70362ee..5505b982 100644
--- a/data/skeletons/yacc.c
+++ b/data/skeletons/yacc.c
@@ -1149,22 +1149,25 @@ yyexpected_tokens (const yyparse_context_t *yyctx,
]b4_lac_if([[
int yyx;
for (yyx = 0; yyx < YYNTOKENS; ++yyx)
- if (yyx != YYSYMBOL_YYERROR && yyx != YYSYMBOL_YYUNDEF)
- switch (yy_lac (]b4_push_if([[yyps->yyesa, &yyps->yyes,
&yyps->yyes_capacity, yyps->yyssp, yyx]],
- [[yyctx->yyesa, yyctx->yyes,
yyctx->yyes_capacity, yyctx->yyssp, yyx]])[))
- {
- case YYNOMEM:
- return YYNOMEM;
- case 1:
- continue;
- default:
- if (!yyarg)
- ++yycount;
- else if (yycount == yyargn)
- return 0;
- else
- yyarg[yycount++] = yyx;
- }]],
+ {
+ yysymbol_type_t yysym = YY_CAST (yysymbol_type_t, yyx);
+ if (yysym != YYSYMBOL_YYERROR && yysym != YYSYMBOL_YYUNDEF)
+ switch (yy_lac (]b4_push_if([[yyps->yyesa, &yyps->yyes,
&yyps->yyes_capacity, yyps->yyssp, yysym]],
+ [[yyctx->yyesa, yyctx->yyes,
yyctx->yyes_capacity, yyctx->yyssp, yysym]])[))
+ {
+ case YYNOMEM:
+ return YYNOMEM;
+ case 1:
+ continue;
+ default:
+ if (!yyarg)
+ ++yycount;
+ else if (yycount == yyargn)
+ return 0;
+ else
+ yyarg[yycount++] = yysym;
+ }
+ }]],
[[ int yyn = yypact@{+*]b4_push_if([yyps], [yyctx])[->yyssp@};
if (!yypact_value_is_default (yyn))
{
@@ -1185,7 +1188,7 @@ yyexpected_tokens (const yyparse_context_t *yyctx,
else if (yycount == yyargn)
return 0;
else
- yyarg[yycount++] = yyx;
+ yyarg[yycount++] = YY_CAST (yysymbol_type_t, yyx);
}
}]])[
return yycount;
--
2.26.0
- [PATCH 03/21] regen, (continued)
- [PATCH 03/21] regen, Akim Demaille, 2020/04/01
- [PATCH 06/21] regen, Akim Demaille, 2020/04/01
- [PATCH 05/21] yacc.c: also define a symbol number for the empty token, Akim Demaille, 2020/04/01
- [PATCH 08/21] regen, Akim Demaille, 2020/04/01
- [PATCH 07/21] yacc.c: prefer YYSYMBOL_YYERROR to YYSYMBOL_error, Akim Demaille, 2020/04/01
- [PATCH 09/21] bistromathic: use symbol numbers instead of YYTRANSLATE, Akim Demaille, 2020/04/01
- [PATCH 11/21] regen, Akim Demaille, 2020/04/01
- [PATCH 10/21] yysymbol_type_t: always assign an enumerator, Akim Demaille, 2020/04/01
- [PATCH 12/21] yacc.c: revert to not using yysymbol_type_t in the yytranslate table, Akim Demaille, 2020/04/01
- [PATCH 13/21] regen, Akim Demaille, 2020/04/01
- [PATCH 14/21] yacc.c: fix more errors from make maintainer-check-g++,
Akim Demaille <=
- [PATCH 15/21] regen, Akim Demaille, 2020/04/01
- [PATCH 16/21] glr.c: use yysymbol_type_t, YYSYMBOL_YYEOF etc., Akim Demaille, 2020/04/01
- [PATCH 18/21] regen, Akim Demaille, 2020/04/01
- [PATCH 17/21] glr.c, yacc.c: propagate yysymbol_type_t, Akim Demaille, 2020/04/01
- [PATCH 19/21] glr.c: remove the yySymbol alias, Akim Demaille, 2020/04/01
- [PATCH 21/21] c++: replace symbol_number_type with symbol_type_type, Akim Demaille, 2020/04/01
- [PATCH 20/21] c++: also use symbol_type_type, Akim Demaille, 2020/04/01