diff options
author | van Hauser <vh@thc.org> | 2020-04-02 16:41:33 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-04-09 10:23:37 +0200 |
commit | e8e6dbf83962900eb9a0909ca4f2e8aeea6d96e9 (patch) | |
tree | 02f97bf65e9fe9cfa6ba08dac48556bf787247a5 /include/list.h | |
parent | 5602a09cc61371fcb2527963368bc99dbc66ff8d (diff) | |
download | AFLplusplus-e8e6dbf83962900eb9a0909ca4f2e8aeea6d96e9.tar.gz |
small enhancements and code-format
Diffstat (limited to 'include/list.h')
-rw-r--r-- | include/list.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/include/list.h b/include/list.h index d9cd9d34..e93b4e8f 100644 --- a/include/list.h +++ b/include/list.h @@ -98,24 +98,23 @@ static inline void list_append(list_t *list, void *el) { A return from this block will return from calling func. */ -#define LIST_FOREACH(list, type, block) \ - do { \ - \ - list_t * li = (list); \ - element_t *head = get_head((li)); \ - element_t *el_box = (head)->next; \ - if (!el_box) FATAL("foreach over uninitialized list"); \ - while (el_box != head) { \ - \ - __attribute__((unused)) \ - type *el = (type *)((el_box)->data); \ - /* get next so el_box can be unlinked */ \ - element_t *next = el_box->next; \ - {block}; \ - el_box = next; \ - \ - } \ - \ +#define LIST_FOREACH(list, type, block) \ + do { \ + \ + list_t * li = (list); \ + element_t *head = get_head((li)); \ + element_t *el_box = (head)->next; \ + if (!el_box) FATAL("foreach over uninitialized list"); \ + while (el_box != head) { \ + \ + __attribute__((unused)) type *el = (type *)((el_box)->data); \ + /* get next so el_box can be unlinked */ \ + element_t *next = el_box->next; \ + {block}; \ + el_box = next; \ + \ + } \ + \ } while (0); /* In foreach: remove the current el from the list */ |