summaryrefslogtreecommitdiffhomepage
path: root/misc/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-05 15:12:52 +0100
committerTyge Løvset <[email protected]>2023-01-05 15:12:52 +0100
commit45bfcdc35788988f5c8b2b53a62f7fb8c5e1cf50 (patch)
treea834aecc95006cfca2d6aa2c67c5db94d098fb76 /misc/examples
parent1a98d0b660775f9a434197430905024519a0efbf (diff)
downloadSTC-modified-45bfcdc35788988f5c8b2b53a62f7fb8c5e1cf50.tar.gz
STC-modified-45bfcdc35788988f5c8b2b53a62f7fb8c5e1cf50.zip
Added clist_X_get_node(valptr) to complete the node API.
Diffstat (limited to 'misc/examples')
-rw-r--r--misc/examples/intrusive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/intrusive.c b/misc/examples/intrusive.c
index a0ac6095..7e7a7b39 100644
--- a/misc/examples/intrusive.c
+++ b/misc/examples/intrusive.c
@@ -1,4 +1,4 @@
-// Example of intrusive list by using the node API and typesafe c_CONTAINER_OF().
+// Example of intrusive list by using the node API.
#include <stdio.h>
@@ -33,7 +33,7 @@ int main()
Outer_push_back(&outer, (Inner_node){NULL, *i.ref});
c_FOREACH (i, Outer, outer)
- Inner_push_node_back(&inner, c_CONTAINER_OF(&i.ref->value, Inner_node, value));
+ Inner_push_node_back(&inner, Inner_get_node(&i.ref->value));
printLists(inner, outer);
@@ -47,7 +47,7 @@ int main()
if (it1.ref) {
Inner_unlink_node_after(&inner, it1.prev);
- free(Outer_unlink_node_after(&outer, c_CONTAINER_OF(it1.prev, Outer_node, value)));
+ free(Outer_unlink_node_after(&outer, Outer_get_node(it1.prev)));
}
printLists(inner, outer);