summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-09 02:29:04 +0000
committerDavid Robillard <d@drobilla.net>2012-08-09 02:29:04 +0000
commitd06c35c6603859a575993ee3dac5244c529e09f5 (patch)
treef256922db71cd71ac3e65e0238925edf35da32e5 /test
parent3b899b4f8c72990679c33d480b968882b0e6f960 (diff)
downloadzix-d06c35c6603859a575993ee3dac5244c529e09f5.tar.gz
zix-d06c35c6603859a575993ee3dac5244c529e09f5.tar.bz2
zix-d06c35c6603859a575993ee3dac5244c529e09f5.zip
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
Diffstat (limited to 'test')
-rw-r--r--test/sorted_array_test.c10
-rw-r--r--test/tree_test.c10
2 files changed, 10 insertions, 10 deletions
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");