warnings: fusion of complain and complain_at

These functions are very similar, and keeping them seperate makes
future improvements difficult, so merge them.

This impacts 89 calls.

* src/bootstrap.conf: Adjust.
* src/complain.c (complain, complain_at): Merge into...
(complain): this.
(complain_args): Adjust.
* src/complain.h, src/conflicts.c, src/files.c, src/getargs.c,
* src/gram.c, src/location.c, src/muscle-tab.c, src/parse-gram.y,
* src/reader.c, src/reduce.c, src/scan-code.l, src/scan-gram.l,
* src/scan-skel.l, src/symlist.c, src/symtab.c:
Adjust.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
This commit is contained in:
Theophile Ranquet
2012-10-01 13:44:20 +00:00
committed by Akim Demaille
parent a49f4904c3
commit bb8e56ff67
19 changed files with 161 additions and 179 deletions

View File

@@ -134,7 +134,7 @@ static void fail_for_invalid_at (char const *at);
<SC_AT_DIRECTIVE_ARGS,SC_AT_DIRECTIVE_SKIP_WS>
{
<<EOF>> complain (fatal, _("unclosed %s directive in skeleton"), argv[0]);
<<EOF>> complain (NULL, fatal, _("unclosed %s directive in skeleton"), argv[0]);
}
%%
@@ -194,19 +194,19 @@ at_directive_perform (int argc, char *argv[], char **outnamep, int *out_linenop)
switch (argc)
{
case 2:
complain (w, "%s", _(argv[1]));
complain (NULL, w, "%s", _(argv[1]));
break;
case 3:
complain (w, _(argv[1]), argv[2]);
complain (NULL, w, _(argv[1]), argv[2]);
break;
case 4:
complain (w, _(argv[1]), argv[2], argv[3]);
complain (NULL, w, _(argv[1]), argv[2], argv[3]);
break;
case 5:
complain (w, _(argv[1]), argv[2], argv[3], argv[4]);
complain (NULL, w, _(argv[1]), argv[2], argv[3], argv[4]);
break;
case 6:
complain (w, _(argv[1]), argv[2], argv[3], argv[4], argv[5]);
complain (NULL, w, _(argv[1]), argv[2], argv[3], argv[4], argv[5]);
break;
default:
fail_for_at_directive_too_many_args (argv[0]);
@@ -226,19 +226,19 @@ at_directive_perform (int argc, char *argv[], char **outnamep, int *out_linenop)
switch (argc)
{
case 4:
complain_at (loc, w, "%s", _(argv[3]));
complain (&loc, w, "%s", _(argv[3]));
break;
case 5:
complain_at (loc, w, _(argv[3]), argv[4]);
complain (&loc, w, _(argv[3]), argv[4]);
break;
case 6:
complain_at (loc, w, _(argv[3]), argv[4], argv[5]);
complain (&loc, w, _(argv[3]), argv[4], argv[5]);
break;
case 7:
complain_at (loc, w, _(argv[3]), argv[4], argv[5], argv[6]);
complain (&loc, w, _(argv[3]), argv[4], argv[5], argv[6]);
break;
case 8:
complain_at (loc, w, _(argv[3]), argv[4], argv[5], argv[6],
complain (&loc, w, _(argv[3]), argv[4], argv[5], argv[6],
argv[7]);
break;
default:
@@ -267,19 +267,19 @@ at_directive_perform (int argc, char *argv[], char **outnamep, int *out_linenop)
static void
fail_for_at_directive_too_few_args (char const *at_directive_name)
{
complain (fatal, _("too few arguments for %s directive in skeleton"),
complain (NULL, fatal, _("too few arguments for %s directive in skeleton"),
at_directive_name);
}
static void
fail_for_at_directive_too_many_args (char const *at_directive_name)
{
complain (fatal, _("too many arguments for %s directive in skeleton"),
complain (NULL, fatal, _("too many arguments for %s directive in skeleton"),
at_directive_name);
}
static void
fail_for_invalid_at (char const *at)
{
complain (fatal, "invalid @ in skeleton: %s", at);
complain (NULL, fatal, "invalid @ in skeleton: %s", at);
}