From 221d1927c7120467566e4440d42f1b2bd025d108 Mon Sep 17 00:00:00 2001 From: junkyu han Date: Wed, 20 Dec 2017 14:30:05 +0900 Subject: [PATCH] Fix coding rule disobey Change-Id: I91c04ea0e91173c5ca8736fe0f3438de3a9e8229 --- src/animation.c | 27 ++++++++++------------ src/boot.c | 10 ++++---- src/boot_sound.c | 6 ++--- test/feature_test/group_feature_on_off_animation.c | 24 ++++++++----------- .../unit_test_log_buf_function.c | 2 +- test/unit/unit_test/unit_test_main.c | 3 +-- 6 files changed, 31 insertions(+), 41 deletions(-) diff --git a/src/animation.c b/src/animation.c index a222386..d9abd8b 100755 --- a/src/animation.c +++ b/src/animation.c @@ -99,9 +99,9 @@ static Eina_Bool __end_cb(void *data) __block_display(); } else { __D("EXIT on BOOTING"); - if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) { + if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) __E("Failed to set finished set"); - } + boot_exit(); } return ECORE_CALLBACK_CANCEL; @@ -111,9 +111,9 @@ static void __animation_finished_cb(void *d, Evas_Object * obj, const char *e, c { if (s_animation.animation_type == TYPE_OFF) { __D("TYPE OFF"); - if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) { + if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) __E("Failed to set finished set"); - } + ecore_timer_add(1, __end_cb, (void *)TYPE_OFF); } else { __D("TYPE_ON"); @@ -160,22 +160,20 @@ static char * __get_layout_file_name(int animation_type, int w, int h) char file_name[1024]; int ret = 0; - if (animation_type == TYPE_OFF) { + if (animation_type == TYPE_OFF) snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOff.edj", w, h); - } else { + else snprintf(file_name, sizeof(file_name), FILE_PATH"%dx%d_PowerOn.edj", w, h); - } + __D("File name for Animation is: %s", file_name); ret = access(file_name, 0); - if (ret == 0) { - } else { + if (ret != 0) { __E("There's no Image same with [%s], So set Default[720x1280] image", file_name); - if (animation_type == TYPE_OFF) { + if (animation_type == TYPE_OFF) snprintf(file_name, sizeof(file_name), "%s", DEFAULT_OFF); - } else { + else snprintf(file_name, sizeof(file_name), "%s", DEFAULT_ON); - } ret = access(file_name, 0); if (ret) { @@ -192,11 +190,10 @@ static Eina_Bool __is_layout_file_exist(const char *file_name) int ret = 0; ret = access(file_name, 0); - if (ret == 0) { + if (ret == 0) return EINA_TRUE; - } else { + else return EINA_FALSE; - } } int animation_init(int animation_type) diff --git a/src/boot.c b/src/boot.c index bf02c70..d55a9fc 100755 --- a/src/boot.c +++ b/src/boot.c @@ -50,9 +50,8 @@ static int __check_on_off_type(void *user_data) argc = args->argc; argv = args->argv; - for (i = 0; i < argc; i++) { + for (i = 0; i < argc; i++) __D("argc %d [%s]", i, argv[i]); - } while ((c = getopt_long(argc, argv, "sopc", long_options, NULL)) >= 0) { @@ -101,9 +100,9 @@ int main(int argc, char *argv[]) args.argv = argv; static int invoked_flag = 0; - if (invoked_flag == 1) { + if (invoked_flag == 1) return -1; - } + invoked_flag = 1; close(1); @@ -125,9 +124,8 @@ int main(int argc, char *argv[]) return 1; } - if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 0) != 0) { + if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 0) != 0) __D("Failed to set finished value to 0\n"); - } play_boot_sound(boot_type); diff --git a/src/boot_sound.c b/src/boot_sound.c index 4127bff..eaf6161 100755 --- a/src/boot_sound.c +++ b/src/boot_sound.c @@ -41,9 +41,8 @@ static int __get_sound_status(void) { int soundon = 1; - if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &soundon) < 0) { + if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &soundon) < 0) __D("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!"); - } __D("Sound status: %d", soundon); @@ -52,7 +51,8 @@ static int __get_sound_status(void) void play_boot_sound(int boot_type) { - if(!is_supported) return ; + if (!is_supported) + return; int soundon = __get_sound_status(); if (soundon) { diff --git a/test/feature_test/group_feature_on_off_animation.c b/test/feature_test/group_feature_on_off_animation.c index 567be2b..826035c 100755 --- a/test/feature_test/group_feature_on_off_animation.c +++ b/test/feature_test/group_feature_on_off_animation.c @@ -57,28 +57,25 @@ static void __tear_down(void) static int __get_step_max(int w, int h) { - if (w == 360 && h == 360) { + if (w == 360 && h == 360) return 3; - } else if (w == 360 && h == 480) { + else if (w == 360 && h == 480) return 3; - } else if (w == 480 && h == 800) { - if (s_info.animation_type == TYPE_ON) { + else if (w == 480 && h == 800) { + if (s_info.animation_type == TYPE_ON) return 4; - } else { + else return 3; - } } else if (w == 720 && h == 1280) { - if (s_info.animation_type == TYPE_ON) { + if (s_info.animation_type == TYPE_ON) return 7; - } else { + else return 3; - } } else { - if (s_info.animation_type == TYPE_ON) { + if (s_info.animation_type == TYPE_ON) return 7; - } else { + else return 3; - } } } @@ -153,9 +150,8 @@ static unit_case_func_t __continue_check_animation_layout(void *data) free(expected_file_name); int current_step = (int)data; - if (current_step < __get_step_max(screen_w, screen_h)) { + if (current_step < __get_step_max(screen_w, screen_h)) TEST_CASE_CONTINUE(0.8, __continue_check_animation_layout, (void*)(current_step + 1)); - } if (s_info.animation_type == TYPE_ON) TEST_CASE_CONTINUE(0.8, __continue_check_finish_on_animation, NULL); diff --git a/test/unit/unit_test/unit_test_function_test/unit_test_log_buf_function.c b/test/unit/unit_test/unit_test_function_test/unit_test_log_buf_function.c index db5230a..629d889 100755 --- a/test/unit/unit_test/unit_test_function_test/unit_test_log_buf_function.c +++ b/test/unit/unit_test/unit_test_function_test/unit_test_log_buf_function.c @@ -27,7 +27,7 @@ static Eina_Bool __unit_test_clear_log(void); void unit_test_log_buf_function(void) { - __unit_test_run_function( __unit_test_write_log() == EINA_TRUE); + __unit_test_run_function(__unit_test_write_log() == EINA_TRUE); __unit_test_run_function(__unit_test_clear_log() == EINA_TRUE); } diff --git a/test/unit/unit_test/unit_test_main.c b/test/unit/unit_test/unit_test_main.c index 66f916b..4f18069 100755 --- a/test/unit/unit_test/unit_test_main.c +++ b/test/unit/unit_test/unit_test_main.c @@ -62,9 +62,8 @@ int main(int argc, char *argv[]) lifecycle_callback.terminate = __terminate; int ret = ui_app_main(argc, argv, &lifecycle_callback, NULL); - if (ret != APP_ERROR_NONE) { + if (ret != APP_ERROR_NONE) __T("app_main() is failed. err = %d", ret); - } return 0; } -- 2.7.4