[Mesa-dev] [PATCH 01/20] glsl: Silence several "warning: unused parameter"

Ian Romanick idr at freedesktop.org
Mon Aug 29 14:58:51 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

---
 src/glsl/ast_to_hir.cpp                   |    6 ++++++
 src/glsl/builtin_stubs.cpp                |    1 +
 src/glsl/glcpp/glcpp.c                    |    1 +
 src/glsl/ir_function_detect_recursion.cpp |    4 ++++
 src/glsl/lower_jumps.cpp                  |    1 +
 src/glsl/opt_discard_simplification.cpp   |    1 +
 src/glsl/opt_if_simplification.cpp        |    1 +
 src/glsl/standalone_scaffolding.cpp       |    1 +
 8 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 9e7496b..5af45e1 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2958,6 +2958,12 @@ ast_function::hir(exec_list *instructions,
 
    const char *const name = identifier;
 
+   /* New functions are always added to the top-level IR instruction stream,
+    * so this instruction list pointer is ignored.  See also emit_function
+    * (called below).
+    */
+   (void) instructions;
+
    /* From page 21 (page 27 of the PDF) of the GLSL 1.20 spec,
     *
     *   "Function declarations (prototypes) cannot occur inside of functions;
diff --git a/src/glsl/builtin_stubs.cpp b/src/glsl/builtin_stubs.cpp
index 00b3294..dfa5d32 100644
--- a/src/glsl/builtin_stubs.cpp
+++ b/src/glsl/builtin_stubs.cpp
@@ -35,4 +35,5 @@ _mesa_glsl_release_functions(void)
 void
 _mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state)
 {
+   (void) state;
 }
diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
index 3252891..e461a65 100644
--- a/src/glsl/glcpp/glcpp.c
+++ b/src/glsl/glcpp/glcpp.c
@@ -34,6 +34,7 @@ void
 _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
                        struct gl_shader *sh)
 {
+   (void) ctx;
    *ptr = sh;
 }
 
diff --git a/src/glsl/ir_function_detect_recursion.cpp b/src/glsl/ir_function_detect_recursion.cpp
index 8f805bf..890bc45 100644
--- a/src/glsl/ir_function_detect_recursion.cpp
+++ b/src/glsl/ir_function_detect_recursion.cpp
@@ -289,6 +289,8 @@ emit_errors_unlinked(const void *key, void *data, void *closure)
    function *f = (function *) data;
    YYLTYPE loc;
 
+   (void) key;
+
    char *proto = prototype_string(f->sig->return_type,
 				  f->sig->function_name(),
 				  &f->sig->parameters);
@@ -308,6 +310,8 @@ emit_errors_linked(const void *key, void *data, void *closure)
       (struct gl_shader_program *) closure;
    function *f = (function *) data;
 
+   (void) key;
+
    char *proto = prototype_string(f->sig->return_type,
 				  f->sig->function_name(),
 				  &f->sig->parameters);
diff --git a/src/glsl/lower_jumps.cpp b/src/glsl/lower_jumps.cpp
index 6187499..92813f5 100644
--- a/src/glsl/lower_jumps.cpp
+++ b/src/glsl/lower_jumps.cpp
@@ -438,6 +438,7 @@ struct ir_lower_jumps_visitor : public ir_control_flow_visitor {
        * satisfied, because discard statements can't contain other
        * statements.
        */
+      (void) ir;
    }
 
    enum jump_strength get_jump_strength(ir_instruction* ir)
diff --git a/src/glsl/opt_discard_simplification.cpp b/src/glsl/opt_discard_simplification.cpp
index a19947d..ba4981b 100644
--- a/src/glsl/opt_discard_simplification.cpp
+++ b/src/glsl/opt_discard_simplification.cpp
@@ -138,6 +138,7 @@ is_only_instruction(ir_discard *discard)
 ir_visitor_status
 discard_simplifier::visit_enter(ir_assignment *ir)
 {
+   (void) ir;
    return visit_continue_with_parent;
 }
 
diff --git a/src/glsl/opt_if_simplification.cpp b/src/glsl/opt_if_simplification.cpp
index 29b1d18..940dd08 100644
--- a/src/glsl/opt_if_simplification.cpp
+++ b/src/glsl/opt_if_simplification.cpp
@@ -49,6 +49,7 @@ public:
 ir_visitor_status
 ir_if_simplification_visitor::visit_enter(ir_assignment *ir)
 {
+   (void) ir;
    return visit_continue_with_parent;
 }
 
diff --git a/src/glsl/standalone_scaffolding.cpp b/src/glsl/standalone_scaffolding.cpp
index bbd7bb9..72aa1e4 100644
--- a/src/glsl/standalone_scaffolding.cpp
+++ b/src/glsl/standalone_scaffolding.cpp
@@ -37,6 +37,7 @@ void
 _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
                        struct gl_shader *sh)
 {
+   (void) ctx;
    *ptr = sh;
 }
 
-- 
1.7.4.4



More information about the mesa-dev mailing list