From: Radoslaw Czerski Date: Tue, 14 Jun 2016 07:43:05 +0000 (+0200) Subject: SVACE errors fixed. X-Git-Tag: submit/tizen/20160614.082623^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F10%2F74310%2F3;p=profile%2Fmobile%2Fapps%2Fnative%2Findicator.git SVACE errors fixed. Change-Id: I430bfd6f12cb13108bb4c2afa50209cab86702d9 Signed-off-by: Radoslaw Czerski --- diff --git a/src/modules/connection/connection.c b/src/modules/connection/connection.c index fa1b6ae..37a42d1 100644 --- a/src/modules/connection/connection.c +++ b/src/modules/connection/connection.c @@ -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 diff --git a/src/modules/information/mp3_playing.c b/src/modules/information/mp3_playing.c index 586b0f2..58e9f44 100644 --- a/src/modules/information/mp3_playing.c +++ b/src/modules/information/mp3_playing.c @@ -109,7 +109,6 @@ static void show_mp_icon(void* data) if (fp == NULL) { _E("Invalid file path!!"); - fclose(fp); return; } diff --git a/src/modules/information/toast_popup.c b/src/modules/information/toast_popup.c index 222ade8..5fc983f 100644 --- a/src/modules/information/toast_popup.c +++ b/src/modules/information/toast_popup.c @@ -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; } diff --git a/src/modules/processing/downloading.c b/src/modules/processing/downloading.c index 9adfc59..e277ebd 100644 --- a/src/modules/processing/downloading.c +++ b/src/modules/processing/downloading.c @@ -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(void* data) +static void set_app_state(void *data) { downloading.ad = data; } -static void show_image_icon(void* data, 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(void* data) +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(void* data) +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; }