From 2249291fec7ae107aa6ef44ce15b223bdb573668 Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Thu, 27 Feb 2020 13:02:55 +0900 Subject: [PATCH] Handle parameter hidden warning #2 Local variable in swith-case, input, hides a parameter of the function process_input() Change-Id: I51c67f1baafd506f2e5d816fd282cbb3945a16e9 Signed-off-by: Cheoleun Moon --- test/wifi_direct_test.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/test/wifi_direct_test.c b/test/wifi_direct_test.c index cfd8247..27eecc6 100644 --- a/test/wifi_direct_test.c +++ b/test/wifi_direct_test.c @@ -1832,7 +1832,7 @@ void process_input(const char *input, gpointer user_data) case CMD_SET_CURRENT_WPS_MODE: if (ad != NULL) { wifi_direct_wps_type_e wps_mode; - int input; + int input_wps_mode; result = wifi_direct_get_req_wps_type(&wps_mode); switch (wps_mode) { @@ -1854,10 +1854,10 @@ void process_input(const char *input, gpointer user_data) printf("1. WIFI_DIRECT_WPS_TYPE_PBC\n"); printf("2. WIFI_DIRECT_WPS_TYPE_PIN_DISPLAY\n"); printf("3. WIFI_DIRECT_WPS_TYPE_PIN_KEYPAD\n"); - if (scanf(" %1d", &input) < 1) + if (scanf(" %1d", &input_wps_mode) < 1) break; - switch (input) { + switch (input_wps_mode) { case 1: wps_mode = WIFI_DIRECT_WPS_TYPE_PBC; break; @@ -2166,20 +2166,20 @@ void process_input(const char *input, gpointer user_data) case CMD_DEREGISTER_SERVICE: if (ad != NULL) { - int input; + int input_service_id; printf("Enter service id:\n"); - if (scanf(" %5d", &input) < 1) + if (scanf(" %5d", &input_service_id) < 1) break; - result = wifi_direct_deregister_service(input); + result = wifi_direct_deregister_service(input_service_id); printf("wifi_direct_deregister_service() result=[%d]\n", result); } break; case CMD_START_SERVICE_DISCOVERY: if (ad != NULL) { - int input; + int input_service_discovery; wifi_direct_service_type_e service_type = WIFI_DIRECT_SERVICE_TYPE_ALL; printf("Input service type:\n"); @@ -2188,11 +2188,11 @@ void process_input(const char *input, gpointer user_data) printf("3. WIFI_DIRECT_SERVICE_TYPE_UPNP\n"); printf("4. WIFI_DIRECT_SERVICE_TYPE_BT_ADDR\n"); printf("5. WIFI_DIRECT_SERVICE_TYPE_CONTACT_INFO\n"); - if (scanf(" %1d", &input) < 1) + if (scanf(" %1d", &input_service_discovery) < 1) break; - printf("input = %d\n", input); + printf("input = %d\n", input_service_discovery); - switch (input) { + switch (input_service_discovery) { case 1: service_type = WIFI_DIRECT_SERVICE_TYPE_ALL; break; @@ -2238,16 +2238,16 @@ void process_input(const char *input, gpointer user_data) case CMD_CANCEL_SERVICE_DISCOVERY: if (ad != NULL) { - int input; + int input_service_discovery; wifi_direct_service_type_e service_type = WIFI_DIRECT_SERVICE_TYPE_ALL; printf("Input service ID:\n"); - if (scanf(" %1d", &input) < 1) + if (scanf(" %1d", &input_service_discovery) < 1) break; - printf("input = %d\n", input); + printf("input = %d\n", input_service_discovery); - switch (input) { + switch (input_service_discovery) { case 1: service_type = WIFI_DIRECT_SERVICE_TYPE_ALL; break; -- 2.7.4