summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2017-06-25 11:21:33 +0200
committerJesus Fernandez <Jesus.Fernandez@qt.io>2017-06-26 08:17:23 +0000
commit1fa071b2b70ee6314fa12312da2d930f3983a7cc (patch)
tree5bbc303fc144f7e3b983d5f941254001e1d3a422
parent47b59f9001ea6c185e44f243a1fb697b1859215b (diff)
Initialize variables
*** CID 181280: Uninitialized members (UNINIT_CTOR) /qtdeclarative/src/imports/shapes/qquickshapegenericrenderer.cpp: 700 in QQuickShapeLinearGradientShader::QQuickShapeLinearGradientShader()() 694 QQuickShapeLinearGradientShader::QQuickShapeLinearGradientShader() 695 { 696 setShaderSourceFile(QOpenGLShader::Vertex, 697 QStringLiteral(":/qt-project.org/items/shaders/lineargradient.vert")); 698 setShaderSourceFile(QOpenGLShader::Fragment, 699 QStringLiteral(":/qt-project.org/items/shaders/lineargradient.frag")); >>> CID 181280: Uninitialized members (UNINIT_CTOR) >>> Non-static class member "m_gradEndLoc" is not initialized in this constructor nor in any functions that it calls. 700 } 701 702 void QQuickShapeLinearGradientShader::initialize() 703 { 704 m_opacityLoc = program()->uniformLocation("opacity"); 705 m_matrixLoc = program()->uniformLocation("matrix"); Change-Id: Ic9435039a1409ade63c7592a4a55b6c7306d03c2 Coverity-Id: 181280 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/imports/shapes/qquickshapegenericrenderer_p.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/imports/shapes/qquickshapegenericrenderer_p.h b/src/imports/shapes/qquickshapegenericrenderer_p.h
index 430a95465b..ad2427f00a 100644
--- a/src/imports/shapes/qquickshapegenericrenderer_p.h
+++ b/src/imports/shapes/qquickshapegenericrenderer_p.h
@@ -259,10 +259,10 @@ public:
static QSGMaterialType type;
private:
- int m_opacityLoc;
- int m_matrixLoc;
- int m_gradStartLoc;
- int m_gradEndLoc;
+ int m_opacityLoc = -1;
+ int m_matrixLoc = -1;
+ int m_gradStartLoc = -1;
+ int m_gradEndLoc = -1;
};
class QQuickShapeLinearGradientMaterial : public QSGMaterial