increase code quality 75/239675/1
authorYoungjae Shin <yj99.shin@samsung.com>
Wed, 29 Jul 2020 01:39:49 +0000 (10:39 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Wed, 29 Jul 2020 01:39:54 +0000 (10:39 +0900)
fix build warnings
add static to global variables

Change-Id: I4bfac0b5359b6c2bf08f76a97da1f9910bc206e8

common/common_ip_info.c
common/wlan_connection.c
common/wlan_manager.c
ui-gadget/view_advanced.c
ui-gadget/viewer_manager.c
wifi-syspopup/wifi-syspopup.c

index 2b1fa56..850ea10 100644 (file)
@@ -990,15 +990,14 @@ static bool __ap_foreach_ipv6_callback(char *ipv6_address, void *user_data)
                        ERROR_LOG(UG_NAME_ERR, "Failed to allocate memory");
                        return false;
                }
-               *buf[0] = '\0';
-               strncpy(*buf, ipv6_address, strlen(ipv6_address) + 1);
+               snprintf(*buf, strlen(ipv6_address) + 1, "%s", ipv6_address);
        } else {
+               int len = strlen(*buf);
                if (!(*buf = (char *)realloc(*buf, strlen(*buf) + strlen(ipv6_address) + 5))) {
                        ERROR_LOG(UG_NAME_ERR, "Failed to realloc memory");
                        return false;
                }
-               strncat(*buf, "<br>", 5);
-               strncat(*buf, ipv6_address, strlen(ipv6_address) + 1);
+               snprintf(*buf + len, len + strlen(ipv6_address) + 5, "<br>%s", ipv6_address);
        }
 
        return true;
index 64a5085..a646ef3 100644 (file)
@@ -30,8 +30,8 @@ struct wlan_connection {
 
 static wifi_manager_h *wifi_handle = NULL;
 
-static struct wlan_connection current_item = { NULL, NULL, NULL };
-static struct wlan_connection next_item = { NULL, NULL, NULL };
+static struct wlan_connection current_item;
+static struct wlan_connection next_item;
 
 static void wlan_connect_debug(wifi_manager_ap_h ap)
 {
index 9b7ebd5..579006c 100644 (file)
@@ -48,7 +48,7 @@ typedef struct {
        wifi_manager_ap_h *ap;
 } ap_state_info_t;
 
-wlan_mgr_req_data_t scan_req_data;
+static wlan_mgr_req_data_t scan_req_data;
 
 static void wlan_manager_register_cbs(void);
 static void wlan_manager_deregister_cbs(void);
index 3413e56..d21d3ba 100644 (file)
@@ -54,7 +54,7 @@ struct _private_data {
        Elm_Object_Item *item_install_cert;
 };
 
-struct _private_data g_pd;
+static struct _private_data g_pd;
 extern genlist_info_t g_genlist_info[WIFI_GENLIST_STYLE_MAX];
 extern content_size_info_t g_content_size_info;
 
index 739720f..61da062 100644 (file)
@@ -85,14 +85,14 @@ static Eina_Bool rotate_flag = EINA_FALSE;
 
 static bool show_more = TRUE;
 
-wifi_emulator_sample_s wifi_samples[] = {
+static wifi_emulator_sample_s wifi_samples[] = {
                {"datanetwork", WIFI_MANAGER_SECURITY_TYPE_WPA_PSK, 1},
                {"ureadyinternet", WIFI_MANAGER_SECURITY_TYPE_EAP, 0},
                {"uready", WIFI_MANAGER_SECURITY_TYPE_EAP, 1},
                {"setup", WIFI_MANAGER_SECURITY_TYPE_NONE, 0},
                {"Tizen", WIFI_MANAGER_SECURITY_TYPE_WPA2_PSK, 1},
 };
-int wifi_sample_count = sizeof(wifi_samples) / sizeof(wifi_samples[0]);
+static int wifi_sample_count = sizeof(wifi_samples) / sizeof(wifi_samples[0]);
 
 static void _hidden_button_callback(void* data, Evas_Object* obj, void* event_info);
 static void viewer_manager_hidden_confirm_cleanup(void);
@@ -709,7 +709,7 @@ static char *_gl_helper_text_get(void *data, Evas_Object *obj, const char *part)
        return det;
 }
 
-static char *_gl_helper_content_get(void *data, Evas_Object *obj, const char *part)
+static Evas_Object* _gl_helper_content_get(void *data, Evas_Object *obj, const char *part)
 {
        retvm_if(NULL == manager_object, NULL);
 
index 902eaf9..471160b 100644 (file)
@@ -55,7 +55,7 @@ typedef enum {
 
 wifi_object* devpkr_app_state = NULL;
 
-Ecore_Event_Handler* event_handler = NULL;
+static Ecore_Event_Handler* event_handler = NULL;
 
 static void __idle_lock_state_change_cb(keynode_t *node, void *user_data);