core: fix compiler warnings -Werror=shadow by trivial renaming of variables

https://bugzilla.gnome.org/show_bug.cgi?id=710497

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2013-10-22 17:11:24 +02:00
parent ba781ced57
commit c67f978df0
3 changed files with 35 additions and 35 deletions

View File

@@ -787,7 +787,7 @@ nm_dbus_manager_register_exported_type (NMDBusManager *self,
GType object_type, GType object_type,
const DBusGObjectInfo *info) const DBusGObjectInfo *info)
{ {
const char *properties_info, *dbus_name, *gobject_name, *access; const char *properties_info, *dbus_name, *gobject_name, *tmp_access;
dbus_g_object_type_install_info (object_type, info); dbus_g_object_type_install_info (object_type, info);
if (!info->exported_properties) if (!info->exported_properties)
@@ -798,8 +798,8 @@ nm_dbus_manager_register_exported_type (NMDBusManager *self,
/* The format is: "interface\0DBusPropertyName\0gobject_property_name\0access\0" */ /* The format is: "interface\0DBusPropertyName\0gobject_property_name\0access\0" */
dbus_name = strchr (properties_info, '\0') + 1; dbus_name = strchr (properties_info, '\0') + 1;
gobject_name = strchr (dbus_name, '\0') + 1; gobject_name = strchr (dbus_name, '\0') + 1;
access = strchr (gobject_name, '\0') + 1; tmp_access = strchr (gobject_name, '\0') + 1;
properties_info = strchr (access, '\0') + 1; properties_info = strchr (tmp_access, '\0') + 1;
/* Note that nm-properties-changed-signal takes advantage of the /* Note that nm-properties-changed-signal takes advantage of the
* fact that @dbus_name and @gobject_name are static data that won't * fact that @dbus_name and @gobject_name are static data that won't

View File

@@ -174,7 +174,7 @@ static void rfkill_change_wifi (const char *desc, gboolean enabled);
static void static void
platform_link_added_cb (NMPlatform *platform, platform_link_added_cb (NMPlatform *platform,
int ifindex, int ifindex,
NMPlatformLink *link, NMPlatformLink *plink,
NMPlatformReason reason, NMPlatformReason reason,
gpointer user_data); gpointer user_data);
@@ -2401,7 +2401,7 @@ load_device_factories (NMManager *self)
static void static void
platform_link_added_cb (NMPlatform *platform, platform_link_added_cb (NMPlatform *platform,
int ifindex, int ifindex,
NMPlatformLink *link, NMPlatformLink *plink,
NMPlatformReason reason, NMPlatformReason reason,
gpointer user_data) gpointer user_data)
{ {
@@ -2421,7 +2421,7 @@ platform_link_added_cb (NMPlatform *platform,
NMDeviceFactoryCreateFunc create_func = iter->data; NMDeviceFactoryCreateFunc create_func = iter->data;
g_clear_error (&error); g_clear_error (&error);
device = (NMDevice *) create_func (link, &error); device = (NMDevice *) create_func (plink, &error);
if (device && NM_IS_DEVICE (device)) { if (device && NM_IS_DEVICE (device)) {
g_assert_no_error (error); g_assert_no_error (error);
break; /* success! */ break; /* success! */
@@ -2429,7 +2429,7 @@ platform_link_added_cb (NMPlatform *platform,
if (error) { if (error) {
nm_log_warn (LOGD_HW, "%s: factory failed to create device: (%d) %s", nm_log_warn (LOGD_HW, "%s: factory failed to create device: (%d) %s",
link->udi, plink->udi,
error ? error->code : -1, error ? error->code : -1,
error ? error->message : "(unknown)"); error ? error->message : "(unknown)");
g_clear_error (&error); g_clear_error (&error);
@@ -2441,63 +2441,63 @@ platform_link_added_cb (NMPlatform *platform,
int parent_ifindex = -1; int parent_ifindex = -1;
NMDevice *parent; NMDevice *parent;
switch (link->type) { switch (plink->type) {
case NM_LINK_TYPE_ETHERNET: case NM_LINK_TYPE_ETHERNET:
device = nm_device_ethernet_new (link); device = nm_device_ethernet_new (plink);
break; break;
case NM_LINK_TYPE_INFINIBAND: case NM_LINK_TYPE_INFINIBAND:
device = nm_device_infiniband_new (link); device = nm_device_infiniband_new (plink);
break; break;
case NM_LINK_TYPE_OLPC_MESH: case NM_LINK_TYPE_OLPC_MESH:
device = nm_device_olpc_mesh_new (link); device = nm_device_olpc_mesh_new (plink);
break; break;
case NM_LINK_TYPE_WIFI: case NM_LINK_TYPE_WIFI:
device = nm_device_wifi_new (link); device = nm_device_wifi_new (plink);
break; break;
case NM_LINK_TYPE_BOND: case NM_LINK_TYPE_BOND:
device = nm_device_bond_new (link); device = nm_device_bond_new (plink);
break; break;
case NM_LINK_TYPE_TEAM: case NM_LINK_TYPE_TEAM:
device = nm_device_team_new (link); device = nm_device_team_new (plink);
break; break;
case NM_LINK_TYPE_BRIDGE: case NM_LINK_TYPE_BRIDGE:
/* FIXME: always create device when we handle bridges non-destructively */ /* FIXME: always create device when we handle bridges non-destructively */
if (bridge_created_by_nm (self, link->name)) if (bridge_created_by_nm (self, plink->name))
device = nm_device_bridge_new (link); device = nm_device_bridge_new (plink);
else else
nm_log_info (LOGD_BRIDGE, "(%s): ignoring bridge not created by NetworkManager", link->name); nm_log_info (LOGD_BRIDGE, "(%s): ignoring bridge not created by NetworkManager", plink->name);
break; break;
case NM_LINK_TYPE_VLAN: case NM_LINK_TYPE_VLAN:
/* Have to find the parent device */ /* Have to find the parent device */
if (nm_platform_vlan_get_info (ifindex, &parent_ifindex, NULL)) { if (nm_platform_vlan_get_info (ifindex, &parent_ifindex, NULL)) {
parent = find_device_by_ifindex (self, parent_ifindex); parent = find_device_by_ifindex (self, parent_ifindex);
if (parent) if (parent)
device = nm_device_vlan_new (link, parent); device = nm_device_vlan_new (plink, parent);
else { else {
/* If udev signaled the VLAN interface before it signaled /* If udev signaled the VLAN interface before it signaled
* the VLAN's parent at startup we may not know about the * the VLAN's parent at startup we may not know about the
* parent device yet. But we'll find it on the second pass * parent device yet. But we'll find it on the second pass
* from nm_manager_start(). * from nm_manager_start().
*/ */
nm_log_dbg (LOGD_HW, "(%s): VLAN parent interface unknown", link->name); nm_log_dbg (LOGD_HW, "(%s): VLAN parent interface unknown", plink->name);
} }
} else } else
nm_log_err (LOGD_HW, "(%s): failed to get VLAN parent ifindex", link->name); nm_log_err (LOGD_HW, "(%s): failed to get VLAN parent ifindex", plink->name);
break; break;
case NM_LINK_TYPE_VETH: case NM_LINK_TYPE_VETH:
device = nm_device_veth_new (link); device = nm_device_veth_new (plink);
break; break;
case NM_LINK_TYPE_TUN: case NM_LINK_TYPE_TUN:
case NM_LINK_TYPE_TAP: case NM_LINK_TYPE_TAP:
device = nm_device_tun_new (link); device = nm_device_tun_new (plink);
break; break;
case NM_LINK_TYPE_MACVLAN: case NM_LINK_TYPE_MACVLAN:
case NM_LINK_TYPE_MACVTAP: case NM_LINK_TYPE_MACVTAP:
device = nm_device_macvlan_new (link); device = nm_device_macvlan_new (plink);
break; break;
case NM_LINK_TYPE_GRE: case NM_LINK_TYPE_GRE:
case NM_LINK_TYPE_GRETAP: case NM_LINK_TYPE_GRETAP:
device = nm_device_gre_new (link); device = nm_device_gre_new (plink);
break; break;
case NM_LINK_TYPE_WWAN_ETHERNET: case NM_LINK_TYPE_WWAN_ETHERNET:
@@ -2513,7 +2513,7 @@ platform_link_added_cb (NMPlatform *platform,
break; break;
default: default:
device = nm_device_generic_new (link); device = nm_device_generic_new (plink);
break; break;
} }
} }
@@ -2525,7 +2525,7 @@ platform_link_added_cb (NMPlatform *platform,
static void static void
platform_link_removed_cb (NMPlatform *platform, platform_link_removed_cb (NMPlatform *platform,
int ifindex, int ifindex,
NMPlatformLink *link, NMPlatformLink *plink,
NMPlatformReason reason, NMPlatformReason reason,
gpointer user_data) gpointer user_data)
{ {

View File

@@ -505,7 +505,7 @@ link_type_from_udev (NMPlatform *platform, int ifindex, int arptype, const char
} }
static gboolean static gboolean
link_is_software (struct rtnl_link *link) link_is_software (struct rtnl_link *rtnllink)
{ {
const char *type; const char *type;
@@ -514,11 +514,11 @@ link_is_software (struct rtnl_link *link)
* device causes. * device causes.
*/ */
if ( rtnl_link_get_arptype (link) == ARPHRD_INFINIBAND if ( rtnl_link_get_arptype (rtnllink) == ARPHRD_INFINIBAND
&& strchr (rtnl_link_get_name (link), '.')) && strchr (rtnl_link_get_name (rtnllink), '.'))
return TRUE; return TRUE;
type = rtnl_link_get_type (link); type = rtnl_link_get_type (rtnllink);
if (type == NULL) if (type == NULL)
return FALSE; return FALSE;
@@ -1646,7 +1646,7 @@ link_supports_vlans (NMPlatform *platform, int ifindex)
auto_nl_object struct rtnl_link *rtnllink = link_get (platform, ifindex); auto_nl_object struct rtnl_link *rtnllink = link_get (platform, ifindex);
const char *name = nm_platform_link_get_name (ifindex); const char *name = nm_platform_link_get_name (ifindex);
auto_g_free struct ethtool_gfeatures *features = NULL; auto_g_free struct ethtool_gfeatures *features = NULL;
int index, block, bit, size; int idx, block, bit, size;
/* Only ARPHRD_ETHER links can possibly support VLANs. */ /* Only ARPHRD_ETHER links can possibly support VLANs. */
if (!rtnllink || rtnl_link_get_arptype (rtnllink) != ARPHRD_ETHER) if (!rtnllink || rtnl_link_get_arptype (rtnllink) != ARPHRD_ETHER)
@@ -1655,14 +1655,14 @@ link_supports_vlans (NMPlatform *platform, int ifindex)
if (!name) if (!name)
return FALSE; return FALSE;
index = ethtool_get_stringset_index (name, ETH_SS_FEATURES, "vlan-challenged"); idx = ethtool_get_stringset_index (name, ETH_SS_FEATURES, "vlan-challenged");
if (index == -1) { if (idx == -1) {
debug ("vlan-challenged ethtool feature does not exist?"); debug ("vlan-challenged ethtool feature does not exist?");
return FALSE; return FALSE;
} }
block = index / 32; block = idx / 32;
bit = index % 32; bit = idx % 32;
size = block + 1; size = block + 1;
features = g_malloc0 (sizeof (*features) + size * sizeof (struct ethtool_get_features_block)); features = g_malloc0 (sizeof (*features) + size * sizeof (struct ethtool_get_features_block));