summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMark Stapp <mjs.ietf@gmail.com>2023-09-12 17:20:50 +0200
committerGitHub <noreply@github.com>2023-09-12 17:20:50 +0200
commitbf4e97c632538b6f79ff0a9ae738f2d12485c01c (patch)
tree4c7a80bed4db98050bbd0aa2e2207e2e5e581e48 /lib
parentMerge pull request #14379 from donaldsharp/peer_connection_part_two (diff)
parentlib: add inline comment about _const iteration (diff)
downloadfrr-bf4e97c632538b6f79ff0a9ae738f2d12485c01c.tar.xz
frr-bf4e97c632538b6f79ff0a9ae738f2d12485c01c.zip
Merge pull request #14365 from opensourcerouting/typesafe-const-declutter
Revert "lib: add a frr_each_const macro"
Diffstat (limited to 'lib')
-rw-r--r--lib/typesafe.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/typesafe.h b/lib/typesafe.h
index 8eb59c33b..a84298b06 100644
--- a/lib/typesafe.h
+++ b/lib/typesafe.h
@@ -17,12 +17,14 @@ extern "C" {
/* generic macros for all list-like types */
+/* to iterate using the const variants of the functions, append "_const" to
+ * the name of the container, e.g. "frr_each (my_list, head, item)" becomes
+ * "frr_each (my_list_const, head, item)"
+ */
+
#define frr_each(prefix, head, item) \
for (item = prefix##_first(head); item; \
item = prefix##_next(head, item))
-#define frr_each_const(prefix, head, item) \
- for (item = prefix##_const_first(head); item; \
- item = prefix##_const_next(head, item))
#define frr_each_safe(prefix, head, item) \
for (typeof(prefix##_next_safe(head, NULL)) prefix##_safe = \
prefix##_next_safe(head, \