Support C++17 fallthrough attribute
Replaces our mix of comments for annotating intended absence of break in switches with the C++17 attribute [[fallthrough]], or its earlier a clang extension counterpart. Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
25dd9c521f
commit
9f888d2fde
@ -321,7 +321,7 @@ QMakeEvaluator::quoteValue(const ProString &val)
|
||||
break;
|
||||
case 32:
|
||||
quote = true;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
ret += c;
|
||||
break;
|
||||
|
@ -318,7 +318,7 @@ ProStringList QMakeEvaluator::split_value_list(const QStringRef &vals, const Pro
|
||||
--x;
|
||||
}
|
||||
}
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
hadWord = true;
|
||||
break;
|
||||
@ -1643,7 +1643,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::expandVariableReferences(
|
||||
tokPtr++;
|
||||
continue;
|
||||
}
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
Q_ASSERT_X(false, "expandVariableReferences", "Unrecognized token");
|
||||
break;
|
||||
@ -2109,7 +2109,7 @@ QString QMakeEvaluator::formatValue(const ProString &val, bool forceQuote)
|
||||
break;
|
||||
case 32:
|
||||
quote = true;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
ret += c;
|
||||
break;
|
||||
|
@ -411,7 +411,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
|
||||
switch (errno) {
|
||||
case EILSEQ:
|
||||
++invalidCount;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case EINVAL:
|
||||
{
|
||||
inBytes += sizeof(QChar);
|
||||
|
@ -288,7 +288,7 @@ QString QJisCodec::convertToUnicode(const char* chars, int len, ConverterState *
|
||||
result += QLatin1Char(ch);
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
Q_FALLTHROUGH();
|
||||
case JISX0201_Latin:
|
||||
u = conv->jisx0201ToUnicode(ch);
|
||||
result += QValidChar(u);
|
||||
|
@ -1341,6 +1341,18 @@
|
||||
Q_ASSUME_IMPL(valueOfExpression);\
|
||||
} while (0)
|
||||
|
||||
#if QT_HAS_CPP_ATTRIBUTE(fallthrough)
|
||||
# define Q_FALLTHROUGH() [[fallthrough]]
|
||||
#elif defined(__cplusplus)
|
||||
/* Clang can not parse namespaced attributes in C mode, but defines __has_cpp_attribute */
|
||||
# if QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
|
||||
# define Q_FALLTHROUGH() [[clang::fallthrough]]
|
||||
# endif
|
||||
#endif
|
||||
#ifndef Q_FALLTHROUGH
|
||||
# define Q_FALLTHROUGH() (void)0
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Sanitize compiler feature availability
|
||||
|
@ -2949,6 +2949,20 @@ QString QSysInfo::machineHostName()
|
||||
\sa Q_ASSERT(), Q_ASSUME(), qFatal()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro void Q_FALLTHROUGH()
|
||||
\relates <QtGlobal>
|
||||
\since 5.8
|
||||
|
||||
Can be used in switch statements at the end of case block to tell the compiler
|
||||
and other developers that that the lack of a break statement is intentional.
|
||||
|
||||
This is useful since a missing break statement is often a bug, and some
|
||||
compilers can be configured to emit warnings when one is not found.
|
||||
|
||||
\sa Q_UNREACHABLE()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\macro void Q_CHECK_PTR(void *pointer)
|
||||
\relates <QtGlobal>
|
||||
|
@ -813,7 +813,7 @@ StNormal:
|
||||
++i;
|
||||
goto StSkipSpaces;
|
||||
}
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
default: {
|
||||
int j = i + 1;
|
||||
while (j < to) {
|
||||
|
@ -742,7 +742,7 @@ void QWinSettingsPrivate::set(const QString &uKey, const QVariant &value)
|
||||
}
|
||||
|
||||
case QVariant::ByteArray:
|
||||
// fallthrough intended
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
default: {
|
||||
// If the string does not contain '\0', we can use REG_SZ, the native registry
|
||||
|
@ -339,7 +339,7 @@ bool Value::isValid(const Base *b) const
|
||||
case QJsonValue::Double:
|
||||
if (latinOrIntValue)
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QJsonValue::String:
|
||||
case QJsonValue::Array:
|
||||
case QJsonValue::Object:
|
||||
@ -418,7 +418,7 @@ uint Value::valueToStore(const QJsonValue &v, uint offset)
|
||||
if (c != INT_MAX)
|
||||
return c;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QJsonValue::String:
|
||||
case QJsonValue::Array:
|
||||
case QJsonValue::Object:
|
||||
|
@ -167,7 +167,7 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty
|
||||
case QVariant::List: {
|
||||
if (format != QLatin1String("text/uri-list"))
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QVariant::Url: {
|
||||
QByteArray ba = data.toByteArray();
|
||||
|
@ -149,12 +149,13 @@ QString QSystemError::toString() const
|
||||
return windowsErrorString(errorCode);
|
||||
#else
|
||||
//unix: fall through as native and standard library are the same
|
||||
Q_FALLTHROUGH();
|
||||
#endif
|
||||
case StandardLibraryError:
|
||||
return standardLibraryErrorString(errorCode);
|
||||
default:
|
||||
qWarning("invalid error scope");
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case NoError:
|
||||
return QLatin1String("No error");
|
||||
}
|
||||
|
@ -468,7 +468,6 @@ void QTimerInfoList::registerTimer(int timerId, int interval, Qt::TimerType time
|
||||
// above 20 s, 5% inaccuracy is above 1 s, so we convert to VeryCoarseTimer
|
||||
if (interval >= 20000) {
|
||||
t->timerType = Qt::VeryCoarseTimer;
|
||||
// fall through
|
||||
} else {
|
||||
t->timeout = expected;
|
||||
if (interval <= 20) {
|
||||
@ -479,7 +478,7 @@ void QTimerInfoList::registerTimer(int timerId, int interval, Qt::TimerType time
|
||||
}
|
||||
break;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::VeryCoarseTimer:
|
||||
// the very coarse timer is based on full second precision,
|
||||
// so we keep the interval in seconds (round to closest second)
|
||||
|
@ -203,7 +203,7 @@ static qlonglong qConvertToNumber(const QVariant::Private *d, bool *ok)
|
||||
case QMetaType::QJsonValue:
|
||||
if (!v_cast<QJsonValue>(d)->isDouble())
|
||||
break;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
#endif
|
||||
case QVariant::Double:
|
||||
case QVariant::Int:
|
||||
@ -278,7 +278,7 @@ static qulonglong qConvertToUnsignedNumber(const QVariant::Private *d, bool *ok)
|
||||
case QMetaType::QJsonValue:
|
||||
if (!v_cast<QJsonValue>(d)->isDouble())
|
||||
break;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
#endif
|
||||
case QVariant::Double:
|
||||
case QVariant::Int:
|
||||
@ -3119,7 +3119,7 @@ bool QVariant::canConvert(int targetTypeId) const
|
||||
case QVariant::Int:
|
||||
if (currentType == QVariant::KeySequence)
|
||||
return true;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QVariant::UInt:
|
||||
case QVariant::LongLong:
|
||||
case QVariant::ULongLong:
|
||||
|
@ -2656,7 +2656,7 @@ static void setTimeSpec(QDateTimeData &d, Qt::TimeSpec spec, int offsetSeconds)
|
||||
case Qt::TimeZone:
|
||||
// Use system time zone instead
|
||||
spec = Qt::LocalTime;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::UTC:
|
||||
case Qt::LocalTime:
|
||||
offsetSeconds = 0;
|
||||
|
@ -602,7 +602,7 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const
|
||||
return 2;
|
||||
#else
|
||||
mcount = 7;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
#endif
|
||||
case MonthSection:
|
||||
#ifdef QT_NO_TEXTDATE
|
||||
@ -770,7 +770,8 @@ int QDateTimeParser::parseSection(const QDateTime ¤tValue, int sectionInde
|
||||
state = Intermediate;
|
||||
}
|
||||
break;
|
||||
} // else: fall through
|
||||
}
|
||||
Q_FALLTHROUGH();
|
||||
case DaySection:
|
||||
case YearSection:
|
||||
case YearSection2Digits:
|
||||
@ -1155,7 +1156,7 @@ end:
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
default: {
|
||||
int toMin;
|
||||
int toMax;
|
||||
@ -1489,7 +1490,7 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const
|
||||
switch (sn.type) {
|
||||
case MSecSection:
|
||||
ret |= Fraction;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
case SecondSection:
|
||||
case MinuteSection:
|
||||
case Hour24Section:
|
||||
@ -1509,7 +1510,7 @@ QDateTimeParser::FieldInfo QDateTimeParser::fieldInfo(int index) const
|
||||
switch (sn.count) {
|
||||
case 2:
|
||||
ret |= FixedWidth;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
case 1:
|
||||
ret |= (Numeric|AllowPartial);
|
||||
break;
|
||||
|
@ -3011,7 +3011,7 @@ int QRegExpEngine::getEscape()
|
||||
case 'I':
|
||||
if (xmlSchemaExtensions) {
|
||||
yyCharClass->setNegative(!yyCharClass->negative());
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@ -3051,7 +3051,7 @@ int QRegExpEngine::getEscape()
|
||||
case 'C':
|
||||
if (xmlSchemaExtensions) {
|
||||
yyCharClass->setNegative(!yyCharClass->negative());
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@ -3097,7 +3097,7 @@ int QRegExpEngine::getEscape()
|
||||
case 'P':
|
||||
if (xmlSchemaExtensions) {
|
||||
yyCharClass->setNegative(!yyCharClass->negative());
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
@ -522,13 +522,13 @@ static void getLineBreaks(const ushort *string, quint32 len, QCharAttributes *at
|
||||
// do not change breaks before and after the expression
|
||||
for (quint32 j = nestart + 1; j < pos; ++j)
|
||||
attributes[j].lineBreak = false;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case LB::NS::None:
|
||||
nelast = LB::NS::XX; // reset state
|
||||
break;
|
||||
case LB::NS::Start:
|
||||
nestart = i;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
nelast = necur;
|
||||
break;
|
||||
|
@ -976,11 +976,11 @@ bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject)
|
||||
case '\r':
|
||||
if ((c = filterCarriageReturn()) == 0)
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case '\n':
|
||||
++lineNumber;
|
||||
lastLineStart = characterOffset + readBufferPos;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case '\t':
|
||||
textBuffer += QChar(c);
|
||||
continue;
|
||||
@ -1158,11 +1158,11 @@ inline int QXmlStreamReaderPrivate::fastScanLiteralContent()
|
||||
case '\r':
|
||||
if (filterCarriageReturn() == 0)
|
||||
return n;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case '\n':
|
||||
++lineNumber;
|
||||
lastLineStart = characterOffset + readBufferPos;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case ' ':
|
||||
case '\t':
|
||||
if (normalizeLiterals)
|
||||
@ -1179,7 +1179,7 @@ inline int QXmlStreamReaderPrivate::fastScanLiteralContent()
|
||||
putChar(c);
|
||||
return n;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (c < 0x20) {
|
||||
putChar(c);
|
||||
@ -1201,11 +1201,11 @@ inline int QXmlStreamReaderPrivate::fastScanSpace()
|
||||
case '\r':
|
||||
if ((c = filterCarriageReturn()) == 0)
|
||||
return n;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case '\n':
|
||||
++lineNumber;
|
||||
lastLineStart = characterOffset + readBufferPos;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case ' ':
|
||||
case '\t':
|
||||
textBuffer += QChar(c);
|
||||
@ -1259,11 +1259,11 @@ inline int QXmlStreamReaderPrivate::fastScanContentCharList()
|
||||
case '\r':
|
||||
if ((c = filterCarriageReturn()) == 0)
|
||||
return n;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case '\n':
|
||||
++lineNumber;
|
||||
lastLineStart = characterOffset + readBufferPos;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case ' ':
|
||||
case '\t':
|
||||
textBuffer += QChar(ushort(c));
|
||||
@ -1275,7 +1275,7 @@ inline int QXmlStreamReaderPrivate::fastScanContentCharList()
|
||||
putChar(c);
|
||||
return n;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (c < 0x20) {
|
||||
putChar(c);
|
||||
@ -1339,7 +1339,7 @@ inline int QXmlStreamReaderPrivate::fastScanName(int *prefix)
|
||||
putChar(c);
|
||||
return n;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
textBuffer += QChar(c);
|
||||
++n;
|
||||
@ -2123,7 +2123,7 @@ QString QXmlStreamReader::readElementText(ReadElementTextBehaviour behaviour)
|
||||
result += readElementText(behaviour);
|
||||
break;
|
||||
}
|
||||
// Fall through (for ErrorOnUnexpectedElement)
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (d->error || behaviour == ErrorOnUnexpectedElement) {
|
||||
if (!d->error)
|
||||
|
@ -1048,7 +1048,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
dtdName.clear();
|
||||
dtdPublicId.clear();
|
||||
dtdSystemId.clear();
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QXmlStreamReader::Comment:
|
||||
case QXmlStreamReader::Characters:
|
||||
isCDATA = false;
|
||||
@ -1080,7 +1080,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
clearTextBuffer();
|
||||
;
|
||||
@ -1124,7 +1124,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case ~0U: {
|
||||
token = EOF_SYMBOL;
|
||||
if (!tagsDone && !inParseEntity) {
|
||||
@ -1338,7 +1338,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
case 17:
|
||||
case 18:
|
||||
dtdName = symString(3);
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
case 19:
|
||||
case 20:
|
||||
@ -1480,7 +1480,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
if (entityDeclaration.parameter)
|
||||
raiseWellFormedError(QXmlStream::tr("NDATA in parameter entity declaration."));
|
||||
}
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
case 94:
|
||||
case 95: {
|
||||
@ -1588,7 +1588,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
|
||||
case 129:
|
||||
isWhitespace = false;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
case 130:
|
||||
sym(1).len += fastScanContentCharList();
|
||||
@ -1760,7 +1760,7 @@ bool QXmlStreamReaderPrivate::parse()
|
||||
|
||||
case 236:
|
||||
isEmptyElement = true;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
case 237:
|
||||
setType(QXmlStreamReader::StartElement);
|
||||
|
@ -318,7 +318,7 @@ void QDBusMarshaller::open(QDBusMarshaller &sub, int code, const char *signature
|
||||
case DBUS_TYPE_ARRAY:
|
||||
*ba += char(code);
|
||||
*ba += signature;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
case DBUS_TYPE_DICT_ENTRY:
|
||||
sub.closeCode = 0;
|
||||
@ -495,9 +495,9 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg)
|
||||
return true;
|
||||
|
||||
default:
|
||||
; // fall through
|
||||
;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
case DBUS_TYPE_STRUCT:
|
||||
case DBUS_STRUCT_BEGIN_CHAR:
|
||||
@ -513,7 +513,7 @@ bool QDBusMarshaller::appendVariantInternal(const QVariant &arg)
|
||||
append(qvariant_cast<QDBusUnixFileDescriptor>(arg));
|
||||
return true;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
default:
|
||||
qWarning("QDBusMarshaller::appendVariantInternal: Found unknown D-BUS type '%s'",
|
||||
|
@ -373,7 +373,7 @@ int QDBusMetaType::signatureToType(const char *signature)
|
||||
return qMetaTypeId<QList<QDBusSignature> >();
|
||||
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
return QMetaType::UnknownType;
|
||||
}
|
||||
|
@ -1888,7 +1888,7 @@ void QImage::invertPixels(InvertMode mode)
|
||||
case QImage::Format_RGBA8888:
|
||||
if (mode == InvertRgba)
|
||||
break;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
case QImage::Format_RGBX8888:
|
||||
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
||||
xorbits = 0xffffff00;
|
||||
@ -1900,7 +1900,7 @@ void QImage::invertPixels(InvertMode mode)
|
||||
case QImage::Format_ARGB32:
|
||||
if (mode == InvertRgba)
|
||||
break;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
case QImage::Format_RGB32:
|
||||
xorbits = 0x00ffffff;
|
||||
break;
|
||||
|
@ -1151,7 +1151,7 @@ bool QImageReader::autoTransform() const
|
||||
case QImageReaderPrivate::UsePluginDefault:
|
||||
if (d->initHandler())
|
||||
return d->handler->supportsOption(QImageIOHandler::TransformedByDefault);
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -113,10 +113,10 @@ int QBlittablePlatformPixmap::metric(QPaintDevice::PaintDeviceMetric metric) con
|
||||
return qRound(h * 25.4 / qt_defaultDpiY());
|
||||
case QPaintDevice::PdmDepth:
|
||||
return 32;
|
||||
case QPaintDevice::PdmDpiX: // fall-through
|
||||
case QPaintDevice::PdmDpiX:
|
||||
case QPaintDevice::PdmPhysicalDpiX:
|
||||
return qt_defaultDpiX();
|
||||
case QPaintDevice::PdmDpiY: // fall-through
|
||||
case QPaintDevice::PdmDpiY:
|
||||
case QPaintDevice::PdmPhysicalDpiY:
|
||||
return qt_defaultDpiY();
|
||||
case QPaintDevice::PdmDevicePixelRatio:
|
||||
|
@ -154,14 +154,14 @@ bool QPlatformGraphicsBufferHelper::bindSWToTexture(const QPlatformGraphicsBuffe
|
||||
switch (imageformat) {
|
||||
case QImage::Format_ARGB32_Premultiplied:
|
||||
premultiplied = true;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
case QImage::Format_RGB32:
|
||||
case QImage::Format_ARGB32:
|
||||
swizzle = true;
|
||||
break;
|
||||
case QImage::Format_RGBA8888_Premultiplied:
|
||||
premultiplied = true;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
case QImage::Format_RGBX8888:
|
||||
case QImage::Format_RGBA8888:
|
||||
break;
|
||||
|
@ -197,7 +197,7 @@ void qDrawEdge(QPainter *p, qreal x1, qreal y1, qreal x2, qreal y2, qreal dw1, q
|
||||
if ((style == BorderStyle_Outset && (edge == TopEdge || edge == LeftEdge))
|
||||
|| (style == BorderStyle_Inset && (edge == BottomEdge || edge == RightEdge)))
|
||||
c = c.color().lighter();
|
||||
// fall through!
|
||||
Q_FALLTHROUGH();
|
||||
case BorderStyle_Solid: {
|
||||
p->setPen(Qt::NoPen);
|
||||
p->setBrush(c);
|
||||
|
@ -1760,7 +1760,7 @@ static bool bool_op(bool a, bool b, QPathClipper::Operation op)
|
||||
switch (op) {
|
||||
case QPathClipper::BoolAnd:
|
||||
return a && b;
|
||||
case QPathClipper::BoolOr: // fall-through
|
||||
case QPathClipper::BoolOr:
|
||||
case QPathClipper::Simplify:
|
||||
return a || b;
|
||||
case QPathClipper::BoolSub:
|
||||
@ -1956,7 +1956,7 @@ QPointF intersectLine(const QPointF &a, const QPointF &b, qreal t)
|
||||
{
|
||||
QLineF line(a, b);
|
||||
switch (edge) {
|
||||
case Left: // fall-through
|
||||
case Left:
|
||||
case Right:
|
||||
return line.pointAt((t - a.x()) / (b.x() - a.x()));
|
||||
default:
|
||||
|
@ -2091,7 +2091,7 @@ int QPdfEnginePrivate::generateLinearGradientShader(const QLinearGradient *gradi
|
||||
break;
|
||||
case QGradient::ReflectSpread:
|
||||
reflect = true;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QGradient::RepeatSpread: {
|
||||
// calculate required bounds
|
||||
QRectF pageRect = m_pageLayout.fullRectPixels(resolution);
|
||||
@ -2154,7 +2154,7 @@ int QPdfEnginePrivate::generateRadialGradientShader(const QRadialGradient *gradi
|
||||
break;
|
||||
case QGradient::ReflectSpread:
|
||||
reflect = true;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QGradient::RepeatSpread: {
|
||||
Q_ASSERT(qFuzzyIsNull(r0)); // QPainter emulates if this is not 0
|
||||
|
||||
|
@ -471,14 +471,14 @@ GLuint QPlatformBackingStore::toTexture(const QRegion &dirtyRegion, QSize *textu
|
||||
switch (image.format()) {
|
||||
case QImage::Format_ARGB32_Premultiplied:
|
||||
*flags |= TexturePremultiplied;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
case QImage::Format_RGB32:
|
||||
case QImage::Format_ARGB32:
|
||||
*flags |= TextureSwizzle;
|
||||
break;
|
||||
case QImage::Format_RGBA8888_Premultiplied:
|
||||
*flags |= TexturePremultiplied;
|
||||
// no break
|
||||
Q_FALLTHROUGH();
|
||||
case QImage::Format_RGBX8888:
|
||||
case QImage::Format_RGBA8888:
|
||||
break;
|
||||
|
@ -446,7 +446,7 @@ QTransform &QTransform::translate(qreal dx, qreal dy)
|
||||
break;
|
||||
case TxProject:
|
||||
m_33 += dx*m_13 + dy*m_23;
|
||||
// Fall through
|
||||
Q_FALLTHROUGH();
|
||||
case TxShear:
|
||||
case TxRotate:
|
||||
affine._dx += dx*affine._m11 + dy*affine._m21;
|
||||
@ -508,12 +508,12 @@ QTransform & QTransform::scale(qreal sx, qreal sy)
|
||||
case TxProject:
|
||||
m_13 *= sx;
|
||||
m_23 *= sy;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case TxRotate:
|
||||
case TxShear:
|
||||
affine._m12 *= sx;
|
||||
affine._m21 *= sy;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case TxScale:
|
||||
affine._m11 *= sx;
|
||||
affine._m22 *= sy;
|
||||
@ -581,7 +581,7 @@ QTransform & QTransform::shear(qreal sh, qreal sv)
|
||||
m_13 += tm13;
|
||||
m_23 += tm23;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case TxRotate:
|
||||
case TxShear: {
|
||||
qreal tm11 = sv*affine._m21;
|
||||
@ -663,7 +663,7 @@ QTransform & QTransform::rotate(qreal a, Qt::Axis axis)
|
||||
qreal tm23 = -sina*m_13 + cosa*m_23;
|
||||
m_13 = tm13;
|
||||
m_23 = tm23;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case TxRotate:
|
||||
case TxShear: {
|
||||
@ -742,7 +742,7 @@ QTransform & QTransform::rotateRadians(qreal a, Qt::Axis axis)
|
||||
qreal tm23 = -sina*m_13 + cosa*m_23;
|
||||
m_13 = tm13;
|
||||
m_23 = tm23;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case TxRotate:
|
||||
case TxShear: {
|
||||
|
@ -874,7 +874,7 @@ void QTriangulator<T>::initialize(const QVectorPath &path, const QTransform &mat
|
||||
case QPainterPath::MoveToElement:
|
||||
if (!m_indices.isEmpty())
|
||||
m_indices.push_back(T(-1)); // Q_TRIANGULATE_END_OF_POLYGON
|
||||
// Fall through.
|
||||
Q_FALLTHROUGH();
|
||||
case QPainterPath::LineToElement:
|
||||
m_indices.push_back(T(m_vertices.size()));
|
||||
m_vertices.resize(m_vertices.size() + 1);
|
||||
@ -2100,7 +2100,7 @@ void QTriangulator<T>::SimpleToMonotone::monotoneDecomposition()
|
||||
} else {
|
||||
qWarning("Inconsistent polygon. (#3)");
|
||||
}
|
||||
// Fall through.
|
||||
Q_FALLTHROUGH();
|
||||
case StartVertex:
|
||||
if (m_clockwiseOrder) {
|
||||
leftEdgeNode = searchEdgeLeftOfEdge(j);
|
||||
@ -2129,7 +2129,7 @@ void QTriangulator<T>::SimpleToMonotone::monotoneDecomposition()
|
||||
} else {
|
||||
qWarning("Inconsistent polygon. (#4)");
|
||||
}
|
||||
// Fall through.
|
||||
Q_FALLTHROUGH();
|
||||
case EndVertex:
|
||||
if (m_clockwiseOrder) {
|
||||
if (m_edges.at(m_edges.at(i).helper).type == MergeVertex)
|
||||
|
@ -740,7 +740,7 @@ static void convertPath(const QPainterPath &path, QVector<TTF_POINT> *points, QV
|
||||
points->takeLast();
|
||||
endPoints->append(points->size() - 1);
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QPainterPath::LineToElement:
|
||||
p.flags = OnCurve;
|
||||
break;
|
||||
|
@ -438,7 +438,7 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor
|
||||
if (relativePos < blockIt.length()-1)
|
||||
++position;
|
||||
|
||||
// FALL THROUGH!
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QTextCursor::PreviousWord:
|
||||
case QTextCursor::WordLeft:
|
||||
@ -590,9 +590,9 @@ bool QTextCursorPrivate::movePosition(QTextCursor::MoveOperation op, QTextCursor
|
||||
adjustX = false;
|
||||
break;
|
||||
}
|
||||
case QTextCursor::NextCell: // fall through
|
||||
case QTextCursor::PreviousCell: // fall through
|
||||
case QTextCursor::NextRow: // fall through
|
||||
case QTextCursor::NextCell:
|
||||
case QTextCursor::PreviousCell:
|
||||
case QTextCursor::NextRow:
|
||||
case QTextCursor::PreviousRow: {
|
||||
QTextTable *table = qobject_cast<QTextTable *>(priv->frameAt(position));
|
||||
if (!table)
|
||||
|
@ -827,7 +827,7 @@ bool QTextHtmlImporter::closeTag()
|
||||
case Html_div:
|
||||
if (closedNode->children.isEmpty())
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (closedNode->isBlock())
|
||||
blockTagClosed = true;
|
||||
|
@ -508,7 +508,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon
|
||||
case QChar::DirAN:
|
||||
if (eor >= 0)
|
||||
appendItems(analysis, sor, eor, control, dir);
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QChar::DirR:
|
||||
case QChar::DirAL:
|
||||
dir = QChar::DirR; eor = current; status.eor = QChar::DirR; break;
|
||||
@ -564,7 +564,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon
|
||||
status.eor = QChar::DirON;
|
||||
dir = QChar::DirAN;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QChar::DirEN:
|
||||
case QChar::DirL:
|
||||
eor = current;
|
||||
@ -744,7 +744,7 @@ static bool bidiItemize(QTextEngine *engine, QScriptAnalysis *analysis, QBidiCon
|
||||
status.last = QChar::DirL;
|
||||
break;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
status.last = dirCurrent;
|
||||
}
|
||||
@ -1663,7 +1663,7 @@ void QTextEngine::itemize() const
|
||||
analysis->bidiLevel = control.baseLevel();
|
||||
break;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
analysis->flags = QScriptAnalysis::None;
|
||||
break;
|
||||
@ -2250,7 +2250,6 @@ void QTextEngine::justify(const QScriptLine &line)
|
||||
case Justification_Prohibited:
|
||||
break;
|
||||
case Justification_Space:
|
||||
// fall through
|
||||
case Justification_Arabic_Space:
|
||||
if (kashida_pos >= 0) {
|
||||
// qDebug("kashida position at %d in word", kashida_pos);
|
||||
@ -2263,7 +2262,7 @@ void QTextEngine::justify(const QScriptLine &line)
|
||||
}
|
||||
kashida_pos = -1;
|
||||
kashida_type = Justification_Arabic_Normal;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Justification_Character:
|
||||
set(&justificationPoints[nPoints++], justification, g.mid(i), fontEngine(si));
|
||||
maxJustify = qMax(maxJustify, justification);
|
||||
@ -2966,9 +2965,8 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
|
||||
switch (tabSpec.type) {
|
||||
case QTextOption::CenterTab:
|
||||
length /= 2;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QTextOption::DelimiterTab:
|
||||
// fall through
|
||||
case QTextOption::RightTab:
|
||||
tab = QFixed::fromReal(tabSpec.position) * dpiScale - length;
|
||||
if (tab < x) // default to tab taking no space
|
||||
|
@ -1871,7 +1871,7 @@ QVector<QCss::Declaration> standardDeclarationForNode(const QTextHtmlParserNode
|
||||
decls << decl;
|
||||
if (node.id == Html_b || node.id == Html_strong)
|
||||
break;
|
||||
// Delibrate fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Html_big:
|
||||
case Html_small:
|
||||
if (node.id != Html_th) {
|
||||
@ -1892,7 +1892,7 @@ QVector<QCss::Declaration> standardDeclarationForNode(const QTextHtmlParserNode
|
||||
decls << decl;
|
||||
break;
|
||||
}
|
||||
// Delibrate fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Html_center:
|
||||
case Html_td:
|
||||
decl = QCss::Declaration();
|
||||
@ -1969,7 +1969,7 @@ QVector<QCss::Declaration> standardDeclarationForNode(const QTextHtmlParserNode
|
||||
}
|
||||
if (node.id != Html_pre)
|
||||
break;
|
||||
// Delibrate fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Html_br:
|
||||
case Html_nobr:
|
||||
decl = QCss::Declaration();
|
||||
|
@ -1121,7 +1121,7 @@ bool QFtpPI::processReply()
|
||||
case Success:
|
||||
// success handling
|
||||
state = Idle;
|
||||
// no break!
|
||||
Q_FALLTHROUGH();
|
||||
case Idle:
|
||||
if (dtp.hasError()) {
|
||||
emit error(QFtp::UnknownError, dtp.errorMessage());
|
||||
|
@ -1036,7 +1036,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
|
||||
|
||||
if (!protocolHandler) {
|
||||
switch (sslSocket->sslConfiguration().nextProtocolNegotiationStatus()) {
|
||||
case QSslConfiguration::NextProtocolNegotiationNegotiated: /* fall through */
|
||||
case QSslConfiguration::NextProtocolNegotiationNegotiated:
|
||||
case QSslConfiguration::NextProtocolNegotiationUnsupported: {
|
||||
QByteArray nextProtocol = sslSocket->sslConfiguration().nextNegotiatedProtocol();
|
||||
if (nextProtocol == QSslConfiguration::NextProtocolHttp1_1) {
|
||||
@ -1056,6 +1056,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
|
||||
"detected unknown Next Protocol Negotiation protocol");
|
||||
break;
|
||||
}
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QSslConfiguration::NextProtocolNegotiationNone:
|
||||
protocolHandler.reset(new QHttpProtocolHandler(this));
|
||||
|
@ -99,7 +99,7 @@ void QHttpProtocolHandler::_q_receiveReply()
|
||||
switch (state) {
|
||||
case QHttpNetworkReplyPrivate::NothingDoneState: {
|
||||
m_reply->d_func()->state = QHttpNetworkReplyPrivate::ReadingStatusState;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QHttpNetworkReplyPrivate::ReadingStatusState: {
|
||||
qint64 statusBytes = m_reply->d_func()->readStatus(m_socket);
|
||||
@ -213,7 +213,8 @@ void QHttpProtocolHandler::_q_receiveReply()
|
||||
if (replyPrivate->state == QHttpNetworkReplyPrivate::ReadingDataState)
|
||||
break;
|
||||
|
||||
// everything done, fall through
|
||||
// everything done
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QHttpNetworkReplyPrivate::AllDoneState:
|
||||
m_channel->allDone();
|
||||
@ -428,7 +429,7 @@ bool QHttpProtocolHandler::sendRequest()
|
||||
}
|
||||
case QHttpNetworkConnectionChannel::ReadingState:
|
||||
// ignore _q_bytesWritten in these states
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ static QDateTime parseDateString(const QByteArray &dateString)
|
||||
switch (end - 1) {
|
||||
case 4:
|
||||
minutes = atoi(dateString.mid(at + 3, 2).constData());
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case 2:
|
||||
hours = atoi(dateString.mid(at + 1, 2).constData());
|
||||
break;
|
||||
|
@ -536,7 +536,7 @@ QHostAddress::QHostAddress(SpecialAddress address)
|
||||
|
||||
case LocalHostIPv6:
|
||||
ip6[15] = 1;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case AnyIPv6:
|
||||
d->setAddress(ip6);
|
||||
return;
|
||||
|
@ -712,7 +712,7 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin
|
||||
|
||||
if (errorDetected)
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case WSAEINPROGRESS:
|
||||
setError(QAbstractSocket::UnfinishedSocketOperationError, InvalidSocketErrorString);
|
||||
|
@ -618,7 +618,7 @@ void QSocks5SocketEnginePrivate::setErrorState(Socks5State state, const QString
|
||||
QSocks5SocketEngine::tr("Connection to proxy timed out"));
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
q->setError(controlSocketError, data->controlSocket->errorString());
|
||||
break;
|
||||
@ -1205,7 +1205,7 @@ void QSocks5SocketEnginePrivate::_q_controlSocketReadNotification()
|
||||
break;
|
||||
}
|
||||
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
qWarning("QSocks5SocketEnginePrivate::_q_controlSocketReadNotification: "
|
||||
"Unexpectedly received data while in state=%d and mode=%d",
|
||||
|
@ -171,7 +171,7 @@ void QFbVtHandler::handleSignal()
|
||||
char sigNo;
|
||||
if (QT_READ(m_sigFd[1], &sigNo, sizeof(sigNo)) == sizeof(sigNo)) {
|
||||
switch (sigNo) {
|
||||
case SIGINT: // fallthrough
|
||||
case SIGINT:
|
||||
case SIGTERM:
|
||||
handleInt();
|
||||
break;
|
||||
|
@ -111,10 +111,10 @@ void QNetworkSessionPrivateImpl::syncStateWithInterface()
|
||||
case QNetworkConfiguration::ServiceNetwork:
|
||||
serviceConfig = publicConfig;
|
||||
// Defer setting engine and signals until open().
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QNetworkConfiguration::UserChoice:
|
||||
// Defer setting serviceConfig and activeConfig until open().
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
engine = 0;
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ QVariant QAndroidPlatformTheme::themeHint(ThemeHint hint) const
|
||||
if (ret > 0)
|
||||
return ret;
|
||||
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
default:
|
||||
return QPlatformTheme::themeHint(hint);
|
||||
|
@ -200,7 +200,7 @@ int QMacPrintEngine::metric(QPaintDevice::PaintDeviceMetric m) const
|
||||
val = (int)resolution.vRes;
|
||||
break;
|
||||
}
|
||||
//otherwise fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QPaintDevice::PdmDpiY:
|
||||
val = (int)d->resolution.vRes;
|
||||
|
@ -563,7 +563,7 @@ public:
|
||||
if (newPen.widthF() <= 1.0)
|
||||
props.startCap = props.endCap = props.dashCap = D2D1_CAP_STYLE_FLAT;
|
||||
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
props.dashStyle = D2D1_DASH_STYLE_CUSTOM;
|
||||
break;
|
||||
|
@ -945,7 +945,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
|
||||
switch (et) {
|
||||
case QtWindows::KeyboardLayoutChangeEvent:
|
||||
if (QWindowsInputContext *wic = windowsInputContext())
|
||||
wic->handleInputLanguageChanged(wParam, lParam); // fallthrough intended.
|
||||
wic->handleInputLanguageChanged(wParam, lParam);
|
||||
Q_FALLTHROUGH();
|
||||
case QtWindows::KeyDownEvent:
|
||||
case QtWindows::KeyEvent:
|
||||
case QtWindows::InputMethodKeyEvent:
|
||||
|
@ -551,14 +551,14 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &pixmapSiz
|
||||
break;
|
||||
case FileLinkIcon:
|
||||
stockFlags = SHGSI_LINKOVERLAY;
|
||||
// Fall through
|
||||
Q_FALLTHROUGH();
|
||||
case FileIcon:
|
||||
stockId = SIID_DOCNOASSOC;
|
||||
resourceId = 1;
|
||||
break;
|
||||
case DirLinkIcon:
|
||||
stockFlags = SHGSI_LINKOVERLAY;
|
||||
// Fall through
|
||||
Q_FALLTHROUGH();
|
||||
case DirClosedIcon:
|
||||
case DirIcon:
|
||||
stockId = SIID_FOLDER;
|
||||
@ -572,7 +572,7 @@ QPixmap QWindowsTheme::standardPixmap(StandardPixmap sp, const QSizeF &pixmapSiz
|
||||
break;
|
||||
case DirLinkOpenIcon:
|
||||
stockFlags = SHGSI_LINKOVERLAY;
|
||||
// Fall through
|
||||
Q_FALLTHROUGH();
|
||||
case DirOpenIcon:
|
||||
stockId = SIID_FOLDEROPEN;
|
||||
resourceId = 5;
|
||||
|
@ -150,7 +150,7 @@ void QPdfPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
|
||||
else
|
||||
d->m_pageLayout.setMode(QPageLayout::StandardMode);
|
||||
break;
|
||||
case PPK_CopyCount: // fallthrough
|
||||
case PPK_CopyCount:
|
||||
case PPK_NumberOfCopies:
|
||||
d->copies = value.toInt();
|
||||
break;
|
||||
|
@ -1141,7 +1141,7 @@ void QWin32PrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &
|
||||
#endif // QT_DEBUG_METRICS
|
||||
break;
|
||||
|
||||
case PPK_CopyCount: // fallthrough
|
||||
case PPK_CopyCount:
|
||||
case PPK_NumberOfCopies:
|
||||
if (!d->devMode)
|
||||
break;
|
||||
|
@ -115,14 +115,14 @@ namespace QTest
|
||||
case MouseDClick:
|
||||
qt_handleMouseEvent(w, pos, global, button, stateKey, ++lastMouseTimestamp);
|
||||
qt_handleMouseEvent(w, pos, global, Qt::NoButton, stateKey, ++lastMouseTimestamp);
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case MousePress:
|
||||
case MouseClick:
|
||||
qt_handleMouseEvent(w, pos, global, button, stateKey, ++lastMouseTimestamp);
|
||||
lastMouseButton = button;
|
||||
if (action == MousePress)
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case MouseRelease:
|
||||
qt_handleMouseEvent(w, pos, global, Qt::NoButton, stateKey, ++lastMouseTimestamp);
|
||||
lastMouseTimestamp += 500; // avoid double clicks being generated
|
||||
|
@ -163,7 +163,7 @@ Type Moc::parseType()
|
||||
case SIGNED:
|
||||
case UNSIGNED:
|
||||
hasSignedOrUnsigned = true;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case CONST:
|
||||
case VOLATILE:
|
||||
type.name += lexem();
|
||||
|
@ -251,7 +251,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
|
||||
}
|
||||
token = FLOATING_LITERAL;
|
||||
++data;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case FLOATING_LITERAL:
|
||||
while (is_digit_char(*data))
|
||||
++data;
|
||||
@ -321,7 +321,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
|
||||
++data;
|
||||
}
|
||||
token = WHITESPACE; // one comment, one whitespace
|
||||
// fall through;
|
||||
Q_FALLTHROUGH();
|
||||
case WHITESPACE:
|
||||
if (column == 1)
|
||||
column = 0;
|
||||
@ -428,7 +428,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
|
||||
}
|
||||
token = PP_FLOATING_LITERAL;
|
||||
++data;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case PP_FLOATING_LITERAL:
|
||||
while (is_digit_char(*data))
|
||||
++data;
|
||||
@ -482,7 +482,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
|
||||
++data;
|
||||
}
|
||||
token = PP_WHITESPACE; // one comment, one whitespace
|
||||
// fall through;
|
||||
Q_FALLTHROUGH();
|
||||
case PP_WHITESPACE:
|
||||
while (*data && (*data == ' ' || *data == '\t'))
|
||||
++data;
|
||||
@ -1177,7 +1177,7 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed)
|
||||
case PP_ELIF:
|
||||
case PP_ELSE:
|
||||
skipUntilEndif();
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case PP_ENDIF:
|
||||
until(PP_NEWLINE);
|
||||
continue;
|
||||
|
@ -335,28 +335,28 @@ static void parseCmdLine(QStringList &arguments)
|
||||
switch (c) {
|
||||
case 'P':
|
||||
flags |= QDBusConnection::ExportNonScriptableProperties;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case 'p':
|
||||
flags |= QDBusConnection::ExportScriptableProperties;
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
flags |= QDBusConnection::ExportNonScriptableSignals;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case 's':
|
||||
flags |= QDBusConnection::ExportScriptableSignals;
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
flags |= QDBusConnection::ExportNonScriptableSlots;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case 'm':
|
||||
flags |= QDBusConnection::ExportScriptableSlots;
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
flags |= QDBusConnection::ExportNonScriptableContents;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case 'a':
|
||||
flags |= QDBusConnection::ExportScriptableContents;
|
||||
break;
|
||||
|
@ -1379,7 +1379,7 @@ void QMessageBox::changeEvent(QEvent *ev)
|
||||
d->buttonBox->setCenterButtons(style()->styleHint(QStyle::SH_MessageBox_CenterButtons, 0, this));
|
||||
if (d->informativeLabel)
|
||||
d->informativeLabel->setTextInteractionFlags(flags);
|
||||
// intentional fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QEvent::FontChange:
|
||||
case QEvent::ApplicationFontChange:
|
||||
@ -1390,6 +1390,7 @@ void QMessageBox::changeEvent(QEvent *ev)
|
||||
d->label->setFont(f);
|
||||
}
|
||||
#endif
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -9570,7 +9570,7 @@ public:
|
||||
shape = qt_regionToPath(QRegion(mask).translated(offset.toPoint()));
|
||||
break;
|
||||
}
|
||||
// FALL THROUGH
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
case QGraphicsPixmapItem::BoundingRectShape:
|
||||
shape.addRect(QRectF(offset.x(), offset.y(), pixmap.width(), pixmap.height()));
|
||||
|
@ -2563,7 +2563,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e)
|
||||
int section = logicalIndexAt(pos);
|
||||
updateSection(section);
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QHeaderViewPrivate::NoState:
|
||||
if (d->clickableSections) {
|
||||
int section = logicalIndexAt(pos);
|
||||
@ -2669,7 +2669,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
|
||||
case QEvent::FontChange:
|
||||
case QEvent::StyleChange:
|
||||
d->invalidateCachedSizeHint();
|
||||
// Fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::Hide:
|
||||
case QEvent::Show: {
|
||||
QAbstractScrollArea *parent = qobject_cast<QAbstractScrollArea *>(parentWidget());
|
||||
|
@ -1737,7 +1737,7 @@ void QTreeWidgetItem::setData(int column, int role, const QVariant &value)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Don't break, but fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (column < values.count()) {
|
||||
bool found = false;
|
||||
@ -1787,7 +1787,7 @@ QVariant QTreeWidgetItem::data(int column, int role) const
|
||||
// special case for check state in tristate
|
||||
if (children.count() && (itemFlags & Qt::ItemIsAutoTristate))
|
||||
return childrenCheckState(column);
|
||||
// fallthrough intended
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (column >= 0 && column < values.size()) {
|
||||
const QVector<QWidgetItemData> &column_values = values.at(column);
|
||||
|
@ -450,8 +450,8 @@ bool QWhatsThisPrivate::eventFilter(QObject *o, QEvent *e)
|
||||
QApplication::changeOverrideCursor((!sentEvent || !e.isAccepted())?
|
||||
Qt::ForbiddenCursor:Qt::WhatsThisCursor);
|
||||
#endif
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
// fall through
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseButtonDblClick:
|
||||
if (leaveOnMouseRelease && e->type() == QEvent::MouseButtonRelease)
|
||||
|
@ -8835,7 +8835,7 @@ bool QWidget::event(QEvent *event)
|
||||
|
||||
case QEvent::KeyRelease:
|
||||
keyReleaseEvent((QKeyEvent*)event);
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::ShortcutOverride:
|
||||
break;
|
||||
|
||||
@ -8954,7 +8954,7 @@ bool QWidget::event(QEvent *event)
|
||||
0, this);
|
||||
break;
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
#endif
|
||||
default:
|
||||
event->ignore();
|
||||
@ -9193,7 +9193,7 @@ bool QWidget::event(QEvent *event)
|
||||
}
|
||||
if (windowHandle() && !qstrncmp(propName, "_q_platform_", 12))
|
||||
windowHandle()->setProperty(propName, property(propName));
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
@ -11194,13 +11194,13 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
|
||||
d->enforceNativeChildren();
|
||||
}
|
||||
#endif
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::WA_OpaquePaintEvent:
|
||||
d->updateIsOpaque();
|
||||
break;
|
||||
case Qt::WA_NoSystemBackground:
|
||||
d->updateIsOpaque();
|
||||
// fall through...
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::WA_UpdatesDisabled:
|
||||
d->updateSystemBackground();
|
||||
break;
|
||||
|
@ -4232,7 +4232,6 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
switch (sc) {
|
||||
case SC_GroupBoxFrame:
|
||||
// FALL THROUGH
|
||||
case SC_GroupBoxContents: {
|
||||
int topMargin = 0;
|
||||
int topHeight = 0;
|
||||
@ -4261,7 +4260,6 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
break;
|
||||
}
|
||||
case SC_GroupBoxCheckBox:
|
||||
// FALL THROUGH
|
||||
case SC_GroupBoxLabel: {
|
||||
QFontMetrics fontMetrics = groupBox->fontMetrics;
|
||||
int h = fontMetrics.height();
|
||||
@ -4327,7 +4325,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
if (numSubControls == 1)
|
||||
break;
|
||||
offset += buttonWidth + 2;
|
||||
//FALL THROUGH
|
||||
Q_FALLTHROUGH();
|
||||
case SC_MdiNormalButton:
|
||||
// No offset needed if
|
||||
// 1) There's only one sub control
|
||||
@ -4895,7 +4893,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
||||
case CT_ProgressBar:
|
||||
case CT_TabBarTab:
|
||||
// just return the contentsSize for now
|
||||
// fall through intended
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1100,7 +1100,7 @@ void QRenderRule::fixupBorder(int nativeWidth)
|
||||
case BorderStyle_Native:
|
||||
if (bd->borders[i] == 0)
|
||||
bd->borders[i] = nativeWidth;
|
||||
// intentional fall through
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
if (bd->colors[i].style() == Qt::NoBrush) // auto-acquire 'color'
|
||||
bd->colors[i] = color;
|
||||
|
@ -808,7 +808,8 @@ void QWindowsStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt,
|
||||
p->setPen(opt->palette.dark().color());
|
||||
else
|
||||
p->setPen(opt->palette.text().color());
|
||||
} // Fall through!
|
||||
}
|
||||
Q_FALLTHROUGH();
|
||||
case PE_IndicatorViewItemCheck:
|
||||
if (!doRestore) {
|
||||
p->save();
|
||||
@ -2383,7 +2384,7 @@ QSize QWindowsStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
||||
case CT_ToolButton:
|
||||
if (qstyleoption_cast<const QStyleOptionToolButton *>(opt))
|
||||
return sz += QSize(7, 6);
|
||||
// Otherwise, fall through
|
||||
Q_FALLTHROUGH();
|
||||
|
||||
default:
|
||||
sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
|
||||
|
@ -3465,13 +3465,13 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
|
||||
case SC_TitleBarContextHelpButton:
|
||||
if (tb->titleBarFlags & Qt::WindowContextHelpButtonHint)
|
||||
offset += delta;
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case SC_TitleBarMinButton:
|
||||
if (!isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint))
|
||||
offset += delta;
|
||||
else if (subControl == SC_TitleBarMinButton)
|
||||
break;
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case SC_TitleBarNormalButton:
|
||||
if (isMinimized && (tb->titleBarFlags & Qt::WindowMinimizeButtonHint))
|
||||
offset += delta;
|
||||
@ -3479,25 +3479,25 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
|
||||
offset += delta;
|
||||
else if (subControl == SC_TitleBarNormalButton)
|
||||
break;
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case SC_TitleBarMaxButton:
|
||||
if (!isMaximized && (tb->titleBarFlags & Qt::WindowMaximizeButtonHint))
|
||||
offset += delta;
|
||||
else if (subControl == SC_TitleBarMaxButton)
|
||||
break;
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case SC_TitleBarShadeButton:
|
||||
if (!isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint))
|
||||
offset += delta;
|
||||
else if (subControl == SC_TitleBarShadeButton)
|
||||
break;
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case SC_TitleBarUnshadeButton:
|
||||
if (isMinimized && (tb->titleBarFlags & Qt::WindowShadeButtonHint))
|
||||
offset += delta;
|
||||
else if (subControl == SC_TitleBarUnshadeButton)
|
||||
break;
|
||||
//fall through
|
||||
Q_FALLTHROUGH();
|
||||
case SC_TitleBarCloseButton:
|
||||
if (tb->titleBarFlags & Qt::WindowSystemMenuHint)
|
||||
offset += delta;
|
||||
@ -3576,7 +3576,7 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
|
||||
if (numSubControls == 1)
|
||||
break;
|
||||
offset += buttonWidth;
|
||||
//FALL THROUGH
|
||||
Q_FALLTHROUGH();
|
||||
case SC_MdiNormalButton:
|
||||
// No offset needed if
|
||||
// 1) There's only one sub control
|
||||
|
@ -551,11 +551,11 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
|
||||
|
||||
case QEvent::TouchBegin:
|
||||
inputType = QScroller::InputPress;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::TouchEnd:
|
||||
if (!inputType)
|
||||
inputType = QScroller::InputRelease;
|
||||
// fallthrough
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::TouchUpdate:
|
||||
if (!inputType)
|
||||
inputType = QScroller::InputMove;
|
||||
@ -669,7 +669,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
|
||||
event->accept();
|
||||
}
|
||||
}
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::TouchBegin:
|
||||
q->setHotSpot(globalPos);
|
||||
result |= scrollerIsActive ? TriggerGesture : MayBeGesture;
|
||||
@ -681,7 +681,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
|
||||
#endif
|
||||
if (PressDelayHandler::instance()->isDelaying())
|
||||
result |= ConsumeEventHint;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::TouchUpdate:
|
||||
result |= scrollerIsActive ? TriggerGesture : Ignore;
|
||||
break;
|
||||
@ -692,7 +692,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
|
||||
case QEvent::MouseButtonRelease:
|
||||
if (PressDelayHandler::instance()->released(event, scrollerWasDragging || scrollerWasScrolling, scrollerIsActive))
|
||||
result |= ConsumeEventHint;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case QEvent::TouchEnd:
|
||||
result |= scrollerIsActive ? FinishGesture : CancelGesture;
|
||||
break;
|
||||
|
@ -1058,7 +1058,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e)
|
||||
break;
|
||||
case Qt::Key_Up:
|
||||
next = false;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::Key_Left:
|
||||
case Qt::Key_Right:
|
||||
case Qt::Key_Down: {
|
||||
|
@ -933,7 +933,7 @@ void QAbstractSlider::changeEvent(QEvent *ev)
|
||||
d->repeatActionTimer.stop();
|
||||
setSliderDown(false);
|
||||
}
|
||||
// fall through...
|
||||
Q_FALLTHROUGH();
|
||||
default:
|
||||
QWidget::changeEvent(ev);
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ bool QComboBoxPrivateContainer::eventFilter(QObject *o, QEvent *e)
|
||||
case Qt::Key_Down:
|
||||
if (!(keyEvent->modifiers() & Qt::AltModifier))
|
||||
break;
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::Key_F4:
|
||||
combo->hidePopup();
|
||||
return true;
|
||||
@ -3140,7 +3140,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e)
|
||||
return;
|
||||
} else if (e->modifiers() & Qt::ControlModifier)
|
||||
break; // pass to line edit for auto completion
|
||||
// fall through
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::Key_PageDown:
|
||||
#ifdef QT_KEYPAD_NAVIGATION
|
||||
if (QApplication::keypadNavigationEnabled())
|
||||
|
@ -2979,7 +2979,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
||||
key_consumed = true;
|
||||
break;
|
||||
}
|
||||
//FALL THROUGH
|
||||
Q_FALLTHROUGH();
|
||||
case Qt::Key_Left: {
|
||||
if (d->currentAction && !d->scroll) {
|
||||
QAction *nextAction = 0;
|
||||
@ -3026,6 +3026,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
||||
if (!style()->styleHint(QStyle::SH_Menu_SpaceActivatesItem, 0, this))
|
||||
break;
|
||||
// for motif, fall through
|
||||
Q_FALLTHROUGH();
|
||||
#ifdef QT_KEYPAD_NAVIGATION
|
||||
case Qt::Key_Select:
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user