gallium: fix warnings in release build
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 16 Apr 2016 01:00:12 +0000 (04:00 +0300)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 25 Apr 2016 10:23:21 +0000 (12:23 +0200)
Mark variables MAYBE_UNUSED to avoid unused-but-set-variable warnings
in release build.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
src/gallium/auxiliary/util/u_surface.c
src/gallium/drivers/llvmpipe/lp_setup_vbuf.c
src/gallium/drivers/r600/compute_memory_pool.c
src/gallium/drivers/softpipe/sp_state_sampler.c
src/gallium/drivers/softpipe/sp_tile_cache.c
src/gallium/drivers/trace/tr_context.c

index 64af321558e8a2f1e69e02200bd87e55a451a4fa..7717d784f78af3da2b5de3a070660e6d8812698d 100644 (file)
@@ -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) {
index c150d92b967c8aa26849825a40b52edd652589a6..4ef81c041c4f71299018f35a6a4e410b0908d768 100644 (file)
@@ -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);
index 534c5f48a640335c28250248d84a0647467a17d5..d7fa9fd20bf2c234dce34bf42220b90750842f31 100644 (file)
@@ -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 */
 }
index 93e3ffe256fdce27aa31d41cace3c06b54786586..bcda155c71aa5c227ffd70051c0a98a0a284bdb2 100644 (file)
@@ -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",
index 23ec4ef3cb6d20377e80e5e489e6d458f4864598..f917147754d9a71e928a52b706ef79b50dac2333 100644 (file)
@@ -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) {
index c6233261938a53734fee9a2329ae1f9147a362a6..0ebe082e8eb1d31684a1aafa52268b66dcfb2c92 100644 (file)
@@ -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);
index 7ed4f4988ddce1d995adcf63c358da72c94630ca..18c5c4345a72d7fc769b2067a2c65e75a55560c9 100644 (file)
@@ -1893,6 +1893,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);
 }