From: Jihoon Kim Date: Mon, 24 Apr 2017 00:27:33 +0000 (+0900) Subject: Fix coding style X-Git-Tag: submit/tizen/20170605.004832~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=836c4061f87bfa415b518c26d65b261e59a3e685;p=platform%2Fcore%2Fuifw%2Fsmartreply.git Fix coding style Change-Id: I134cd04f3541d64d950fba52ffd55c54b64ece03 Signed-off-by: Jihoon Kim --- diff --git a/include/analyzer_iface.h b/include/analyzer_iface.h index 68da144..64d7454 100755 --- a/include/analyzer_iface.h +++ b/include/analyzer_iface.h @@ -37,9 +37,7 @@ namespace smr { virtual int read(const char* subject, smr::json option, smr::json* request_result) = 0; virtual int write(const char* subject, smr::json data, smr::json* request_result) = 0; - }; /* class analyzer_iface */ - } /* namespace smr */ #endif /* End of __SMARTREPLY_ANALYZER_INTERFACE_H__ */ diff --git a/include/event.h b/include/event.h index 698f17b..5576d22 100755 --- a/include/event.h +++ b/include/event.h @@ -48,7 +48,6 @@ class event_driven_thread { bool start(); bool stop(); bool is_running(); - }; /* class event_driven_thread */ #endif /* _EVENT_DRIVEN_THREAD_H_ */ diff --git a/include/json.h b/include/json.h index 29c444b..da2bc4a 100755 --- a/include/json.h +++ b/include/json.h @@ -26,7 +26,7 @@ #define _J(cmt, jobj) \ do { \ _SD("%s: %s", (cmt), jobj.str().c_str()); \ -} while(0) +} while (0) #define EMPTY_JSON_OBJECT "{}" #define DEFAULT_PRECISION 3 diff --git a/include/smartreply_util.h b/include/smartreply_util.h index 429d6b2..c7e97fb 100755 --- a/include/smartreply_util.h +++ b/include/smartreply_util.h @@ -32,11 +32,11 @@ /* * Internal Macros */ -#define SMARTREPLY_LOGD(fmt,args...) LOGD(fmt, ##args) -#define SMARTREPLY_LOGW(fmt,args...) LOGW(fmt, ##args) -#define SMARTREPLY_LOGI(fmt,args...) LOGI(fmt, ##args) -#define SMARTREPLY_LOGE(fmt,args...) LOGE(fmt, ##args) -#define SMARTREPLY_SECLOG(fmt,args...) SECURE_LOGD(fmt, ##args) +#define SMARTREPLY_LOGD(fmt, args...) LOGD(fmt, ##args) +#define SMARTREPLY_LOGW(fmt, args...) LOGW(fmt, ##args) +#define SMARTREPLY_LOGI(fmt, args...) LOGI(fmt, ##args) +#define SMARTREPLY_LOGE(fmt, args...) LOGE(fmt, ##args) +#define SMARTREPLY_SECLOG(fmt, args...) SECURE_LOGD(fmt, ##args) #define SMARTREPLY_CHECK_CONDITION(condition, error, msg) \ do { \ @@ -49,14 +49,14 @@ #define SMARTREPLY_NULL_ARG_CHECK_RETURN_FALSE(arg)\ do { \ - if(arg != NULL) { \ + if (arg != NULL) { \ } else { \ SMARTREPLY_LOGE("SMARTREPLY_ERROR_INVALID_PARAMETER"); \ return false; }; \ } while (0) #define SMARTREPLY_NULL_ARG_CHECK(arg) \ - SMARTREPLY_CHECK_CONDITION(arg != NULL,SMARTREPLY_ERROR_INVALID_PARAMETER,"SMARTREPLY_ERROR_INVALID_PARAMETER") + SMARTREPLY_CHECK_CONDITION(arg != NULL, SMARTREPLY_ERROR_INVALID_PARAMETER, "SMARTREPLY_ERROR_INVALID_PARAMETER") #define SMARTREPLY_PRINT_ERROR_CODE_RETURN(code) \ do{ \ diff --git a/include/types_internal.h b/include/types_internal.h index 6b29d7a..9594b3b 100755 --- a/include/types_internal.h +++ b/include/types_internal.h @@ -82,15 +82,15 @@ return SMARTREPLY_ERROR_INVALID_PARAMETER; \ } -#define SMR_MEM_DATA_CPY(dest,src,len,type) \ +#define SMR_MEM_DATA_CPY(dest, src, len, type) \ do{ \ - if(src!=NULL&&len>0) \ + if (src != NULL && len > 0) \ { \ dest = (type *) calloc (len+1 , sizeof (type)); \ assert(dest); \ memcpy(dest, src, len*sizeof(type)); \ } \ - } while(0); + } while (0); diff --git a/src/dbus_client.cpp b/src/dbus_client.cpp index ce09c50..3b27521 100755 --- a/src/dbus_client.cpp +++ b/src/dbus_client.cpp @@ -144,7 +144,7 @@ bool smr::dbus_client::init() guint reg_id = g_dbus_connection_register_object(dbus_connection, DBUS_PATH, dbus_node_info->interfaces[0], &vtable, NULL, NULL, &gerr); HANDLE_GERROR(gerr); - IF_FAIL_RETURN_TAG(reg_id>0, false, _E, "Object registration failed"); + IF_FAIL_RETURN_TAG(reg_id > 0, false, _E, "Object registration failed"); _I("Dbus connection established: %s", g_dbus_connection_get_unique_name(dbus_connection)); return true; @@ -174,7 +174,6 @@ namespace { void g_async_ready_callback(GObject *source_object, GAsyncResult *res, gpointer user_data) { - _I("g_async_ready_callback"); GError *err = NULL; diff --git a/src/dbus_client.h b/src/dbus_client.h index baa64cb..1e9ef31 100755 --- a/src/dbus_client.h +++ b/src/dbus_client.h @@ -33,7 +33,6 @@ namespace smr { int request_async(int type, int req_id, const char* subject, const char* input, void* ext, dbus_client_request_callback cb); int request(int type, int req_id, const char* subject, const char* input, std::string* req_result, std::string* data_read); int request_with_no_reply(int type, int req_id, const char* subject, const char* input); - }; /* classs smr::dbus_client */ } /* namespace smr */ diff --git a/src/event.cpp b/src/event.cpp index 99ba604..9c27c2f 100755 --- a/src/event.cpp +++ b/src/event.cpp @@ -104,7 +104,6 @@ void event_driven_thread::process_event_queue() event_message_s *event = NULL; while (g_atomic_int_get(&thread_info.is_running)) { - event = static_cast(g_async_queue_pop(thread_info.event_queue)); if (event) { @@ -116,6 +115,5 @@ void event_driven_thread::process_event_queue() delete event; } } - } } diff --git a/src/json.cpp b/src/json.cpp index aece126..c4b8f50 100755 --- a/src/json.cpp +++ b/src/json.cpp @@ -250,7 +250,7 @@ static char** tokenize_path(const char* path, int* length) return tokens; CATCH: - for (j=0; j(json_array_get_length(rarr)), false); - for (int i=0; irequest_with_no_reply(REQ_PREPARE_ENGINE, req_id, NULL, NULL); - - + _I("[prepare_engine():Client Get Result] Error: %#x", error); return error; } diff --git a/src/smartreply_service.cpp b/src/smartreply_service.cpp index 4977900..8593778 100755 --- a/src/smartreply_service.cpp +++ b/src/smartreply_service.cpp @@ -59,7 +59,6 @@ std::vector split(const std::string &s, char delim) { std::string check_null_str(const char* str, const char* def) { return std::string(str == NULL || (strlen(str) == 0) ? def : str); - } int _list_add_all(smartreply_reply_h** candidate_list, int* length, std::string result_str) @@ -133,7 +132,7 @@ EXPORT_API int smartreply_service_get_replies(const char* app_id, const char* sender, const char* message, smartreply_reply_h** candidate_list, int* length) { int start = getTime(); - + ASSERT_NOT_NULL(message); ASSERT_NOT_NULL(candidate_list); ASSERT_NOT_NULL(length); @@ -210,7 +209,7 @@ EXPORT_API int smartreply_service_get_nth_reply_message_with_type(smartreply_rep smartreply_message_s * _message; _message = (smartreply_message_s*)cursor->data; int len = strlen(_message->message); - + string action_msg = _message->message; //cout << action_msg << endl; if (isAction(action_msg)) { @@ -219,19 +218,18 @@ EXPORT_API int smartreply_service_get_nth_reply_message_with_type(smartreply_rep splitActionMessage(action_msg, atype, msg); //cout << atype << " " << msg << endl; SMR_MEM_DATA_CPY(temp, msg.c_str(), msg.length(), char); - *reply_str = temp; + *reply_str = temp; if (type != NULL) { SMR_MEM_DATA_CPY(temp, atype.c_str(), atype.length(), char); *type = temp; - } - } - else { + } + } else { SMR_MEM_DATA_CPY(temp, _message->message, len, char); *reply_str = temp; if (type != NULL) { SMR_MEM_DATA_CPY(temp, "TEXT", strlen("TEXT"), char); *type = temp; - } + } } return SMARTREPLY_ERROR_NONE; } @@ -283,7 +281,7 @@ const char* sender, const char* received_message, const char* replied_message) return err; } -EXPORT_API int smartreply_service_prepare_engine() +EXPORT_API int smartreply_service_prepare_engine() { int err = smr::request_handler::send_prepare_engine(); return err;