aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison/src/complain.c
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-29 11:45:54 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-29 11:54:41 +0300
commit9158d9115725ca7f4ada745ec55eddd5747bc61e (patch)
treef262cd6d7a98bb367943a4918b6963a7800f3937 /contrib/tools/bison/src/complain.c
parent632b3cedb8e12fbbb0bcd1bdbf7ec5686725b7e9 (diff)
downloadydb-9158d9115725ca7f4ada745ec55eddd5747bc61e.tar.gz
Update contrib/tools/bison to 3.2.4
78e59a97f3fde03511ddb9969cd1daabbaf998bd
Diffstat (limited to 'contrib/tools/bison/src/complain.c')
-rw-r--r--contrib/tools/bison/src/complain.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/contrib/tools/bison/src/complain.c b/contrib/tools/bison/src/complain.c
index e39626a3f3..6c1acf392e 100644
--- a/contrib/tools/bison/src/complain.c
+++ b/contrib/tools/bison/src/complain.c
@@ -83,7 +83,7 @@ static const char * const warnings_args[] =
0
};
-static const int warnings_types[] =
+static const warnings warnings_types[] =
{
Wnone,
Wmidrule_values,
@@ -114,8 +114,7 @@ warning_argmatch (char const *arg, size_t no, size_t err)
no = !no;
}
- size_t b;
- for (b = 0; b < warnings_size; ++b)
+ for (size_t b = 0; b < warnings_size; ++b)
if (value & 1 << b)
{
if (err && no)
@@ -176,8 +175,7 @@ complain_init (void)
warnings warnings_default =
Wconflicts_sr | Wconflicts_rr | Wdeprecated | Wother;
- size_t b;
- for (b = 0; b < warnings_size; ++b)
+ for (size_t b = 0; b < warnings_size; ++b)
{
warnings_flag[b] = (1 << b & warnings_default
? severity_warning
@@ -204,8 +202,7 @@ warning_severity (warnings flags)
{
/* Diagnostics about warnings. */
severity res = severity_disabled;
- size_t b;
- for (b = 0; b < warnings_size; ++b)
+ for (size_t b = 0; b < warnings_size; ++b)
if (flags & 1 << b)
{
res = res < warnings_flag[b] ? warnings_flag[b] : res;
@@ -225,8 +222,7 @@ warning_severity (warnings flags)
bool
warning_is_unset (warnings flags)
{
- size_t b;
- for (b = 0; b < warnings_size; ++b)
+ for (size_t b = 0; b < warnings_size; ++b)
if (flags & 1 << b && warnings_flag[b] != severity_unset)
return false;
return true;
@@ -238,8 +234,7 @@ static void
warnings_print_categories (warnings warn_flags, FILE *f)
{
/* Display only the first match, the second is "-Wall". */
- size_t i;
- for (i = 0; warnings_args[i]; ++i)
+ for (size_t i = 0; warnings_args[i]; ++i)
if (warn_flags & warnings_types[i])
{
severity s = warning_severity (warnings_types[i]);