fixed svace issues 54/244054/1 submit/tizen/20200914.132903
authoraman.jeph <aman.jeph@samsung.com>
Mon, 14 Sep 2020 10:24:25 +0000 (15:54 +0530)
committeraman.jeph <aman.jeph@samsung.com>
Mon, 14 Sep 2020 10:24:25 +0000 (15:54 +0530)
Change-Id: Iffd05b19a08131f79beefa9e29ef114b23098b1f
Signed-off-by: aman.jeph <aman.jeph@samsung.com>
src/datetime/util-time.c
src/media.c
src/minictrl/minictrl.c
src/settings/modules/bluetooth.c
src/settings/modules/dnd.c
src/settings/modules/softkey.c
src/settings/modules/voice-control.c
src/settings/modules/wifi.c

index 2dddd75edd12bed4bc5a6d2503507e781194c5bc..4a076720503576405c1d6b1d985b1eec19c03d5c 100755 (executable)
@@ -348,10 +348,10 @@ static i18n_udate_format_h __util_time_date_formatter_get(void *data, const char
        i18n_uchar u_timezone_id[BUF_FORMATTER] = {0,};
        if (timezone_id == NULL) {
                i18n_ustring_copy_ua_n(u_timezone_id, s_info.timezone_id, sizeof(u_timezone_id));
-               i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.dateregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
+               status = i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.dateregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
        } else {
                i18n_ustring_copy_ua_n(u_timezone_id, timezone_id, sizeof(u_timezone_id));
-               i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.dateregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
+               status = i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.dateregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
        }
        if (status != I18N_ERROR_NONE) {
                ERR("i18n_udate_create() failed");
@@ -379,10 +379,10 @@ static i18n_udate_format_h __util_time_ampm_formatter_get(void *data, const char
        i18n_uchar u_timezone_id[BUF_FORMATTER] = {0,};
        if (timezone_id == NULL) {
                i18n_ustring_copy_ua_n(u_timezone_id, s_info.timezone_id, sizeof(u_timezone_id));
-               i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
+               status = i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
        } else {
                i18n_ustring_copy_ua_n(u_timezone_id, timezone_id, sizeof(u_timezone_id));
-               i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
+               status = i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
        }
        if (status != I18N_ERROR_NONE) {
                ERR("i18n_udate_create() failed");
@@ -445,10 +445,10 @@ static i18n_udate_format_h __util_time_time_formatter_get(void *data, int time_f
        i18n_uchar u_timezone_id[BUF_FORMATTER] = {0,};
        if (timezone_id == NULL) {
                i18n_ustring_copy_ua_n(u_timezone_id, s_info.timezone_id, sizeof(u_timezone_id));
-               i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
+               status = i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
        } else {
                i18n_ustring_copy_ua_n(u_timezone_id, timezone_id, sizeof(u_timezone_id));
-               i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
+               status = i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, s_info.timeregion_format, u_timezone_id, -1, u_best_pattern, -1, &formatter);
        }
        if (status != I18N_ERROR_NONE) {
                ERR("i18n_udate_create() failed");
index 18febe05d358fe243a32a6326c2ba291c4535867..bef84b30818e7176b4d71bc6ebd549e76cc05031 100755 (executable)
@@ -226,7 +226,7 @@ HAPI int quickpanel_media_player_play(sound_type_e sound_type, const char *sound
        ERR("player_create finished");
 #endif
 
-       player_get_state(*sound_player, &state);
+       ret = player_get_state(*sound_player, &state);
        if (state > PLAYER_STATE_READY) {
                _quickpanel_player_free(sound_player);
                return ret;
@@ -255,10 +255,11 @@ HAPI int quickpanel_media_player_play(sound_type_e sound_type, const char *sound
                return ret;
        }
 
-       player_get_state(*sound_player, &state);
+       ret = player_get_state(*sound_player, &state);
        if (state != PLAYER_STATE_READY) {
                ERR("state of player is invalid %d", state);
                _quickpanel_player_free(sound_player);
+               ret = PLAYER_ERROR_INVALID_STATE;
                return ret;
        }
 
index 605cba017ac11a31f8c82448e47ffd61abab6cf1..b5288971386767794e77bedca129ad29b9a2d1b9 100755 (executable)
@@ -230,6 +230,12 @@ static void _mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_in
 
        ev = (Evas_Event_Mouse_Down *)event_info;
 
+       if(ev == NULL)
+       {
+               ERR("Evas_Event_Mouse_Down data is null, can't process event");
+               return;
+       }
+
        /** this is done to stop the flick animation when dragging the slider in mini-controller 
         *  as the slider is not created by quickpanel it is part of widget viewer..quickpanel doesn't have access to slider object.
         *  so we have to estimate the slider area, whenever the drag start from slider we freeze the scroller to stop animation.
@@ -247,8 +253,8 @@ static void _mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_in
 
        vit = evas_object_data_get(obj, MINICONTROL_VIEW_DATA);
 
-       if (!ev || !vit) {
-               ERR("ev %p, vit %p", ev, vit);
+       if (!vit) {
+               ERR("vit %p", vit);
                return;
        }
 
@@ -657,12 +663,12 @@ static void _minictrl_lock(const char *name)
 
 static void _mctrl_viewer_event_cb(minicontrol_event_e event, const char *name, bundle *event_arg, void *data)
 {
-       struct appdata *ad;
-       int ret;
-       int *width;
-       int *height;
-       int _width;
-       int _height;
+       struct appdata *ad = NULL;
+       int ret = BUNDLE_ERROR_NONE;
+       int _width = 0;
+       int _height = 0;
+       int *width = &_width;
+       int *height = &_height;
        size_t bundle_size;
 
        if (!data || !name) {
@@ -689,14 +695,12 @@ static void _mctrl_viewer_event_cb(minicontrol_event_e event, const char *name,
                        if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) {
                                ERR("Failed to get bundle value(width) %d : %d", ret, bundle_size);
                                _width = 0;
-                               width = &_width;
                        }
 
                        ret = bundle_get_byte(event_arg, MINICONTROL_BUNDLE_KEY_HEIGHT, (void **)&height, &bundle_size);
                        if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) {
                                ERR("Failed to get bundle value(height) : %d", ret);
                                _height = 0;
-                               height = &_height;
                        }
 
                        DBG("Name: %s, Size: %dx%d", name, *width, *height);
@@ -707,14 +711,12 @@ static void _mctrl_viewer_event_cb(minicontrol_event_e event, const char *name,
                        if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) {
                                ERR("Failed to get bundle value(width) %d : %d", ret, bundle_size);
                                _width = 0;
-                               width = &_width;
                        }
 
                        ret = bundle_get_byte(event_arg, MINICONTROL_BUNDLE_KEY_HEIGHT, (void **)&height, &bundle_size);
                        if (ret != BUNDLE_ERROR_NONE || bundle_size != sizeof(int)) {
                                ERR("Failed to get bundle value(height) : %d", ret);
                                _height = 0;
-                               height = &_height;
                        }
 
                        DBG("Name: %s, Size: %dx%d", name, *width, *height);
index 81e18b97b6285a5a06978ff60a5d3bf030d0c1ac..0ffb7c8d4a7bf0870d927e895d5cab5dac191e72 100755 (executable)
@@ -75,7 +75,7 @@ static void _long_press_cb(void *data)
 static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
 {
        Evas_Object *image = NULL;
-       const char *icon_path = NULL;
+       const char *icon_path = BUTTON_ICON_NORMAL;
 
        quickpanel_setting_icon_state_set(view, state);
 
@@ -91,9 +91,6 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla
                icon_path = BUTTON_ICON_NORMAL;
        }
 
-       if (icon_path == NULL)
-               icon_path = BUTTON_ICON_NORMAL;
-
        image = quickpanel_setting_icon_image_new(view, icon_path);
        quickpanel_setting_icon_content_set(view, image);
        quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state);
index 6fe17574aac14e294e0ae6d5ddbc13bb940922d0..39e8119e921230614b06c4b9d8ecf2a8bb2a7781 100755 (executable)
@@ -132,7 +132,7 @@ static void _long_press_cb(void *data)
 static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
 {
        Evas_Object *image = NULL;
-       const char *icon_path = NULL;
+       const char *icon_path = BUTTON_ICON_NORMAL;
 
        quickpanel_setting_icon_state_set(view, state);
 
@@ -148,9 +148,6 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla
                icon_path = BUTTON_ICON_NORMAL;
        }
 
-       if (icon_path == NULL)
-               icon_path = BUTTON_ICON_NORMAL;
-
        image = quickpanel_setting_icon_image_new(view, icon_path);
        quickpanel_setting_icon_content_set(view, image);
        quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state);
index 5f341f1c250c3942c3fd567496115e7d02682620..f0d800880baba10962d7b658126921c864660b08 100755 (executable)
@@ -68,7 +68,7 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla
 {\r
        DBG(">>> view_update , state = %d",state);\r
        Evas_Object *image = NULL;\r
-       const char *icon_path = NULL;\r
+       const char *icon_path = BUTTON_ICON_NORMAL;\r
 \r
        quickpanel_setting_icon_state_set(view, state);\r
 \r
@@ -84,9 +84,6 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla
                icon_path = BUTTON_ICON_NORMAL;\r
        }\r
 \r
-       if (icon_path == NULL)\r
-               icon_path = BUTTON_ICON_NORMAL;\r
-\r
        image = quickpanel_setting_icon_image_new(view, icon_path);\r
        quickpanel_setting_icon_content_set(view, image);\r
        quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state);\r
index db991a3f0d19568c4d36b14e2d00917d1c5ded21..439b6bac9dd8bd04d9ca57fc2ef81d8904c60e65 100755 (executable)
@@ -61,11 +61,11 @@ static int _check_dead_signal(int pid, void *data)
        if(pid == vcpid) {
                DBG("pid = %d and vcpid = %d",pid,vcpid);
                QP_Module_Setting *module = (QP_Module_Setting *)data;
-               DBG("name of module = %s",module->name);
                if(module == NULL) {
                        ERR("module is NULL");
                        return 0;
                }
+               DBG("name of module = %s",module->name);
                DBG(" check_dead_signal, setting the module icon state to 0");
                quickpanel_setting_module_icon_state_set(module, 0);
                quickpanel_setting_module_icon_view_update(module ,0,FLAG_VALUE_VOID);
@@ -101,7 +101,7 @@ static void _long_press_cb(void *data)
 static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
 {
        Evas_Object *image = NULL;
-       const char *icon_path = NULL;
+       const char *icon_path = BUTTON_ICON_NORMAL;
 
        quickpanel_setting_icon_state_set(view, state);
 
@@ -117,9 +117,6 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla
                icon_path = BUTTON_ICON_NORMAL;
        }
 
-       if (icon_path == NULL)
-               icon_path = BUTTON_ICON_NORMAL;
-
        image = quickpanel_setting_icon_image_new(view, icon_path);
        quickpanel_setting_icon_content_set(view, image);
        quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state);
index 652f221c14b4b8c28804bcec74ab140898d8bb09..64b1f53b0f11a93efb5b399233f2d34c435d3e5f 100755 (executable)
@@ -85,7 +85,7 @@ static void _long_press_cb(void *data)
 static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
 {
        Evas_Object *image = NULL;
-       const char *icon_path = NULL;
+       const char *icon_path = BUTTON_ICON_NORMAL;
 
        quickpanel_setting_icon_state_set(view, state);
 
@@ -101,9 +101,6 @@ static void _view_update(Evas_Object *view, int state, int flag_extra_1, int fla
                icon_path = BUTTON_ICON_NORMAL;
        }
 
-       if (icon_path == NULL)
-               icon_path = BUTTON_ICON_NORMAL;
-
        image = quickpanel_setting_icon_image_new(view, icon_path);
        quickpanel_setting_icon_content_set(view, image);
        quickpanel_setting_icon_text_set(view, BUTTON_LABEL, state);