glsl: Initialize parse-state in constructor of lower_subroutine.
authorMatt Turner <mattst88@gmail.com>
Wed, 29 Jul 2015 17:47:51 +0000 (10:47 -0700)
committerMatt Turner <mattst88@gmail.com>
Fri, 31 Jul 2015 17:33:03 +0000 (10:33 -0700)
Static analysis tools don't like partial object initializations.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/glsl/lower_subroutine.cpp

index e45ccfea6d92722b090d57e95ef27be4eecf043f..b29912ad1509777d7833019ab2a3ca5b4fd4e53f 100644 (file)
@@ -37,7 +37,8 @@ namespace {
 
 class lower_subroutine_visitor : public ir_hierarchical_visitor {
 public:
-   lower_subroutine_visitor()
+   lower_subroutine_visitor(struct _mesa_glsl_parse_state *state)
+      : state(state)
    {
       this->progress = false;
    }
@@ -52,8 +53,7 @@ public:
 bool
 lower_subroutine(exec_list *instructions, struct _mesa_glsl_parse_state *state)
 {
-   lower_subroutine_visitor v;
-   v.state = state;
+   lower_subroutine_visitor v(state);
    visit_list_elements(&v, instructions);
    return v.progress;
 }