Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset b466ec1 in mainline


Ignore:
Timestamp:
2020-03-14T14:46:11Z (3 weeks ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
e3a68c4e
Parents:
16e23e2
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-05-24 09:23:02)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2020-03-14 14:46:11)
Message:

dyn_array: Hide actual iterator in foreach macro

File:
1 edited

Legend:

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

    r16e23e2 rb466ec1  
    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.