[Mesa-dev] [PATCH 3/7] gallium: fix warnings in release build

Grazvydas Ignotas notasas at gmail.com
Sat Apr 16 01:00:12 UTC 2016


Mark variables MAYBE_UNUSED to avoid unused-but-set-variable warnings
in release build.

Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
---
I have no commit access, if this patch is ok, please someone push.

 src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 2 +-
 src/gallium/auxiliary/util/u_surface.c              | 3 ++-
 src/gallium/drivers/llvmpipe/lp_setup_vbuf.c        | 2 +-
 src/gallium/drivers/r600/compute_memory_pool.c      | 2 +-
 src/gallium/drivers/softpipe/sp_state_sampler.c     | 2 +-
 src/gallium/drivers/softpipe/sp_tile_cache.c        | 3 ++-
 src/gallium/drivers/trace/tr_context.c              | 2 +-
 7 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index 64af321..7717d78 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -826,7 +826,7 @@ fenced_buffer_fence(struct pb_buffer *buf,
       assert(fenced_buf->validation_flags);
 
       if (fenced_buf->fence) {
-         boolean destroyed = fenced_buffer_remove_locked(fenced_mgr, fenced_buf);
+         MAYBE_UNUSED boolean destroyed = fenced_buffer_remove_locked(fenced_mgr, fenced_buf);
          assert(!destroyed);
       }
       if (fence) {
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index c150d92..4ef81c0 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -254,7 +254,8 @@ util_resource_copy_region(struct pipe_context *pipe,
    struct pipe_transfer *src_trans, *dst_trans;
    uint8_t *dst_map;
    const uint8_t *src_map;
-   enum pipe_format src_format, dst_format;
+   MAYBE_UNUSED enum pipe_format src_format;
+   enum pipe_format dst_format;
    struct pipe_box dst_box;
 
    assert(src && dst);
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
index 534c5f4..d7fa9fd 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
@@ -108,7 +108,7 @@ lp_setup_unmap_vertices(struct vbuf_render *vbr,
                        ushort min_index,
                        ushort max_index )
 {
-   struct lp_setup_context *setup = lp_setup_context(vbr);
+   MAYBE_UNUSED struct lp_setup_context *setup = lp_setup_context(vbr);
    assert( setup->vertex_buffer_size >= (max_index+1) * setup->vertex_size );
    /* do nothing */
 }
diff --git a/src/gallium/drivers/r600/compute_memory_pool.c b/src/gallium/drivers/r600/compute_memory_pool.c
index 93e3ffe..bcda155 100644
--- a/src/gallium/drivers/r600/compute_memory_pool.c
+++ b/src/gallium/drivers/r600/compute_memory_pool.c
@@ -489,7 +489,7 @@ void compute_memory_move_item(struct compute_memory_pool *pool,
 	struct r600_context *rctx = (struct r600_context *)pipe;
 	struct pipe_box box;
 
-	struct compute_memory_item *prev;
+	MAYBE_UNUSED struct compute_memory_item *prev;
 
 	COMPUTE_DBG(pool->screen, "* compute_memory_move_item()\n"
 			"  + Moving item %"PRIi64" from %"PRIi64" (%"PRIi64" bytes) to %"PRIu64" (%"PRIu64" bytes)\n",
diff --git a/src/gallium/drivers/softpipe/sp_state_sampler.c b/src/gallium/drivers/softpipe/sp_state_sampler.c
index 23ec4ef..f917147 100644
--- a/src/gallium/drivers/softpipe/sp_state_sampler.c
+++ b/src/gallium/drivers/softpipe/sp_state_sampler.c
@@ -199,7 +199,7 @@ prepare_shader_sampling(
 
          if (!sp_tex->dt) {
             /* regular texture - setup array of mipmap level offsets */
-            struct pipe_resource *res = view->texture;
+            MAYBE_UNUSED struct pipe_resource *res = view->texture;
             int j;
 
             if (view->target != PIPE_BUFFER) {
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index c623326..0ebe082 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -92,7 +92,8 @@ sp_create_tile_cache( struct pipe_context *pipe )
 {
    struct softpipe_tile_cache *tc;
    uint pos;
-   int maxLevels, maxTexSize;
+   MAYBE_UNUSED int maxTexSize;
+   int maxLevels;
 
    /* sanity checking: max sure MAX_WIDTH/HEIGHT >= largest texture image */
    maxLevels = pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c
index b575f2c..fbf3eae 100644
--- a/src/gallium/drivers/trace/tr_context.c
+++ b/src/gallium/drivers/trace/tr_context.c
@@ -1891,6 +1891,6 @@ error1:
 void
 trace_context_check(const struct pipe_context *pipe)
 {
-   struct trace_context *tr_ctx = (struct trace_context *) pipe;
+   MAYBE_UNUSED struct trace_context *tr_ctx = (struct trace_context *) pipe;
    assert(tr_ctx->base.destroy == trace_context_destroy);
 }
-- 
2.7.4



More information about the mesa-dev mailing list