Fix the coding style errors 10/72010/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 30 May 2016 07:29:34 +0000 (16:29 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 30 May 2016 07:29:34 +0000 (16:29 +0900)
Change-Id: I237e55746d136806a50e680f71931d0fe2c25ab5
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
12 files changed:
bt-share/include/bt-share-cynara.h
bt-share/include/bt-share-notification.h
bt-share/src/bt-share-common.c
bt-share/src/bt-share-cynara.c
bt-share/src/bt-share-ipc.c
bt-share/src/bt-share-main.c
bt-share/src/bt-share-noti-handler.c
bt-share/src/bt-share-notification.c
bt-share/src/bt-share-syspopup.c
bt-share/src/obex-event-handler.c
lib/bluetooth-share-api.h
lib/bt-share-db.c

index cb37cd4..ca028c7 100644 (file)
@@ -27,8 +27,7 @@
 
 /* #define CYNARA_ENABLE 1 */
 
-typedef struct
-{
+typedef struct {
        pid_t pid;
        char *uid;
        char *smack;
index 5e34338..e5e89d3 100644 (file)
@@ -95,7 +95,7 @@ int _bt_set_notification_app_launch(notification_h noti,
                const char *progress_cnt,
                int transfer_id);
 
-gboolean _bt_update_notification_status(struct bt_appdata *ad );
+gboolean _bt_update_notification_status(struct bt_appdata *ad);
 
 void _bt_register_notification_cb(struct bt_appdata *ad);
 
index e622bb7..8360b0c 100644 (file)
@@ -112,16 +112,16 @@ int _bt_set_transfer_indicator(gboolean state)
                return -1;
        }
 
-       if(state == TRUE) {
+       if (state == TRUE) {
                block_cnt++;
-               if(bt_device_state & BT_STATUS_TRANSFER)
+               if (bt_device_state & BT_STATUS_TRANSFER)
                        return 0;
                bt_device_state |= BT_STATUS_TRANSFER;
                event_val = EVT_VAL_BT_TRANSFERING;
        } else {
-               if(block_cnt > 0)
+               if (block_cnt > 0)
                        block_cnt--;
-               if(block_cnt != 0)
+               if (block_cnt != 0)
                        return 0;
                bt_device_state ^= BT_STATUS_TRANSFER;
                event_val = EVT_VAL_BT_NON_TRANSFERING;
index 5e9e693..9683ca7 100644 (file)
@@ -38,8 +38,7 @@ int _bt_share_cynara_init(void)
        int ret;
 
        ret = cynara_initialize(&_cynara, NULL);
-       if (ret != CYNARA_API_SUCCESS)
-       {
+       if (ret != CYNARA_API_SUCCESS) {
                cynara_strerror(ret, error_msg, error_msg_size);
                ERR("cynara_initialize failed: %s\n", error_msg);
                return BT_SHARE_FAIL;
index 2e9b10d..b7867a4 100644 (file)
@@ -108,7 +108,7 @@ static opc_transfer_info_t *__add_transfer_info(DBusMessage *msg)
        char byte;
        char *file_path = NULL;
        char mime_type[BT_MIME_TYPE_MAX_LEN] = { 0 };
-       unsigned int file_size=0;
+       unsigned int file_size = 0;
        struct stat file_attr;
        int len;
        opc_transfer_info_t *data;
@@ -218,7 +218,7 @@ static opc_transfer_info_t *__add_transfer_info(DBusMessage *msg)
                else
                        data->file_path[i] = g_strdup(ptr);
 
-               if(aul_get_mime_from_file(data->file_path[i], mime_type,
+               if (aul_get_mime_from_file(data->file_path[i], mime_type,
                        BT_MIME_TYPE_MAX_LEN) == AUL_R_OK) {
                        g_free(data->type[i]);
                        data->type[i] = g_strdup(mime_type);
@@ -390,7 +390,7 @@ static DBusHandlerResult __event_filter(DBusConnection *sys_conn,
                ret = _request_file_send(node);
                if (ret == BLUETOOTH_ERROR_IN_PROGRESS) {
                        DBG("Aleady OPC progressing. Once completed previous job, will be started\n");
-               } else if ( ret != BLUETOOTH_ERROR_NONE) {
+               } else if (ret != BLUETOOTH_ERROR_NONE) {
                        _bt_create_warning_popup(BLUETOOTH_ERROR_INTERNAL, BT_STR_UNABLE_TO_SEND);
                        g_slist_free_full(bt_transfer_list,
                                                (GDestroyNotify)_free_transfer_info);
@@ -445,7 +445,7 @@ static DBusHandlerResult __event_filter(DBusConnection *sys_conn,
                ret = _request_file_send(node);
                if (ret == BLUETOOTH_ERROR_IN_PROGRESS) {
                        DBG("Aleady OPC progressing. Once completed previous job, will be started\n");
-               } else if ( ret != BLUETOOTH_ERROR_NONE) {
+               } else if (ret != BLUETOOTH_ERROR_NONE) {
                        _bt_create_warning_popup(BLUETOOTH_ERROR_INTERNAL, BT_STR_UNABLE_TO_SEND);
                        g_slist_free_full(bt_transfer_list,
                                                        (GDestroyNotify)_free_transfer_info);
@@ -589,7 +589,7 @@ void _bt_create_warning_popup(int error_type, char *msg)
                char str[BT_TEXT_LEN_MAX] = { 0, };
                bundle *b;
 
-               DBG("error_type: %d",error_type);
+               DBG("error_type: %d", error_type);
                switch (error_type) {
                        case BLUETOOTH_ERROR_SERVICE_NOT_FOUND:
                        case BLUETOOTH_ERROR_NOT_CONNECTED:
@@ -678,7 +678,7 @@ static void __bt_create_send_failed_data(char *filepath, char *dev_name,
 
        bt_tr_data_t *tmp;
        tmp = g_malloc0(sizeof(bt_tr_data_t));
-       if(tmp == NULL)
+       if (tmp == NULL)
                return;
 
        tmp->tr_status = BT_TR_FAIL;
@@ -798,7 +798,7 @@ gboolean _bt_add_recv_transfer_status_data(char *device_name,
                return FALSE;
 
        tmp = g_malloc0(sizeof(bt_tr_data_t));
-       if(tmp == NULL)
+       if (tmp == NULL)
                return FALSE;
 
        tmp->tr_status = status;
index 33367f9..9de45d9 100644 (file)
@@ -276,7 +276,7 @@ static gboolean __bt_dbus_request_name(void)
        if (dbus_error_is_set(&err))
                goto failed;
 
-       if(DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER == ret_code) {
+       if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER == ret_code) {
                dbus_connection_unref(conn);
                return TRUE;
        }
@@ -324,8 +324,7 @@ void __bt_create_transfer_db(void)
 
        /* Check if the DB exists; if not, create it and initialize it */
        ret = stat(BT_TRANSFER_DB, &sts);
-       if (ret == -1 && errno == ENOENT)
-       {
+       if (ret == -1 && errno == ENOENT) {
                DBG("DB %s doesn't exist, it needs to be created and initialized", BT_TRANSFER_DB);
                DBG("script path: %s", SCRIPT_INIT_DB);
                ret = system(SCRIPT_INIT_DB);
@@ -352,10 +351,9 @@ int main(void)
        }
 
        ret = appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, __bt_lang_changed_cb, NULL);
-       if(ret < 0)
+       if (ret < 0)
                DBG("Failed to excute the change of language");
 
-
        /* init internationalization */
        if (appcore_set_i18n(BT_COMMON_PKG, BT_COMMON_RES) < 0)
                return -1;
index 297a459..0721f2e 100644 (file)
@@ -40,7 +40,7 @@ static void __bt_default_memory_changed_cb(keynode_t *node, void *data)
 
        DBG("__bt_default_memory_changed_cb\n");
 
-       ret_if (node == NULL);
+       ret_if(node == NULL);
 
        DBG("key=%s\n", vconf_keynode_get_name(node));
 
index 9418b0a..a92b168 100644 (file)
@@ -239,7 +239,7 @@ notification_h _bt_insert_notification(struct bt_appdata *ad, bt_notification_ty
 int _bt_update_notification(struct bt_appdata *ad, notification_h noti,
                char *title, char *content, char *icon_path)
 {
-       retvm_if (!noti, BT_SHARE_FAIL, "noti is NULL");
+       retvm_if(!noti, BT_SHARE_FAIL, "noti is NULL");
 
        INFO("Update noti : %d", noti);
        notification_error_e ret = NOTIFICATION_ERROR_NONE;
@@ -274,7 +274,7 @@ int _bt_update_notification(struct bt_appdata *ad, notification_h noti,
        }
 
        if (content) {
-               if (noti == ad->send_noti|| noti == ad->receive_noti) {
+               if (noti == ad->send_noti || noti == ad->receive_noti) {
                        if (success == 1)
                                ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
                                                NULL, content,
@@ -479,7 +479,7 @@ int _bt_set_notification_property(notification_h noti, int flag)
        return ret;
 }
 
-gboolean _bt_update_notification_status(struct bt_appdata *ad )
+gboolean _bt_update_notification_status(struct bt_appdata *ad)
 {
        notification_h noti = NULL;
        notification_list_h list_head = NULL;
@@ -493,7 +493,7 @@ gboolean _bt_update_notification_status(struct bt_appdata *ad )
        int priv_id = 0;
        int ret;
 
-       retv_if (ad == NULL, FALSE);
+       retv_if(ad == NULL, FALSE);
 
        /* When bt-share is launched, need to update notification status  */
 
@@ -564,7 +564,7 @@ static void __bt_notification_changed_cb(void *data, notification_type_e type, n
 {
        DBG("__bt_notification_changed_cb");
 
-       retm_if (data == NULL, "Invalid data");
+       retm_if(data == NULL, "Invalid data");
        struct bt_appdata *ad = (struct bt_appdata *)data;
        gboolean is_sent_noti_exist = FALSE;
        gboolean is_received_noti_exist = FALSE;
@@ -575,7 +575,7 @@ static void __bt_notification_changed_cb(void *data, notification_type_e type, n
        int priv_id;
        sqlite3 *db = NULL;
 
-       retm_if (op_list == NULL, "Invalid op_list");
+       retm_if(op_list == NULL, "Invalid op_list");
 
        if (type != NOTIFICATION_TYPE_NOTI ||
                        (op_list->type != NOTIFICATION_OP_DELETE &&
@@ -586,7 +586,7 @@ static void __bt_notification_changed_cb(void *data, notification_type_e type, n
                return;
 
        noti_err = notification_get_list(type, -1, &noti_list);
-       ret_if (noti_err != NOTIFICATION_ERROR_NONE);
+       ret_if(noti_err != NOTIFICATION_ERROR_NONE);
 
        noti_list = notification_list_get_head(noti_list);
        while (noti_list) {
index 4cb16af..25c124e 100644 (file)
@@ -66,7 +66,7 @@ int _bt_launch_system_popup(bt_app_event_type_t event_type,
        DBG("+\n");
 
        b = bundle_create();
-       if(b == NULL) {
+       if (b == NULL) {
                ERR("bundle_create failed");
                return -1;
        }
index 0223c91..8d34fe7 100644 (file)
@@ -171,7 +171,7 @@ void _bt_obex_cancel_transfer(void *data)
 
                DBG("noti_id : %d", noti_data->noti_id);
                ret = bluetooth_obex_server_cancel_transfer(noti_data->transfer_id);
-               if(ret != BLUETOOTH_ERROR_NONE) {
+               if (ret != BLUETOOTH_ERROR_NONE) {
                        ERR("bluetooth_obex_server_cancel_transfer[ret:%d]", ret);
                }
        }
@@ -510,7 +510,7 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param,
                        INFO("BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED");
                        isFirstReceivedPacket = TRUE;
                        transfer_info = param->param_data;
-                       if(transfer_info->file_size > (100 * 1024)) {
+                       if (transfer_info->file_size > (100 * 1024)) {
                                if (0 == g_strcmp0(transfer_info->type, TRANSFER_GET)) {
                                        /*GET request */
                                        noti = _bt_insert_notification(ad, BT_SENDING_NOTI, 0, 0);
@@ -551,7 +551,7 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param,
 
                                if (isFirstReceivedPacket)
                                        _bt_update_notification(ad, data->noti_handle, transfer_info->filename, "", NULL);
-                               if(data && data->noti_id)
+                               if (data && data->noti_id)
                                        _bt_update_notification_progress(
                                                        data->noti_handle,
                                                        data->noti_id,
@@ -622,7 +622,7 @@ void _bt_share_event_handler(int event, bluetooth_event_param_t *param,
                                } else {
                                        _bt_update_notification(ad, ad->receive_noti, NULL, NULL, NULL);
                                }
-                       }else if(0 == g_strcmp0(transfer_info->type, TRANSFER_GET)){
+                       } else if (0 == g_strcmp0(transfer_info->type, TRANSFER_GET)) {
                                INFO("TRANSFER_GET");
                        }
 
@@ -845,7 +845,7 @@ static void __bt_app_obex_openwrite_requested(bt_obex_server_authorize_into_t
 
        regex = g_regex_new("[*\"<>;?|\\^:/]", 0, 0, NULL);
        name = g_regex_replace(regex, server_auth_info->filename, -1, 0, "_", 0, NULL);
-       g_regex_unref(regex );
+       g_regex_unref(regex);
        if (g_strcmp0(name, server_auth_info->filename) != 0) {
                g_free(server_auth_info->filename);
                server_auth_info->filename = name;
@@ -885,7 +885,7 @@ static void __bt_obex_file_push_auth(bt_obex_server_authorize_into_t *server_aut
                goto reject;
        }
 
-       INFO("File Length =%ld",server_auth_info->length);
+       INFO("File Length = %ld", server_auth_info->length);
 
        if (val == BT_DEFAULT_MEM_MMC) {
                ret = __bt_get_available_ext_memory(&available_ext_mem_size);
@@ -1013,7 +1013,7 @@ static gboolean __bt_save_v_object(char *file_path,
                if (ret != CALENDAR_ERROR_NONE) {
                        ERR("[error] = %d \n", ret);
                        ret = calendar_disconnect();
-                       if ( ret != CALENDAR_ERROR_NONE) {
+                       if (ret != CALENDAR_ERROR_NONE) {
                                ERR("calendar_disconnect error = %d \n", ret);
                        }
                        return FALSE;
index 699ef0b..c99f522 100644 (file)
@@ -35,7 +35,7 @@ enum {
        BT_SHARE_ERR_INTERNAL = -1,
        BT_SHARE_ERR_INVALID_PARAM = -2,
        BT_SHARE_ERR_UNKNOWN = -3
-}bt_share_err_e;
+} bt_share_err_e;
 
 
 typedef struct {
@@ -49,7 +49,7 @@ typedef struct {
        char *type;
        char *content;
        unsigned int size;
-}bt_tr_data_t;
+} bt_tr_data_t;
 
 
 typedef enum {
index da41d96..97e4439 100644 (file)
@@ -337,7 +337,7 @@ static int __bt_db_get_record_count(sqlite3 *db, int db_table)
        return count;
 }
 
-static int __bt_db_delete_record(sqlite3 *db, const char *query )
+static int __bt_db_delete_record(sqlite3 *db, const char *query)
 {
        int ret = 0;
        sqlite3_stmt *stmt = NULL;