From 5f577ce27531836497ce18f41cd409a011725562 Mon Sep 17 00:00:00 2001 From: "stom.hwang" Date: Thu, 14 Jul 2016 16:57:54 +0900 Subject: [PATCH] Fix - Coding rule Change-Id: I86fdafc6db812191d809a7903f7e1748f073f545 Signed-off-by: stom.hwang --- client/vc.c | 2 +- client/vc_mgr.c | 2 +- client/vc_mgr_dbus.c | 3 +-- common/vc_command.c | 6 +++--- common/vc_info_parser.c | 22 +++++++++++----------- include/voice_control_manager.h | 2 +- include/voice_control_plugin_engine.h | 2 +- server/vcd_recorder.c | 6 ++---- server/vcd_server.c | 14 +++++++------- 9 files changed, 28 insertions(+), 31 deletions(-) diff --git a/client/vc.c b/client/vc.c index 7410708..7ddecc3 100644 --- a/client/vc.c +++ b/client/vc.c @@ -133,7 +133,7 @@ static int __vc_check_privilege() SLOG(LOG_ERROR, TAG_VCC, "[ERROR] Permission is denied"); return VC_ERROR_PERMISSION_DENIED; } else if (-1 == g_privilege_allowed) { - if (false == __check_privilege_initialize()){ + if (false == __check_privilege_initialize()) { SLOG(LOG_ERROR, TAG_VCC, "[ERROR] privilege initialize is failed"); return VC_ERROR_PERMISSION_DENIED; } diff --git a/client/vc_mgr.c b/client/vc_mgr.c index 0623886..e3a2f21 100644 --- a/client/vc_mgr.c +++ b/client/vc_mgr.c @@ -1497,7 +1497,7 @@ int vc_mgr_get_nlp_info(char** info) int vc_mgr_set_pre_result_cb(vc_mgr_pre_result_cb callback, void* user_data) { - if (NULL == callback){ + if (NULL == callback) { SLOG(LOG_ERROR, TAG_VCM, "[ERROR] Set error callback : callback is NULL"); return VC_ERROR_INVALID_PARAMETER; } diff --git a/client/vc_mgr_dbus.c b/client/vc_mgr_dbus.c index 40f345e..93f4efd 100644 --- a/client/vc_mgr_dbus.c +++ b/client/vc_mgr_dbus.c @@ -240,8 +240,7 @@ static Eina_Bool vc_mgr_listener_event_callback(void* data, Ecore_Fd_Handler *fd if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCM, "<<<< vc mgr Get Error message : Get arguments error (%s)", err.message); dbus_error_free(&err); - } - else { + } else { SLOG(LOG_ERROR, TAG_VCM, "<<<< vc mgr Get Error message : reason(%d), daemon_pid(%d), msg(%s)", reason, daemon_pid, err_msg); __vc_mgr_cb_error(reason, daemon_pid, err_msg); } diff --git a/common/vc_command.c b/common/vc_command.c index c42e84e..ef433d4 100644 --- a/common/vc_command.c +++ b/common/vc_command.c @@ -110,13 +110,13 @@ static void __check_privilege_deinitialize() static int __vc_cmd_check_privilege() { - char uid[16]; + char uid[16]; if (0 == g_privilege_allowed) { SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Permission is denied"); return VC_ERROR_PERMISSION_DENIED; } else if (-1 == g_privilege_allowed) { - if (false == __check_privilege_initialize()){ + if (false == __check_privilege_initialize()) { SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] privilege initialize is failed"); return VC_ERROR_PERMISSION_DENIED; } @@ -454,7 +454,7 @@ int vc_cmd_list_filter_by_type(vc_cmd_list_h original, int type, vc_cmd_list_h* if (NULL != iter_cmd) { int iter_type; if (0 != vc_cmd_get_type((vc_cmd_h)iter_cmd, &iter_type)) { - SLOG(LOG_ERROR,TAG_VCCMD, "[ERROR] Fail to get command type"); + SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] Fail to get command type"); continue; } diff --git a/common/vc_info_parser.c b/common/vc_info_parser.c index 3b6095b..1f098f1 100644 --- a/common/vc_info_parser.c +++ b/common/vc_info_parser.c @@ -1278,19 +1278,19 @@ int vc_info_parser_get_nlp_info(char** nlp_info) } SLOG(LOG_DEBUG, vc_info_tag(), "[DEBUG] buffer size (%d)", readn); - if (10000000 < readn || 0 > readn) { - SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Invalid buffer size"); - fclose(fp); - return -1; - } - int tmp_readn = readn + 10; + if (10000000 < readn || 0 > readn) { + SLOG(LOG_DEBUG, vc_info_tag(), "[ERROR] Invalid buffer size"); + fclose(fp); + return -1; + } + int tmp_readn = readn + 10; *nlp_info = (char*)calloc(tmp_readn, sizeof(char)); - if (NULL == *nlp_info) { - SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Out of memory"); - fclose(fp); - return -1; - } + if (NULL == *nlp_info) { + SLOG(LOG_ERROR, vc_info_tag(), "[ERROR] Out of memory"); + fclose(fp); + return -1; + } readn = fread(*nlp_info, 1, readn, fp); fclose(fp); diff --git a/include/voice_control_manager.h b/include/voice_control_manager.h index 6cb1829..e6d80a4 100644 --- a/include/voice_control_manager.h +++ b/include/voice_control_manager.h @@ -117,7 +117,7 @@ typedef enum { VC_PRE_RESULT_EVENT_FINAL_RESULT = 0, VC_PRE_RESULT_EVENT_PARTIAL_RESULT, VC_PRE_RESULT_EVENT_ERROR -}vc_pre_result_event_e; +} vc_pre_result_event_e; // support pre-result typedef bool(*vc_mgr_pre_result_cb)(vc_pre_result_event_e event, const char* result, void *user_data); diff --git a/include/voice_control_plugin_engine.h b/include/voice_control_plugin_engine.h index c4322ea..0524a8c 100644 --- a/include/voice_control_plugin_engine.h +++ b/include/voice_control_plugin_engine.h @@ -127,7 +127,7 @@ typedef enum { VCP_PRE_RESULT_EVENT_FINAL_RESULT = 0, VCP_PRE_RESULT_EVENT_PARTIAL_RESULT, VCP_PRE_RESULT_EVENT_ERROR -}vcp_pre_result_event_e; +} vcp_pre_result_event_e; // Add new typedef void (*vcpe_pre_result_cb)(vcp_pre_result_event_e event, const char* pre_result, void *user_data); diff --git a/server/vcd_recorder.c b/server/vcd_recorder.c index 5e7f0d0..4996cea 100644 --- a/server/vcd_recorder.c +++ b/server/vcd_recorder.c @@ -542,8 +542,7 @@ int vcd_recorder_start() g_bt_extend_count = 0; #endif - } - else if (0 == strncmp(VCP_AUDIO_ID_MSF, g_current_audio_type, strlen(VCP_AUDIO_ID_MSF))) { + } else if (0 == strncmp(VCP_AUDIO_ID_MSF, g_current_audio_type, strlen(VCP_AUDIO_ID_MSF))) { SLOG(LOG_ERROR, TAG_VCD, "[Recorder] call RegisterMSFAudioCallback() function"); #ifdef TV_MSF_WIFI_MODE @@ -633,8 +632,7 @@ int vcd_recorder_stop() return VCD_ERROR_OPERATION_FAILED; } #endif - } - else if (0 == strncmp(VCP_AUDIO_ID_MSF, g_current_audio_type, strlen(VCP_AUDIO_ID_MSF))) { + } else if (0 == strncmp(VCP_AUDIO_ID_MSF, g_current_audio_type, strlen(VCP_AUDIO_ID_MSF))) { #ifdef TV_MSF_WIFI_MODE UnRegisterMSFAudioCallback(); stoped = true; diff --git a/server/vcd_server.c b/server/vcd_server.c index 748e548..e8ea19e 100644 --- a/server/vcd_server.c +++ b/server/vcd_server.c @@ -257,13 +257,13 @@ static Eina_Bool __vcd_send_selected_result(void *data) static int __convert_type_to_priority(vc_cmd_type_e type) { switch (type) { - case VC_COMMAND_TYPE_NONE: return 0; - case VC_COMMAND_TYPE_BACKGROUND: return 1; - case VC_COMMAND_TYPE_FOREGROUND: return 2; - case VC_COMMAND_TYPE_WIDGET: return 2; - case VC_COMMAND_TYPE_SYSTEM: return 3; - case VC_COMMAND_TYPE_EXCLUSIVE: return 3; - default: return 0; + case VC_COMMAND_TYPE_NONE: return 0; + case VC_COMMAND_TYPE_BACKGROUND: return 1; + case VC_COMMAND_TYPE_FOREGROUND: return 2; + case VC_COMMAND_TYPE_WIDGET: return 2; + case VC_COMMAND_TYPE_SYSTEM: return 3; + case VC_COMMAND_TYPE_EXCLUSIVE: return 3; + default: return 0; } } -- 2.7.4