From 5553af07eddf655cfa6f07daf8d058a128df7f92 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Tue, 15 Nov 2016 21:28:18 +0900 Subject: [PATCH] Fix coding rule issue Change-Id: Ibaff504c0082da59e4c7c83ba1fd48739e613871 Signed-off-by: sooyeon.kim --- common/vc_cmd_db.c | 32 +++++++++++++++----------------- common/vc_json_parser.c | 2 +- include/voice_control_common.h | 2 +- include/voice_control_plugin_engine.h | 2 +- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/common/vc_cmd_db.c b/common/vc_cmd_db.c index 240928a..00c7ce4 100755 --- a/common/vc_cmd_db.c +++ b/common/vc_cmd_db.c @@ -52,7 +52,7 @@ const char* vc_db_tag() * */ -#define FREE_MEM(X) {if (NULL != X) {free(X); X = NULL;}} +#define FREE_MEM(X) {if (NULL != X) {free(X); X = NULL; } } //#define DB_PATH tzplatform_mkpath(TZ_USER_DB, ".vc_info.db") @@ -65,14 +65,12 @@ static int __vc_db_transaction(const char* transaction) sqlite3_stmt* pStmt = NULL; int ret = sqlite3_prepare_v2(db_handle, transaction, -1, &pStmt, NULL); - if (ret != SQLITE_OK) - { + if (ret != SQLITE_OK) { SLOG(LOG_ERROR, vc_db_tag(), "sqlite3_prepare_v2: transaction(%s), ret(%d), err(%s)", transaction, ret, sqlite3_errmsg(db_handle)); return VC_DB_ERROR_OPERATION_FAILED; } - if (sqlite3_step(pStmt) != SQLITE_DONE) - { + if (sqlite3_step(pStmt) != SQLITE_DONE) { SLOG(LOG_ERROR, vc_db_tag(), "sqlite3_step: transaction(%s), ret(%d), err(%s)", transaction, ret, sqlite3_errmsg(db_handle)); sqlite3_finalize(pStmt); return VC_DB_ERROR_OPERATION_FAILED; @@ -290,7 +288,7 @@ static int __vc_db_get_commands(int pid, vc_cmd_type_e type, GSList** cmd_list) SLOG(LOG_ERROR, vc_db_tag(), "sqlite3_bind_int: %s", sqlite3_errmsg(db_handle)); return VC_DB_ERROR_OPERATION_FAILED; } - if (VC_COMMAND_TYPE_BACKGROUND != type ) { + if (VC_COMMAND_TYPE_BACKGROUND != type) { ret = sqlite3_bind_int(stmt, 2, pid); if (ret != SQLITE_OK) { SLOG(LOG_ERROR, vc_db_tag(), "sqlite3_bind_int: %s", sqlite3_errmsg(db_handle)); @@ -1032,20 +1030,20 @@ int vc_db_initialize(void) } if (lstat(path, &stat) < 0) { - char buf_err[256]; - SLOG(LOG_ERROR, vc_db_tag(), "%s", strerror_r(errno, buf_err, sizeof (buf_err))); - if (db_handle) - db_util_close(db_handle); - db_handle = NULL; - return VC_DB_ERROR_OPERATION_FAILED; + char buf_err[256]; + SLOG(LOG_ERROR, vc_db_tag(), "%s", strerror_r(errno, buf_err, sizeof(buf_err))); + if (db_handle) + db_util_close(db_handle); + db_handle = NULL; + return VC_DB_ERROR_OPERATION_FAILED; } if (!S_ISREG(stat.st_mode)) { - SLOG(LOG_ERROR, vc_db_tag(), "[ERROR] S_ISREG failed"); - if (db_handle) - db_util_close(db_handle); - db_handle = NULL; - return VC_DB_ERROR_OPERATION_FAILED; + SLOG(LOG_ERROR, vc_db_tag(), "[ERROR] S_ISREG failed"); + if (db_handle) + db_util_close(db_handle); + db_handle = NULL; + return VC_DB_ERROR_OPERATION_FAILED; } if (!stat.st_size) { diff --git a/common/vc_json_parser.c b/common/vc_json_parser.c index 4c99231..748a607 100755 --- a/common/vc_json_parser.c +++ b/common/vc_json_parser.c @@ -328,7 +328,7 @@ static int __vc_json_set_commands(JsonObject *root_obj, int type, char* invocati if (VC_ERROR_NONE != ret) { SLOG(LOG_ERROR, vc_json_tag(), "[ERROR] Fail to insert command into db, type(%s), command(%s)", temp_type, temp_text); if (NULL != cmd->command) free(cmd->command); - if (NULL != cmd->appid) free(cmd->appid); + if (NULL != cmd->appid) free(cmd->appid); if (NULL != cmd->invocation_name) free(cmd->invocation_name); free(temp_type); free(prev_appid); diff --git a/include/voice_control_common.h b/include/voice_control_common.h index c81f5df..c938da2 100644 --- a/include/voice_control_common.h +++ b/include/voice_control_common.h @@ -125,7 +125,7 @@ typedef void (*vc_current_language_changed_cb)(const char* previous, const char* * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * * @param[in] language A language is specified as an ISO 3166 alpha-2 two letter country-code \n - * followed by ISO 639-1 for the two-letter language code. \n + * followed by ISO 639-1 for the two-letter language code. \n * For example, "ko_KR" for Korean, "en_US" for American English. * @param[in] user_data The user data passed from the foreach function * diff --git a/include/voice_control_plugin_engine.h b/include/voice_control_plugin_engine.h index a9d573b..c6c3ab5 100644 --- a/include/voice_control_plugin_engine.h +++ b/include/voice_control_plugin_engine.h @@ -124,7 +124,7 @@ typedef enum { VCP_ASR_RESULT_EVENT_FINAL_RESULT = 0, VCP_ASR_RESULT_EVENT_PARTIAL_RESULT, VCP_ASR_RESULT_EVENT_ERROR -}vcp_asr_result_event_e; +} vcp_asr_result_event_e; /** * @brief A structure of handle for VC command -- 2.7.4