summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/image/qimage.cpp5
-rw-r--r--src/gui/image/qpixmap.cpp5
-rw-r--r--src/opengl/qopenglpaintengine.cpp10
3 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 8011aa2eb5..95be9772c8 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -77,6 +77,11 @@
QT_BEGIN_NAMESPACE
+// MSVC 19.28 does show spurious warning "C4723: potential divide by 0" for code that divides
+// by height() in release builds. Anyhow, all the code paths in this file are only executed
+// for valid QImage's, where height() cannot be 0. Therefore disable the warning.
+QT_WARNING_DISABLE_MSVC(4723)
+
static inline bool isLocked(QImageData *data)
{
return data != nullptr && data->is_locked;
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index a57e4c1fe2..3d46dc4a6b 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -70,6 +70,11 @@
QT_BEGIN_NAMESPACE
+// MSVC 19.28 does show spurious warning "C4723: potential divide by 0" for code that divides
+// by height() in release builds. Anyhow, all the code paths in this file are only executed
+// for valid QPixmap's, where height() cannot be 0. Therefore disable the warning.
+QT_WARNING_DISABLE_MSVC(4723)
+
static bool qt_pixmap_thread_test()
{
if (Q_UNLIKELY(!QCoreApplication::instance())) {
diff --git a/src/opengl/qopenglpaintengine.cpp b/src/opengl/qopenglpaintengine.cpp
index 9c8325ca11..7da9bf143d 100644
--- a/src/opengl/qopenglpaintengine.cpp
+++ b/src/opengl/qopenglpaintengine.cpp
@@ -1745,6 +1745,14 @@ bool QOpenGL2PaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, cons
return QPaintEngineEx::shouldDrawCachedGlyphs(fontEngine, t);
}
+
+// MSVC 19.28 does show spurious warning "C4723: potential divide by 0" for the code
+// that divides by QOpenGLTextureGlyphCache::height() in release builds.
+// Anyhow, the code path in this method is only executed
+// if height() != 0. Therefore disable the warning.
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_MSVC(4723)
+
void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat glyphFormat,
QStaticTextItem *staticTextItem)
{
@@ -2060,6 +2068,8 @@ void QOpenGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngine::GlyphFormat gly
#endif
}
+QT_WARNING_POP
+
void QOpenGL2PaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap,
QPainter::PixmapFragmentHints hints)
{