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 <akim@lrde.epita.fr>
This commit is contained in:
Theophile Ranquet
2012-10-15 17:03:17 +00:00
committed by Akim Demaille
parent 56f0d1d187
commit f60321dc59
2 changed files with 9 additions and 9 deletions

View File

@@ -162,21 +162,21 @@ complain_args (location const *loc, warnings w, unsigned *indent,
{ {
switch (argc) switch (argc)
{ {
case 1:
complain_indent (loc, w, indent, "%s", _(argv[0]));
break;
case 2: case 2:
complain_indent (loc, w, indent, "%s", _(argv[1])); complain_indent (loc, w, indent, _(argv[0]), argv[1]);
break; break;
case 3: case 3:
complain_indent (loc, w, indent, _(argv[1]), argv[2]); complain_indent (loc, w, indent, _(argv[0]), argv[1], argv[2]);
break; break;
case 4: 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; break;
case 5: case 5:
complain_indent (loc, w, indent, _(argv[1]), argv[2], argv[3], argv[4]); complain_indent (loc, w, indent, _(argv[0]), argv[1], argv[2], argv[3],
break; argv[4]);
case 6:
complain_indent (loc, w, indent, _(argv[1]), argv[2], argv[3], argv[4],
argv[5]);
break; break;
default: default:
complain (loc, fatal, "too many arguments for complains"); complain (loc, fatal, "too many arguments for complains");

View File

@@ -226,7 +226,7 @@ at_complain (int argc, char *argv[], char **out_namep, int *out_linenop)
indent += SUB_INDENT; indent += SUB_INDENT;
else else
indent = 0; indent = 0;
complain_args (locp, w, &indent, argc - 3, argv + 3); complain_args (locp, w, &indent, argc - 4, argv + 4);
if (w & silent) if (w & silent)
indent -= SUB_INDENT; indent -= SUB_INDENT;
} }