From: Theophile Ranquet Date: Mon, 15 Oct 2012 17:03:17 +0000 (+0000) Subject: scan-skel.l: shift complain_args arguments X-Git-Tag: v2.7.90~299 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f60321dc590673828a6b6aed652523927d11adc8;p=platform%2Fupstream%2Fbison.git scan-skel.l: shift complain_args arguments Because argv[0] is never used, shift it out from the argument list. * src/complain.c (complain_args): Here. * src/scan-skel.l (at_complain): Adjust argv and argc. Signed-off-by: Akim Demaille --- diff --git a/src/complain.c b/src/complain.c index 985ef40..0fa812a 100644 --- a/src/complain.c +++ b/src/complain.c @@ -162,21 +162,21 @@ complain_args (location const *loc, warnings w, unsigned *indent, { switch (argc) { + case 1: + complain_indent (loc, w, indent, "%s", _(argv[0])); + break; case 2: - complain_indent (loc, w, indent, "%s", _(argv[1])); + complain_indent (loc, w, indent, _(argv[0]), argv[1]); break; case 3: - complain_indent (loc, w, indent, _(argv[1]), argv[2]); + complain_indent (loc, w, indent, _(argv[0]), argv[1], argv[2]); break; case 4: - complain_indent (loc, w, indent, _(argv[1]), argv[2], argv[3]); + complain_indent (loc, w, indent, _(argv[0]), argv[1], argv[2], argv[3]); break; case 5: - complain_indent (loc, w, indent, _(argv[1]), argv[2], argv[3], argv[4]); - break; - case 6: - complain_indent (loc, w, indent, _(argv[1]), argv[2], argv[3], argv[4], - argv[5]); + complain_indent (loc, w, indent, _(argv[0]), argv[1], argv[2], argv[3], + argv[4]); break; default: complain (loc, fatal, "too many arguments for complains"); diff --git a/src/scan-skel.l b/src/scan-skel.l index c5b46eb..c1e7b65 100644 --- a/src/scan-skel.l +++ b/src/scan-skel.l @@ -226,7 +226,7 @@ at_complain (int argc, char *argv[], char **out_namep, int *out_linenop) indent += SUB_INDENT; else indent = 0; - complain_args (locp, w, &indent, argc - 3, argv + 3); + complain_args (locp, w, &indent, argc - 4, argv + 4); if (w & silent) indent -= SUB_INDENT; }