From 21c3bda5d41642c4ee8ab5275d6b96b0ced12041 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Fri, 5 Feb 2021 17:42:56 +0200 Subject: [PATCH] YACReaderFlowGL: initialize data member texture pointers Moving the initialization of defaultTexture out of the member initializer list gets rid of a GCC's -Wreorder warning. Initialize other texture pointers to improve safety and consistency. --- common/gl/yacreader_flow_gl.cpp | 2 +- common/gl/yacreader_flow_gl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/gl/yacreader_flow_gl.cpp b/common/gl/yacreader_flow_gl.cpp index 57643c74..e468e531 100644 --- a/common/gl/yacreader_flow_gl.cpp +++ b/common/gl/yacreader_flow_gl.cpp @@ -190,7 +190,7 @@ struct Preset pressetYACReaderFlowDownConfig = { }; /*Constructor*/ YACReaderFlowGL::YACReaderFlowGL(QWidget *parent, struct Preset p) - : QOpenGLWidget(/*QOpenGLWidget migration QGLFormat(QGL::SampleBuffers),*/ parent), numObjects(0), lazyPopulateObjects(-1), defaultTexture(nullptr), hasBeenInitialized(false), bUseVSync(false), flowRightToLeft(false) + : QOpenGLWidget(/*QOpenGLWidget migration QGLFormat(QGL::SampleBuffers),*/ parent), numObjects(0), lazyPopulateObjects(-1), hasBeenInitialized(false), bUseVSync(false), flowRightToLeft(false) { updateCount = 0; config = p; diff --git a/common/gl/yacreader_flow_gl.h b/common/gl/yacreader_flow_gl.h index 6fc965a7..c47345d8 100644 --- a/common/gl/yacreader_flow_gl.h +++ b/common/gl/yacreader_flow_gl.h @@ -119,9 +119,9 @@ protected: int updateCount; int fontSize; - QOpenGLTexture *defaultTexture; - QOpenGLTexture *markTexture; - QOpenGLTexture *readingTexture; + QOpenGLTexture *defaultTexture = nullptr; + QOpenGLTexture *markTexture = nullptr; + QOpenGLTexture *readingTexture = nullptr; void initializeGL(); void paintGL(); void timerEvent(QTimerEvent *);