On Sun, 27 Apr 2014 04:11:21 -0700 Wonguk Jeong <wonguk.je...@samsung.com> wrote:
> cedric pushed a commit to branch master. > > http://git.enlightenment.org/core/efl.git/commit/?id=66b784c804412242785fcc0b29c1a1ad64808eb4 > > commit 66b784c804412242785fcc0b29c1a1ad64808eb4 > Author: Wonguk Jeong <wonguk.je...@samsung.com> > Date: Sun Apr 27 13:10:25 2014 +0200 > > emotion: use eina stringshare not strdup > > Summary: @fix > > Reviewers: raster, cedric > > Reviewed By: cedric > > CC: seoz, cedric > > Differential Revision: https://phab.enlightenment.org/D804 > --- > src/lib/emotion/emotion_smart.c | 23 ++++++++++------------- > 1 file changed, 10 insertions(+), 13 deletions(-) > > diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c > index 7ec603b..e60506b 100644 > --- a/src/lib/emotion/emotion_smart.c > +++ b/src/lib/emotion/emotion_smart.c > @@ -225,9 +225,9 @@ _smart_data_free(Smart_Data *sd) > sd->job = NULL; > if (sd->anim) ecore_animator_del(sd->anim); > sd->anim = NULL; > - free(sd->progress.info); > + eina_stringshare_del(sd->progress.info); > sd->progress.info = NULL; > - free(sd->ref.file); > + eina_stringshare_del(sd->ref.file); > sd->ref.file = NULL; > free(sd); > > @@ -341,12 +341,12 @@ emotion_object_init(Evas_Object *obj, const char > *module_filename) > file = sd->file; > sd->file = NULL; > > - free(sd->title); > + eina_stringshare_del(sd->title); > sd->title = NULL; > - free(sd->progress.info); > + eina_stringshare_del(sd->progress.info); > sd->progress.info = NULL; > sd->progress.stat = 0.0; > - free(sd->ref.file); > + eina_stringshare_del(sd->ref.file); > sd->ref.file = NULL; > sd->ref.num = 0; > sd->spu.button_num = 0; > @@ -1565,8 +1565,7 @@ _emotion_title_set(Evas_Object *obj, char *title) > Smart_Data *sd; > > E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); > - free(sd->title); > - sd->title = strdup(title); > + eina_stringshare_replace(&sd->title, title); > evas_object_smart_callback_call(obj, SIG_TITLE_CHANGE, NULL); > } > > @@ -1576,8 +1575,7 @@ _emotion_progress_set(Evas_Object *obj, char *info, > double st) > Smart_Data *sd; > > E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); > - free(sd->progress.info); > - sd->progress.info = strdup(info); > + eina_stringshare_replace(&sd->progress.info, info); > sd->progress.stat = st; > evas_object_smart_callback_call(obj, SIG_PROGRESS_CHANGE, NULL); > } > @@ -1588,8 +1586,7 @@ _emotion_file_ref_set(Evas_Object *obj, const char > *file, int num) > Smart_Data *sd; > > E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME); > - free(sd->ref.file); > - sd->ref.file = strdup(file); > + eina_stringshare_replace(&sd->ref.file, file); > sd->ref.num = num; > evas_object_smart_callback_call(obj, SIG_REF_CHANGE, NULL); > } > @@ -1866,9 +1863,9 @@ _smart_del(Evas_Object * obj) > sd->job = NULL; > if (sd->anim) ecore_animator_del(sd->anim); > sd->anim = NULL; > - free(sd->progress.info); > + eina_stringshare_del(sd->progress.info); > sd->progress.info = NULL; > - free(sd->ref.file); > + eina_stringshare_del(sd->ref.file); > sd->ref.file = NULL; > if (sd->smartobj) evas_object_smart_data_set(sd->smartobj, NULL); > sd->smartobj = NULL; > lib/emotion/emotion_smart.c: In function '_emotion_title_set': lib/emotion/emotion_smart.c:1568:4: warning: passing argument 1 of 'eina_stringshare_replace' from incompatible pointer type [enabled by default] In file included from ../src/lib/eina/eina_stringshare.h:338:0, from ../src/lib/eina/Eina.h:237, from ../src/lib/evas/Evas.h:251, from lib/emotion/emotion_smart.c:5: ../src/lib/eina/eina_inline_stringshare.x:78:1: note: expected 'const Eina_Stringshare **' but argument is of type 'char **' lib/emotion/emotion_smart.c: In function '_emotion_progress_set': lib/emotion/emotion_smart.c:1578:4: warning: passing argument 1 of 'eina_stringshare_replace' from incompatible pointer type [enabled by default] In file included from ../src/lib/eina/eina_stringshare.h:338:0, from ../src/lib/eina/Eina.h:237, from ../src/lib/evas/Evas.h:251, from lib/emotion/emotion_smart.c:5: ../src/lib/eina/eina_inline_stringshare.x:78:1: note: expected 'const Eina_Stringshare **' but argument is of type 'char **' lib/emotion/emotion_smart.c: In function '_emotion_file_ref_set': lib/emotion/emotion_smart.c:1589:4: warning: passing argument 1 of 'eina_stringshare_replace' from incompatible pointer type [enabled by default] In file included from ../src/lib/eina/eina_stringshare.h:338:0, from ../src/lib/eina/Eina.h:237, from ../src/lib/evas/Evas.h:251, from lib/emotion/emotion_smart.c:5: ../src/lib/eina/eina_inline_stringshare.x:78:1: note: expected 'const Eina_Stringshare **' but argument is of type 'char **' ------------------------------------------------------------------------------ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel