未验证 提交 754b3638 编写于 作者: L Lynx Zhou 提交者: GitHub

Add list iterators over list elements

Address the comments from armink@rt-thread
上级 3b9dfc6a
...@@ -278,7 +278,7 @@ rt_inline int rt_slist_isempty(rt_slist_t *l) ...@@ -278,7 +278,7 @@ rt_inline int rt_slist_isempty(rt_slist_t *l)
* @head: the head for your single list. * @head: the head for your single list.
*/ */
#define rt_slist_for_each(pos, head) \ #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 * rt_slist_for_each_entry - iterate over single list of given type
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册