From: seoz Date: Wed, 28 Mar 2012 07:04:14 +0000 (+0000) Subject: elm slider: Changed format function callback's const char * to char *. X-Git-Tag: sbs/armel/slp2-target~36^2~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e72d1dffa49061d12c0dd7c3d9d21cc1fdc72b8e;p=framework%2Fuifw%2Felementary.git elm slider: Changed format function callback's const char * to char *. The string will be freed in application's callback later. So 'const' is not appropriate. In elm_slider_indicator_format_function_set and elm_slider_units_format_function_set. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69692 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index bf9f3b3..6a3719d 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -16,11 +16,11 @@ struct _Widget_Data const char *units; const char *indicator; - const char *(*indicator_format_func)(double val); - void (*indicator_format_free)(const char *str); + char *(*indicator_format_func)(double val); + void (*indicator_format_free)(char *str); - const char *(*units_format_func)(double val); - void (*units_format_free)(const char *str); + char *(*units_format_func)(double val); + void (*units_format_free)(char *str); double val, val_min, val_max, val2; Evas_Coord size; @@ -348,7 +348,7 @@ _units_set(Evas_Object *obj) if (!wd) return; if (wd->units_format_func) { - const char *buf; + char *buf; buf = wd->units_format_func(wd->val); edje_object_part_text_set(wd->slider, "elm.units", buf); if (wd->units_format_free) wd->units_format_free(buf); @@ -371,7 +371,7 @@ _indicator_set(Evas_Object *obj) if (!wd) return; if (wd->indicator_format_func) { - const char *buf; + char *buf; buf = wd->indicator_format_func(wd->val); edje_object_part_text_set(wd->slider, "elm.dragable.slider:elm.indicator", buf); if (wd->indicator_format_free) wd->indicator_format_free(buf); @@ -747,8 +747,8 @@ _hash_labels_free_cb(void* label) static void _min_max_set(Evas_Object *obj) { - const char *buf_min = NULL; - const char *buf_max = NULL; + char *buf_min = NULL; + char *buf_max = NULL; Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; @@ -1023,7 +1023,7 @@ elm_slider_inverted_get(const Evas_Object *obj) } EAPI void -elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(double val), void (*free_func)(const char *str)) +elm_slider_indicator_format_function_set(Evas_Object *obj, char *(*func)(double val), void (*free_func)(char *str)) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); @@ -1034,7 +1034,7 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(d } EAPI void -elm_slider_units_format_function_set(Evas_Object *obj, const char *(*func)(double val), void (*free_func)(const char *str)) +elm_slider_units_format_function_set(Evas_Object *obj, char *(*func)(double val), void (*free_func)(char *str)) { ELM_CHECK_WIDTYPE(obj, widtype); Widget_Data *wd = elm_widget_data_get(obj); diff --git a/src/lib/elm_slider.h b/src/lib/elm_slider.h index c42bd09..4e5d2bf 100644 --- a/src/lib/elm_slider.h +++ b/src/lib/elm_slider.h @@ -211,7 +211,7 @@ EAPI const char *elm_slider_indicator_format_get(const Evas_Obj * * @ingroup Slider */ -EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(double val), void (*free_func)(const char *str)); +EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, char *(*func)(double val), void (*free_func)(char *str)); /** * Set the format function pointer for the units label @@ -226,7 +226,7 @@ EAPI void elm_slider_indicator_format_function_set(Evas_ * * @ingroup Slider */ -EAPI void elm_slider_units_format_function_set(Evas_Object *obj, const char *(*func)(double val), void (*free_func)(const char *str)); +EAPI void elm_slider_units_format_function_set(Evas_Object *obj, char *(*func)(double val), void (*free_func)(char *str)); /** * Set the orientation of a given slider widget.