From: junkyu han Date: Tue, 12 Sep 2017 11:45:20 +0000 (+0900) Subject: Fix Coding rule non-compliance X-Git-Tag: submit/tizen_4.0/20170912.114833^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a257832b1537c3c5c307866fec89a9432f4127e9;p=apps%2Fnative%2Fboot-animation.git Fix Coding rule non-compliance Change-Id: I3cd100b1f35fc9f4a72ee908ff6d9549dca6b0e8 --- diff --git a/src/animation.c b/src/animation.c index 6f2e222..8de3bba 100644 --- a/src/animation.c +++ b/src/animation.c @@ -92,9 +92,8 @@ 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; @@ -104,9 +103,8 @@ static void __animation_finished_cb(void *d, Evas_Object * obj, const char *e, c { if (s_animation.state == 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"); @@ -162,22 +160,21 @@ char *get_layout_file_name(int state, int w, int h) char file_name[1024]; int ret = 0; - if (state == TYPE_OFF) { + if (state == 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 { __E("There's no Image same with [%s], So set Default[720x1280] image", file_name); - if (state == TYPE_OFF) { + if (state == 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) { @@ -194,11 +191,10 @@ 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; - } } Evas_Object *create_layout(Evas_Object *win, const char *file_name) diff --git a/src/boot.c b/src/boot.c index afb8b8d..f52f393 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 db14398..dedc13c 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,7 @@ 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 8e948c6..26345b7 100755 --- a/test/feature_test/group_feature_on_off_animation.c +++ b/test/feature_test/group_feature_on_off_animation.c @@ -94,28 +94,25 @@ static void __case_start_off_animation(bool * is_passed) 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.on_off == TYPE_ON) { + if (s_info.on_off == TYPE_ON) return 4; - } else { + else return 3; - } } else if (w == 720 && h == 1280) { - if (s_info.on_off == TYPE_ON) { + if (s_info.on_off == TYPE_ON) return 7; - } else { + else return 3; - } } else { - if (s_info.on_off == TYPE_ON) { + if (s_info.on_off == TYPE_ON) return 7; - } else { + else return 3; - } } } @@ -149,9 +146,8 @@ static void __case_check_animation(bool * is_passed) elm_layout_file_get(layout, &file_name, NULL); TEST_ASSERT_EQUAL_STRING(get_layout_file_name(s_info.on_off, screen_w, screen_h), file_name); - if (s_info.current_step < __get_step_max(screen_w, screen_h)) { + if (s_info.current_step < __get_step_max(screen_w, screen_h)) s_info.current_case -= 1; - } s_info.current_step += 1; diff --git a/test/function_test/function_test.c b/test/function_test/function_test.c index 26fce35..083d711 100755 --- a/test/function_test/function_test.c +++ b/test/function_test/function_test.c @@ -31,9 +31,8 @@ static void __complete_group_cb(void) static void __run_next_group(void) { - if (s_info.group_starter_pool[s_info.current_group]) { + if (s_info.group_starter_pool[s_info.current_group]) TEST_GROUP(s_info.group_name[s_info.current_group], s_info.group_starter_pool[s_info.current_group], __complete_group_cb); - } } void function_test(void) diff --git a/test/unit/unit_test/unit_test_group_test/unit_test_group.c b/test/unit/unit_test/unit_test_group_test/unit_test_group.c index 186a7d5..aefcadd 100755 --- a/test/unit/unit_test/unit_test_group_test/unit_test_group.c +++ b/test/unit/unit_test/unit_test_group_test/unit_test_group.c @@ -40,9 +40,8 @@ void unit_test_group(void) static void __run_next_group(void) { - if (s_info.current_group >= 2) { + if (s_info.current_group >= 2) return ; - } unit_init(); TEST_GROUP(s_info.group_name[s_info.current_group], s_info.group_starter_pool[s_info.current_group], __complete_group_cb); @@ -50,11 +49,10 @@ static void __run_next_group(void) static void __complete_group_cb(void) { - if (s_info.current_group == 0) { + if (s_info.current_group == 0) __unit_test_run_group(0, 1, __unit_test_pass_group); - } else if (s_info.current_group == 1) { + else if (s_info.current_group == 1) __unit_test_run_group(0, 1, __unit_test_fail_group); - } s_info.current_group += 1; diff --git a/test/unit/unit_test/unit_test_main.c b/test/unit/unit_test/unit_test_main.c index fb51f03..987a322 100755 --- a/test/unit/unit_test/unit_test_main.c +++ b/test/unit/unit_test/unit_test_main.c @@ -46,9 +46,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; }