Changeset c1b2084 in mainline


Ignore:
Timestamp:
2019-08-06T18:26:36Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
73f7c4e
Parents:
e55741e
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-05-24 09:23:02)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 18:26:36)
Message:

dyn_array: Hide actual iterator in foreach macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/dyn_array.h

    re55741e rc1b2084  
    101101 */
    102102#define dyn_array_foreach(dyn_array, type, it)                                 \
    103         for (type *it = (type *)(dyn_array)._data;                             \
    104             it != ((type *)(dyn_array)._data + (dyn_array).size); ++it)
     103        for (type *it = NULL; it == NULL; it = (type *)1)                      \
     104            for (type *_it = (type *)(dyn_array)._data;                        \
     105            it = _it, _it != ((type *)(dyn_array)._data + (dyn_array).size);   \
     106            ++_it)
    105107
    106108/** Find first occurence of value
Note: See TracChangeset for help on using the changeset viewer.