From: Gert Wollny Date: Thu, 16 Nov 2017 15:09:48 +0000 (+0100) Subject: gallium/aux/util/u_threaded_context.c: Fix some -Wunused-param warnings. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=82e2f1ea34c8479b7bc35e5b750e0c329aade582;p=mesa.git gallium/aux/util/u_threaded_context.c: Fix some -Wunused-param warnings. Decorate the params accordingly with UNUSED or MAYBE_UNUSED (for params that are used in debug mode). v2: move *UNUSED decoration in front of parameter declaration Signed-off-by: Gert Wollny Reviewed-by: Brian Paul (v1) --- diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index b05cffd754d..b212393a5ba 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -64,7 +64,7 @@ typedef void (*tc_execute)(struct pipe_context *pipe, union tc_payload *payload) static const tc_execute execute_func[TC_NUM_CALLS]; static void -tc_batch_check(struct tc_batch *batch) +tc_batch_check(MAYBE_UNUSED struct tc_batch *batch) { tc_assert(batch->sentinel == TC_SENTINEL); tc_assert(batch->num_total_call_slots <= TC_CALLS_PER_BATCH); @@ -80,7 +80,7 @@ tc_debug_check(struct threaded_context *tc) } static void -tc_batch_execute(void *job, int thread_index) +tc_batch_execute(void *job, UNUSED int thread_index) { struct tc_batch *batch = job; struct pipe_context *pipe = batch->pipe; @@ -180,7 +180,7 @@ tc_is_sync(struct threaded_context *tc) } static void -_tc_sync(struct threaded_context *tc, const char *info, const char *func) +_tc_sync(struct threaded_context *tc, MAYBE_UNUSED const char *info, MAYBE_UNUSED const char *func) { struct tc_batch *last = &tc->batch_slots[tc->last]; struct tc_batch *next = &tc->batch_slots[tc->next]; @@ -211,8 +211,9 @@ _tc_sync(struct threaded_context *tc, const char *info, const char *func) if (synced) { p_atomic_inc(&tc->num_syncs); - if (tc_strcmp(func, "tc_destroy") != 0) + if (tc_strcmp(func, "tc_destroy") != 0) { tc_printf("sync %s %s\n", func, info); + } } tc_debug_check(tc); @@ -1845,16 +1846,16 @@ tc_fence_server_sync(struct pipe_context *_pipe, } static struct pipe_video_codec * -tc_create_video_codec(struct pipe_context *_pipe, - const struct pipe_video_codec *templ) +tc_create_video_codec(UNUSED struct pipe_context *_pipe, + UNUSED const struct pipe_video_codec *templ) { unreachable("Threaded context should not be enabled for video APIs"); return NULL; } static struct pipe_video_buffer * -tc_create_video_buffer(struct pipe_context *_pipe, - const struct pipe_video_buffer *templ) +tc_create_video_buffer(UNUSED struct pipe_context *_pipe, + UNUSED const struct pipe_video_buffer *templ) { unreachable("Threaded context should not be enabled for video APIs"); return NULL; @@ -2138,7 +2139,7 @@ static void tc_call_generate_mipmap(struct pipe_context *pipe, union tc_payload *payload) { struct tc_generate_mipmap *p = (struct tc_generate_mipmap *)payload; - bool MAYBE_UNUSED result = pipe->generate_mipmap(pipe, p->res, p->format, + MAYBE_UNUSED bool result = pipe->generate_mipmap(pipe, p->res, p->format, p->base_level, p->last_level, p->first_layer, @@ -2391,7 +2392,7 @@ struct tc_callback_payload { }; static void -tc_call_callback(struct pipe_context *pipe, union tc_payload *payload) +tc_call_callback(UNUSED struct pipe_context *pipe, union tc_payload *payload) { struct tc_callback_payload *p = (struct tc_callback_payload *)payload;