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

@@ -4264,13 +4264,11 @@ static int
parse_odp_key_mask_attr(const char *s, const struct simap *port_names,
struct ofpbuf *key, struct ofpbuf *mask)
{
ovs_u128 ufid;
int len;
/* Skip UFID. */
len = odp_ufid_from_string(s, &ufid);
if (len) {
return len;
ovs_u128 ufid;
int ufid_len = odp_ufid_from_string(s, &ufid);
if (ufid_len) {
return ufid_len;
}
SCAN_SINGLE("skb_priority(", uint32_t, u32, OVS_KEY_ATTR_PRIORITY);