diff options
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; |