[Mesa-dev] [PATCH v2 15/29] gallium/aux/util/u_threaded_context.c: Fix some -Wunused-param warnings.
Gert Wollny
gw.fossdev at gmail.com
Thu Nov 16 15:09:48 UTC 2017
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 <gw.fossdev at gmail.com>
Reviewed-by: Brian Paul <brianp at vmware.com> (v1)
---
src/gallium/auxiliary/util/u_threaded_context.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c
index b05cffd754..b212393a5b 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;
--
2.13.6
More information about the mesa-dev
mailing list