Add list iterators over list elements

Address the comments from armink@rt-thread
This commit is contained in:
Lynx Zhou 2018-07-11 17:14:44 +08:00 committed by GitHub
parent 3b9dfc6aed
commit 754b363839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -278,7 +278,7 @@ rt_inline int rt_slist_isempty(rt_slist_t *l)
* @head: the head for your single list.
*/
#define rt_slist_for_each(pos, head) \
for (pos = (head)->next; &pos->next != (head); pos = pos->next)
for (pos = (head)->next; pos != RT_NULL; pos = pos->next)
/**
* rt_slist_for_each_entry - iterate over single list of given type