summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-18 02:45:33 -0500
committerTavian Barnes <tavianator@gmail.com>2010-11-18 02:45:33 -0500
commita69a062b31a26f04699315179ed1026d9cfedf5e (patch)
tree4df7fb974b44ad99992a12ab798de8dd8da50f6e
parent1fb1d68006b524ba85a5e71e72457369f3d3f26d (diff)
downloaddimension-a69a062b31a26f04699315179ed1026d9cfedf5e.tar.xz
Fix signed/unsigned comparison in DMNSN_ARRAY_FOREACH.
-rw-r--r--libdimension/dimension/array.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libdimension/dimension/array.h b/libdimension/dimension/array.h
index 09746dd..10afa9c 100644
--- a/libdimension/dimension/array.h
+++ b/libdimension/dimension/array.h
@@ -241,9 +241,9 @@ dmnsn_array_remove(dmnsn_array *array, size_t i)
* @param i The name of the iterator within the loop body.
* @param[in] array The array to loop over.
*/
-#define DMNSN_ARRAY_FOREACH(type, i, array) \
- for (type i = dmnsn_array_first(array); \
- i - (type)dmnsn_array_first(array) < dmnsn_array_size(array); \
+#define DMNSN_ARRAY_FOREACH(type, i, array) \
+ for (type i = dmnsn_array_first(array); \
+ (size_t)(i - (type)dmnsn_array_first(array)) < dmnsn_array_size(array); \
++i)
/**