summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2019-09-21 18:28:22 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2019-09-21 18:28:22 -0400
commita1099999e02fb87e3f5f209dfbba3f93692953db (patch)
treedd392f9ba1d4a091b09e6f8ce8f2963dc3054ff2 /util
parentfc35d3e7cb55c90bf04d93eed584db0868db13bc (diff)
added float builtin and check for decl self-reference
Diffstat (limited to 'util')
-rw-r--r--util/arr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/arr.c b/util/arr.c
index 0d7ddfa..63423c0 100644
--- a/util/arr.c
+++ b/util/arr.c
@@ -51,5 +51,6 @@ static void arr_free(Array *arr) {
free(arr->data);
}
+/* NOTE: this will not work if type is a pointer! */
#define arr_foreach(arr, type, var) for (type *var = (arr)->data, *var##_foreach_last = arr_last(arr); var; var == var##_foreach_last ? var = NULL : var++)
#define arr_foreach_reverse(arr, type, var) for (type *var = arr_last(arr); var; var == (arr)->data ? var = NULL : var--)