More use of iterator macro.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 20 Oct 2008 12:36:48 +0000 (12:36 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 20 Oct 2008 12:36:48 +0000 (12:36 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@36852 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_callbacks.c
src/lib/engines/common/evas_font_load.c

index 0c6a30c..9dfedf6 100644 (file)
@@ -41,16 +41,11 @@ evas_object_event_callback_clear(Evas_Object *obj)
 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 @@ EAPI void *
 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 @@ evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, void (
 
    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 @@ EAPI void *
 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 @@ evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, v
 
    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;
index cb5b80c..01ca4af 100644 (file)
@@ -91,14 +91,11 @@ evas_common_font_source_load_complete(RGBA_Font_Source *fs)
 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 @@ font_flush_free_glyph_cb(const Evas_Hash *hash, const char *key, void *data, voi
 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 @@ evas_common_font_flush_last(void)
 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);