]> git.tdb.fi Git - libs/gl.git/commitdiff
Some more default member initializers
authorMikko Rasa <tdb@tdb.fi>
Thu, 11 Nov 2021 11:37:09 +0000 (13:37 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 11 Nov 2021 11:37:09 +0000 (13:37 +0200)
source/backends/opengl/framebuffer_backend.cpp
source/backends/opengl/framebuffer_backend.h
source/backends/opengl/uniformblock_backend.h
source/core/framebuffer.cpp
source/core/framebuffer.h
source/glsl/finalize.h
source/glsl/syntax.cpp
source/render/view.cpp
source/render/view.h

index b56499d1609186572a8ada56492163c0bfbfaf1b..db1905d23394c50a2ffad1ebad7099fc8a9ea65c 100644 (file)
@@ -19,7 +19,6 @@ namespace Msp {
 namespace GL {
 
 OpenGLFramebuffer::OpenGLFramebuffer(bool is_system):
-       id(0),
        status(is_system ? GL_FRAMEBUFFER_COMPLETE : GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)
 {
        if(!is_system)
index 090071f7caddb2ab416a576923d7b696c672e390..7a7ebfbe82d3da5a8fa577ab3cb0c67b59d6faf9 100644 (file)
@@ -13,7 +13,7 @@ class OpenGLFramebuffer
        friend class OpenGLPipelineState;
 
 protected:
-       unsigned id;
+       unsigned id = 0;
        mutable unsigned status;
 
        OpenGLFramebuffer(bool);
index c95a34812c79cce1271b93b5fb1c97f22f53c34e..9607ea69a6017c08958fd2c44a82c7cdbb933b24 100644 (file)
@@ -8,7 +8,7 @@ class OpenGLUniformBlock
 {
 protected:
        OpenGLUniformBlock(bool);
-       ~OpenGLUniformBlock() { }
+       ~OpenGLUniformBlock() = default;
 };
 
 using UniformBlockBackend = OpenGLUniformBlock;
index 70c19859d128aeda40f1f9a1b34cb7cfd4774e06..b0777171448b5a27222e4b631e8d04cc52143ae6 100644 (file)
@@ -16,15 +16,11 @@ framebuffer_incomplete::framebuffer_incomplete(const std::string &reason):
 
 
 Framebuffer::Framebuffer(bool s):
-       FramebufferBackend(s),
-       dirty(0)
+       FramebufferBackend(s)
 { }
 
 Framebuffer::Framebuffer():
-       FramebufferBackend(false),
-       width(0),
-       height(0),
-       dirty(0)
+       FramebufferBackend(false)
 { }
 
 Framebuffer::Framebuffer(FrameAttachment fa):
index fd7b8eb4d17ccffd2f829182dd55d52837187dcb..920d9422fae0c103d0a492c81e9024b9f3a595ae 100644 (file)
@@ -47,9 +47,9 @@ protected:
 
        FrameFormat format;
        std::vector<Attachment> attachments;
-       unsigned width;
-       unsigned height;
-       mutable unsigned dirty;
+       unsigned width = 0;
+       unsigned height = 0;
+       mutable unsigned dirty = 0;
 
        Framebuffer(bool);
 public:
index 19ad594781825a5cef996fe9c1958cb392074395..f9502954f6b1d6ed9983e403c14414870ae63090 100644 (file)
@@ -29,11 +29,9 @@ class LocationAllocator: private TraversingVisitor
 private:
        struct Uniform
        {
-               int location;
-               int desc_set;
-               int bind_point;
-
-               Uniform(): location(-1), desc_set(0), bind_point(-1) { }
+               int location = -1;
+               int desc_set = 0;
+               int bind_point = -1;
        };
 
        Features features;
index 2ab4d1b61a197b3ccee9ea849d60c990e8b2427b..45765f27d88dbf0599e9de494a5ceea90dc64dd4 100644 (file)
@@ -78,8 +78,7 @@ NodeContainer<C>::NodeContainer(const NodeContainer &c):
 Block::Block(const Block &other):
        Node(other),
        body(other.body),
-       use_braces(other.use_braces),
-       parent(0)
+       use_braces(other.use_braces)
 { }
 
 void Block::visit(NodeVisitor &visitor)
index 54828c7b8c75d265385c53309e97eb44651c93ce..d57c8530719a494d67c7c106d750d248559ec311 100644 (file)
@@ -6,12 +6,6 @@
 namespace Msp {
 namespace GL {
 
-View::View():
-       camera(0),
-       content(0),
-       internal_renderer(0)
-{ }
-
 View::~View()
 {
        delete internal_renderer;
index b7cb2256e937a6ef014415ae635c31d7d4e2b7fd..bdddb65d31b977cf896cdd3dacc1d89c470cfbd8 100644 (file)
@@ -20,11 +20,11 @@ Sequence can be used to specify other tags and add post-processing.
 class View
 {
 protected:
-       Camera *camera;
-       Renderable *content;
-       Renderer *internal_renderer;
+       Camera *camera = 0;
+       Renderable *content = 0;
+       Renderer *internal_renderer = 0;
 
-       View();
+       View() = default;
 public:
        virtual ~View();