Fix the coding style errors 14/103314/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 8 Dec 2016 04:46:44 +0000 (13:46 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 8 Dec 2016 04:46:44 +0000 (13:46 +0900)
Change-Id: Iaadf5045dbfa5e9c2d77d4b58afcbf62a75a7ecd
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-event-handler.c
bt-api/bt-map-client.c
bt-service/bt-request-handler.c
bt-service/bt-service-map-client.c
include/bluetooth-api.h

index 9c86f26..523d440 100644 (file)
@@ -2017,9 +2017,8 @@ void __bt_map_client_event_filter(GDBusConnection *connection,
                                result, &dev_address,
                                event_info->cb, event_info->user_data);
 
-               if (result != BLUETOOTH_ERROR_NONE) {
+               if (result != BLUETOOTH_ERROR_NONE)
                        __bt_remove_push_request_id(request_id);
-               }
        } else if (strcasecmp(signal_name, BT_MAP_DISCONNECTED) == 0) {
                const char *address = NULL;
                int request_id = 0;
@@ -2119,7 +2118,7 @@ void __bt_map_client_event_filter(GDBusConnection *connection,
                                request_id, &fields_info,
                                event_info->cb, event_info->user_data);
 
-               while(--i >= 0) {
+               while (--i >= 0) {
                        free(fields_info.fields[i]);
                        fields_info.fields[i] = NULL;
                }
index d1b52cb..e7a15dd 100644 (file)
 #include "bt-dpm.h"
 #endif
 
-GVariant *__g_variant_new_array_split(char *str) {
+GVariant *__g_variant_new_array_split(char *str)
+{
        GVariantBuilder b;
        g_variant_builder_init(&b, (const GVariantType*) "a{s}");
        char *pos = str;
        char *item;
-       while ((item = strsep(&pos, ","))) {
+
+       while ((item = strsep(&pos, ",")))
                g_variant_builder_add(&b, "{s}", item);
-       }
+
        return g_variant_builder_end(&b);
 }
 
@@ -182,8 +184,7 @@ BT_EXPORT_API int bluetooth_map_client_list_folders(
        return result;
 }
 
-BT_EXPORT_API int bluetooth_map_client_list_filter_fields(
-    bt_map_client_session_info_s *session)
+BT_EXPORT_API int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session)
 {
        BT_DBG("bluetooth_map_client_list_filter_fields");
        int result = BLUETOOTH_ERROR_NONE;
@@ -209,10 +210,9 @@ BT_EXPORT_API int bluetooth_map_client_list_filter_fields(
        return result;
 }
 
-BT_EXPORT_API int bluetooth_map_client_list_messages(
-    bt_map_client_session_info_s *session,
-    const char *folder,
-    bt_map_client_list_messages_filter_t *filter)
+BT_EXPORT_API int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
+                       const char *folder,
+                       bt_map_client_list_messages_filter_t *filter)
 {
        BT_DBG("bluetooth_map_client_list_messages");
        int result = 0;
@@ -269,8 +269,7 @@ BT_EXPORT_API int bluetooth_map_client_list_messages(
        return result;
 }
 
-BT_EXPORT_API int bluetooth_map_client_update_inbox(
-    bt_map_client_session_info_s *session)
+BT_EXPORT_API int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session)
 {
        BT_DBG("bluetooth_map_client_update_inbox");
        int result = BLUETOOTH_ERROR_INTERNAL;
@@ -296,11 +295,10 @@ BT_EXPORT_API int bluetooth_map_client_update_inbox(
        return result;
 }
 
-BT_EXPORT_API int bluetooth_map_client_push_message(
-    bt_map_client_session_info_s *session,
-    const char *source_file,
-    const char *folder,
-    bt_map_client_push_message_args_t *args)
+BT_EXPORT_API int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
+                       const char *source_file,
+                       const char *folder,
+                       bt_map_client_push_message_args_t *args)
 {
        BT_DBG("Entered bluetooth_map_client_push_message");
        int result = 0;
@@ -341,13 +339,12 @@ BT_EXPORT_API int bluetooth_map_client_push_message(
        return result;
 }
 
-BT_EXPORT_API int bluetooth_map_client_get_message(
-    bt_map_client_session_info_s *session,
-    const bt_map_client_message_object_t message_object,
-    const char *target_file,
-    bool attachment)
+BT_EXPORT_API int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
+                       const bt_map_client_message_object_t message_object,
+                       const char *target_file,
+                       bool attachment)
 {
-    BT_DBG("Entered bluetooth_map_client_get_message");
+       BT_DBG("Entered bluetooth_map_client_get_message");
        int result = 0;
 
        BT_CHECK_ENABLED(return);
index 96bd1f6..b1b532c 100644 (file)
@@ -2266,9 +2266,8 @@ int __bt_obexd_request(int function_name,
                char *address = (char *)g_variant_get_data(in_param1);
                char *session_id = NULL;
                result = _bt_create_session_sync(address, &session_id);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        g_array_append_vals(*out_param1, session_id, strlen(session_id)+1);
-               }
                break;
        }
 
@@ -2276,9 +2275,8 @@ int __bt_obexd_request(int function_name,
                BT_DBG("BT_MAP_DESTROY_SESSION");
                char* session_id = (char *)g_variant_get_data(in_param1);
                result = _bt_destroy_session_sync(session_id);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        BT_DBG("successfully destroyed session");
-               }
                break;
        }
 
@@ -2297,9 +2295,9 @@ int __bt_obexd_request(int function_name,
                char* filter_serialized = (char*)g_variant_get_data(in_param2);
 
                result = _bt_map_client_list_folders(request_id, context, session_id, filter_serialized);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        BT_DBG("_bt_map_client_list_folders succeed");
-               }
+
                break;
        }
 
