From ced30ed4b498c34b9aaf69bdcae12f3cedb43af8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 18 Oct 2019 17:00:48 +0200 Subject: Fix unused parameter warnings --- test/ampatree_test.c | 2 +- test/bitset_test.c | 2 +- test/btree_test.c | 4 +++- test/hash_test.c | 4 ++-- test/patree_test.c | 2 +- test/ring_test.c | 8 ++++---- test/sem_test.c | 6 +++--- test/sorted_array_test.c | 2 +- test/strindex_test.c | 2 +- test/tree_test.c | 2 +- test/trie_test.c | 2 +- 11 files changed, 19 insertions(+), 17 deletions(-) (limited to 'test') diff --git a/test/ampatree_test.c b/test/ampatree_test.c index 1138b39..e14e85f 100644 --- a/test/ampatree_test.c +++ b/test/ampatree_test.c @@ -55,7 +55,7 @@ test_fail(const char* fmt, ...) } int -main(int argc, char** argv) +main(void) { ZixAMPatree* patree = zix_ampatree_new(); diff --git a/test/bitset_test.c b/test/bitset_test.c index 4514e79..62c574c 100644 --- a/test/bitset_test.c +++ b/test/bitset_test.c @@ -36,7 +36,7 @@ test_fail(const char* fmt, ...) } int -main(int argc, char** argv) +main(void) { ZixBitset b[N_ELEMS]; ZixBitsetTally t[N_ELEMS]; diff --git a/test/btree_test.c b/test/btree_test.c index ec8ba41..488fbf7 100644 --- a/test/btree_test.c +++ b/test/btree_test.c @@ -18,6 +18,8 @@ #include "test_malloc.h" +#include "zix/common.h" + #include #include #include @@ -50,7 +52,7 @@ unique_rand(uint32_t i) } static int -int_cmp(const void* a, const void* b, const void* user_data) +int_cmp(const void* a, const void* b, ZIX_UNUSED const void* user_data) { const uintptr_t ia = (uintptr_t)a; const uintptr_t ib = (uintptr_t)b; diff --git a/test/hash_test.c b/test/hash_test.c index 874bdff..c2ecb2d 100644 --- a/test/hash_test.c +++ b/test/hash_test.c @@ -61,7 +61,7 @@ test_fail(const char* fmt, ...) static unsigned n_checked = 0; static void -check(void* value, void* user_data) +check(void* value, ZIX_UNUSED void* user_data) { if (strlen(*(const char*const*)value) >= 3) { ++n_checked; @@ -199,7 +199,7 @@ stress(void) } int -main(int argc, char** argv) +main(void) { if (stress()) { return 1; diff --git a/test/patree_test.c b/test/patree_test.c index 19df93f..efd8999 100644 --- a/test/patree_test.c +++ b/test/patree_test.c @@ -55,7 +55,7 @@ test_fail(const char* fmt, ...) } int -main(int argc, char** argv) +main(void) { ZixPatree* patree = zix_patree_new(); diff --git a/test/ring_test.c b/test/ring_test.c index cabf6d3..9e11690 100644 --- a/test/ring_test.c +++ b/test/ring_test.c @@ -63,7 +63,7 @@ cmp_msg(int* msg1, int* msg2) } static void* -reader(void* arg) +reader(ZIX_UNUSED void* arg) { printf("Reader starting\n"); @@ -90,7 +90,7 @@ reader(void* arg) } static void* -writer(void* arg) +writer(ZIX_UNUSED void* arg) { printf("Writer starting\n"); @@ -118,12 +118,12 @@ main(int argc, char** argv) unsigned size = 1024; if (argc > 1) { - size = atoi(argv[1]); + size = (unsigned)atoi(argv[1]); } n_writes = size * 1024; if (argc > 2) { - n_writes = atoi(argv[2]); + n_writes = (unsigned)atoi(argv[2]); } printf("Testing %u writes of %d ints to a %d int ring...\n", diff --git a/test/sem_test.c b/test/sem_test.c index ff95664..a3485d8 100644 --- a/test/sem_test.c +++ b/test/sem_test.c @@ -24,7 +24,7 @@ static ZixSem sem; static unsigned n_signals = 1024; static void* -reader(void* arg) +reader(ZIX_UNUSED void* arg) { printf("Reader starting\n"); @@ -37,7 +37,7 @@ reader(void* arg) } static void* -writer(void* arg) +writer(ZIX_UNUSED void* arg) { printf("Writer starting\n"); @@ -58,7 +58,7 @@ main(int argc, char** argv) } if (argc > 1) { - n_signals = atoi(argv[1]); + n_signals = (unsigned)atoi(argv[1]); } printf("Testing %u signals...\n", n_signals); diff --git a/test/sorted_array_test.c b/test/sorted_array_test.c index 76745cf..5ebe8e8 100644 --- a/test/sorted_array_test.c +++ b/test/sorted_array_test.c @@ -32,7 +32,7 @@ static unsigned seed = 1; static int -int_cmp(const void* a, const void* b, const void* user_data) +int_cmp(const void* a, const void* b, ZIX_UNUSED const void* user_data) { const intptr_t ia = *(const intptr_t*)a; const intptr_t ib = *(const intptr_t*)b; diff --git a/test/strindex_test.c b/test/strindex_test.c index f8a5424..0ad3be5 100644 --- a/test/strindex_test.c +++ b/test/strindex_test.c @@ -32,7 +32,7 @@ test_fail(const char* fmt, ...) } int -main(int argc, char** argv) +main(void) { const char* str = "BANANA"; const size_t str_len = strlen(str); diff --git a/test/tree_test.c b/test/tree_test.c index a32a58f..07f59c1 100644 --- a/test/tree_test.c +++ b/test/tree_test.c @@ -33,7 +33,7 @@ static unsigned seed = 1; static int -int_cmp(const void* a, const void* b, const void* user_data) +int_cmp(const void* a, const void* b, ZIX_UNUSED const void* user_data) { const intptr_t ia = (intptr_t)a; const intptr_t ib = (intptr_t)b; diff --git a/test/trie_test.c b/test/trie_test.c index 4ea6d0d..2ddc019 100644 --- a/test/trie_test.c +++ b/test/trie_test.c @@ -55,7 +55,7 @@ test_fail(const char* fmt, ...) } int -main(int argc, char** argv) +main(void) { ZixTrie* trie = zix_trie_new(); -- cgit v1.2.1