aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis_indexer/include/helpers.h
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:33:32 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-02-12 16:33:32 -0500
commit4e8732a2ad94982dcde175a6518da33021d2b6e8 (patch)
tree15007ccd3d06e41060b26f36fca3da24023f550e /src/cli/stasis_indexer/include/helpers.h
parentafecc407fd0d36061169ae64164703382656cafe (diff)
downloadstasis-4e8732a2ad94982dcde175a6518da33021d2b6e8.tar.gz
Encapsulate macro arguments in parentheses
Diffstat (limited to 'src/cli/stasis_indexer/include/helpers.h')
-rw-r--r--src/cli/stasis_indexer/include/helpers.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cli/stasis_indexer/include/helpers.h b/src/cli/stasis_indexer/include/helpers.h
index d493f75..46705d2 100644
--- a/src/cli/stasis_indexer/include/helpers.h
+++ b/src/cli/stasis_indexer/include/helpers.h
@@ -5,12 +5,12 @@
#define ARRAY_COUNT_DYNAMIC(X, COUNTER) \
do { \
- for (COUNTER = 0; X && X[COUNTER] != NULL; COUNTER++) {} \
+ for ((COUNTER) = 0; (X) && (X)[COUNTER] != NULL; (COUNTER)++) {} \
} while(0)
#define ARRAY_COUNT_BY_STRUCT_MEMBER(X, MEMBER, COUNTER) \
do { \
- for (COUNTER = 0; X[COUNTER].MEMBER != NULL; COUNTER++) {} \
+ for ((COUNTER) = 0; (X)[COUNTER].MEMBER != NULL; (COUNTER)++) {} \
} while(0)
struct StrList *get_architectures(struct Delivery ctx[], size_t nelem);