]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/resolve.h
Use default member initializers for simple types
[libs/gl.git] / source / glsl / resolve.h
index 633ff11d27b4382e66ce6240847ac84907b54f5a..f32d0cd530fe03b289d04176da2535e43e86221a 100644 (file)
@@ -15,11 +15,9 @@ namespace SL {
 class BlockHierarchyResolver: private TraversingVisitor
 {
 private:
-       bool r_any_resolved;
+       bool r_any_resolved = false;
 
 public:
-       BlockHierarchyResolver(): r_any_resolved(false) { }
-
        bool apply(Stage &s) { r_any_resolved = false; s.content.visit(*this); return r_any_resolved; }
 
 private:
@@ -30,16 +28,14 @@ private:
 class TypeResolver: private TraversingVisitor
 {
 private:
-       Stage *stage;
+       Stage *stage = 0;
        std::map<TypeDeclaration *, TypeDeclaration *> alias_map;
        std::map<TypeDeclaration *, TypeDeclaration *> array_types;
        NodeList<Statement>::iterator type_insert_point;
-       InterfaceBlock *iface_block;
-       bool r_any_resolved;
+       InterfaceBlock *iface_block = 0;
+       bool r_any_resolved = false;
 
 public:
-       TypeResolver();
-
        bool apply(Stage &);
 
 private:
@@ -59,18 +55,16 @@ of an interface block are turned into interface block references. */
 class VariableResolver: private TraversingVisitor
 {
 private:
-       Stage *stage;
+       Stage *stage = 0;
        RefPtr<Expression> r_replacement_expr;
-       bool r_any_resolved;
-       bool record_target;
-       bool r_self_referencing;
+       bool r_any_resolved = false;
+       bool record_target = false;
+       bool r_self_referencing = false;
        Assignment::Target r_assignment_target;
        std::vector<VariableDeclaration *> redeclared_builtins;
        std::set<Node *> nodes_to_remove;
 
 public:
-       VariableResolver();
-
        bool apply(Stage &);
 
 private:
@@ -102,20 +96,16 @@ private:
 
        struct ArgumentInfo
        {
-               BasicTypeDeclaration *type;
-               unsigned component_count;
-
-               ArgumentInfo(): type(0), component_count(0) { }
+               BasicTypeDeclaration *type = 0;
+               unsigned component_count = 0;
        };
 
-       Stage *stage;
+       Stage *stage = 0;
        std::vector<BasicTypeDeclaration *> basic_types;
        NodeList<Statement>::iterator insert_point;
-       bool r_any_resolved;
+       bool r_any_resolved = false;
 
 public:
-       ExpressionResolver();
-
        bool apply(Stage &);
 
 private:
@@ -148,9 +138,9 @@ private:
 class FunctionResolver: private TraversingVisitor
 {
 private:
-       Stage *stage;
+       Stage *stage = 0;
        std::map<std::string, std::vector<FunctionDeclaration *> > declarations;
-       bool r_any_resolved;
+       bool r_any_resolved = false;
 
 public:
        bool apply(Stage &);