From af2daafde72db02454d24b7d691aa6861525ab99 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 18 Nov 2019 17:01:26 +0100 Subject: Deprecate constructing QFlags from a pointer This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira --- src/gui/opengl/qopenglbuffer.cpp | 4 ++-- src/gui/opengl/qopenglfunctions.cpp | 4 ++-- src/gui/opengl/qopenglpaintengine.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/gui/opengl') diff --git a/src/gui/opengl/qopenglbuffer.cpp b/src/gui/opengl/qopenglbuffer.cpp index 537097c09f..5ad16a8438 100644 --- a/src/gui/opengl/qopenglbuffer.cpp +++ b/src/gui/opengl/qopenglbuffer.cpp @@ -545,9 +545,9 @@ void *QOpenGLBuffer::map(QOpenGLBuffer::Access access) qWarning("QOpenGLBuffer::map(): buffer not created"); #endif if (!d->guard || !d->guard->id()) - return 0; + return nullptr; if (d->funcs->hasOpenGLExtension(QOpenGLExtensions::MapBufferRange)) { - QOpenGLBuffer::RangeAccessFlags rangeAccess = 0; + QOpenGLBuffer::RangeAccessFlags rangeAccess; switch (access) { case QOpenGLBuffer::ReadOnly: rangeAccess = QOpenGLBuffer::RangeRead; diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 8ec814296a..42186ace23 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -489,7 +489,7 @@ QOpenGLFunctions::OpenGLFeatures QOpenGLFunctions::openGLFeatures() const { QOpenGLFunctionsPrivateEx *d = static_cast(d_ptr); if (!d) - return 0; + return { }; if (d->m_features == -1) d->m_features = qt_gl_resolve_features(); return QOpenGLFunctions::OpenGLFeatures(d->m_features); @@ -527,7 +527,7 @@ QOpenGLExtensions::OpenGLExtensions QOpenGLExtensions::openGLExtensions() { QOpenGLFunctionsPrivateEx *d = static_cast(d_ptr); if (!d) - return 0; + return { }; if (d->m_extensions == -1) d->m_extensions = qt_gl_resolve_extensions(); return QOpenGLExtensions::OpenGLExtensions(d->m_extensions); diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 47394999c6..20cc2b5ae5 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -1575,7 +1575,7 @@ void QOpenGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, c case QImage::Format_ARGB32: case QImage::Format_RGBA64: d->shaderManager->setSrcPixelType(QOpenGLEngineShaderManager::NonPremultipliedImageSrc); - bindOption = 0; + bindOption = { }; break; case QImage::Format_Alpha8: if (ctx->functions()->hasOpenGLFeature(QOpenGLFunctions::TextureRGFormats)) { -- cgit v1.2.3