2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

Eliminate most shadowing for local variable names.

Shadowing is when a variable with a given name in an inner scope hides a
different variable with the same name in a surrounding scope.  This is
generally undesirable because it can confuse programmers.  This commit
eliminates most of it.

Found with -Wshadow=local in GCC 7.  The repo is not really ready to enable
this option by default because of a few cases that are harder to fix, and
harmless, such as nested use of CMAP_FOR_EACH.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
This commit is contained in:
Ben Pfaff
2017-08-02 15:03:06 -07:00
parent b24fa3f486
commit 71f21279f6
37 changed files with 128 additions and 166 deletions

View File

@@ -787,10 +787,10 @@ ovsdb_idl_check_consistency(const struct ovsdb_idl *idl)
ok = false;
}
}
for (size_t i = 0; i < n_dsts; i++) {
for (size_t j = 0; j < n_dsts; j++) {
VLOG_ERR("%s row "UUID_FMT" missing arc to row "UUID_FMT,
table->class->name, UUID_ARGS(&row->uuid),
UUID_ARGS(&dsts[i]));
UUID_ARGS(&dsts[j]));
ok = false;
}
}