From b4e3696101b049815dac8459b2b9cb18213b489e Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 7 Jul 2025 13:19:13 -0400 Subject: list: Simplify macros with C23 features We can avoid the MACRO_((list), __VA_ARGS__, ) dance since the comma is no longer required. typeof() also comes in handy. --- tests/list.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/list.c') diff --git a/tests/list.c b/tests/list.c index 5d0403f..1d70f33 100644 --- a/tests/list.c +++ b/tests/list.c @@ -96,4 +96,7 @@ void check_list(void) { SLIST_APPEND(&l2, &i12); SLIST_SPLICE(&l1, &l1.head->next, &l2); bfs_verify(check_list_items(&l1, ARRAY(10, 11, 12, 15, 20))); + + // Check the return type of SLIST_POP() + bfs_check(SLIST_POP(&l1)->n == 10); } -- cgit v1.2.3