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

@@ -165,7 +165,7 @@ splice (\\[ \f\t\v]*\n)*
{
/* Comments and white space. */
"," {
complain_at (*loc, Wother, _("stray ',' treated as white space"));
complain (loc, Wother, _("stray ',' treated as white space"));
}
[ \f\n\t\v] |
"//".* ;
@@ -241,7 +241,7 @@ splice (\\[ \f\t\v]*\n)*
"%yacc" return PERCENT_YACC;
{directive} {
complain_at (*loc, complaint, _("invalid directive: %s"), quote (yytext));
complain (loc, complaint, _("invalid directive: %s"), quote (yytext));
}
"=" return EQUAL;
@@ -267,7 +267,7 @@ splice (\\[ \f\t\v]*\n)*
/* Identifiers may not start with a digit. Yet, don't silently
accept "1FOO" as "1 FOO". */
{int}{id} {
complain_at (*loc, complaint, _("invalid identifier: %s"), quote (yytext));
complain (loc, complaint, _("invalid identifier: %s"), quote (yytext));
}
/* Characters. */
@@ -325,7 +325,7 @@ splice (\\[ \f\t\v]*\n)*
}
. {
complain_at (*loc, complaint, _("invalid character: %s"), quote (yytext));
complain (loc, complaint, _("invalid character: %s"), quote (yytext));
}
<<EOF>> {
@@ -342,7 +342,7 @@ splice (\\[ \f\t\v]*\n)*
<SC_ESCAPED_CHARACTER,SC_ESCAPED_STRING,SC_TAG>
{
\0 complain_at (*loc, complaint, _("invalid null character"));
\0 complain (loc, complaint, _("invalid null character"));
}
@@ -394,9 +394,9 @@ splice (\\[ \f\t\v]*\n)*
{id} {
if (bracketed_id_str)
{
complain_at (*loc, complaint,
_("unexpected identifier in bracketed name: %s"),
quote (yytext));
complain (loc, complaint,
_("unexpected identifier in bracketed name: %s"),
quote (yytext));
}
else
{
@@ -417,10 +417,10 @@ splice (\\[ \f\t\v]*\n)*
}
}
else
complain_at (*loc, complaint, _("an identifier expected"));
complain (loc, complaint, _("an identifier expected"));
}
. {
complain_at (*loc, complaint, _("invalid character in bracketed name: %s"),
complain (loc, complaint, _("invalid character in bracketed name: %s"),
quote (yytext));
}
<<EOF>> {
@@ -518,12 +518,12 @@ splice (\\[ \f\t\v]*\n)*
/* FIXME: Eventually, make these errors. */
if (last_string[0] == '\0')
{
complain_at (*loc, Wother, _("empty character literal"));
complain (loc, Wother, _("empty character literal"));
/* '\0' seems dangerous even if we are about to complain. */
val->character = '\'';
}
else if (last_string[1] != '\0')
complain_at (*loc, Wother,
complain (loc, Wother,
_("extra characters in character literal"));
}
if (yytext[0] == '\n')
@@ -540,12 +540,12 @@ splice (\\[ \f\t\v]*\n)*
/* FIXME: Eventually, make these errors. */
if (last_string[0] == '\0')
{
complain_at (*loc, Wother, _("empty character literal"));
complain (loc, Wother, _("empty character literal"));
/* '\0' seems dangerous even if we are about to complain. */
val->character = '\'';
}
else if (last_string[1] != '\0')
complain_at (*loc, Wother,
complain (loc, Wother,
_("extra characters in character literal"));
}
unexpected_eof (token_start, "'");
@@ -599,7 +599,7 @@ splice (\\[ \f\t\v]*\n)*
\\[0-7]{1,3} {
unsigned long int c = strtoul (yytext + 1, NULL, 8);
if (!c || UCHAR_MAX < c)
complain_at (*loc, complaint, _("invalid number after \\-escape: %s"),
complain (loc, complaint, _("invalid number after \\-escape: %s"),
yytext+1);
else
obstack_1grow (&obstack_for_string, c);
@@ -609,7 +609,7 @@ splice (\\[ \f\t\v]*\n)*
verify (UCHAR_MAX < ULONG_MAX);
unsigned long int c = strtoul (yytext + 2, NULL, 16);
if (!c || UCHAR_MAX < c)
complain_at (*loc, complaint, _("invalid number after \\-escape: %s"),
complain (loc, complaint, _("invalid number after \\-escape: %s"),
yytext+1);
else
obstack_1grow (&obstack_for_string, c);
@@ -629,7 +629,7 @@ splice (\\[ \f\t\v]*\n)*
\\(u|U[0-9abcdefABCDEF]{4})[0-9abcdefABCDEF]{4} {
int c = convert_ucn_to_byte (yytext);
if (c <= 0)
complain_at (*loc, complaint, _("invalid number after \\-escape: %s"),
complain (loc, complaint, _("invalid number after \\-escape: %s"),
yytext+1);
else
obstack_1grow (&obstack_for_string, c);
@@ -641,7 +641,7 @@ splice (\\[ \f\t\v]*\n)*
p = quote (p);
else
p = quotearg_style_mem (escape_quoting_style, p, 1);
complain_at (*loc, complaint, _("invalid character after \\-escape: %s"),
complain (loc, complaint, _("invalid character after \\-escape: %s"),
p);
}
}
@@ -873,7 +873,7 @@ scan_integer (char const *number, int base, location loc)
if (INT_MAX < num)
{
complain_at (loc, complaint, _("integer out of range: %s"),
complain (&loc, complaint, _("integer out of range: %s"),
quote (number));
num = INT_MAX;
}
@@ -952,7 +952,7 @@ handle_syncline (char *args, location loc)
*strchr (file, '"') = '\0';
if (INT_MAX <= lineno)
{
complain_at (loc, Wother, _("line number overflow"));
complain (&loc, Wother, _("line number overflow"));
lineno = INT_MAX;
}
current_file = uniqstr_new (file);
@@ -976,7 +976,7 @@ unexpected_end (boundary start, char const *msgid, char const *token_end)
// Instead of '\'', display "'".
if (STREQ (token_end, "'\\''"))
token_end = "\"'\"";
complain_at (loc, complaint, _(msgid), token_end);
complain (&loc, complaint, _(msgid), token_end);
}