From 4e8732a2ad94982dcde175a6518da33021d2b6e8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 12 Feb 2025 16:33:32 -0500 Subject: Encapsulate macro arguments in parentheses --- src/cli/stasis_indexer/include/helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cli/stasis_indexer/include/helpers.h') 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); -- cgit