diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-11-07 17:39:23 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-11-07 17:39:23 -0500 |
commit | 4ddd6b7f2ec82155b7535062b4af67618ce70e30 (patch) | |
tree | d5a552473831b3b92030d0e33a1bafe7169737b8 /libdimension/dimension | |
parent | d3250a168254ebc6aa0087dfcfee5d7dfead9703 (diff) | |
download | dimension-4ddd6b7f2ec82155b7535062b4af67618ce70e30.tar.xz |
Support checkered pigments in dimension.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r-- | libdimension/dimension/array.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libdimension/dimension/array.h b/libdimension/dimension/array.h index b718021..fa48ac0 100644 --- a/libdimension/dimension/array.h +++ b/libdimension/dimension/array.h @@ -170,10 +170,16 @@ dmnsn_array_remove(dmnsn_array *array, size_t i) dmnsn_array_resize(array, size - 1); } -/* Macro to shorten array iteration */ +/* Macros to shorten array iteration */ + #define DMNSN_ARRAY_FOREACH(type, i, array) \ for (type i = dmnsn_array_first(array); \ i - (type)dmnsn_array_first(array) < dmnsn_array_size(array); \ ++i) +#define DMNSN_ARRAY_FOREACH_REVERSE(type, i, array) \ + for (type i = dmnsn_array_last(array); \ + (type)dmnsn_array_last(array) - i < dmnsn_array_size(array); \ + --i) + #endif /* DIMENSION_ARRAY_H */ |