Fix -Wimplicit-fallthrough for clang
Clang's `-Wimplicit-fallthrough` warnings are a little stricter than gcc's interpretation: switch (i) { case 0: foo(); case 4: break; } While gcc accepts the implicit fallthrough, if the following statement is a trivial `break`, clang will warn about it. Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit c26994ff1551aa5450383cc51bed9b4d39f973f7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
91fa8748a1
commit
137568c920
2
src/3rdparty/tinycbor/src/cborparser.c
vendored
2
src/3rdparty/tinycbor/src/cborparser.c
vendored
@ -232,7 +232,7 @@ static CborError preparse_value(CborValue *it)
|
|||||||
case SinglePrecisionFloat:
|
case SinglePrecisionFloat:
|
||||||
case DoublePrecisionFloat:
|
case DoublePrecisionFloat:
|
||||||
it->flags |= CborIteratorFlag_IntegerValueTooLarge;
|
it->flags |= CborIteratorFlag_IntegerValueTooLarge;
|
||||||
/* fall through */
|
Q_FALLTHROUGH();
|
||||||
case TrueValue:
|
case TrueValue:
|
||||||
case NullValue:
|
case NullValue:
|
||||||
case UndefinedValue:
|
case UndefinedValue:
|
||||||
|
@ -1355,6 +1355,7 @@ static qsizetype indic_nextSyllableBoundary(QChar::Script script, const char16_t
|
|||||||
// ### needs proper testing for correct two/three part matras
|
// ### needs proper testing for correct two/three part matras
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Q_FALLTHROUGH();
|
||||||
case IndependentVowel:
|
case IndependentVowel:
|
||||||
case Invalid:
|
case Invalid:
|
||||||
case Other:
|
case Other:
|
||||||
|
@ -709,6 +709,7 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
|
|||||||
case DaySectionMask:
|
case DaySectionMask:
|
||||||
qWarning("QDateTimeParser::sectionMaxSize: Invalid section %s",
|
qWarning("QDateTimeParser::sectionMaxSize: Invalid section %s",
|
||||||
SectionNode::name(s).toLatin1().constData());
|
SectionNode::name(s).toLatin1().constData());
|
||||||
|
break;
|
||||||
|
|
||||||
case NoSectionIndex:
|
case NoSectionIndex:
|
||||||
case FirstSectionIndex:
|
case FirstSectionIndex:
|
||||||
|
@ -2027,6 +2027,7 @@ bool QGuiApplication::event(QEvent *e)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -268,6 +268,7 @@ void qDrawEdge(QPainter *p, qreal x1, qreal y1, qreal x2, qreal y2, qreal dw1, q
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -1234,6 +1234,7 @@ const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSy
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@ FrameStatus Frame::validateHeader() const
|
|||||||
// 6.6 PUSH_PROMISE
|
// 6.6 PUSH_PROMISE
|
||||||
if (framePayloadSize < 4)
|
if (framePayloadSize < 4)
|
||||||
return FrameStatus::sizeError;
|
return FrameStatus::sizeError;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// DATA/HEADERS/CONTINUATION will be verified
|
// DATA/HEADERS/CONTINUATION will be verified
|
||||||
// when we have payload.
|
// when we have payload.
|
||||||
|
@ -436,6 +436,7 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16
|
|||||||
case EFAULT:
|
case EFAULT:
|
||||||
case ENOTSOCK:
|
case ENOTSOCK:
|
||||||
socketState = QAbstractSocket::UnconnectedState;
|
socketState = QAbstractSocket::UnconnectedState;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -194,6 +194,7 @@ QEvdevTouchScreenHandler::QEvdevTouchScreenHandler(const QString &device, const
|
|||||||
case 180:
|
case 180:
|
||||||
case 270:
|
case 270:
|
||||||
rotationAngle = argValue;
|
rotationAngle = argValue;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ QTuioHandler::QTuioHandler(const QString &specification)
|
|||||||
case 180:
|
case 180:
|
||||||
case 270:
|
case 270:
|
||||||
rotationAngle = argValue;
|
rotationAngle = argValue;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1146,6 +1146,7 @@ void QJpegHandler::setOption(ImageOption option, const QVariant &value)
|
|||||||
int transformation = value.toInt();
|
int transformation = value.toInt();
|
||||||
if (transformation > 0 && transformation < 8)
|
if (transformation > 0 && transformation < 8)
|
||||||
d->transformation = QImageIOHandler::Transformations(transformation);
|
d->transformation = QImageIOHandler::Transformations(transformation);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -135,6 +135,7 @@ void QXcbWindow::setImageFormatForVisual(const xcb_visualtype_t *visual)
|
|||||||
case 16:
|
case 16:
|
||||||
qWarning("Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.");
|
qWarning("Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.");
|
||||||
m_imageFormat = QImage::Format_RGB16;
|
m_imageFormat = QImage::Format_RGB16;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -352,6 +352,7 @@ bool QAccessibleTable::unselectRow(int row)
|
|||||||
//the ones which are down the current row will be deselected
|
//the ones which are down the current row will be deselected
|
||||||
selection = QItemSelection(index, theModel->index(rowCount() - 1, 0, rootIndex));
|
selection = QItemSelection(index, theModel->index(rowCount() - 1, 0, rootIndex));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -392,6 +393,7 @@ bool QAccessibleTable::unselectColumn(int column)
|
|||||||
//of the current rown, the ones which are at the right will be deselected
|
//of the current rown, the ones which are at the right will be deselected
|
||||||
selection = QItemSelection(index, theModel->index(0, columnCount() - 1, rootIndex));
|
selection = QItemSelection(index, theModel->index(0, columnCount() - 1, rootIndex));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2768,6 +2768,7 @@ QPixmap QMessageBoxPrivate::standardIcon(QMessageBox::Icon icon, QMessageBox *mb
|
|||||||
break;
|
break;
|
||||||
case QMessageBox::Question:
|
case QMessageBox::Question:
|
||||||
tmpIcon = style->standardIcon(QStyle::SP_MessageBoxQuestion, nullptr, mb);
|
tmpIcon = style->standardIcon(QStyle::SP_MessageBoxQuestion, nullptr, mb);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3253,6 +3253,7 @@ bool QGraphicsScene::event(QEvent *event)
|
|||||||
// ### this should only be cleared if we received a new mouse move event,
|
// ### this should only be cleared if we received a new mouse move event,
|
||||||
// which relies on us fixing the replay mechanism in QGraphicsView.
|
// which relies on us fixing the replay mechanism in QGraphicsView.
|
||||||
d->cachedItemsUnderMouse.clear();
|
d->cachedItemsUnderMouse.clear();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4301,6 +4301,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -2645,6 +2645,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
|||||||
Q_FALLTHROUGH();
|
Q_FALLTHROUGH();
|
||||||
case QEvent::Leave:
|
case QEvent::Leave:
|
||||||
d->toolTipWakeUp.stop();
|
d->toolTipWakeUp.stop();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2669,6 +2670,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
|||||||
|| key == Qt::Key_Up
|
|| key == Qt::Key_Up
|
||||||
|| key == Qt::Key_Right
|
|| key == Qt::Key_Right
|
||||||
|| key == Qt::Key_Down);
|
|| key == Qt::Key_Down);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -329,6 +329,7 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e)
|
|||||||
case QEvent::MouseMove:
|
case QEvent::MouseMove:
|
||||||
if (o == widget && !rect.isNull() && !rect.contains(static_cast<QMouseEvent*>(e)->position().toPoint()))
|
if (o == widget && !rect.isNull() && !rect.contains(static_cast<QMouseEvent*>(e)->position().toPoint()))
|
||||||
hideTip();
|
hideTip();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4224,6 +4224,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
|||||||
break;
|
break;
|
||||||
case SC_SpinBoxFrame:
|
case SC_SpinBoxFrame:
|
||||||
ret = spinbox->rect;
|
ret = spinbox->rect;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3309,6 +3309,7 @@ QRect QFusionStyle::subControlRect(ComplexControl control, const QStyleOptionCom
|
|||||||
break;
|
break;
|
||||||
case SC_SpinBoxFrame:
|
case SC_SpinBoxFrame:
|
||||||
rect = spinbox->rect;
|
rect = spinbox->rect;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -256,6 +256,7 @@ static QImage blendedImage(const QImage &start, const QImage &end, float alpha)
|
|||||||
front_data += bpl;
|
front_data += bpl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4871,6 +4871,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
|
|||||||
w = w->parentWidget(); //match on the QTabBar instead of the CloseButton
|
w = w->parentWidget(); //match on the QTabBar instead of the CloseButton
|
||||||
}
|
}
|
||||||
pseudoElement = PseudoElement_TabBarTabCloseButton;
|
pseudoElement = PseudoElement_TabBarTabCloseButton;
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -2043,6 +2043,7 @@ QVariant operator-(const QVariant &arg1, const QVariant &arg2)
|
|||||||
dt.setTime(dt.time().addMSecs(msecs));
|
dt.setTime(dt.time().addMSecs(msecs));
|
||||||
ret = QVariant(dt);
|
ret = QVariant(dt);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
@ -3099,6 +3099,7 @@ bool QCalendarWidget::event(QEvent *event)
|
|||||||
case QEvent::StyleChange:
|
case QEvent::StyleChange:
|
||||||
d->cachedSizeHint = QSize();
|
d->cachedSizeHint = QSize();
|
||||||
d->m_view->updateGeometry();
|
d->m_view->updateGeometry();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1331,6 +1331,7 @@ void QDateTimeEdit::focusInEvent(QFocusEvent *event)
|
|||||||
case Qt::ActiveWindowFocusReason:
|
case Qt::ActiveWindowFocusReason:
|
||||||
if (oldHasHadFocus)
|
if (oldHasHadFocus)
|
||||||
return;
|
return;
|
||||||
|
break;
|
||||||
case Qt::ShortcutFocusReason:
|
case Qt::ShortcutFocusReason:
|
||||||
case Qt::TabFocusReason:
|
case Qt::TabFocusReason:
|
||||||
default:
|
default:
|
||||||
|
@ -292,6 +292,7 @@ void QAlphaWidget::alphaBlend()
|
|||||||
back_data += bpl;
|
back_data += bpl;
|
||||||
front_data += bpl;
|
front_data += bpl;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -338,6 +338,7 @@ bool QDockWidgetGroupWindow::event(QEvent *e)
|
|||||||
case QEvent::Resize:
|
case QEvent::Resize:
|
||||||
updateCurrentGapRect();
|
updateCurrentGapRect();
|
||||||
emit resized();
|
emit resized();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1084,6 +1084,7 @@ bool QToolBar::event(QEvent *event)
|
|||||||
d->layout->setExpanded(false);
|
d->layout->setExpanded(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1638,6 +1638,7 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event)
|
|||||||
setText(m_completer->currentCompletion());
|
setText(m_completer->currentCompletion());
|
||||||
inlineCompletionAccepted = true;
|
inlineCompletionAccepted = true;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break; // normal key processing
|
break; // normal key processing
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user