Rename EINA_INLIST_ITER_NEXT/EINA_INLIST_ITER_LAST to EINA_INLIST_FOREACH/
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 21 Oct 2008 12:19:57 +0000 (12:19 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 21 Oct 2008 12:19:57 +0000 (12:19 +0000)
EINA_INLIST_REVERSE_FOREACH so it best match is behaviour. Asked by Gustavo.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@36928 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/include/eina_inlist.h
src/lib/eina_benchmark.c
src/lib/eina_counter.c
src/lib/eina_magic.c
src/modules/mp/chained_pool/eina_chained_mempool.c
src/tests/eina_bench_array.c
src/tests/eina_test_inlist.c

index dd05250..8d79679 100644 (file)
@@ -51,8 +51,8 @@ EAPI Eina_Inlist * eina_inlist_demote(Eina_Inlist *list, Eina_Inlist *item);
 EAPI Eina_Iterator *eina_inlist_iterator_new(const Eina_Inlist *in_list);
 EAPI Eina_Accessor *eina_inlist_accessor_new(const Eina_Inlist *in_list);
 
-#define EINA_INLIST_ITER_NEXT(list, l) for (l = (void*)list; l; l = (void*)(l->__in_list.next))
-#define EINA_INLIST_ITER_LAST(list, l) for (l = (void*)(list->last); l; l = (void*)(l->__in_list.prev))
+#define EINA_INLIST_FOREACH(list, l) for (l = (void*)list; l; l = (void*)(l->__in_list.next))
+#define EINA_INLIST_REVERSE_FOREACH(list, l) for (l = (void*)(list->last); l; l = (void*)(l->__in_list.prev))
 
 /** @} */
 
index e2972ef..f2530e4 100644 (file)
@@ -332,7 +332,7 @@ eina_benchmark_run(Eina_Benchmark *bench)
           "set ylabel \"time\"\n"
           "plot ", bench->name, bench->run, bench->name, bench->run);
 
-   EINA_INLIST_ITER_NEXT(bench->runs, run)
+   EINA_INLIST_FOREACH(bench->runs, run)
      {
        Eina_Counter *counter;
        int i;
index e700cda..29a546b 100644 (file)
@@ -396,7 +396,7 @@ eina_counter_dump(Eina_Counter *counter, FILE *out)
 
    fprintf(out, "# specimen\texperiment time\tstarting time\tending time\n");
 
-   EINA_INLIST_ITER_LAST(counter->clocks, clk)
+   EINA_INLIST_REVERSE_FOREACH(counter->clocks, clk)
      {
         long int start;
         long int end;
index 0e9726e..c1bb095 100644 (file)
@@ -95,7 +95,7 @@ eina_magic_string_get(Eina_Magic magic)
 {
    Eina_Magic_String *ems;
 
-   EINA_INLIST_ITER_NEXT(strings, ems)
+   EINA_INLIST_FOREACH(strings, ems)
      if (ems->magic == magic)
        return ems->string;
 
@@ -107,7 +107,7 @@ eina_magic_string_set(Eina_Magic magic, const char *magic_name)
 {
    Eina_Magic_String *ems;
 
-   EINA_INLIST_ITER_NEXT(strings, ems)
+   EINA_INLIST_FOREACH(strings, ems)
      if (ems->magic == magic)
        {
          free(ems->string);
index e2f7c56..2377d20 100644 (file)
@@ -86,7 +86,7 @@ eina_chained_mempool_malloc(void *data, __UNUSED__ unsigned int size)
    void *mem;
 
    // look 4 pool from 2nd bucket on
-   EINA_INLIST_ITER_NEXT(pool->first, p)
+   EINA_INLIST_FOREACH(pool->first, p)
      {
        // base is not NULL - has a free slot
        if (p->base)
@@ -126,7 +126,7 @@ eina_chained_mempool_free(void *data, void *ptr)
    psize = item_alloc * pool->pool_size;
    // look 4 pool
 
-   EINA_INLIST_ITER_NEXT(pool->first, p)
+   EINA_INLIST_FOREACH(pool->first, p)
      {
        // pool mem base
        pmem = (void *)(((unsigned char *)p) + sizeof(Chained_Pool));
index 139d35e..40c8ef7 100644 (file)
@@ -361,7 +361,7 @@ eina_bench_inlist_4evas_render(int request)
               }
          }
 
-       EINA_INLIST_ITER_NEXT(head, ebo)
+       EINA_INLIST_FOREACH(head, ebo)
          ebo->keep = rand() < (RAND_MAX / 2) ? ebo->keep : EINA_FALSE;
      }
 
index 9bfa85e..a42625f 100644 (file)
@@ -82,7 +82,7 @@ START_TEST(eina_inlist_simple)
    tmp = _eina_test_inlist_build(81);
    lst = eina_inlist_append_relative(lst, EINA_INLIST_GET(tmp), NULL);
 
-   EINA_INLIST_ITER_NEXT(lst, tmp)
+   EINA_INLIST_FOREACH(lst, tmp)
      {
        switch (i)
          {