From d06c35c6603859a575993ee3dac5244c529e09f5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 9 Aug 2012 02:29:04 +0000 Subject: Fix warnings: -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes. git-svn-id: http://svn.drobilla.net/zix/trunk@72 df6676b4-ccc9-40e5-b5d6-7c4628a128e3 --- test/sorted_array_test.c | 10 +++++----- test/tree_test.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/sorted_array_test.c b/test/sorted_array_test.c index 3b0a090..b235753 100644 --- a/test/sorted_array_test.c +++ b/test/sorted_array_test.c @@ -34,8 +34,8 @@ unsigned seed = 1; static int int_cmp(const void* a, const void* b, void* user_data) { - const intptr_t ia = *(intptr_t*)a; - const intptr_t ib = *(intptr_t*)b; + const intptr_t ia = *(const intptr_t*)a; + const intptr_t ib = *(const intptr_t*)b; return ia - ib; } @@ -54,7 +54,7 @@ ith_elem(int test_num, unsigned n_elems, int i) } static int -test_fail() +test_fail(void) { return EXIT_FAILURE; } @@ -121,8 +121,8 @@ stress(int test_num, unsigned n_elems) srand(seed); // Delete all elements - for (unsigned i = 0; i < n_elems; i++) { - r = ith_elem(test_num, n_elems, i); + for (unsigned e = 0; e < n_elems; e++) { + r = ith_elem(test_num, n_elems, e); ZixSortedArrayIter item; if (zix_sorted_array_find(t, &r, &item) != ZIX_STATUS_SUCCESS) { fprintf(stderr, "Failed to find item to remove\n"); diff --git a/test/tree_test.c b/test/tree_test.c index 6f25f6c..5eb5a11 100644 --- a/test/tree_test.c +++ b/test/tree_test.c @@ -53,7 +53,7 @@ ith_elem(int test_num, size_t n_elems, int i) } static int -test_fail() +test_fail(void) { return EXIT_FAILURE; } @@ -144,8 +144,8 @@ stress(int test_num, size_t n_elems) srand(seed); // Delete all elements - for (size_t i = 0; i < n_elems; i++) { - r = ith_elem(test_num, n_elems, i); + for (size_t e = 0; e < n_elems; e++) { + r = ith_elem(test_num, n_elems, e); ZixTreeIter* item; if (zix_tree_find(t, (void*)r, &item) != ZIX_STATUS_SUCCESS) { fprintf(stderr, "Failed to find item to remove\n"); @@ -165,8 +165,8 @@ stress(int test_num, size_t n_elems) srand(seed); // Insert n_elems elements again (to test non-empty destruction) - for (size_t i = 0; i < n_elems; ++i) { - r = ith_elem(test_num, n_elems, i); + for (size_t e = 0; e < n_elems; ++e) { + r = ith_elem(test_num, n_elems, e); int status = zix_tree_insert(t, (void*)r, &ti); if (status) { fprintf(stderr, "Insert failed\n"); -- cgit v1.2.1