From a767014167d4f7b258a2bd83637dc1ef25b364f0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 30 Jun 2015 22:11:15 +0200 Subject: QtGui: 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: I72ab40b21a9499b53a639564fa45884de17b6c98 Reviewed-by: Thiago Macieira --- src/gui/opengl/qopenglbuffer.h | 2 +- src/gui/opengl/qopengldebug.h | 2 +- src/gui/opengl/qopenglfunctions.h | 2 +- src/gui/opengl/qopenglshaderprogram.h | 8 ++++---- src/gui/opengl/qopengltexture.h | 32 +++++++++++++++---------------- src/gui/opengl/qopengltimerquery.h | 4 ++-- src/gui/opengl/qopenglversionfunctions.h | 2 +- src/gui/opengl/qopenglvertexarrayobject.h | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) (limited to 'src/gui/opengl') diff --git a/src/gui/opengl/qopenglbuffer.h b/src/gui/opengl/qopenglbuffer.h index 847c1efaa0..ca3d85d8e0 100644 --- a/src/gui/opengl/qopenglbuffer.h +++ b/src/gui/opengl/qopenglbuffer.h @@ -118,7 +118,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(QOpenGLBuffer::Access access); void *mapRange(int offset, int count, QOpenGLBuffer::RangeAccessFlags access); diff --git a/src/gui/opengl/qopengldebug.h b/src/gui/opengl/qopengldebug.h index d24940cb3c..3e93ad4120 100644 --- a/src/gui/opengl/qopengldebug.h +++ b/src/gui/opengl/qopengldebug.h @@ -156,7 +156,7 @@ public: }; Q_ENUM(LoggingMode) - explicit QOpenGLDebugLogger(QObject *parent = 0); + explicit QOpenGLDebugLogger(QObject *parent = Q_NULLPTR); ~QOpenGLDebugLogger(); bool initialize(); diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index b7cb4e53e9..dbd9061336 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -402,7 +402,7 @@ public: protected: QOpenGLFunctionsPrivate *d_ptr; - static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != 0; } + static bool isInitialized(const QOpenGLFunctionsPrivate *d) { return d != Q_NULLPTR; } }; Q_DECLARE_OPERATORS_FOR_FLAGS(QOpenGLFunctions::OpenGLFeatures) diff --git a/src/gui/opengl/qopenglshaderprogram.h b/src/gui/opengl/qopenglshaderprogram.h index 9f5957e612..b959954718 100644 --- a/src/gui/opengl/qopenglshaderprogram.h +++ b/src/gui/opengl/qopenglshaderprogram.h @@ -66,7 +66,7 @@ public: }; Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit) - explicit QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = 0); + explicit QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = Q_NULLPTR); virtual ~QOpenGLShader(); QOpenGLShader::ShaderType shaderType() const; @@ -83,7 +83,7 @@ public: GLuint shaderId() const; - static bool hasOpenGLShaders(ShaderType type, QOpenGLContext *context = 0); + static bool hasOpenGLShaders(ShaderType type, QOpenGLContext *context = Q_NULLPTR); private: friend class QOpenGLShaderProgram; @@ -101,7 +101,7 @@ class Q_GUI_EXPORT QOpenGLShaderProgram : public QObject { Q_OBJECT public: - explicit QOpenGLShaderProgram(QObject *parent = 0); + explicit QOpenGLShaderProgram(QObject *parent = Q_NULLPTR); virtual ~QOpenGLShaderProgram(); bool addShader(QOpenGLShader *shader); @@ -288,7 +288,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(QOpenGLContext *context = 0); + static bool hasOpenGLShaderPrograms(QOpenGLContext *context = Q_NULLPTR); private Q_SLOTS: void shaderDestroyed(); diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h index 3017aac737..baab2d634f 100644 --- a/src/gui/opengl/qopengltexture.h +++ b/src/gui/opengl/qopengltexture.h @@ -409,54 +409,54 @@ public: #if QT_DEPRECATED_SINCE(5, 3) QT_DEPRECATED void setData(int mipLevel, int layer, CubeMapFace cubeFace, PixelFormat sourceFormat, PixelType sourceType, - void *data, const QOpenGLPixelTransferOptions * const options = 0); + void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); QT_DEPRECATED void setData(int mipLevel, int layer, PixelFormat sourceFormat, PixelType sourceType, - void *data, const QOpenGLPixelTransferOptions * const options = 0); + void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); QT_DEPRECATED void setData(int mipLevel, PixelFormat sourceFormat, PixelType sourceType, - void *data, const QOpenGLPixelTransferOptions * const options = 0); + void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); QT_DEPRECATED void setData(PixelFormat sourceFormat, PixelType sourceType, - void *data, const QOpenGLPixelTransferOptions * const options = 0); + void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); #endif // QT_DEPRECATED_SINCE(5, 3) void setData(int mipLevel, int layer, CubeMapFace cubeFace, PixelFormat sourceFormat, PixelType sourceType, - const void *data, const QOpenGLPixelTransferOptions * const options = 0); + const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); void setData(int mipLevel, int layer, PixelFormat sourceFormat, PixelType sourceType, - const void *data, const QOpenGLPixelTransferOptions * const options = 0); + const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); void setData(int mipLevel, PixelFormat sourceFormat, PixelType sourceType, - const void *data, const QOpenGLPixelTransferOptions * const options = 0); + const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); void setData(PixelFormat sourceFormat, PixelType sourceType, - const void *data, const QOpenGLPixelTransferOptions * const options = 0); + const void *data, const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); // Compressed data upload // ### Qt 6: remove the non-const void * overloads #if QT_DEPRECATED_SINCE(5, 3) QT_DEPRECATED void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace, int dataSize, void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); QT_DEPRECATED void setCompressedData(int mipLevel, int layer, int dataSize, void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); QT_DEPRECATED void setCompressedData(int mipLevel, int dataSize, void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); QT_DEPRECATED void setCompressedData(int dataSize, void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); #endif // QT_DEPRECATED_SINCE(5, 3) void setCompressedData(int mipLevel, int layer, CubeMapFace cubeFace, int dataSize, const void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); void setCompressedData(int mipLevel, int layer, int dataSize, const void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); void setCompressedData(int mipLevel, int dataSize, const void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); void setCompressedData(int dataSize, const void *data, - const QOpenGLPixelTransferOptions * const options = 0); + const QOpenGLPixelTransferOptions * const options = Q_NULLPTR); // Helpful overloads for setData void setData(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps); diff --git a/src/gui/opengl/qopengltimerquery.h b/src/gui/opengl/qopengltimerquery.h index 7e46250546..ad111dc03c 100644 --- a/src/gui/opengl/qopengltimerquery.h +++ b/src/gui/opengl/qopengltimerquery.h @@ -50,7 +50,7 @@ class Q_GUI_EXPORT QOpenGLTimerQuery : public QObject Q_OBJECT public: - explicit QOpenGLTimerQuery(QObject *parent = 0); + explicit QOpenGLTimerQuery(QObject *parent = Q_NULLPTR); ~QOpenGLTimerQuery(); bool create(); @@ -78,7 +78,7 @@ class Q_GUI_EXPORT QOpenGLTimeMonitor : public QObject Q_OBJECT public: - explicit QOpenGLTimeMonitor(QObject *parent = 0); + explicit QOpenGLTimeMonitor(QObject *parent = Q_NULLPTR); ~QOpenGLTimeMonitor(); void setSampleCount(int sampleCount); diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h index 2fd3b9dab9..a5d5677938 100644 --- a/src/gui/opengl/qopenglversionfunctions.h +++ b/src/gui/opengl/qopenglversionfunctions.h @@ -123,7 +123,7 @@ class QAbstractOpenGLFunctionsPrivate { public: QAbstractOpenGLFunctionsPrivate() - : owningContext(0), + : owningContext(Q_NULLPTR), initialized(false) {} diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h index 3e01d31202..e8ebf41071 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.h +++ b/src/gui/opengl/qopenglvertexarrayobject.h @@ -50,7 +50,7 @@ class Q_GUI_EXPORT QOpenGLVertexArrayObject : public QObject Q_OBJECT public: - explicit QOpenGLVertexArrayObject(QObject* parent = 0); + explicit QOpenGLVertexArrayObject(QObject* parent = Q_NULLPTR); ~QOpenGLVertexArrayObject(); bool create(); -- cgit v1.2.3