From: DoHyun Pyun Date: Fri, 20 May 2016 02:39:51 +0000 (+0900) Subject: Fix build warning errors X-Git-Tag: accepted/tizen/mobile/20160520.081718^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F38%2F70638%2F1;p=apps%2Fnative%2Fbluetooth-share-ui.git Fix build warning errors Change-Id: I479305a7475b11db357120613c9874c5751dbefc Signed-off-by: DoHyun Pyun --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2af5d0e..fcfb3fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ FOREACH(flag ${pkgs_CFLAGS}) ENDFOREACH(flag) #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ") SET(CMAKE_C_FLAGS_RELEASE "-O2") #This is flag for Gprof diff --git a/src/bt-share-ui-main.c b/src/bt-share-ui-main.c index 774e47b..7e29b99 100644 --- a/src/bt-share-ui-main.c +++ b/src/bt-share-ui-main.c @@ -195,7 +195,7 @@ static int __bt_share_launch_handler(bt_share_appdata_t *ad, bundle *b) /* Get data from share DB */ db = bt_share_open_db(); - retvm_if(!db, NULL, "fail to open db!"); + retvm_if(!db, -1, "fail to open db!"); ad->tr_data_list = bt_share_get_completed_tr_data_list(db, ad->tr_type); bt_share_close_db(db); diff --git a/src/bt-share-ui-main.h b/src/bt-share-ui-main.h index efb953a..5a54113 100755 --- a/src/bt-share-ui-main.h +++ b/src/bt-share-ui-main.h @@ -46,7 +46,6 @@ extern "C" { #define EDJDIR "/usr/apps/org.tizen.bluetooth-share-ui/res/edje" #define EDJFILE EDJDIR"/bt-share-layout.edj" #define EDJ_IMAGES EDJDIR "/images.edj" -#define VCONFKEY_SETAPPL_CHANGE_UI_THEME_INT VCONFKEY_SETAPPL_PREFIX"/change_ui/theme" #endif diff --git a/src/bt-share-ui-popup.c b/src/bt-share-ui-popup.c index 0c9dc18..8d5db96 100755 --- a/src/bt-share-ui-popup.c +++ b/src/bt-share-ui-popup.c @@ -208,6 +208,7 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in char tmp[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; char *name = NULL; char *markup_text = NULL; + char *stms_str = NULL; if (info->file_path == NULL) { ERR("Invalid data"); @@ -227,7 +228,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in elm_object_part_text_set(popup, "title,text", BT_STR_SENT_FILES); char file_size_str[BT_FILE_SIZE_STR] = { 0 }; - snprintf(msg, sizeof(msg), BT_STR_TO_S, info->dev_name); + stms_str = BT_STR_TO_S; + snprintf(msg, sizeof(msg), stms_str, info->dev_name); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); name = strrchr(info->file_path, '/'); @@ -236,7 +238,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in else name = info->file_path; - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, name); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); @@ -251,7 +254,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in snprintf(file_size_str, sizeof(file_size_str), "%dKB", info->size / 1024); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + stms_str = BT_STR_FILE_SIZE_S; + snprintf(tmp, sizeof(tmp), stms_str, file_size_str); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -261,7 +265,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in elm_object_part_text_set(popup, "title,text", BT_STR_RECEIVED_FILES); char file_size_str[BT_FILE_SIZE_STR] = { 0 }; - snprintf(msg, sizeof(msg), BT_STR_FROM_S, info->dev_name); + stms_str = BT_STR_FROM_S; + snprintf(msg, sizeof(msg), stms_str, info->dev_name); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); name = strrchr(info->file_path, '/'); @@ -270,7 +275,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in else name = info->file_path; - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, name); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); @@ -285,7 +291,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in snprintf(file_size_str, sizeof(file_size_str), "%dKB", info->size / 1024); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + stms_str = BT_STR_FILE_SIZE_S; + snprintf(tmp, sizeof(tmp), stms_str, file_size_str); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -297,7 +304,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in g_strlcat(msg, BT_STR_FILE_NOT_RECV, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, info->file_path); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, info->file_path); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -309,7 +317,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in g_strlcat(msg, BT_STR_FILE_NOT_EXIST, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, info->file_path); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, info->file_path); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -317,7 +326,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in } else if (type == BT_FT_RETRY_POPUP) { elm_object_part_text_set(popup, "title,text", BT_STR_UNABLE_TO_SEND_FILES); - snprintf(msg, sizeof(msg), BT_STR_SEND_FAIL_TO_S, info->dev_name); + stms_str = BT_STR_SEND_FAIL_TO_S; + snprintf(msg, sizeof(msg), stms_str, info->dev_name); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); name = strrchr(info->file_path, '/'); @@ -326,7 +336,8 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_e type, bt_tr_data_t *in else name = info->file_path; - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, name); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -371,13 +382,15 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) char tmp[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; char *name = NULL; char *markup_text = NULL; + char *stms_str = NULL; Evas_Object *btn1 = NULL; if (ad->ft_type == BT_FT_SENT_POPUP) { elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_SENT_FILES); char file_size_str[BT_FILE_SIZE_STR] = { 0 }; - snprintf(msg, sizeof(msg), BT_STR_FROM_S, ad->ft_info->dev_name); + stms_str = BT_STR_FROM_S; + snprintf(msg, sizeof(msg), stms_str, ad->ft_info->dev_name); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); name = strrchr(ad->ft_info->file_path, '/'); @@ -386,7 +399,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) else name = ad->ft_info->file_path; - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, name); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); @@ -401,7 +415,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) snprintf(file_size_str, sizeof(file_size_str), "%dKB", ad->ft_info->size / 1024); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + stms_str = BT_STR_FILE_SIZE_S; + snprintf(tmp, sizeof(tmp), stms_str, file_size_str); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -410,7 +425,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_RECEIVED_FILES); char file_size_str[BT_FILE_SIZE_STR] = { 0 }; - snprintf(msg, sizeof(msg), BT_STR_FROM_S, ad->ft_info->dev_name); + stms_str = BT_STR_FROM_S; + snprintf(msg, sizeof(msg), stms_str, ad->ft_info->dev_name); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); name = strrchr(ad->ft_info->file_path, '/'); @@ -419,7 +435,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) else name = ad->ft_info->file_path; - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, name); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); @@ -434,7 +451,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) snprintf(file_size_str, sizeof(file_size_str), "%dKB", ad->ft_info->size / 1024); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_SIZE_S, file_size_str); + stms_str = BT_STR_FILE_SIZE_S; + snprintf(tmp, sizeof(tmp), stms_str, file_size_str); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -445,11 +463,13 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) g_strlcat(msg, BT_STR_FILE_NOT_RECV, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, ad->ft_info->file_path); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, ad->ft_info->file_path); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); - snprintf(tmp, sizeof(tmp), BT_STR_FAIL_S, BT_STR_TR_CANCELLED); + stms_str = BT_STR_FAIL_S; + snprintf(tmp, sizeof(tmp), stms_str, BT_STR_TR_CANCELLED); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -460,7 +480,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) g_strlcat(msg, BT_STR_FILE_NOT_EXIST, BT_GLOBALIZATION_STR_LENGTH); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, ad->ft_info->file_path); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, ad->ft_info->file_path); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); @@ -468,7 +489,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) } else if (ad->ft_type == BT_FT_RETRY_POPUP) { elm_object_part_text_set(ad->ft_popup, "title,text", BT_STR_UNABLE_TO_SEND_FILES); - snprintf(msg, sizeof(msg), BT_STR_SEND_FAIL_TO_S, ad->ft_info->dev_name); + stms_str = BT_STR_SEND_FAIL_TO_S; + snprintf(msg, sizeof(msg), stms_str, ad->ft_info->dev_name); g_strlcat(msg, NEW_LINE, BT_GLOBALIZATION_STR_LENGTH); name = strrchr(ad->ft_info->file_path, '/'); @@ -477,7 +499,8 @@ void _bt_lang_changed_ft_popup(bt_share_appdata_t *ad) else name = ad->ft_info->file_path; - snprintf(tmp, sizeof(tmp), BT_STR_FILE_S, name); + stms_str = BT_STR_FILE_S; + snprintf(tmp, sizeof(tmp), stms_str, name); g_strlcat(msg, tmp, BT_GLOBALIZATION_STR_LENGTH); markup_text = elm_entry_utf8_to_markup(msg); diff --git a/src/bt-share-ui-view.c b/src/bt-share-ui-view.c index f7ad7c3..27114d2 100755 --- a/src/bt-share-ui-view.c +++ b/src/bt-share-ui-view.c @@ -42,6 +42,7 @@ #include #endif #include +#include #include "applog.h" #include "bt-share-ui-view.h" @@ -69,8 +70,6 @@ static void __bt_more_menu_cb(void *data, Evas_Object *_bt_create_win(const char *name) { Evas_Object *eo = NULL; - int w; - int h; #if 0 eo = (Evas_Object *)app_get_preinitialized_window(name); @@ -198,7 +197,7 @@ static void __bt_clear_list_btn_cb(void *data, if (!db) return; - table = ad->tr_type ? BT_DB_INBOUND : BT_DB_OUTBOUND; + table = ad->tr_type ? BT_TR_INBOUND : BT_TR_OUTBOUND; bt_share_remove_all_tr_data(db, table); bt_share_close_db(db); @@ -206,7 +205,7 @@ static void __bt_clear_list_btn_cb(void *data, notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &list_head); list_traverse = list_head; - if (ad->tr_type == BT_DB_INBOUND) + if (ad->tr_type == BT_TR_INBOUND) opp_role = "bluetooth-share-opp-server"; else opp_role = "bluetooth-share-opp-client"; @@ -541,16 +540,17 @@ void _bt_update_tr_notification(void *data) notification_list_h list_head = NULL; notification_list_h list_traverse = NULL; char *app_id = NULL; + char *stms_str = NULL; info = (bt_tr_data_t *)data; - DBG("Transfer type: %s", ad->tr_type == BT_DB_INBOUND ? "Receive" : "Sent"); + DBG("Transfer type: %s", ad->tr_type == BT_TR_INBOUND ? "Receive" : "Sent"); db = bt_share_open_db(); if (!db) return; - if (ad->tr_type == BT_DB_INBOUND) + if (ad->tr_type == BT_TR_INBOUND) opp_role = "bluetooth-share-opp-server"; else opp_role = "bluetooth-share-opp-client"; @@ -583,11 +583,14 @@ void _bt_update_tr_notification(void *data) notification_delete_by_priv_id(app_id, NOTIFICATION_TYPE_NOTI, priv_id); } else { char str[BT_GLOBALIZATION_STR_LENGTH] = { 0 }; - if (success == 1) - snprintf(str, sizeof(str), BT_STR_TR_1FILE_COPIED_STATUS, fail); - else - snprintf(str, sizeof(str), BT_STR_TR_COPIED_STATUS, + if (success == 1) { + stms_str = BT_STR_TR_1FILE_COPIED_STATUS; + snprintf(str, sizeof(str), stms_str, fail); + } else { + stms_str = BT_STR_TR_COPIED_STATUS; + snprintf(str, sizeof(str), stms_str, success, fail); + } notification_set_content(noti, str, NULL); notification_update(noti); @@ -903,7 +906,7 @@ void _bt_nocontent_set(bt_share_appdata_t *ad, gboolean set) }else { genlist = __bt_add_tr_data_genlist(ad->tr_view, ad); - retvm_if (genlist == NULL, -1, "genlist is NULL!"); + retm_if (genlist == NULL, "genlist is NULL!"); if (ad->tr_genlist) { DBG("Clear the previous genlist"); @@ -986,7 +989,7 @@ static void __bt_move_clear_ctxpopup(Evas_Object *ctxpopup, FN_END; } -static void __bt_clear_btn_del_cb(void *data) +void __bt_clear_btn_del_cb(void *data, Evas_Object *obj, void *event_info) { FN_START; bt_share_appdata_t *ad = NULL;