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

@@ -5373,7 +5373,7 @@ get_stats_via_netlink(const struct netdev *netdev_, struct netdev_stats *stats)
netdev_stats_from_rtnl_link_stats64(stats, nl_attr_get(a));
error = 0;
} else {
const struct nlattr *a = nl_attr_find(reply, 0, IFLA_STATS);
a = nl_attr_find(reply, 0, IFLA_STATS);
if (a && nl_attr_get_size(a) >= sizeof(struct rtnl_link_stats)) {
netdev_stats_from_rtnl_link_stats(stats, nl_attr_get(a));
error = 0;