From fbfe987ae83e91b1c53f84df815488708cdffa86 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Mon, 23 Jan 2017 17:21:43 -0600 Subject: [PATCH] netif: clean up remaining index shadowing from if APIs This commit cleans up the remaining instance of global variable "index" shadowing caused by using local variables and function parameters named "index" These were introduced in the recent interface index API commits --- src/core/netif.c | 6 +++--- src/include/lwip/netif.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/netif.c b/src/core/netif.c index d998288f..787e018e 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -1302,14 +1302,14 @@ netif_name_to_index(const char *name) * @param name char buffer of at least IF_NAMESIZE bytes */ char * -netif_index_to_name(u8_t index, char *name) +netif_index_to_name(u8_t idx, char *name) { struct netif *curif = netif_list; u8_t num; - if (index == 0) { + if (idx == 0) { return NULL; /* indexes start at 1 */ } - num = netif_index_to_num(index); + num = netif_index_to_num(idx); /* find netif from num */ while (curif != NULL) { diff --git a/src/include/lwip/netif.h b/src/include/lwip/netif.h index 6fd20a36..abd4e440 100644 --- a/src/include/lwip/netif.h +++ b/src/include/lwip/netif.h @@ -492,7 +492,7 @@ err_t netif_add_ip6_address(struct netif *netif, const ip6_addr_t *ip6addr, s8_t /* @ingroup netif */ u8_t netif_name_to_index(const char *name); -char * netif_index_to_name(u8_t index, char *name); +char * netif_index_to_name(u8_t idx, char *name); /* Interface indexes always start at 1 per RFC 3493, section 4, num starts at 0 */ #define netif_num_to_index(netif) ((netif)->num + 1)