]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/reflect.h
Use default member initializers for simple types
[libs/gl.git] / source / glsl / reflect.h
index 6c00bca8de3d7f5f8dc3372dfd45cc8937b0568f..d48fbec156506f31fda79fd86aa676b8257a128d 100644 (file)
@@ -16,16 +16,14 @@ bool can_convert(const BasicTypeDeclaration &, const BasicTypeDeclaration &);
 class TypeComparer: private NodeVisitor
 {
 private:
-       Node *first;
-       Node *second;
-       unsigned first_tag;
-       bool r_result;
+       Node *first = 0;
+       Node *second = 0;
+       unsigned first_tag = 0;
+       bool r_result = false;
 
        static unsigned next_tag;
 
 public:
-       TypeComparer();
-
        bool apply(TypeDeclaration &t1, TypeDeclaration &t2) { compare(t1, t2); return r_result; }
 
 private:
@@ -47,11 +45,9 @@ private:
 class LocationCounter: private NodeVisitor
 {
 private:
-       unsigned r_count;
+       unsigned r_count = 0;
 
 public:
-       LocationCounter();
-
        unsigned apply(VariableDeclaration &v) { v.visit(*this); return r_count; }
 
 private:
@@ -74,9 +70,9 @@ public:
                Result(unsigned s, unsigned a): size(s), alignment(a), stride(s+a-1-(s+a-1)%a) { }
        };
 private:
-       unsigned r_size;
-       unsigned r_alignment;
-       int r_offset;
+       unsigned r_size = 0;
+       unsigned r_alignment = 1;
+       int r_offset = -1;
 
 public:
        Result apply(VariableDeclaration &v) { v.visit(*this); return Result(r_size, r_alignment); }