* nih/test_alloc.h (TEST_ALLOC_FAIL): Initialise the count in the
loop pre-condition, still doesn't solve gcc's issues but I prefer
it.
diff --git a/ChangeLog b/ChangeLog
index 410d4e5..8658506 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2009-01-29 Scott James Remnant <scott@netsplit.com>
+ * nih/test_alloc.h (TEST_ALLOC_FAIL): Initialise the count in the
+ loop pre-condition, still doesn't solve gcc's issues but I prefer
+ it.
+
* nih/tests/test_command.c (test_help): Array was too small, increase
the size.
diff --git a/nih/test_alloc.h b/nih/test_alloc.h
index c1786ef..df8edcf 100644
--- a/nih/test_alloc.h
+++ b/nih/test_alloc.h
@@ -157,11 +157,10 @@
* and sharing a global state.
**/
#define TEST_ALLOC_FAIL \
- for (test_alloc_failed = -1; \
+ for (test_alloc_failed = -1, _test_alloc_count = 0; \
test_alloc_failed <= (_test_alloc_count + 1); \
test_alloc_failed++, _test_alloc_call = 0) \
if (test_alloc_failed < 0) { \
- _test_alloc_count = 0; \
__nih_malloc = _test_malloc; \
__nih_realloc = _test_realloc; \
} else if (test_alloc_failed \