Fix tizen coding style errors and warnings 35/149335/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 12 Sep 2017 05:48:25 +0000 (14:48 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 12 Sep 2017 06:01:06 +0000 (15:01 +0900)
Change-Id: I04805324de92c440fd0d5cab82b039ce733cff02
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-api/bt-event-handler.c
bt-api/bt-gatt-client.c
bt-otp/bt-otpserver.c
bt-service/bt-service-agent.c
bt-service/bt-service-otp.c
bt-service/include/bt-service-common.h
include/bluetooth-api.h
include/plugin.h
plugin/headed.c

index f1cb967..8e2a0f7 100644 (file)
@@ -3084,9 +3084,8 @@ static void __bt_otp_event_filter(GDBusConnection *connection,
                                result, info,
                                event_info->cb, event_info->user_data);
 
-               if (info->handle) {
+               if (info->handle)
                        g_free(info->handle);
-               }
 
                if (info->data) {
                        g_free(info->data);
@@ -3137,9 +3136,8 @@ static void __bt_otp_event_filter(GDBusConnection *connection,
                                result,  ind_res,
                                event_info->cb, event_info->user_data);
 
-               if (ind_res->handle) {
+               if (ind_res->handle)
                        g_free(ind_res->handle);
-               }
 
                if (ind_res->data) {
                        g_free(ind_res->data);
index ba8f797..dfca5e9 100644 (file)
@@ -136,9 +136,8 @@ BT_EXPORT_API int bluetooth_gatt_set_service_change_watcher(
                        return BLUETOOTH_ERROR_NONE;
                }
 
-               if (service_monitor_list == NULL) {
+               if (service_monitor_list == NULL)
                        _bt_register_manager_subscribe_signal(TRUE);
-               }
 
                addr = g_malloc0(sizeof(bluetooth_device_address_t));
                memcpy(addr, address, sizeof(bluetooth_device_address_t));
index 4de7302..7693b12 100644 (file)
@@ -210,9 +210,8 @@ void _bt_otp_exit(void)
        if (ret != BLUETOOTH_ERROR_NONE)
                BT_ERR("Failed to stop ADV %d", ret);
 
-       if (main_loop != NULL) {
+       if (main_loop != NULL)
                g_main_loop_quit(main_loop);
-       }
 }
 
 static void _bt_otp_set_char_value(const char *obj_path,
@@ -700,9 +699,8 @@ static void _bt_otp_method(GDBusConnection *connection,
                        goto fail;
                }
 
-               while ((filename = g_dir_read_name(dir))) {
+               while ((filename = g_dir_read_name(dir)))
                        list = g_slist_append(list, (gpointer) filename);
-               }
 
                g_dir_close(dir);
 
@@ -1789,9 +1787,8 @@ int _bt_otp_read_cb(const char *obj_path, char **value, int *len, uint16_t offse
        }
 
        if (g_strcmp0(obj_path, otp_feature_obj_path)) {
-               if (!selected_object) {
+               if (!selected_object)
                        return BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED;
-               }
        }
 
        info = otp_get_char_value(obj_path);
@@ -1948,13 +1945,11 @@ void _bt_otp_gatt_char_property_changed_event(GVariant *msg,
 
                                        /* Send indication for CPs */
                                        if (!g_strcmp0(char_path, otp_oacp_obj_path)) {
-                                               if (OACP_indicate) {
+                                               if (OACP_indicate)
                                                        _bt_otp_send_indication(char_path, &info, &addr_hex);
-                                               }
                                        } else if (!g_strcmp0(char_path, otp_olcp_obj_path)) {
-                                               if (OLCP_indicate) {
+                                               if (OLCP_indicate)
                                                        _bt_otp_send_indication(char_path, &info, &addr_hex);
-                                               }
                                        }
                                } else {
                                        BT_ERR("Array Len 0");
@@ -2000,11 +1995,10 @@ void _bt_otp_gatt_char_property_changed_event(GVariant *msg,
                                indicate ? "StartNotify" : "StopNotify");
                        BT_INFO("Type '%s'\n", g_variant_get_type_string(var));
 
-                       if (!g_strcmp0(char_path, otp_oacp_obj_path)) {
+                       if (!g_strcmp0(char_path, otp_oacp_obj_path))
                                OACP_indicate = indicate;
-                       } else if (!g_strcmp0(char_path, otp_olcp_obj_path)) {
+                       else if (!g_strcmp0(char_path, otp_olcp_obj_path))
                                OLCP_indicate = indicate;
-                       }
                }
        }
        return;
@@ -2048,9 +2042,8 @@ void _bt_otp_adapter_event_filter(GDBusConnection *connection,
        BT_INFO("Interface %s, Signal %s", interface_name, signal_name);
 
        if (g_strcmp0(interface_name, BT_OTP_INTERFACE_NAME) == 0) {
-               if (strcasecmp(signal_name, BLE_DISABLED) == 0) {
+               if (strcasecmp(signal_name, BLE_DISABLED) == 0)
                        _bt_otp_exit();
-               }
        }
 }
 
@@ -2232,9 +2225,8 @@ int main(void)
 
        BT_DBG("g_main_loop_quit called!");
 
-       if (main_loop != NULL) {
+       if (main_loop != NULL)
                g_main_loop_unref(main_loop);
-       }
 
        return 0;
 }
index 6e39de7..92ee46f 100644 (file)
@@ -584,7 +584,7 @@ static gboolean __authorize_request(GapAgentPrivate *agent, GDBusProxy *device,
                        }
 
                        if (headed_plugin_info->plugin_headed_enabled) {
-                               if (headed_plugin_info->headed_plugin->bt_is_tethering_enabled() == FALSE) {
+                               if (headed_plugin_info->headed_plugin->bt_is_tethering_enabled() == false) {
                                        BT_ERR("BT tethering is not enabled");
                                        goto fail;
                                }
index 17a2669..2fadc58 100644 (file)
@@ -254,9 +254,10 @@ int bt_otp_server_deinit(int request_id)
 int __get_handle_length(char *handle)
 {
        int i = 0;
-       while (handle && (handle[i] != '\0')) {
+
+       while (handle && (handle[i] != '\0'))
                i++;
-       }
+
        return i;
 }
 
@@ -757,9 +758,8 @@ int _bt_otp_write_characteristic_value(int request_id, char *sender, char *handl
 
        builder1 = g_variant_builder_new(G_VARIANT_TYPE("ay"));
 
-       for (i = 0; i < length; i++) {
+       for (i = 0; i < length; i++)
                g_variant_builder_add(builder1, "y", param[i]);
-       }
 
        val = g_variant_new("ay", builder1);
        builder2 = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
index b0c2c8a..726a892 100644 (file)
@@ -347,8 +347,8 @@ struct bluetooth_headed_plugin_t {
                                                        const char *filename,
                                                        const char *agent_path);
        void (*bt_destroy_popup_all)(void);
-       gboolean (*bt_launch_unable_to_pairing_syspopup)(int result);
-       gboolean (*bt_is_tethering_enabled)(void);
+       bool (*bt_launch_unable_to_pairing_syspopup)(int result);
+       bool (*bt_is_tethering_enabled)(void);
        int (*bt_get_mime_type)(char *file_name, char **mime_type);
 };
 
index 003563c..2d23b9c 100644 (file)
@@ -210,7 +210,7 @@ extern "C" {
 #define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED             0xFC
 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED         0xFD
 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS      0xFE
-#define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE                       0xFF
+#define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE       0xFF
 
 /*
  * Bluetooth ATT error codes specific to OTP
@@ -7629,7 +7629,7 @@ int bluetooth_otp_enable_notification(const char *handle);
  *
  * @remark     None
  */
-int bluetooth_otp_write_characteristics_value( const char *handle,
+int bluetooth_otp_write_characteristics_value(const char *handle,
                                        unsigned char *buf, int length);
 
 /**
index 0112dc4..6a79b28 100644 (file)
@@ -18,8 +18,9 @@
 #ifndef __BLUETOOTH_PLUGIN_H
 #define __BLUETOOTH_PLUGIN_H
 
+#include <stdbool.h>
 #include <dlog.h>
-#include <glib.h>
+
 
 #undef LOG_TAG
 #define LOG_TAG "BLUETOOTH_FRWK_PLUGIN"
@@ -80,7 +81,7 @@ typedef enum {
 } bt_agent_event_type_t;
 
 struct bluetooth_headed_plugin_t {
-       int (*bt_launch_dpmpopup) (char *mode);
+       int (*bt_launch_dpmpopup)(char *mode);
        int (*bt_launch_system_popup)(bt_agent_event_type_t event_type,
                                                        const char *device_name,
                                                        const unsigned char *auth_info,
@@ -89,8 +90,8 @@ struct bluetooth_headed_plugin_t {
                                                        const char *agent_path);
 
        void (*bt_destroy_popup_all)(void);
-       gboolean (*bt_launch_unable_to_pairing_syspopup)(int result);
-       gboolean (*bt_is_tethering_enabled)(void);
+       bool (*bt_launch_unable_to_pairing_syspopup)(int result);
+       bool (*bt_is_tethering_enabled)(void);
        int (*bt_get_mime_type)(char *file_name, char **mime_type);
 };
 
index 8ed7698..9a2b3c5 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <stdio.h>
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -206,7 +207,7 @@ int bt_launch_system_popup(bt_agent_event_type_t event_type,
        return 0;
 }
 
-gboolean bt_launch_unable_to_pairing_syspopup(int result)
+bool bt_launch_unable_to_pairing_syspopup(int result)
 {
        BT_DBG("+");
        int ret = 0;
@@ -214,7 +215,7 @@ gboolean bt_launch_unable_to_pairing_syspopup(int result)
 
        b = bundle_create();
        if (b == NULL)
-               return FALSE;
+               return false;
 
        bundle_add(b, "event-type", "unable-to-pairing");
 
@@ -235,11 +236,11 @@ gboolean bt_launch_unable_to_pairing_syspopup(int result)
        }
 
        BT_DBG("-");
-       return TRUE;
+       return true;
 }
 
 
-gboolean bt_is_tethering_enabled(void)
+bool bt_is_tethering_enabled(void)
 {
        BT_DBG("+");
 
@@ -264,7 +265,7 @@ gboolean bt_is_tethering_enabled(void)
        if (ret != TETHERING_ERROR_NONE)
                BT_ERR("Fail to destroy tethering: %d", ret);
 
-       return (gboolean)enabled;
+       return enabled;
 }
 
 int bt_get_mime_type(char *file_name, char **mime_type)