Avoid -Wshadow warnings from older gcc versions
authorJouni Malinen <j@w1.fi>
Thu, 25 Dec 2014 11:02:29 +0000 (13:02 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 26 Dec 2014 11:21:00 +0000 (13:21 +0200)
It looks like gcc 4.8.2 would warn about these with -Wshadow, but 4.6.3
did.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/crypto/aes-siv.c
src/drivers/driver_nl80211_capa.c
wpa_supplicant/scan.c

index bd619b4..ff4b823 100644 (file)
@@ -50,7 +50,7 @@ static void xorend(u8 *a, int alen, const u8 *b, int blen)
 }
 
 
-static void pad(u8 *pad, const u8 *addr, size_t len)
+static void pad_block(u8 *pad, const u8 *addr, size_t len)
 {
        os_memset(pad, 0, AES_BLOCK_SIZE);
        os_memcpy(pad, addr, len);
@@ -99,7 +99,7 @@ int aes_s2v(const u8 *key, size_t num_elem, const u8 *addr[],
        }
 
        dbl(tmp);
-       pad(tmp2, addr[i], len[i]);
+       pad_block(tmp2, addr[i], len[i]);
        xor(tmp, tmp2);
 
        return omac1_aes_128(key, tmp, sizeof(tmp), mac);
index 657f38c..330ebdf 100644 (file)
@@ -723,10 +723,10 @@ static int features_info_handler(struct nl_msg *msg, void *arg)
 static int check_feature(enum qca_wlan_vendor_features feature,
                         struct features_info *info)
 {
-       size_t index = feature / 8;
+       size_t idx = feature / 8;
 
-       return (index < info->flags_len) &&
-               (info->flags[index] & BIT(feature % 8));
+       return (idx < info->flags_len) &&
+               (info->flags[idx] & BIT(feature % 8));
 }
 
 
index 6f4ea08..b303760 100644 (file)
@@ -605,7 +605,7 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
 {
        struct wpa_supplicant *wpa_s = eloop_ctx;
        struct wpa_ssid *ssid;
-       int ret, p2p_in_progress;
+       int ret, p2p_in_prog;
        struct wpabuf *extra_ie = NULL;
        struct wpa_driver_scan_params params;
        struct wpa_driver_scan_params *scan_params;
@@ -658,8 +658,8 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
                return;
        }
 
-       p2p_in_progress = wpas_p2p_in_progress(wpa_s);
-       if (p2p_in_progress && p2p_in_progress != 2) {
+       p2p_in_prog = wpas_p2p_in_progress(wpa_s);
+       if (p2p_in_prog && p2p_in_prog != 2) {
                wpa_dbg(wpa_s, MSG_DEBUG, "Delay station mode scan while P2P operation is in progress");
                wpa_supplicant_req_scan(wpa_s, 5, 0);
                return;