diff options
author | David Robillard <d@drobilla.net> | 2020-08-13 17:25:39 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-13 17:25:39 +0200 |
commit | 56b8eb22da76b58a60a797994cecb6499e236896 (patch) | |
tree | 38ac10bd2a0465340535397567a150098cc62423 /zix | |
parent | c64c8bb33042f2e49eea2efb6e4bbff812e955c1 (diff) | |
download | zix-56b8eb22da76b58a60a797994cecb6499e236896.tar.gz zix-56b8eb22da76b58a60a797994cecb6499e236896.tar.bz2 zix-56b8eb22da76b58a60a797994cecb6499e236896.zip |
Fix unused parameter warnings
Diffstat (limited to 'zix')
-rw-r--r-- | zix/common.h | 9 | ||||
-rw-r--r-- | zix/thread.h | 2 | ||||
-rw-r--r-- | zix/tree.c | 4 | ||||
-rw-r--r-- | zix/trie.c | 8 |
4 files changed, 14 insertions, 9 deletions
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 <stdbool.h> #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; } @@ -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; } @@ -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; |