Handle parameter hidden warning #2 16/226116/1 accepted/tizen/unified/20200228.123659 submit/tizen/20200227.123712
authorCheoleun Moon <chleun.moon@samsung.com>
Thu, 27 Feb 2020 04:02:55 +0000 (13:02 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Thu, 27 Feb 2020 04:03:01 +0000 (13:03 +0900)
Local variable in swith-case, input, hides a parameter of the function
process_input()

Change-Id: I51c67f1baafd506f2e5d816fd282cbb3945a16e9
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
test/wifi_direct_test.c

index cfd8247..27eecc6 100644 (file)
@@ -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;