From 56b8eb22da76b58a60a797994cecb6499e236896 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 13 Aug 2020 17:25:39 +0200 Subject: Fix unused parameter warnings --- zix/common.h | 9 ++++++--- zix/thread.h | 2 ++ zix/tree.c | 4 ++-- zix/trie.c | 8 ++++---- 4 files changed, 14 insertions(+), 9 deletions(-) (limited to 'zix') diff --git a/zix/common.h b/zix/common.h index a59c033..f0737eb 100644 --- a/zix/common.h +++ b/zix/common.h @@ -52,10 +52,13 @@ extern "C" { # include #endif -#ifdef __GNUC__ -#define ZIX_UNUSED __attribute__((__unused__)) +// Unused parameter macro to suppresses warnings and make it impossible to use +#if defined(__cplusplus) +# define ZIX_UNUSED(name) +#elif defined(__GNUC__) +# define ZIX_UNUSED(name) name##_unused __attribute__((__unused__)) #else -#define ZIX_UNUSED +# define ZIX_UNUSED(name) name #endif typedef enum { diff --git a/zix/thread.h b/zix/thread.h index 9f05b10..2af0c5e 100644 --- a/zix/thread.h +++ b/zix/thread.h @@ -80,6 +80,8 @@ zix_thread_create(ZixThread* thread, static inline ZixStatus zix_thread_join(ZixThread thread, void** retval) { + (void)retval; + return WaitForSingleObject(thread, INFINITE) ? ZIX_STATUS_SUCCESS : ZIX_STATUS_ERROR; } diff --git a/zix/tree.c b/zix/tree.c index e6698a7..ab23614 100644 --- a/zix/tree.c +++ b/zix/tree.c @@ -632,7 +632,7 @@ zix_tree_begin(ZixTree* t) } ZIX_API ZixTreeIter* -zix_tree_end(ZIX_UNUSED ZixTree* t) +zix_tree_end(ZixTree* ZIX_UNUSED(t)) { return NULL; } @@ -652,7 +652,7 @@ zix_tree_rbegin(ZixTree* t) } ZIX_API ZixTreeIter* -zix_tree_rend(ZIX_UNUSED ZixTree* t) +zix_tree_rend(ZixTree* ZIX_UNUSED(t)) { return NULL; } diff --git a/zix/trie.c b/zix/trie.c index 8a7661c..369b647 100644 --- a/zix/trie.c +++ b/zix/trie.c @@ -205,10 +205,10 @@ zix_trie_add_child(ZixTrieNode** n_ptr, } ZIX_PRIVATE ZixTrieNode** -trie_insert_tail(ZixTrieNode** n_ptr, - const uint8_t* str, - const uint8_t* first, - ZIX_UNUSED const size_t len) +trie_insert_tail(ZixTrieNode** n_ptr, + const uint8_t* str, + const uint8_t* first, + const size_t ZIX_UNUSED(len)) { assert(first[0]); ZixTrieNode* c = NULL; -- cgit v1.2.1