summaryrefslogtreecommitdiffstats
path: root/coccinelle
diff options
context:
space:
mode:
authorMatteo Croce <teknoraver@meta.com>2024-04-18 14:24:03 +0200
committerMatteo Croce <teknoraver@meta.com>2024-04-18 17:39:34 +0200
commit64f7b2961a18574528bb32dec33bc26de1e773c7 (patch)
tree264f8d9c2d61be48e1e28a5c10602863c1aa4eab /coccinelle
parentMerge pull request #32328 from YHNdnzj/deserialize-objective (diff)
downloadsystemd-64f7b2961a18574528bb32dec33bc26de1e773c7.tar.xz
systemd-64f7b2961a18574528bb32dec33bc26de1e773c7.zip
introduce FOREACH_ELEMENT
Add a FOREACH_ELEMENT() macro which just passes ELEMENTSOF(v) as third argument to FOREACH_ARRAY().
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/parsing_hacks.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/coccinelle/parsing_hacks.h b/coccinelle/parsing_hacks.h
index 9e77e514dd..f88dae0c86 100644
--- a/coccinelle/parsing_hacks.h
+++ b/coccinelle/parsing_hacks.h
@@ -68,6 +68,7 @@
/* Mark a couple of iterator explicitly as iterators, otherwise Coccinelle gets a bit confused. Coccinelle
* can usually infer this information automagically, but in these specific cases it needs a bit of help. */
#define FOREACH_ARRAY(i, array, num) YACFE_ITERATOR
+#define FOREACH_ELEMENT(i, array) YACFE_ITERATOR
#define FOREACH_DIRENT_ALL(de, d, on_error) YACFE_ITERATOR
#define FOREACH_STRING(x, y, ...) YACFE_ITERATOR
#define HASHMAP_FOREACH(e, h) YACFE_ITERATOR