From ecceaec8581886e5215ab10c8f5c702e315cb397 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 3 Apr 2017 20:53:17 +0100 Subject: GCC 7: fix -Werror=implicit-fallthrough More fallthrough-are-errors fixed. Change-Id: I9a6cb6efe988400ed3f9cb95d1e426dac317e6c4 Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Marc Mutz --- src/gui/painting/qblendfunctions_p.h | 12 +++++------ src/gui/painting/qdrawhelper_p.h | 42 ++++++++++++++++++------------------ src/gui/painting/qgrayraster.c | 14 ++++++------ src/gui/painting/qtransform.cpp | 6 +++++- 4 files changed, 40 insertions(+), 34 deletions(-) (limited to 'src/gui/painting') diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h index 7ee04987fe..167f725143 100644 --- a/src/gui/painting/qblendfunctions_p.h +++ b/src/gui/painting/qblendfunctions_p.h @@ -375,12 +375,12 @@ void qt_transform_image_rasterize(DestT *destPixels, int dbpl, --ii; } switch (i & 7) { - case 7: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; - case 6: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; - case 5: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; - case 4: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; - case 3: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; - case 2: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; + case 7: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH(); + case 6: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH(); + case 5: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH(); + case 4: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH(); + case 3: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH(); + case 2: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH(); case 1: blender.write(line, reinterpret_cast(reinterpret_cast(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; } diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 0e46962784..694959909b 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -846,13 +846,13 @@ inline void qt_memfill(T *dest, T value, int count) int n = (count + 7) / 8; switch (count & 0x07) { - case 0: do { *dest++ = value; - case 7: *dest++ = value; - case 6: *dest++ = value; - case 5: *dest++ = value; - case 4: *dest++ = value; - case 3: *dest++ = value; - case 2: *dest++ = value; + case 0: do { *dest++ = value; Q_FALLTHROUGH(); + case 7: *dest++ = value; Q_FALLTHROUGH(); + case 6: *dest++ = value; Q_FALLTHROUGH(); + case 5: *dest++ = value; Q_FALLTHROUGH(); + case 4: *dest++ = value; Q_FALLTHROUGH(); + case 3: *dest++ = value; Q_FALLTHROUGH(); + case 2: *dest++ = value; Q_FALLTHROUGH(); case 1: *dest++ = value; } while (--n > 0); } @@ -888,13 +888,13 @@ do { \ int n = ((length) + 7) / 8; \ switch ((length) & 0x07) \ { \ - case 0: do { *--_d = *--_s; \ - case 7: *--_d = *--_s; \ - case 6: *--_d = *--_s; \ - case 5: *--_d = *--_s; \ - case 4: *--_d = *--_s; \ - case 3: *--_d = *--_s; \ - case 2: *--_d = *--_s; \ + case 0: do { *--_d = *--_s; Q_FALLTHROUGH(); \ + case 7: *--_d = *--_s; Q_FALLTHROUGH(); \ + case 6: *--_d = *--_s; Q_FALLTHROUGH(); \ + case 5: *--_d = *--_s; Q_FALLTHROUGH(); \ + case 4: *--_d = *--_s; Q_FALLTHROUGH(); \ + case 3: *--_d = *--_s; Q_FALLTHROUGH(); \ + case 2: *--_d = *--_s; Q_FALLTHROUGH(); \ case 1: *--_d = *--_s; \ } while (--n > 0); \ } \ @@ -908,13 +908,13 @@ do { \ int n = ((length) + 7) / 8; \ switch ((length) & 0x07) \ { \ - case 0: do { *_d++ = *_s++; \ - case 7: *_d++ = *_s++; \ - case 6: *_d++ = *_s++; \ - case 5: *_d++ = *_s++; \ - case 4: *_d++ = *_s++; \ - case 3: *_d++ = *_s++; \ - case 2: *_d++ = *_s++; \ + case 0: do { *_d++ = *_s++; Q_FALLTHROUGH(); \ + case 7: *_d++ = *_s++; Q_FALLTHROUGH(); \ + case 6: *_d++ = *_s++; Q_FALLTHROUGH(); \ + case 5: *_d++ = *_s++; Q_FALLTHROUGH(); \ + case 4: *_d++ = *_s++; Q_FALLTHROUGH(); \ + case 3: *_d++ = *_s++; Q_FALLTHROUGH(); \ + case 2: *_d++ = *_s++; Q_FALLTHROUGH(); \ case 1: *_d++ = *_s++; \ } while (--n > 0); \ } \ diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c index db3453898f..dae1c06bec 100644 --- a/src/gui/painting/qgrayraster.c +++ b/src/gui/painting/qgrayraster.c @@ -162,6 +162,8 @@ #include #include +#include + #include #include @@ -1147,12 +1149,12 @@ switch ( spans->len ) { - case 7: *q++ = (unsigned char)coverage; - case 6: *q++ = (unsigned char)coverage; - case 5: *q++ = (unsigned char)coverage; - case 4: *q++ = (unsigned char)coverage; - case 3: *q++ = (unsigned char)coverage; - case 2: *q++ = (unsigned char)coverage; + case 7: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 6: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 5: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 4: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 3: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 2: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); case 1: *q = (unsigned char)coverage; default: ; diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 2d841b2953..4e0489b352 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -2094,7 +2094,8 @@ QTransform::TransformationType QTransform::type() const if (!qFuzzyIsNull(m_13) || !qFuzzyIsNull(m_23) || !qFuzzyIsNull(m_33 - 1)) { m_type = TxProject; break; - } + } + Q_FALLTHROUGH(); case TxShear: case TxRotate: if (!qFuzzyIsNull(affine._m12) || !qFuzzyIsNull(affine._m21)) { @@ -2105,16 +2106,19 @@ QTransform::TransformationType QTransform::type() const m_type = TxShear; break; } + Q_FALLTHROUGH(); case TxScale: if (!qFuzzyIsNull(affine._m11 - 1) || !qFuzzyIsNull(affine._m22 - 1)) { m_type = TxScale; break; } + Q_FALLTHROUGH(); case TxTranslate: if (!qFuzzyIsNull(affine._dx) || !qFuzzyIsNull(affine._dy)) { m_type = TxTranslate; break; } + Q_FALLTHROUGH(); case TxNone: m_type = TxNone; break; -- cgit v1.2.3