Skip to content

Commit 79a54c5

Browse files
core/lib/clist: fix example of clist_foreach usage
Also fix some doxygen rendering issues.
1 parent 5d26414 commit 79a54c5

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

core/lib/include/clist.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,21 @@
6262
*
6363
* Or use the clist_foreach() helper function, e.g.,:
6464
*
65-
* static int _print_node(clist_node_t *node)
66-
* {
67-
* printf("0x%08x ", (unsigned)node);
68-
* return 0;
69-
* }
65+
* static int _print_node(clist_node_t *node, void *arg)
66+
* {
67+
* (void) arg; // unused optional argument
68+
* printf("0x%08x ", (unsigned)node);
69+
* return 0;
70+
* }
7071
*
71-
* [...]
72-
* clist_foreach(&list, _print_node);
72+
* [...]
73+
* clist_foreach(&list, _print_node, NULL);
7374
*
7475
* To use clist as a queue, use clist_rpush() for adding elements and clist_lpop()
7576
* for removal. Using clist_lpush() and clist_rpop() is inefficient due to
7677
* clist_rpop()'s O(n) runtime.
7778
*
78-
* To use clist as stack, use clist_lpush()/clist_lpop().
79+
* To use clist as stack, use clist_lpush() / clist_lpop().
7980
*
8081
* Implementation details:
8182
*

0 commit comments

Comments
 (0)