list: Don't leave out last element in for_each_list()
This commit is contained in:
parent
580ab1f584
commit
d7292f1fe2
@ -36,10 +36,10 @@
|
|||||||
* to each element in the list, in turn.
|
* to each element in the list, in turn.
|
||||||
*/
|
*/
|
||||||
#define for_each_list(it, head, parent_type, member) \
|
#define for_each_list(it, head, parent_type, member) \
|
||||||
for (it = container((head)->next, parent_type, member); it->member.next != (head); it = container(it->member.next, parent_type, member))
|
for (it = container((head)->next, parent_type, member); &it->member != (head); it = container(it->member.next, parent_type, member))
|
||||||
|
|
||||||
#define for_each_list_noinit(it, head, parent_type, member) \
|
#define for_each_list_noinit(it, head, parent_type, member) \
|
||||||
for (; it->member.next != (head); it = container(it->member.next, parent_type, member))
|
for (; &it->member != (head); it = container(it->member.next, parent_type, member))
|
||||||
|
|
||||||
struct dlist_node {
|
struct dlist_node {
|
||||||
struct dlist_node *next, *prev;
|
struct dlist_node *next, *prev;
|
||||||
|
Loading…
Reference in New Issue
Block a user