From e0acbde6da2127d9fa75aa6c032682086295ce27 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 30 May 2016 11:15:01 +0200 Subject: Shader examples: initialize all members Coverity (CIDs 161677, 161674) caught us setting a bad example in our example code. Change-Id: I395f689586f9a6ad783328b9258096cbc9ccd692 Reviewed-by: Gunnar Sletta --- examples/quick/scenegraph/graph/linenode.cpp | 2 +- examples/quick/scenegraph/graph/noisynode.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/quick/scenegraph') diff --git a/examples/quick/scenegraph/graph/linenode.cpp b/examples/quick/scenegraph/graph/linenode.cpp index 473be7da17..992e2d44c9 100644 --- a/examples/quick/scenegraph/graph/linenode.cpp +++ b/examples/quick/scenegraph/graph/linenode.cpp @@ -56,7 +56,7 @@ class LineShader : public QSGSimpleMaterialShader QSG_DECLARE_SIMPLE_SHADER(LineShader, LineMaterial) public: - LineShader() { + LineShader() : id_color(-1), id_spread(-1), id_size(-1) { setShaderSourceFile(QOpenGLShader::Vertex, ":/scenegraph/graph/shaders/line.vsh"); setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/line.fsh"); } diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp index bc273cf632..834151599b 100644 --- a/examples/quick/scenegraph/graph/noisynode.cpp +++ b/examples/quick/scenegraph/graph/noisynode.cpp @@ -61,7 +61,7 @@ class NoisyShader : public QSGSimpleMaterialShader QSG_DECLARE_SIMPLE_SHADER(NoisyShader, NoisyMaterial) public: - NoisyShader() { + NoisyShader() : id_color(-1), id_texture(-1), id_textureSize(-1) { setShaderSourceFile(QOpenGLShader::Vertex, ":/scenegraph/graph/shaders/noisy.vsh"); setShaderSourceFile(QOpenGLShader::Fragment, ":/scenegraph/graph/shaders/noisy.fsh"); } -- cgit v1.2.3