From bfd88b557f58e3228f849996a58509870d29e9f8 Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Wed, 16 Mar 2016 17:34:55 +0900 Subject: [PATCH] Remove build warnings Change-Id: I32e225ac2f93c68d24bec6388e6fa5b178836861 Signed-off-by: Yu jiung --- ...ect-efl.spec => ug-setting-wifidirect-efl.spec} | 5 +- popup-wifidirect/src/wfd-app-client.c | 15 +++--- popup-wifidirect/src/wfd-app-popup-view.c | 62 ++++++++++++---------- popup-wifidirect/src/wfd-app-util.c | 4 +- ug-wifidirect/src/wfd_ug.c | 17 ------ ug-wifidirect/src/wfd_ug_genlist.c | 6 +-- ug-wifidirect/src/wfd_ug_main_view.c | 4 +- ug-wifidirect/src/wfd_ug_multiconnect_view.c | 17 ++++-- ug-wifidirect/src/wfd_ug_popup.c | 14 +++-- 9 files changed, 72 insertions(+), 72 deletions(-) rename packaging/{libug-setting-wifidirect-efl.spec => ug-setting-wifidirect-efl.spec} (97%) diff --git a/packaging/libug-setting-wifidirect-efl.spec b/packaging/ug-setting-wifidirect-efl.spec similarity index 97% rename from packaging/libug-setting-wifidirect-efl.spec rename to packaging/ug-setting-wifidirect-efl.spec index 6055778..e18919d 100644 --- a/packaging/libug-setting-wifidirect-efl.spec +++ b/packaging/ug-setting-wifidirect-efl.spec @@ -2,7 +2,7 @@ Name: ug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget Version: 1.11.70 Release: 1 -Group: App/Network +Group: Applications/Network License: Flora-1.1 Source0: %{name}-%{version}.tar.gz @@ -65,8 +65,6 @@ Requires: %{name} = %{version}-%{release} %description -n org.tizen.wifi-direct-popup Wi-Fi Direct system popup. - - %prep %setup -q @@ -121,7 +119,6 @@ ln -sf %{TZ_SYS_RO_APP}/%{name}/lib/lib%{name}.so %{TZ_SYS_RO_APP}/%{name}/lib/l %{TZ_SYS_RO_APP}/org.tizen.wifi-direct-popup/bin/* %{TZ_SYS_RO_APP}/org.tizen.wifi-direct-popup/res/images/* %{TZ_SYS_RO_APP}/org.tizen.wifi-direct-popup/res/edje/* -#%{TZ_SYS_RO_APP}/org.tizen.wifi-direct-popup/res/locale/*/*/* %{TZ_SYS_RO_UG}/res/locale/*/*/* %{TZ_SYS_RO_APP}/org.tizen.wifi-direct-popup/author-signature.xml %{TZ_SYS_RO_APP}/org.tizen.wifi-direct-popup/signature1.xml diff --git a/popup-wifidirect/src/wfd-app-client.c b/popup-wifidirect/src/wfd-app-client.c index e1fd8dd..cef7254 100644 --- a/popup-wifidirect/src/wfd-app-client.c +++ b/popup-wifidirect/src/wfd-app-client.c @@ -401,6 +401,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st case WIFI_DIRECT_CONNECTION_REQ: { WFD_APP_LOG(WFD_APP_LOG_LOW, "event ------------------ WIFI_DIRECT_CONNECTION_REQ\n"); + char *format_str = D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"); memcpy((char*)ad->mac_addr_connecting, connection->peer_addr, MACSTR_LENGTH); @@ -410,9 +411,8 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st result = wifi_direct_reject_connection(connection->peer_addr); if (result != WIFI_DIRECT_ERROR_NONE) WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to reject connection(%d)", result); - snprintf(popup_text, MAX_POPUP_TEXT_SIZE, - D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"), - WFD_MAX_CONNECTED_PEER); + g_snprintf(popup_text, MAX_POPUP_TEXT_SIZE, + format_str, WFD_MAX_CONNECTED_PEER); notification_status_message_post(popup_text); break; } @@ -487,6 +487,7 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st { char *msg = NULL; char txt[WFD_POP_STR_MAX_LEN] = {0}; + char *format_str = NULL; wfd_destroy_popup(); memset(ad->mac_addr_connecting, 0x00, MACSTR_LENGTH); @@ -494,13 +495,13 @@ void _cb_connection(int error_code, wifi_direct_connection_state_e connection_st if (error_code != WIFI_DIRECT_ERROR_NONE) { WFD_APP_LOG(WFD_APP_LOG_ERROR, "Failed to connect with peer[%s] -(%d)", connection->peer_name, error_code); - snprintf(txt, WFD_POP_STR_MAX_LEN, D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"); + snprintf(txt, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); } else { WFD_APP_LOG(WFD_APP_LOG_LOW, "Succeeded to connect with peer[%s] -(%d)", connection->peer_name, error_code); - snprintf(txt, WFD_POP_STR_MAX_LEN, D_("IDS_WIFI_BODY_CONNECTED_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_BODY_CONNECTED_TO_PS"); + snprintf(txt, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); #ifdef WFD_SCREEN_MIRRORING_ENABLED result = vconf_get_int(VCONFKEY_SCREEN_MIRRORING_STATE, &screen_mirroring_status); if (result < 0) diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index f25f2a0..f0d55bf 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -78,8 +78,9 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) wfd_appdata_t *ad = wfd_get_appdata(); wfd_connection_info_s *connection = ad->connection; int result = -1; - int resp = (int) data; + unsigned long int resp = (unsigned long int) data; char msg[WFD_POP_STR_MAX_LEN] = {0}; + char *format_str = NULL; WFD_APP_LOG(WFD_APP_LOG_HIGH, "popup resp : %d\n", resp); @@ -96,8 +97,8 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) evas_object_hide(ad->win); /* tickernoti popup */ - snprintf(msg, WFD_POP_STR_MAX_LEN, D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"); + snprintf(msg, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); notification_status_message_post(msg); } WFD_APP_LOG(WFD_APP_LOG_LOW, "Succeeded to accept connection"); @@ -148,8 +149,8 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) result = wifi_direct_set_wps_pin(connection->wps_pin); if (result != WIFI_DIRECT_ERROR_NONE) { /* tickernoti popup */ - snprintf(msg, WFD_POP_STR_MAX_LEN, D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"); + snprintf(msg, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); notification_status_message_post(msg); return; } @@ -160,8 +161,8 @@ static void __popup_resp_cb(void *data, Evas_Object * obj, void *event_info) evas_object_hide(ad->win); /* tickernoti popup */ - snprintf(msg, WFD_POP_STR_MAX_LEN, D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_POP_FAILED_TO_CONNECT_TO_PS"); + snprintf(msg, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); notification_status_message_post(msg); } WFD_APP_LOG(WFD_APP_LOG_LOW, "Succeeded to connect with [%s]", connection->peer_addr); @@ -302,7 +303,7 @@ static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop) popup = elm_popup_add(win); elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, (void *) pop->resp_data1); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, (void *) (intptr_t) pop->resp_data1); evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, mouseup_cb, ad); // evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN, keydown_cb, ad); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -312,7 +313,7 @@ static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop) elm_object_style_set(btn, "popup"); elm_object_domain_translatable_text_set(btn, PACKAGE, pop->label1); elm_object_part_content_set(popup, "button1", btn); - evas_object_smart_callback_add(btn, "clicked", __popup_resp_cb, (void *) pop->resp_data1); + evas_object_smart_callback_add(btn, "clicked", __popup_resp_cb, (void *) (intptr_t) pop->resp_data1); evas_object_show(popup); evas_object_show(win); @@ -336,7 +337,7 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop) popup = elm_popup_add(win); elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, (void *) pop->resp_data2); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, (void *) (intptr_t) pop->resp_data2); evas_object_event_callback_add(popup, EVAS_CALLBACK_MOUSE_UP, mouseup_cb, ad); // evas_object_event_callback_add(popup, EVAS_CALLBACK_KEY_DOWN, keydown_cb, ad); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -349,14 +350,14 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop) elm_object_domain_translatable_text_set(btn1, PACKAGE, pop->label2); elm_object_part_content_set(popup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, - (void *) pop->resp_data2); + (void *) (intptr_t) pop->resp_data2); btn2 = elm_button_add(popup); elm_object_style_set(btn2, "popup"); elm_object_domain_translatable_text_set(btn2, PACKAGE, pop->label1); elm_object_part_content_set(popup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, - (void *) pop->resp_data1); + (void *) (intptr_t) pop->resp_data1); evas_object_show(popup); evas_object_show(win); @@ -389,6 +390,7 @@ Evas_Object *wfd_draw_pop_type_auto_deactivation(Evas_Object *win, void *userda Evas_Object *popup = NULL; Evas_Object *btn = NULL; char popup_text[MAX_POPUP_TEXT_SIZE] = {0}; + char *format_str = NULL; wfd_appdata_t *ad = wfd_get_appdata(); popup = elm_popup_add(win); @@ -399,8 +401,8 @@ Evas_Object *wfd_draw_pop_type_auto_deactivation(Evas_Object *win, void *userda evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_object_domain_translatable_part_text_set(popup, "title,text", PACKAGE, "IDS_WIFI_BODY_WI_FI_DIRECT_ABB"); - snprintf(popup_text, MAX_POPUP_TEXT_SIZE, - "IDS_WIFI_POP_THERE_HAS_BEEN_NO_ACTIVITY_FOR_PD_MINUTES_SINCE_WI_FI_DIRECT_WAS_ENABLED_MSG", 5); + format_str = D_("IDS_WIFI_POP_THERE_HAS_BEEN_NO_ACTIVITY_FOR_PD_MINUTES_SINCE_WI_FI_DIRECT_WAS_ENABLED_MSG"); + snprintf(popup_text, MAX_POPUP_TEXT_SIZE, format_str, 5); elm_object_domain_translatable_text_set(popup, PACKAGE, popup_text); btn = elm_button_add(popup); @@ -520,6 +522,7 @@ static Eina_Bool _keypad_popup_timer_cb(void *data) char msg1[WFD_POP_STR_MAX_LEN] = {0}; char msg2[WFD_POP_STR_MAX_LEN] = {0}; char label_str[WFD_POP_STR_MAX_LEN] = {0, }; + char * format_str = NULL; Evas_Object *label = (Evas_Object*) data; wfd_appdata_t *ad = wfd_get_appdata(); @@ -538,8 +541,8 @@ static Eina_Bool _keypad_popup_timer_cb(void *data) D_("IDS_ST_BODY_CONNECT_WITH_PS_IN_PD_SECS_ABB"), connection->peer_name, keypad_popup_timeout); - snprintf(msg2, sizeof(msg2), D_("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"); + snprintf(msg2, sizeof(msg2), format_str, connection->peer_name); snprintf(label_str, sizeof(label_str), "%s %s", msg1, msg2); elm_object_domain_translatable_text_set(label, PACKAGE, label_str); @@ -709,8 +712,9 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) elm_object_domain_translatable_text_set(btn2, PACKAGE, pop->label2); elm_object_part_content_set(popup, "button1", btn2); evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, - (void *) pop->resp_data2); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, (void *) pop->resp_data2); + (void *) (intptr_t) pop->resp_data2); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, + (void *) (intptr_t) pop->resp_data2); } if (pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_KEYPAD_YES || pop->resp_data1 == WFD_POP_RESP_APRV_CONNECT_PBC_YES ) { @@ -720,8 +724,9 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop) elm_object_domain_translatable_text_set(btn1, PACKAGE, pop->label1); elm_object_part_content_set(popup, "button2", btn1); evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, - (void *) pop->resp_data1); - eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, (void *) pop->resp_data1); + (void *) (intptr_t) pop->resp_data1); + eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __popup_resp_cb, + (void *) (intptr_t) pop->resp_data1); } elm_object_content_set(popup, layout); @@ -804,6 +809,7 @@ static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj, char buf[WFD_POP_STR_MAX_LEN] = {0, }; char msg1[WFD_POP_STR_MAX_LEN] = {0, }; char msg2[WFD_POP_STR_MAX_LEN] = {0, }; + char *format_str = NULL; wfd_appdata_t *ad = wfd_get_appdata(); WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n"); wfd_connection_info_s *connection = ad->connection; @@ -817,9 +823,8 @@ static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj, D_("IDS_ST_BODY_CONNECT_WITH_PS_IN_PD_SECS_ABB"), connection->peer_name, ad->timeout); - snprintf(msg2, WFD_POP_STR_MAX_LEN, - D_("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"), - connection->peer_name); + format_str = D_("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"); + snprintf(msg2, WFD_POP_STR_MAX_LEN, format_str, connection->peer_name); WFD_APP_LOG(WFD_APP_LOG_LOW, "string %s %s", msg1, msg2); snprintf(buf, WFD_POP_STR_MAX_LEN, @@ -1075,14 +1080,14 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop) elm_object_domain_translatable_text_set(btn1, PACKAGE, pop->label2); elm_object_part_content_set(pinpopup, "button1", btn1); evas_object_smart_callback_add(btn1, "clicked", __popup_resp_cb, - (void *)pop->resp_data2); + (void *) (intptr_t) pop->resp_data2); btn2 = elm_button_add(pinpopup); elm_object_style_set(btn2, "popup"); elm_object_domain_translatable_text_set(btn2, PACKAGE, pop->label1); elm_object_part_content_set(pinpopup, "button2", btn2); evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb, - (void *)pop->resp_data1); + (void *) (intptr_t) pop->resp_data1); #if defined(GENLIST_REALIZATION_MOTE_SET) elm_genlist_realization_mode_set(genlist, EINA_TRUE); #endif @@ -1151,6 +1156,8 @@ void wfd_prepare_popup(int type, void *user_data) char text1[WFD_POP_STR_MAX_LEN+1] = {0, }; wfd_destroy_popup(); char *peer_name; + char *format_str = NULL; + peer_name = elm_entry_utf8_to_markup(connection->peer_name); memset(pop, 0, sizeof(wfd_popup_t)); @@ -1174,9 +1181,8 @@ void wfd_prepare_popup(int type, void *user_data) break; case /* MT */ WFD_POP_APRV_CONNECTION_WPS_DISPLAY_REQ: - snprintf(pop->text, sizeof(pop->text), - D_("IDS_WIFI_BODY_PS_IS_REQUESTING_A_WI_FI_DIRECT_CONNECTION_ALLOW_Q"), - peer_name); + format_str = D_("IDS_WIFI_BODY_PS_IS_REQUESTING_A_WI_FI_DIRECT_CONNECTION_ALLOW_Q"); + snprintf(pop->text, sizeof(pop->text), format_str, peer_name); snprintf(pop->label1, sizeof(pop->label1), "%s", D_("IDS_WIFI_BUTTON_ALLOW")); snprintf(pop->label2, sizeof(pop->label2), "%s", D_("IDS_BR_SK_CANCEL")); pop->timeout = WFD_POP_TIMER_120; diff --git a/popup-wifidirect/src/wfd-app-util.c b/popup-wifidirect/src/wfd-app-util.c index e93e75e..dbf83ea 100644 --- a/popup-wifidirect/src/wfd-app-util.c +++ b/popup-wifidirect/src/wfd-app-util.c @@ -109,7 +109,7 @@ static void _move_data_to_app_control(const char *key, const int type, __WFD_APP_FUNC_ENTER__; void *ptr = NULL; char *buff = NULL; - unsigned int size = 0; + size_t size = 0; WFD_RET_IF(data == NULL || key == NULL || type == 0, , "Invialid parameter!"); @@ -912,7 +912,7 @@ void wfd_app_util_add_wfd_turn_off_notification(void *user_data) res = app_control_create(&control); WFD_RET_IF(res != APP_CONTROL_ERROR_NONE, "app_control_create() return error : %d", res); - app_control_set_package(control, PACKAGE); + app_control_set_app_id(control, PACKAGE); app_control_add_extra_data(control, NOTIFICATION_BUNDLE_PARAM, NOTIFICATION_BUNDLE_VALUE); noti_err = notification_set_launch_option(ad->noti_wifi_direct_connected, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, control); diff --git a/ug-wifidirect/src/wfd_ug.c b/ug-wifidirect/src/wfd_ug.c index 196d5b7..c97de17 100644 --- a/ug-wifidirect/src/wfd_ug.c +++ b/ug-wifidirect/src/wfd_ug.c @@ -839,20 +839,3 @@ UG_MODULE_API int setting_plugin_reset(app_control_h control, void *priv) __FUNC_EXIT__; return 0; } - -UG_MODULE_API int setting_plugin_search_init(app_control_h control, void *priv, char** applocale) -{ - __FUNC_ENTER__; - - *applocale = strdup(PACKAGE); - void *node = NULL; - - Eina_List **pplist = (Eina_List**)priv; - - node = setting_plugin_search_item_add("IDS_WIFI_BUTTON_MULTI_CONNECT", "viewtype:IDS_WIFI_BUTTON_MULTI_CONNECT", NULL, 5, NULL); - *pplist = eina_list_append(*pplist, node); - - __FUNC_EXIT__; - return 0; -} - diff --git a/ug-wifidirect/src/wfd_ug_genlist.c b/ug-wifidirect/src/wfd_ug_genlist.c index 43695eb..c0db0da 100755 --- a/ug-wifidirect/src/wfd_ug_genlist.c +++ b/ug-wifidirect/src/wfd_ug_genlist.c @@ -133,6 +133,7 @@ static char *_gl_device_name_label_get(void *data, Evas_Object *obj, char *dev_name = NULL; char str[WFD_GLOBALIZATION_STR_LENGTH] = {0, }; char buf[WFD_GLOBALIZATION_STR_LENGTH] = {0, }; + char *format_str = NULL; if (!strcmp("elm.text.multiline", part)) { DBG(LOG_INFO, "%s", ugd->dev_name); @@ -144,9 +145,8 @@ static char *_gl_device_name_label_get(void *data, Evas_Object *obj, return NULL; } - snprintf(str, WFD_GLOBALIZATION_STR_LENGTH, - D_("IDS_WIFI_BODY_YOUR_DEVICE_HPS_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES"), - dev_name); + format_str = D_("IDS_WIFI_BODY_YOUR_DEVICE_HPS_IS_CURRENTLY_VISIBLE_TO_NEARBY_DEVICES"); + snprintf(str, WFD_GLOBALIZATION_STR_LENGTH, format_str, dev_name); snprintf(buf, WFD_GLOBALIZATION_STR_LENGTH, "%s", str); diff --git a/ug-wifidirect/src/wfd_ug_main_view.c b/ug-wifidirect/src/wfd_ug_main_view.c index 3d5f117..abf2f20 100755 --- a/ug-wifidirect/src/wfd_ug_main_view.c +++ b/ug-wifidirect/src/wfd_ug_main_view.c @@ -434,6 +434,7 @@ static void _gl_peer_sel(void *data, Evas_Object *obj, void *event_info) struct ug_data *ugd = wfd_get_ug_data(); device_type_s *peer = (device_type_s *)data; Elm_Object_Item *item = (Elm_Object_Item *)event_info; + char *format_str = NULL; if (!ugd || !peer) { DBG(LOG_ERROR, "NULL parameters.\n"); @@ -444,7 +445,8 @@ static void _gl_peer_sel(void *data, Evas_Object *obj, void *event_info) DBG(LOG_INFO, "No of connected peers= %d",ugd->raw_connected_peer_cnt); if (ugd->raw_connected_peer_cnt >= MAX_CONNECTED_PEER_NUM) { - snprintf(popup_text, MAX_POPUP_TEXT_SIZE, D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"), MAX_CONNECTED_PEER_NUM); + format_str = D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"); + snprintf(popup_text, MAX_POPUP_TEXT_SIZE, format_str, MAX_CONNECTED_PEER_NUM); wfd_ug_warn_popup(ugd, popup_text, POP_TYPE_MULTI_CONNECT_POPUP); if (item) { elm_genlist_item_selected_set(item, EINA_FALSE); diff --git a/ug-wifidirect/src/wfd_ug_multiconnect_view.c b/ug-wifidirect/src/wfd_ug_multiconnect_view.c index 6b751dd..a849c2f 100644 --- a/ug-wifidirect/src/wfd_ug_multiconnect_view.c +++ b/ug-wifidirect/src/wfd_ug_multiconnect_view.c @@ -311,6 +311,7 @@ void _connect_btn_cb(void *data, Evas_Object *obj, void *event_info) int count = 0; char popup_text[MAX_POPUP_TEXT_SIZE] = {0}; device_type_s *peer = NULL; + char *format_str = NULL; peer = ugd->multi_conn_dev_list_start; while (peer != NULL) { @@ -323,7 +324,8 @@ void _connect_btn_cb(void *data, Evas_Object *obj, void *event_info) /* if more than 7 device selected, show the popup */ if (count > MAX_CONNECTED_PEER_NUM) { - snprintf(popup_text, MAX_POPUP_TEXT_SIZE, D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"), MAX_CONNECTED_PEER_NUM); + format_str = D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"); + snprintf(popup_text, MAX_POPUP_TEXT_SIZE, format_str, MAX_CONNECTED_PEER_NUM); wfd_ug_warn_popup(ugd, popup_text, POP_TYPE_MULTI_CONNECT_POPUP); __FUNC_EXIT__; return; @@ -385,6 +387,7 @@ static void _wfd_gl_multi_sel_cb(void *data, Evas_Object *obj, void *event_info) const char *object_type = NULL; struct ug_data *ugd = (struct ug_data *)wfd_get_ug_data(); device_type_s *peer = (device_type_s *)data; + char *format_str = NULL; if (NULL == ugd) { DBG(LOG_ERROR, "ugd is NULL\n"); @@ -434,7 +437,8 @@ static void _wfd_gl_multi_sel_cb(void *data, Evas_Object *obj, void *event_info) if (is_sel) { char title[MAX_POPUP_TEXT_SIZE] = {0}; - snprintf(title, MAX_POPUP_TEXT_SIZE, D_("IDS_ST_HEADER_PD_SELECTED"), sel_count); + format_str = D_("IDS_ST_HEADER_PD_SELECTED"); + snprintf(title, MAX_POPUP_TEXT_SIZE, format_str, sel_count); wfd_naviframe_title_set(ugd, title); } else { wfd_naviframe_title_set(ugd, D_("IDS_DLNA_HEADER_SELECT_DEVICES_ABB")); @@ -601,6 +605,7 @@ static void _gl_unrealized(void *data, Evas_Object *obj, void *event_info) int sel_count = 0; bool is_sel = FALSE; device_type_s *peer = NULL; + char *format_str = NULL; if (!ugd->multiconn_conn_btn) { DBG(LOG_INFO, "popup naviframe, no need to update UI\n"); @@ -620,7 +625,8 @@ static void _gl_unrealized(void *data, Evas_Object *obj, void *event_info) if (is_sel) { char title[MAX_POPUP_TEXT_SIZE] = {0}; - snprintf(title, MAX_POPUP_TEXT_SIZE, D_("IDS_ST_HEADER_PD_SELECTED"), sel_count); + format_str = D_("IDS_ST_HEADER_PD_SELECTED"); + snprintf(title, MAX_POPUP_TEXT_SIZE, format_str, sel_count); wfd_naviframe_title_set(ugd, title); } else { wfd_naviframe_title_set(ugd, D_("IDS_DLNA_HEADER_SELECT_DEVICES_ABB")); @@ -760,6 +766,7 @@ void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object * obj, void Evas_Object *content = NULL; const char *object_type; Eina_Bool state; + char *format_str = NULL; struct ug_data *ugd = (struct ug_data *)data; @@ -805,8 +812,8 @@ void wfd_genlist_select_all_check_changed_cb(void *data, Evas_Object * obj, void ugd->is_multi_check_all_selected = TRUE; char title[MAX_POPUP_TEXT_SIZE] = {0}; - snprintf(title, MAX_POPUP_TEXT_SIZE, - D_("IDS_ST_HEADER_PD_SELECTED"), sel_count); + format_str = D_("IDS_ST_HEADER_PD_SELECTED"); + snprintf(title, MAX_POPUP_TEXT_SIZE, format_str, sel_count); wfd_naviframe_title_set(ugd, title); if (ugd->multiconn_layout) { diff --git a/ug-wifidirect/src/wfd_ug_popup.c b/ug-wifidirect/src/wfd_ug_popup.c index 5405eeb..bda5677 100755 --- a/ug-wifidirect/src/wfd_ug_popup.c +++ b/ug-wifidirect/src/wfd_ug_popup.c @@ -462,7 +462,7 @@ void act_popup_language_changed(void *data, Evas_Object *obj, void *event_info) { __FUNC_ENTER__; - int popup_type = (int)data; + unsigned long int popup_type = (unsigned long int)data; Evas_Object *btn1 = NULL; Evas_Object *btn2 = NULL; struct ug_data *ugd = wfd_get_ug_data(); @@ -536,7 +536,8 @@ void wfd_ug_act_popup(void *data, const char *message, int popup_type) elm_object_domain_translatable_part_text_set(popup, "title,text", PACKAGE, D_("IDS_WIFI_HEADER_WI_FI_DIRECT_CONNECTION_ABB")); elm_object_domain_translatable_text_set(popup, PACKAGE, message); - evas_object_smart_callback_add(popup, "language,changed", act_popup_language_changed, (void *)popup_type); + evas_object_smart_callback_add(popup, "language,changed", act_popup_language_changed, + (void *) (intptr_t) popup_type); btn1 = elm_button_add(popup); btn2 = elm_button_add(popup); @@ -720,10 +721,11 @@ void warn_popup_language_changed(void *data, Evas_Object *obj, void *event_info) { __FUNC_ENTER__; - int popup_type = (int)data; + unsigned long int popup_type = (unsigned long int)data; struct ug_data *ugd = wfd_get_ug_data(); char popup_text[MAX_POPUP_TEXT_SIZE] = {0}; Evas_Object *btn = NULL; + char *format_str = NULL; if (!ugd || !ugd->warn_popup) { DBG(LOG_ERROR, "NULL parameters.\n"); @@ -756,7 +758,8 @@ void warn_popup_language_changed(void *data, Evas_Object *obj, void *event_info) "IDS_ST_POP_DEVICE_CONNECTED_TO_ANOTHER_DEVICE"); break; case POP_TYPE_MULTI_CONNECT_POPUP: - snprintf(popup_text, MAX_POPUP_TEXT_SIZE, D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"), MAX_CONNECTED_PEER_NUM); + format_str = D_("IDS_ST_POP_YOU_CAN_CONNECT_UP_TO_PD_DEVICES_AT_THE_SAME_TIME"); + snprintf(popup_text, MAX_POPUP_TEXT_SIZE, format_str, MAX_CONNECTED_PEER_NUM); elm_object_domain_translatable_text_set(ugd->warn_popup, PACKAGE, popup_text); break; @@ -794,7 +797,8 @@ void wfd_ug_warn_popup(void *data, const char *message, int popup_type) PACKAGE, D_("IDS_WIFI_HEADER_WI_FI_DIRECT_CONNECTION_ABB")); } elm_object_domain_translatable_text_set(popup, PACKAGE, message); - evas_object_smart_callback_add(popup, "language,changed", warn_popup_language_changed, (void *)popup_type); + evas_object_smart_callback_add(popup, "language,changed", warn_popup_language_changed, + (void *) (intptr_t) popup_type); btn = elm_button_add(popup); elm_object_style_set(btn, "popup"); -- 2.7.4