From: Youngjae Shin Date: Thu, 30 Jul 2020 05:36:41 +0000 (+0900) Subject: fix incompatible typecasing X-Git-Tag: accepted/tizen/unified/20200731.145623^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F29%2F239829%2F1;p=apps%2Fnative%2Fug-wifi-efl.git fix incompatible typecasing Change-Id: I83ea0e5328763465679e9e9aaafb46d39cdeaac6 --- diff --git a/common/common_eap_connect.c b/common/common_eap_connect.c index e12b2a7..2b8bc47 100644 --- a/common/common_eap_connect.c +++ b/common/common_eap_connect.c @@ -247,7 +247,7 @@ static void __gl_eap_type_sub_sel_language_changed_cb(void *data, Evas_Object *o __COMMON_FUNC_ENTER__; retm_if(obj == NULL); - int val = (int)data; + int val = GPOINTER_TO_INT(data); char str[1024]; char *txt = NULL; @@ -311,7 +311,7 @@ static void _gl_eap_type_sub_sel(void *data, Evas_Object *obj, void *event_info) &popup_data); g_free(popup_data.info_txt); evas_object_smart_callback_add(eap_data->confirm, "language,changed", - __gl_eap_type_sub_sel_language_changed_cb, (void *)value); + __gl_eap_type_sub_sel_language_changed_cb, GINT_TO_POINTER(value)); _create_and_update_list_items_based_on_rules(sel_index, data); wifi_manager_eap_type_e type; diff --git a/common/common_pswd_popup.c b/common/common_pswd_popup.c index 298acb6..c44b968 100644 --- a/common/common_pswd_popup.c +++ b/common/common_pswd_popup.c @@ -313,7 +313,7 @@ static char *_gl_wps_text_get(void *data, Evas_Object *obj, const char *part) { if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) { char buf[1024]; - snprintf(buf, 1023, "%s", sc(PACKAGE, (int)data)); + snprintf(buf, 1023, "%s", sc(PACKAGE, GPOINTER_TO_INT(data))); return g_strdup(dgettext(PACKAGE, buf)); } return NULL; @@ -324,7 +324,7 @@ static void _gl_realized(void *data, Evas_Object *obj, void *event_info) if (!event_info) return; - int index = (int)elm_object_item_data_get(event_info); + int index = GPOINTER_TO_INT(elm_object_item_data_get(event_info)); if (index == I18N_TYPE_WPS_PIN) elm_object_item_signal_emit(event_info, "elm,state,bottomline,hide", ""); diff --git a/ui-gadget/view_advanced.c b/ui-gadget/view_advanced.c index d21d3ba..9ce78f8 100644 --- a/ui-gadget/view_advanced.c +++ b/ui-gadget/view_advanced.c @@ -241,8 +241,9 @@ static char *_gl_sort_by_text_get(void *data, Evas_Object *obj, { char buf[1024]; if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) { - if ((int) data != 0) { - snprintf(buf, 1023, "%s", sc(PACKAGE, (int) data)); + int i18type = GPOINTER_TO_INT(data); + if (i18type != 0) { + snprintf(buf, 1023, "%s", sc(PACKAGE, i18type)); return strdup(buf); } } else if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].sub_text_part, part)) { @@ -263,8 +264,9 @@ static char *_gl_sort_by_sub_text_get(void *data, Evas_Object *obj, const char * { char buf[1024]; if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) { - if ((int) data != 0) { - snprintf(buf, 1023, "%s", sc(PACKAGE, (int) data)); + int i18type = GPOINTER_TO_INT(data); + if (i18type != 0) { + snprintf(buf, 1023, "%s", sc(PACKAGE, i18type)); return strdup(buf); } } @@ -293,8 +295,9 @@ static char *_gl_text_get(void *data, Evas_Object *obj, { char buf[1024]; if (!strcmp(g_genlist_info[WIFI_GENLIST_1LINE_STYLE].text_part, part)) { - if ((int) data != 0) { - snprintf(buf, 1023, "%s", sc(PACKAGE, (int) data)); + int i18type = GPOINTER_TO_INT(data); + if (i18type != 0) { + snprintf(buf, 1023, "%s", sc(PACKAGE, i18type)); return strdup(buf); } } @@ -450,13 +453,13 @@ static void _gl_changed_keep_wifi_sub(void *data, Evas_Object *obj, return; } - value = _convert_wifi_keep_value_to_vconf((int) data); + value = _convert_wifi_keep_value_to_vconf(GPOINTER_TO_INT(data)); if (value >= 0) common_util_set_system_registry(VCONF_SLEEP_POLICY, value); if (g_strcmp0(object_type, "elm_genlist") == 0) - elm_radio_value_set(g_pd.keep_wifi_radio_group, (int) data); + elm_radio_value_set(g_pd.keep_wifi_radio_group, GPOINTER_TO_INT(data)); if (item != NULL) { elm_genlist_item_update(item); @@ -495,15 +498,15 @@ static Evas_Object *_gl_content_get_keep_wifi_sub(void *data, #ifdef ACCESSIBLITY_FEATURE elm_access_object_unregister(radio); #endif - elm_radio_state_value_set(radio, (int) data); + elm_radio_state_value_set(radio, GPOINTER_TO_INT(data)); elm_radio_group_add(radio, g_pd.keep_wifi_radio_group); elm_layout_content_set(content, "elm.swallow.content", radio); value = _convert_vconf_to_wifi_keep_value( common_util_get_system_registry(VCONF_SLEEP_POLICY)); - if (value == (int) data) - elm_radio_value_set(g_pd.keep_wifi_radio_group, (int) data); + if (value == GPOINTER_TO_INT(data)) + elm_radio_value_set(g_pd.keep_wifi_radio_group, GPOINTER_TO_INT(data)); evas_object_smart_callback_add(radio, "changed", _gl_changed_keep_wifi_sub, data); } @@ -530,12 +533,12 @@ static void _gl_changed_sort_by_sub(void *data, Evas_Object *obj, return; } - value = _convert_sort_by_value_to_vconf((int) data); + value = _convert_sort_by_value_to_vconf(GPOINTER_TO_INT(data)); if (value >= 0) common_util_set_system_registry(VCONF_SORT_BY, value); if (g_strcmp0(object_type, "elm_genlist") == 0) - elm_radio_value_set(g_pd.sort_by_radio_group, (int) data); + elm_radio_value_set(g_pd.sort_by_radio_group, GPOINTER_TO_INT(data)); if (item != NULL) { elm_genlist_item_update(item); @@ -576,7 +579,7 @@ static Evas_Object *_gl_content_get_sort_by_sub(void *data, #ifdef ACCESSIBLITY_FEATURE elm_access_object_unregister(radio); #endif - elm_radio_state_value_set(radio, (int) data); + elm_radio_state_value_set(radio, GPOINTER_TO_INT(data)); elm_radio_group_add(radio, g_pd.sort_by_radio_group); elm_layout_content_set(content, "elm.swallow.content", radio); @@ -584,8 +587,8 @@ static Evas_Object *_gl_content_get_sort_by_sub(void *data, value = _convert_vconf_to_sort_by_value( common_util_get_system_registry(VCONF_SORT_BY)); - if (value == (int) data) - elm_radio_value_set(g_pd.sort_by_radio_group, (int) data); + if (value == GPOINTER_TO_INT(data)) + elm_radio_value_set(g_pd.sort_by_radio_group, GPOINTER_TO_INT(data)); evas_object_smart_callback_add(radio, "changed", _gl_changed_sort_by_sub, data); diff --git a/ui-gadget/viewer_manager.c b/ui-gadget/viewer_manager.c index 61da062..c6ec11b 100644 --- a/ui-gadget/viewer_manager.c +++ b/ui-gadget/viewer_manager.c @@ -676,7 +676,7 @@ static void __power_onoff_cb(void *data, Evas_Object *obj, void *event_info) static char *_gl_wifi_onoff_text_get(void *data, Evas_Object *obj, const char *part) { char *det = NULL; - int ug_type = (int) data; + int ug_type = GPOINTER_TO_INT(data); retvm_if(NULL == manager_object, NULL); @@ -745,7 +745,7 @@ static Evas_Object *_gl_wifi_onoff_content_get(void *data, return NULL; Evas_Object *c = NULL; - int ug_type = (int) data; + int ug_type = GPOINTER_TO_INT(data); const char *style; // On&Off toggle button @@ -815,7 +815,7 @@ static void __viewer_manager_wifi_onoff_item_create(Evas_Object* genlist, int ug wifi_onoff_itc.func.del = NULL; manager_object->item_wifi_onoff = elm_genlist_item_append(genlist, - &wifi_onoff_itc, (void *)ug_type, NULL, ELM_GENLIST_ITEM_NONE, + &wifi_onoff_itc, GINT_TO_POINTER(ug_type), NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); elm_genlist_item_select_mode_set(manager_object->item_wifi_onoff, ELM_OBJECT_SELECT_MODE_NONE); diff --git a/ui-gadget/wifi_viewer_list.c b/ui-gadget/wifi_viewer_list.c index e2032f5..ada215c 100644 --- a/ui-gadget/wifi_viewer_list.c +++ b/ui-gadget/wifi_viewer_list.c @@ -354,13 +354,13 @@ static void _gl_realized(void *data, Evas_Object *obj, void *event_info) if (first_item == NULL || last_item == NULL) return; - int index = (int)elm_genlist_item_index_get(item); - int first_item_index = (int)elm_genlist_item_index_get(first_item); - int last_item_index = (int)elm_genlist_item_index_get(last_item); + int index = elm_genlist_item_index_get(item); + int first_item_index = elm_genlist_item_index_get(first_item); + int last_item_index = elm_genlist_item_index_get(last_item); char buf[100] = ""; if (first_item_index == -1) { - int group_index = (int)elm_genlist_item_index_get(grouptitle); + int group_index = elm_genlist_item_index_get(grouptitle); first_item_index = group_index + 1; } @@ -381,10 +381,10 @@ static void _gl_realized(void *data, Evas_Object *obj, void *event_info) if (first_item == NULL) return; - int first_item_index = (int)elm_genlist_item_index_get(first_item); + int first_item_index = elm_genlist_item_index_get(first_item); if (first_item_index == -1) { - int group_index = (int)elm_genlist_item_index_get(grouptitle); + int group_index = elm_genlist_item_index_get(grouptitle); first_item_index = group_index + 1; } #endif