[Mesa-dev] [PATCH] draw: Silence GCC unused-variable warnings.

Vinson Lee vlee at freedesktop.org
Wed Jul 29 20:30:34 PDT 2015


draw/draw_llvm.c: In function 'create_jit_sampler_type':
draw/draw_llvm.c:178:22: warning: unused variable 'target' [-Wunused-variable]
    LLVMTargetDataRef target = gallivm->target;
                      ^
draw/draw_llvm.c: In function 'create_jit_context_type':
draw/draw_llvm.c:218:22: warning: unused variable 'target' [-Wunused-variable]
    LLVMTargetDataRef target = gallivm->target;
                      ^
draw/draw_llvm.c: In function 'create_jit_vertex_header':
draw/draw_llvm.c:377:22: warning: unused variable 'target' [-Wunused-variable]
    LLVMTargetDataRef target = gallivm->target;
                      ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 src/gallium/auxiliary/draw/draw_llvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index b1e1bcb..26580e0 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -202,6 +202,7 @@ create_jit_sampler_type(struct gallivm_state *gallivm, const char *struct_name)
                           DRAW_JIT_SAMPLER_BORDER_COLOR);
 
    LP_CHECK_STRUCT_SIZE(struct draw_jit_sampler, target, sampler_type);
+   (void) target;
 
    return sampler_type;
 }
@@ -250,6 +251,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
                           DRAW_JIT_CTX_SAMPLERS);
    LP_CHECK_STRUCT_SIZE(struct draw_jit_context,
                         target, context_type);
+   (void) target;
 
    return context_type;
 }
@@ -415,6 +417,7 @@ create_jit_vertex_header(struct gallivm_state *gallivm, int data_elems)
 
    assert(LLVMABISizeOfType(target, vertex_header) ==
           offsetof(struct vertex_header, data[data_elems]));
+   (void) target;
 
    return vertex_header;
 }
-- 
2.1.4



More information about the mesa-dev mailing list