X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Freflect.h;h=d48fbec156506f31fda79fd86aa676b8257a128d;hp=6c00bca8de3d7f5f8dc3372dfd45cc8937b0568f;hb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;hpb=3bc34893905a2df622894aadcb6669f27f186772 diff --git a/source/glsl/reflect.h b/source/glsl/reflect.h index 6c00bca8..d48fbec1 100644 --- a/source/glsl/reflect.h +++ b/source/glsl/reflect.h @@ -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); }