diff options
author | David Robillard <d@drobilla.net> | 2019-10-18 17:00:48 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-10-18 17:07:56 +0200 |
commit | ced30ed4b498c34b9aaf69bdcae12f3cedb43af8 (patch) | |
tree | 23e3f002821bd360018bc08ad8a879eb548640d0 | |
parent | e36a086818936d921d7303e45d6180a948ef3196 (diff) | |
download | zix-ced30ed4b498c34b9aaf69bdcae12f3cedb43af8.tar.gz zix-ced30ed4b498c34b9aaf69bdcae12f3cedb43af8.tar.bz2 zix-ced30ed4b498c34b9aaf69bdcae12f3cedb43af8.zip |
Fix unused parameter warnings
-rw-r--r-- | test/ampatree_test.c | 2 | ||||
-rw-r--r-- | test/bitset_test.c | 2 | ||||
-rw-r--r-- | test/btree_test.c | 4 | ||||
-rw-r--r-- | test/hash_test.c | 4 | ||||
-rw-r--r-- | test/patree_test.c | 2 | ||||
-rw-r--r-- | test/ring_test.c | 8 | ||||
-rw-r--r-- | test/sem_test.c | 6 | ||||
-rw-r--r-- | test/sorted_array_test.c | 2 | ||||
-rw-r--r-- | test/strindex_test.c | 2 | ||||
-rw-r--r-- | test/tree_test.c | 2 | ||||
-rw-r--r-- | test/trie_test.c | 2 | ||||
-rw-r--r-- | wscript | 3 | ||||
-rw-r--r-- | zix/tree.c | 4 | ||||
-rw-r--r-- | zix/trie.c | 10 |
14 files changed, 29 insertions, 24 deletions
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 <stdbool.h> #include <assert.h> #include <stdarg.h> @@ -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(); @@ -37,6 +37,9 @@ def configure(conf): 'BUILD_BENCH': Options.options.bench, 'BUILD_STATIC': Options.options.static}) + if Options.options.ultra_strict and not conf.env.MSVC_COMPILER: + conf.env.append_value('CFLAGS', ['-Wunused-parameter']) + # Check for mlock conf.check_function('c', 'mlock', header_name='sys/mman.h', @@ -632,7 +632,7 @@ zix_tree_begin(ZixTree* t) } ZIX_API ZixTreeIter* -zix_tree_end(ZixTree* t) +zix_tree_end(ZIX_UNUSED ZixTree* t) { return NULL; } @@ -652,7 +652,7 @@ zix_tree_rbegin(ZixTree* t) } ZIX_API ZixTreeIter* -zix_tree_rend(ZixTree* t) +zix_tree_rend(ZIX_UNUSED ZixTree* t) { return NULL; } @@ -205,16 +205,16 @@ zix_trie_add_child(ZixTrieNode** n_ptr, } ZIX_PRIVATE ZixTrieNode** -trie_insert_tail(ZixTrieNode** n_ptr, - const uint8_t* str, - const uint8_t* first, - const size_t len) +trie_insert_tail(ZixTrieNode** n_ptr, + const uint8_t* str, + const uint8_t* first, + ZIX_UNUSED const size_t len) { assert(first[0]); ZixTrieNode* c = NULL; while (first[0]) { assert(zix_trie_node_check(*n_ptr)); - + c = realloc_node(NULL, 1); c->str = NULL; c->num_children = 0; |