From: Enlightenment S. <no-...@en...> - 2008-10-20 12:36:55
|
Log: More use of iterator macro. Author: cedric Date: 2008-10-20 05:36:48 -0700 (Mon, 20 Oct 2008) New Revision: 36852 Modified: trunk/evas/src/lib/canvas/evas_callbacks.c trunk/evas/src/lib/engines/common/evas_font_load.c Modified: trunk/evas/src/lib/canvas/evas_callbacks.c =================================================================== --- trunk/evas/src/lib/canvas/evas_callbacks.c 2008-10-20 12:18:37 UTC (rev 36851) +++ trunk/evas/src/lib/canvas/evas_callbacks.c 2008-10-20 12:36:48 UTC (rev 36852) @@ -41,16 +41,11 @@ void evas_object_event_callback_all_del(Evas_Object *obj) { - Eina_Inlist *l; + Evas_Func_Node *fn; if (!obj->callbacks) return; - for (l = obj->callbacks->callbacks; l; l = l->next) - { - Evas_Func_Node *fn; - - fn = (Evas_Func_Node *)l; - fn->delete_me = 1; - } + EINA_INLIST_ITER_NEXT(obj->callbacks->callbacks, fn) + fn->delete_me = 1; } void @@ -380,7 +375,7 @@ evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info)) { /* MEM OK */ - Eina_Inlist *l; + Evas_Func_Node *fn; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; @@ -390,11 +385,8 @@ if (!obj->callbacks) return NULL; - for (l = obj->callbacks->callbacks; l; l = l->next) + EINA_INLIST_ITER_NEXT(obj->callbacks->callbacks, fn) { - Evas_Func_Node *fn; - - fn = (Evas_Func_Node *)l; if ((fn->func == func) && (fn->type == type) && (!fn->delete_me)) { void *data; @@ -440,7 +432,7 @@ evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), const void *data) { /* MEM OK */ - Eina_Inlist *l; + Evas_Func_Node *fn; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; @@ -450,11 +442,8 @@ if (!obj->callbacks) return NULL; - for (l = obj->callbacks->callbacks; l; l = l->next) + EINA_INLIST_ITER_NEXT(obj->callbacks->callbacks, fn) { - Evas_Func_Node *fn; - - fn = (Evas_Func_Node *)l; if ((fn->func == func) && (fn->type == type) && (fn->data == data) && (!fn->delete_me)) { void *data; Modified: trunk/evas/src/lib/engines/common/evas_font_load.c =================================================================== --- trunk/evas/src/lib/engines/common/evas_font_load.c 2008-10-20 12:18:37 UTC (rev 36851) +++ trunk/evas/src/lib/engines/common/evas_font_load.c 2008-10-20 12:36:48 UTC (rev 36852) @@ -91,14 +91,11 @@ EAPI RGBA_Font_Source * evas_common_font_source_find(const char *name) { - Eina_Inlist *l; + RGBA_Font_Source *fs; if (!name) return NULL; - for (l = fonts_src; l; l = l->next) + EINA_INLIST_ITER_NEXT(fonts_src, fs) { - RGBA_Font_Source *fs; - - fs = (RGBA_Font_Source *)l; if ((fs->name) && (!strcmp(name, fs->name))) { fs->references++; @@ -549,14 +546,11 @@ EAPI void evas_common_font_flush_last(void) { - Eina_Inlist *l; + RGBA_Font_Int *fi_tmp; RGBA_Font_Int *fi = NULL; - for (l = fonts; l; l = l->next) + EINA_INLIST_ITER_NEXT(fonts, fi_tmp) { - RGBA_Font_Int *fi_tmp; - - fi_tmp = (RGBA_Font_Int *)l; if (fi_tmp->references == 0) fi = fi_tmp; } if (!fi) return; @@ -577,13 +571,10 @@ EAPI RGBA_Font_Int * evas_common_font_int_find(const char *name, int size) { - Eina_Inlist *l; + RGBA_Font_Int *fi; - for (l = fonts; l; l = l->next) + EINA_INLIST_ITER_NEXT(fonts, fi) { - RGBA_Font_Int *fi; - - fi = (RGBA_Font_Int *)l; if ((fi->size == size) && (!strcmp(name, fi->src->name))) { if (fi->references == 0) evas_common_font_int_modify_cache_by(fi, -1); |