summaryrefslogtreecommitdiffstats
path: root/src/list.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-04-01 14:25:00 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-04-01 14:25:00 -0400
commit536c7e7af3777bc8b8d7f919402aaff51b7cda9d (patch)
tree4f07a63cbaa7bb5b24432c47b71a022e39993f20 /src/list.h
parent86f4b4f7180bca73a734249e67dada708f8275ff (diff)
downloadbfs-536c7e7af3777bc8b8d7f919402aaff51b7cda9d.tar.xz
list: Simplify some macros
Diffstat (limited to 'src/list.h')
-rw-r--r--src/list.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/list.h b/src/list.h
index c43be68..39510e0 100644
--- a/src/list.h
+++ b/src/list.h
@@ -96,8 +96,8 @@
LIST_BLOCK_(SLIST_INIT_((list)))
#define SLIST_INIT_(list) \
- (list)->head = NULL; \
- (list)->tail = &(list)->head;
+ list->head = NULL; \
+ list->tail = &list->head;
/**
* Wraps a group of statements in a block.
@@ -160,22 +160,22 @@
/**
* LIST_LINK_() dispatches to yet another macro:
*
- * LIST_LINK_(next, ) => LIST_LINK__(next, , , . , , )
- * LIST_LINK_(next, link, ) => LIST_LINK__(next, link, , , . , , )
+ * LIST_LINK_(next, ) => LIST_LINK__(next, , . , , )
+ * LIST_LINK_(next, link, ) => LIST_LINK__(next, link, , . , , )
*/
-#define LIST_LINK_(dir, ...) LIST_LINK__(dir, __VA_ARGS__, , . , , )
+#define LIST_LINK_(dir, ...) LIST_LINK__(dir, __VA_ARGS__, . , , )
/**
* And finally, LIST_LINK__() adds the link and the dot if necessary.
*
- * dir link blank ignored dot
- * v v v v v
- * LIST_LINK__(next, , , . , , ) => next
- * LIST_LINK__(next, link, , , . , , ) => link . next
- * ^ ^ ^ ^ ^
- * dir link blank ignored dot
+ * dir link ignored dot
+ * v v v v
+ * LIST_LINK__(next, , . , , ) => next
+ * LIST_LINK__(next, link, , . , , ) => link . next
+ * ^ ^ ^ ^
+ * dir link ignored dot
*/
-#define LIST_LINK__(dir, link, blank, ignored, dot, ...) link dot dir
+#define LIST_LINK__(dir, link, ignored, dot, ...) link dot dir
/**
* SLIST_APPEND_() uses LIST_NEXT_() to generate the right name for the list