@@ -2309,9 +2307,9 @@ int __bt_obexd_request(int function_name,
                char* session_id = (char *)g_variant_get_data(in_param1);
 
                result = _bt_map_client_list_filter_fields(request_id, context, session_id);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        BT_DBG("_bt_map_client_list_filter_fields succeed");
-               }
+
                break;
        }
 
@@ -2323,11 +2321,11 @@ int __bt_obexd_request(int function_name,
                char* filter_serialized = (char*)g_variant_get_data(in_param3);
 
                result = _bt_map_client_list_messages(request_id, context, session_id, folder, filter_serialized);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        BT_DBG("_bt_map_client_list_messages succeed");
-               } else {
+               else
                        BT_DBG("_bt_map_client_list_messages failed");
-               }
+
                break;
        }
 
@@ -2348,11 +2346,11 @@ int __bt_obexd_request(int function_name,
 
                result = _bt_map_client_push_message(
                                request_id, context, session_id, source_file, folder, args_serialized);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        BT_DBG("_bt_map_client_push_message succeed");
-               } else {
+               else
                        BT_ERR("_bt_map_client_push_message failed");
-               }
+
                break;
        }
 
@@ -2367,9 +2365,8 @@ int __bt_obexd_request(int function_name,
 
                result = _bt_map_client_get_message(request_id, context, message_object,
                                target_file, attachment);
-               if (result == BLUETOOTH_ERROR_NONE) {
+               if (result == BLUETOOTH_ERROR_NONE)
                        BT_DBG("_bt_map_client_get_message succeed");
-               }
 
                break;
        }
@@ -2993,6 +2990,7 @@ gboolean __bt_service_check_privilege(int function_name,
        case BT_PXP_REPORTER_REGISTER:
        case BT_PXP_REPORTER_UNREGISTER:
        case BT_PXP_REPORTER_GET_PROPERTY:
+
        ret_val = cynara_check(p_cynara, client_creds, client_session, user_creds,
                                BT_PRIVILEGE_PLATFORM);
 
index 614178e..b436ee5 100644 (file)
@@ -268,11 +268,11 @@ int _bt_create_session_sync(const char* address, char** session_id)
        }
        retv_if(session_proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
 
-       GVariantBuilder* builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
+       GVariantBuilder* builder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
        g_variant_builder_add(builder, "{sv}", "Target",
                        g_variant_new("s", "map"));
        GVariant *args = g_variant_builder_end(builder);
-       g_variant_builder_unref (builder);
+       g_variant_builder_unref(builder);
        GVariant *param = g_variant_new("(s@a{sv})", address, args);
 
        char* string = g_variant_print (param, true);
@@ -688,7 +688,8 @@ int _bt_map_client_update_inbox(const char* session_id)
        return BLUETOOTH_ERROR_NONE;
 }
 
-void _bt_map_on_transfer_finished(const char* transfer_object_path, const int error) {
+void _bt_map_on_transfer_finished(const char *transfer_object_path, const int error)
+{
        BT_DBG("Entered _bt_map_on_transfer_finished");
        BT_DBG("Looking for transfer %s id", transfer_object_path);
 
@@ -696,9 +697,8 @@ void _bt_map_on_transfer_finished(const char* transfer_object_path, const int er
        GSList* transfer = NULL;
        for (transfer = transfer_list; transfer != NULL; transfer = g_slist_next(transfer)) {
                callback_data = transfer->data;
-               if (NULL == callback_data) {
+               if (NULL == callback_data)
                        continue;
-               }
 
                if (0 == strcmp(transfer_object_path, callback_data->transfer_path)) {
                        BT_DBG("request id FOUND - triggering event");
@@ -707,12 +707,12 @@ void _bt_map_on_transfer_finished(const char* transfer_object_path, const int er
 
                        int event = -1;
                        switch (callback_data->transfer_type) {
-                               case BT_MAP_TRANSFER_GET_MESSAGE:
-                                       event = BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE;
-                                       break;
-                               case BT_MAP_TRANSFER_PUSH_MESSAGE:
-                                       event = BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE;
-                                       break;
+                       case BT_MAP_TRANSFER_GET_MESSAGE:
+                               event = BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE;
+                               break;
+                       case BT_MAP_TRANSFER_PUSH_MESSAGE:
+                               event = BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE;
+                               break;
                        }
 
                        _bt_send_event(BT_MAP_CLIENT_EVENT, event, param);
index 624abb0..74d4541 100644 (file)
@@ -4925,32 +4925,23 @@ int bluetooth_obex_server_is_receiving(gboolean *is_receiving);
  *              BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n
  *              BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n
  *
- * @exception   None
+ * @exception None
  *
- * @remark       None
- * @see          bluetooth_map_client_deinit
+ * @remark None
+ * @see bluetooth_map_client_deinit
  */
 int bluetooth_map_client_init(void);
 
 int bluetooth_map_client_deinit(void);
 
-int bluetooth_map_client_create_session(
-   bt_map_client_session_info_s *session
-);
+int bluetooth_map_client_create_session(bt_map_client_session_info_s *session);
 
-int bluetooth_map_client_destroy_session(
-    bt_map_client_session_info_s *session
-);
+int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session);
 
-int bluetooth_map_client_set_folder(
-    bt_map_client_session_info_s *session,
-    const char *name
-);
+int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name);
 
-int bluetooth_map_client_list_folders(
-    bt_map_client_session_info_s *session,
-    bt_map_client_list_folders_filter_t *filter
-);
+int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session,
+                       bt_map_client_list_folders_filter_t *filter);
 
 /**
  * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
@@ -4966,33 +4957,23 @@ int bluetooth_map_client_list_folders(
  * @param[in]  session   Information about session.
  * @remark       None
  */
-int bluetooth_map_client_list_filter_fields(
-    bt_map_client_session_info_s *session
-);
-
-int bluetooth_map_client_list_messages(
-    bt_map_client_session_info_s *session,
-    const char *folder,
-    bt_map_client_list_messages_filter_t *filter
-);
-
-int bluetooth_map_client_update_inbox(
-    bt_map_client_session_info_s *session
-);
-
-int bluetooth_map_client_push_message(
-    bt_map_client_session_info_s *session,
-    const char *source_file,
-    const char *folder,
-    bt_map_client_push_message_args_t *args
-);
-
-int bluetooth_map_client_get_message(
-    bt_map_client_session_info_s *session,
-    const bt_map_client_message_object_t message_object,
-    const char *target_file,
-    bool attachment
-);
+int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session);
+
+int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session,
+                       const char *folder,
+                       bt_map_client_list_messages_filter_t *filter);
+
+int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session);
+
+int bluetooth_map_client_push_message(bt_map_client_session_info_s *session,
+                       const char *source_file,
+                       const char *folder,
+                       bt_map_client_push_message_args_t *args);
+
+int bluetooth_map_client_get_message(bt_map_client_session_info_s *session,
+                       const bt_map_client_message_object_t message_object,
+                       const char *target_file,
+                       bool attachment);
 
 
 /**