From 79a54c57416df617eb6be7b7d71b770ce5934bf8 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 5 Nov 2025 16:26:10 +0100 Subject: [PATCH] core/lib/clist: fix example of clist_foreach usage Also fix some doxygen rendering issues. --- core/lib/include/clist.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/core/lib/include/clist.h b/core/lib/include/clist.h index c646921e57..eed65b6c97 100644 --- a/core/lib/include/clist.h +++ b/core/lib/include/clist.h @@ -62,20 +62,21 @@ * * Or use the clist_foreach() helper function, e.g.,: * - * static int _print_node(clist_node_t *node) - * { - * printf("0x%08x ", (unsigned)node); - * return 0; - * } + * static int _print_node(clist_node_t *node, void *arg) + * { + * (void) arg; // unused optional argument + * printf("0x%08x ", (unsigned)node); + * return 0; + * } * - * [...] - * clist_foreach(&list, _print_node); + * [...] + * clist_foreach(&list, _print_node, NULL); * * To use clist as a queue, use clist_rpush() for adding elements and clist_lpop() * for removal. Using clist_lpush() and clist_rpop() is inefficient due to * clist_rpop()'s O(n) runtime. * - * To use clist as stack, use clist_lpush()/clist_lpop(). + * To use clist as stack, use clist_lpush() / clist_lpop(). * * Implementation details: *