Verified Commit b4046795 authored by Felix Kopp's avatar Felix Kopp
Browse files

list: fix shit

parent c24b183c
......@@ -3,6 +3,8 @@
#pragma once
#include <ardix/util.h>
#include <stddef.h>
#include <toolchain.h>
struct list_head {
......@@ -50,7 +52,7 @@ __always_inline void list_init(struct list_head *head)
cursor = (cursor)->prev)
#define list_for_each_safe(head, cursor, tmp) \
for (cursor = (head)->next, tmp = cursor; \
for (cursor = (head)->next, tmp = (cursor)->next; \
tmp != (head); \
tmp = (tmp)->next, cursor = tmp)
......@@ -67,7 +69,7 @@ __always_inline void list_init(struct list_head *head)
#define list_for_each_entry_safe(head, cursor, tmp, member) \
for (cursor = list_first_entry(head, typeof(*(cursor)), member), \
tmp = list_next_entry(cursor, member); \
&(tmp)->member != (head); \
(tmp)->member.prev != (head); \
cursor = tmp, tmp = list_next_entry(tmp, member))
void list_insert(struct list_head *head, struct list_head *new);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment