]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/visitor.h
Use default member initializers for simple types
[libs/gl.git] / source / glsl / visitor.h
index 3b558bd195c5cf6a9f0e68d57127d1d8159aa9b0..622a4834910d9d1f1a1f8e74db8c06af6c29a506 100644 (file)
@@ -13,13 +13,12 @@ namespace SL {
 class NodeVisitor
 {
 protected:
-       NodeVisitor() { }
+       NodeVisitor() = default;
 public:
-       virtual ~NodeVisitor() { }
+       virtual ~NodeVisitor() = default;
 
        virtual void visit(Block &) { }
        virtual void visit(Literal &) { }
-       virtual void visit(ParenthesizedExpression &) { }
        virtual void visit(VariableReference &) { }
        virtual void visit(InterfaceBlockReference &) { }
        virtual void visit(MemberAccess &) { }
@@ -51,15 +50,14 @@ public:
 class TraversingVisitor: public NodeVisitor
 {
 protected:
-       Block *current_block;
+       Block *current_block = 0;
 
-       TraversingVisitor(): current_block(0) { }
+       TraversingVisitor() = default;
 
 public:
        virtual void enter(Block &) { }
        virtual void visit(Block &);
        virtual void visit(RefPtr<Expression> &);
-       virtual void visit(ParenthesizedExpression &);
        virtual void visit(MemberAccess &);
        virtual void visit(Swizzle &);
        virtual void visit(UnaryExpression &);
@@ -83,13 +81,11 @@ public:
 class NodeRemover: private TraversingVisitor
 {
 private:
-       Stage *stage;
-       const std::set<Node *> *to_remove;
-       bool recursive_remove;
+       Stage *stage = 0;
+       const std::set<Node *> *to_remove = 0;
+       bool recursive_remove = false;
 
 public:
-       NodeRemover();
-
        void apply(Stage &, const std::set<Node *> &);
 
 private:
@@ -112,12 +108,10 @@ on the same hierarchly level as the target node are reordered. */
 class NodeReorderer: private TraversingVisitor
 {
 private:
-       Node *reorder_before;
-       const std::set<Node *> *to_reorder;
+       Node *reorder_before = 0;
+       const std::set<Node *> *to_reorder = 0;
 
 public:
-       NodeReorderer();
-
        void apply(Stage &, Node &, const std::set<Node *> &);
 
 private: