#define STRING_ITERATOR_GET(this) str2chr(this##_s, this##_i++)
#define STRING_ITERATOR_PEEK(this) str2chr(this##_s, this##_i)
-#define STRING_ITERATOR_NEXT(this) MACRO_BEGIN ++this##_i; MACRO_END
-#define STRING_ITERATOR_UNGET(this) MACRO_BEGIN --this##_i; MACRO_END
+#define STRING_ITERATOR_NEXT(this) MACRO_BEGIN { ++this##_i; } MACRO_END
+#define STRING_ITERATOR_UNGET(this) MACRO_BEGIN { --this##_i; } MACRO_END
#define STRING_ITERATOR_SAVE(this) this##_i
#define STRING_ITERATOR_LOAD(this, n) MACRO_BEGIN this##_i = n; MACRO_END
#define SUCCEED() (TEST_ok = true)
/** Add a failure, but continue */
-#define ADD_FAILURE(msg) MACRO_BEGIN ++TEST_failed; LOG_WARN(msg); MACRO_END
+#define ADD_FAILURE(msg) MACRO_BEGIN { ++TEST_failed; LOG_WARN(msg); } MACRO_END
/** Add a failure and return */
#define FAIL(msg) _TEST_ASSERT(ADD_FAILURE(msg))
#!/usr/bin/env python3
-# removes redundant { and } from macros because uncrustify is too dumb to indent them properly (or even not touch them)
+# Removes redundant { and } from macros because uncrustify is too dumb to indent them properly (or even not touch them).
+# Actually, after running this, you might wanna put some back, for cases like `MACRO_BEGIN { ++this##_i; } MACRO_END`,
+# otherwise it ends up like MACRO_BEGIN++ ... sigh'
# all those fancy unix utilities like grep, sed and awk are either woefully inadequate for this or just completely
# unreadable with their arcane syntaxes - and yes, the plural is intentional because why extend existing tools
# get all remote branches - those would potentially get merge conflicts if we formatted everything
branches = run('git branch --list --remotes')
- branches = [b.strip() for b in branches]
+ # strip the leading spaces and ignore branches that are presumably used for debugging uncrustify
+ branches = [b.strip() for b in branches if "uncrustify" not in b]
branches.remove('origin/HEAD -> origin/master')
branches.remove('origin/master')