SVACE errors fixed. 10/74310/3
authorRadoslaw Czerski <r.czerski@samsung.com>
Tue, 14 Jun 2016 07:43:05 +0000 (09:43 +0200)
committerRadoslaw Czerski <r.czerski@samsung.com>
Tue, 14 Jun 2016 07:43:05 +0000 (09:43 +0200)
Change-Id: I430bfd6f12cb13108bb4c2afa50209cab86702d9
Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
src/modules/connection/connection.c
src/modules/information/mp3_playing.c
src/modules/information/toast_popup.c
src/modules/processing/downloading.c

index fa1b6aeddd3e8fcda0183cde21a5bb42243f977c..37a42d1ceeeb03eb72af674cee2ba4604a322f4e 100644 (file)
@@ -197,7 +197,7 @@ static void _view_icon_update_ps_network(telephony_network_ps_type_e ps_type, vo
 {
        icon_e icon = _icon_level_for_ps_network_type(ps_type);
 
-       if (icon != LEVEL_LAST) {
+       if (icon < LEVEL_LAST && icon >= LEVEL_MIN) {
                show_image_icon(icon);
                show_connection_transfer_icon(data);
        } else
@@ -212,7 +212,7 @@ static void _view_icon_update_network(telephony_network_service_state_e state,
        switch (state) {
                case TELEPHONY_NETWORK_SERVICE_STATE_IN_SERVICE:
                        icon = _icon_level_for_network_type(network_type);
-                       if (icon != LEVEL_LAST) {
+                       if (icon < LEVEL_LAST && icon >= LEVEL_MIN) {
                                show_image_icon(icon);
                                show_connection_transfer_icon(data);
                        } else
index 586b0f255e3b088fe7bd539fb576edb5db1aa9b8..58e9f442b135ba2032a2d458edb70e29bf94321f 100644 (file)
@@ -109,7 +109,6 @@ static void show_mp_icon(void* data)
 
        if (fp == NULL) {
                _E("Invalid file path!!");
-               fclose(fp);
                return;
        }
 
index 222ade8546ae40860a066cad06af18456a7329c8..5fc983f75d80781178e169970c21d3908e387e1e 100644 (file)
@@ -158,6 +158,8 @@ static void _post_toast_message_callback(const char *message, void *data)
                        s_info.toast_list = eina_list_append(s_info.toast_list, msg);
                }
        }
+       else
+               free(msg);
 
        return;
 }
index 9adfc5987b0312d28ce9ebe9d4408118c62758d1..e277ebd9091512b3f1df922ad266c7334abc2e10 100644 (file)
@@ -66,12 +66,12 @@ static Ecore_Timer *timer;
 static int icon_index = 0;
 static int updated_while_lcd_off = 0;
 
-static void set_app_state(voiddata)
+static void set_app_state(void *data)
 {
        downloading.ad = data;
 }
 
-static void show_image_icon(voiddata, int index)
+static void show_image_icon(void *data, int index)
 {
        downloading.img_obj.data = icon_path[index];
        icon_show(&downloading);
@@ -82,26 +82,22 @@ static void hide_image_icon(void)
        icon_hide(&downloading);
 }
 
-static Eina_Bool show_downloading_icon_cb(voiddata)
+static Eina_Bool show_downloading_icon_cb(void *data)
 {
 
-       show_image_icon(data,icon_index);
+       show_image_icon(data, icon_index);
        icon_index++;
        icon_index = (icon_index % ICON_NUM) ? icon_index : 0;
 
        return ECORE_CALLBACK_RENEW;
 }
 
-static void show_downloading_icon(voiddata)
+static void show_downloading_icon(void *data)
 {
-       if(timer==NULL)
-       {
+       if (timer == NULL)
                timer = ecore_timer_add(TIMER_INTERVAL, show_downloading_icon_cb, data);
-       }
        else
-       {
                _E("show_downloading_icon!, timer");
-       }
 }
 
 static void hide_downloading_icon(void)
@@ -118,31 +114,24 @@ static void hide_downloading_icon(void)
 
 static void indicator_downloading_change_cb(keynode_t *node, void *data)
 {
-       /*int status = 0;*/
-       int result = 0;
+       int status = 0;
+       int ret = 0;
 
        retm_if(data == NULL, "Invalid parameter!");
 
-       if(icon_get_update_flag()==0)
-       {
+       if (icon_get_update_flag() == 0) {
                updated_while_lcd_off = 1;
                return;
        }
        updated_while_lcd_off = 0;
 
-/*     if (vconf_get_int(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, &status) == 0)
-       {
-               result = result | status;
-       } else {
-               _E("Error getting VCONFKEY_WIFI_DIRECT_RECEIVING_STATE value");
-       }*/
+       ret = vconf_get_int(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, &status);
+       retm_if(ret != 0,"vconf_get_int failed");
 
-       if (result == 1) {
+       if (status == 1)
                show_downloading_icon(data);
-
-       } else {
+       else
                hide_downloading_icon();
-       }
 }
 
 static void indicator_downloading_pm_state_change_cb(keynode_t *node, void *data)
@@ -151,34 +140,27 @@ static void indicator_downloading_pm_state_change_cb(keynode_t *node, void *data
 
        retm_if(data == NULL, "Invalid parameter!");
 
-       if (vconf_get_int(VCONFKEY_PM_STATE, &status) < 0)
-       {
+       if (vconf_get_int(VCONFKEY_PM_STATE, &status) < 0) {
                _E("Error getting VCONFKEY_PM_STATE value");
 
-               if (timer != NULL)
-               {
+               if (timer != NULL) {
                        ecore_timer_del(timer);
                        timer = NULL;
                }
-
                return;
        }
 
-       if(status == VCONFKEY_PM_STATE_LCDOFF)
-       {
+       if (status == VCONFKEY_PM_STATE_LCDOFF)
                if (timer != NULL) {
                        ecore_timer_del(timer);
                        timer = NULL;
                }
-       }
 }
 
 static int wake_up_cb(void *data)
 {
        if(updated_while_lcd_off == 0 && downloading.obj_exist == EINA_FALSE)
-       {
                return OK;
-       }
 
        indicator_downloading_change_cb(NULL, data);
        return OK;
@@ -187,29 +169,31 @@ static int wake_up_cb(void *data)
 static int register_downloading_module(void *data)
 {
        int ret = 0;
-
        retvm_if(data == NULL, FAIL, "Invalid parameter!");
 
        set_app_state(data);
 
-//     ret = ret | vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, indicator_downloading_change_cb, data);
+       ret = vconf_notify_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE,
+                                                                               indicator_downloading_change_cb, data);
+       retvm_if(ret != 0, FAIL, "vconf_notify_key_changed failed");
 
-       ret = ret | vconf_notify_key_changed(VCONFKEY_PM_STATE,
-                                       indicator_downloading_pm_state_change_cb, data);
+       ret = vconf_notify_key_changed(VCONFKEY_PM_STATE,
+                                                                               indicator_downloading_pm_state_change_cb, data);
+       if(ret != 0) _E("vconf_notify_key_changed failed");
 
        indicator_downloading_change_cb(NULL, data);
 
-       return ret;
+       return OK;
 }
 
 static int unregister_downloading_module(void)
 {
        int ret = 0;
 
-//     ret = ret | vconf_ignore_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE, indicator_downloading_change_cb);
-
-       ret = ret | vconf_ignore_key_changed(VCONFKEY_PM_STATE,
-                                               indicator_downloading_pm_state_change_cb);
+       ret |= vconf_ignore_key_changed(VCONFKEY_WIFI_DIRECT_RECEIVING_STATE,
+                                                                               indicator_downloading_change_cb);
 
+       ret |= vconf_ignore_key_changed(VCONFKEY_PM_STATE,
+                                                                               indicator_downloading_pm_state_change_cb);
        return ret;
 }