From db5e672acc29858a59e8e14768cff2767306344e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 30 Jun 2015 22:11:15 +0200 Subject: QtOpenGL: Use Q_NULLPTR instead of 0 in all public headers This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I16c93bd36c242a6d402cf7622820e91eac782772 Reviewed-by: Sean Harmer --- src/opengl/qgl.h | 6 +++--- src/opengl/qglbuffer.h | 2 +- src/opengl/qglcolormap.h | 2 +- src/opengl/qglfunctions.h | 6 +++--- src/opengl/qglpixelbuffer.h | 4 ++-- src/opengl/qglshaderprogram.h | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/opengl') diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 63804cc28d..99abdd2ad6 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -235,7 +235,7 @@ public: QGLContext(const QGLFormat& format); virtual ~QGLContext(); - virtual bool create(const QGLContext* shareContext = 0); + virtual bool create(const QGLContext* shareContext = Q_NULLPTR); bool isValid() const; bool isSharing() const; void reset(); @@ -303,7 +303,7 @@ public: QOpenGLContext *contextHandle() const; protected: - virtual bool chooseContext(const QGLContext* shareContext = 0); + virtual bool chooseContext(const QGLContext* shareContext = Q_NULLPTR); bool deviceIsPixmap() const; bool windowCreated() const; @@ -380,7 +380,7 @@ public: void setFormat(const QGLFormat& format); QGLContext* context() const; - void setContext(QGLContext* context, const QGLContext* shareContext = 0, + void setContext(QGLContext* context, const QGLContext* shareContext = Q_NULLPTR, bool deleteOldContext = true); QPixmap renderPixmap(int w = 0, int h = 0, bool useContext = false); diff --git a/src/opengl/qglbuffer.h b/src/opengl/qglbuffer.h index e424ff2b5c..67b1a68072 100644 --- a/src/opengl/qglbuffer.h +++ b/src/opengl/qglbuffer.h @@ -103,7 +103,7 @@ public: void write(int offset, const void *data, int count); void allocate(const void *data, int count); - inline void allocate(int count) { allocate(0, count); } + inline void allocate(int count) { allocate(Q_NULLPTR, count); } void *map(QGLBuffer::Access access); bool unmap(); diff --git a/src/opengl/qglcolormap.h b/src/opengl/qglcolormap.h index f16f94c7f5..53031fd98f 100644 --- a/src/opengl/qglcolormap.h +++ b/src/opengl/qglcolormap.h @@ -63,7 +63,7 @@ public: int findNearest(QRgb color) const; protected: - Qt::HANDLE handle() { return d ? d->cmapHandle : 0; } + Qt::HANDLE handle() { return d ? d->cmapHandle : Q_NULLPTR; } void setHandle(Qt::HANDLE ahandle) { d->cmapHandle = ahandle; } private: diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h index 80b8596a20..ddb7b89d98 100644 --- a/src/opengl/qglfunctions.h +++ b/src/opengl/qglfunctions.h @@ -70,7 +70,7 @@ public: QGLFunctions::OpenGLFeatures openGLFeatures() const; bool hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const; - void initializeGLFunctions(const QGLContext *context = 0); + void initializeGLFunctions(const QGLContext *context = Q_NULLPTR); void glActiveTexture(GLenum texture); void glAttachShader(GLuint program, GLuint shader); @@ -172,14 +172,14 @@ public: private: QGLFunctionsPrivate *d_ptr; - static bool isInitialized(const QGLFunctionsPrivate *d) { return d != 0; } + static bool isInitialized(const QGLFunctionsPrivate *d) { return d != Q_NULLPTR; } }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGLFunctions::OpenGLFeatures) struct QGLFunctionsPrivate { - QGLFunctionsPrivate(const QGLContext *context = 0); + QGLFunctionsPrivate(const QGLContext *context = Q_NULLPTR); QOpenGLFunctions *funcs; }; diff --git a/src/opengl/qglpixelbuffer.h b/src/opengl/qglpixelbuffer.h index 0f0110da96..2aad76b002 100644 --- a/src/opengl/qglpixelbuffer.h +++ b/src/opengl/qglpixelbuffer.h @@ -47,9 +47,9 @@ class Q_OPENGL_EXPORT QGLPixelBuffer : public QPaintDevice Q_DECLARE_PRIVATE(QGLPixelBuffer) public: QGLPixelBuffer(const QSize &size, const QGLFormat &format = QGLFormat::defaultFormat(), - QGLWidget *shareWidget = 0); + QGLWidget *shareWidget = Q_NULLPTR); QGLPixelBuffer(int width, int height, const QGLFormat &format = QGLFormat::defaultFormat(), - QGLWidget *shareWidget = 0); + QGLWidget *shareWidget = Q_NULLPTR); virtual ~QGLPixelBuffer(); bool isValid() const; diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h index 5d9fe22b0b..8f2c74fae7 100644 --- a/src/opengl/qglshaderprogram.h +++ b/src/opengl/qglshaderprogram.h @@ -58,8 +58,8 @@ public: }; Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit) - explicit QGLShader(QGLShader::ShaderType type, QObject *parent = 0); - QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0); + explicit QGLShader(QGLShader::ShaderType type, QObject *parent = Q_NULLPTR); + QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = Q_NULLPTR); virtual ~QGLShader(); QGLShader::ShaderType shaderType() const; @@ -76,7 +76,7 @@ public: GLuint shaderId() const; - static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = 0); + static bool hasOpenGLShaders(ShaderType type, const QGLContext *context = Q_NULLPTR); private: friend class QGLShaderProgram; @@ -94,8 +94,8 @@ class Q_OPENGL_EXPORT QGLShaderProgram : public QObject { Q_OBJECT public: - explicit QGLShaderProgram(QObject *parent = 0); - explicit QGLShaderProgram(const QGLContext *context, QObject *parent = 0); + explicit QGLShaderProgram(QObject *parent = Q_NULLPTR); + explicit QGLShaderProgram(const QGLContext *context, QObject *parent = Q_NULLPTR); virtual ~QGLShaderProgram(); bool addShader(QGLShader *shader); @@ -280,7 +280,7 @@ public: void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count); void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count); - static bool hasOpenGLShaderPrograms(const QGLContext *context = 0); + static bool hasOpenGLShaderPrograms(const QGLContext *context = Q_NULLPTR); private Q_SLOTS: void shaderDestroyed(); -- cgit v1.2.3