diff options
author | Liang Qi <liang.qi@qt.io> | 2017-04-12 09:38:34 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-04-12 09:38:34 +0200 |
commit | 3a44e86cdceba7acc6b830274968b0dfa482f5a8 (patch) | |
tree | a79d85a9f3af64c874b87329a9045a41999f6f29 /src/xmlpatterns | |
parent | befda75eb0adc1a4b39e7f8e0c78d667160a6c41 (diff) | |
parent | f799a226b1025bf7158bc00dff35ee060f57a137 (diff) | |
download | qtxmlpatterns-3a44e86cdceba7acc6b830274968b0dfa482f5a8.tar.gz |
Merge remote-tracking branch 'origin/5.8' into 5.9v5.9.0-beta2
Change-Id: Iad56858cfdc688957e7a8426f908ab0a641a3312
Diffstat (limited to 'src/xmlpatterns')
18 files changed, 28 insertions, 106 deletions
diff --git a/src/xmlpatterns/acceltree/qacceltree.cpp b/src/xmlpatterns/acceltree/qacceltree.cpp index 1892745..23503fe 100644 --- a/src/xmlpatterns/acceltree/qacceltree.cpp +++ b/src/xmlpatterns/acceltree/qacceltree.cpp @@ -176,11 +176,8 @@ QUrl AccelTree::baseUri(const QXmlNodeModelIndex &ni) const return par.baseUri(); } case QXmlNodeModelIndex::ProcessingInstruction: - /* Fallthrough. */ case QXmlNodeModelIndex::Comment: - /* Fallthrough. */ case QXmlNodeModelIndex::Attribute: - /* Fallthrough. */ case QXmlNodeModelIndex::Text: { const QXmlNodeModelIndex par(ni.iterate(QXmlNodeModelIndex::AxisParent)->next()); @@ -256,22 +253,17 @@ QXmlNodeModelIndex::Iterator::Ptr AccelTree::iterate(const QXmlNodeModelIndex &n switch(kind(preNumber)) { case QXmlNodeModelIndex::Comment: - /* Fallthrough. */ case QXmlNodeModelIndex::ProcessingInstruction: - /* Fallthrough. */ case QXmlNodeModelIndex::Element: - /* Fallthrough. */ case QXmlNodeModelIndex::Text: return makeSingletonIterator(ni); case QXmlNodeModelIndex::Attribute: - /* Fallthrough. */ case QXmlNodeModelIndex::Document: - /* Fallthrough. */ case QXmlNodeModelIndex::Namespace: /* Do nothing. */; } } - /* Else, fallthrough to AxisChild. */ + Q_FALLTHROUGH(); } case QXmlNodeModelIndex::AxisChild: { @@ -316,7 +308,7 @@ QXmlNodeModelIndex::Iterator::Ptr AccelTree::iterate(const QXmlNodeModelIndex &n { if(!hasParent(preNumber) && kind(preNumber) == QXmlNodeModelIndex::Attribute) return makeSingletonIterator(ni); - /* Else, falthrough to AxisAttribute. */ + Q_FALLTHROUGH(); } case QXmlNodeModelIndex::AxisAttribute: { @@ -522,12 +514,11 @@ QString AccelTree::stringValue(const QXmlNodeModelIndex &ni) const { if(isCompressed(preNumber)) return CompressedWhitespace::decompress(data.value(preNumber)); - /* Else, fallthrough. It's not compressed so use it as it is. */ + /* It's not compressed so use it as it is. */ + Q_FALLTHROUGH(); } case QXmlNodeModelIndex::Attribute: - /* Fallthrough */ case QXmlNodeModelIndex::ProcessingInstruction: - /* Fallthrough */ case QXmlNodeModelIndex::Comment: return data.value(preNumber); case QXmlNodeModelIndex::Document: @@ -591,16 +582,12 @@ Item::Iterator::Ptr AccelTree::sequencedTypedValue(const QXmlNodeModelIndex &n) switch(kind(preNumber)) { case QXmlNodeModelIndex::Element: - /* Fallthrough. */ case QXmlNodeModelIndex::Document: - /* Fallthrough. */ case QXmlNodeModelIndex::Attribute: return makeSingletonIterator(Item(UntypedAtomic::fromValue(stringValue(n)))); case QXmlNodeModelIndex::Text: - /* Fallthrough. */ case QXmlNodeModelIndex::ProcessingInstruction: - /* Fallthrough. */ case QXmlNodeModelIndex::Comment: return makeSingletonIterator(Item(AtomicString::fromValue(stringValue(n)))); default: diff --git a/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp b/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp index 388a23a..e25a9b6 100644 --- a/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp +++ b/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp @@ -238,7 +238,6 @@ bool AccelTreeResourceLoader::streamToReceiver(QIODevice *const dev, continue; } case QXmlStreamReader::EntityReference: - /* Fallthrough. */ case QXmlStreamReader::DTD: { /* We just ignore any DTD and entity references. */ diff --git a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp index 7cb2a46..b574427 100644 --- a/src/xmlpatterns/api/qabstractxmlnodemodel.cpp +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.cpp @@ -657,23 +657,18 @@ QAbstractXmlNodeModel::iterate(const QXmlNodeModelIndex &ni, switch(kind(ni)) { case QXmlNodeModelIndex::Comment: - /* Fallthrough. */ case QXmlNodeModelIndex::ProcessingInstruction: - /* Fallthrough. */ case QXmlNodeModelIndex::Element: - /* Fallthrough. */ case QXmlNodeModelIndex::Text: return makeSingletonIterator(ni); case QXmlNodeModelIndex::Attribute: - /* Fallthrough. */ case QXmlNodeModelIndex::Document: - /* Fallthrough. */ case QXmlNodeModelIndex::Namespace: /* Do nothing. */; } } - /* Else, fallthrough to AxisChild. */ + Q_FALLTHROUGH(); } case QXmlNodeModelIndex::AxisChild: { @@ -699,14 +694,13 @@ QAbstractXmlNodeModel::iterate(const QXmlNodeModelIndex &ni, if(kind(ni) == QXmlNodeModelIndex::Attribute && nextFromSimpleAxis(Parent, ni).isNull()) return makeSingletonIterator(ni); - /* Else, fallthrough to AxisAttribute. */ + Q_FALLTHROUGH(); } case QXmlNodeModelIndex::AxisAttribute: return makeVectorIterator(attributes(ni)); case QXmlNodeModelIndex::AxisDescendantOrSelf: return mergeIterators(ni, iterate(ni, QXmlNodeModelIndex::AxisDescendant)); case QXmlNodeModelIndex::AxisFollowing: - /* Fallthrough. */ case QXmlNodeModelIndex::AxisPreceding: { /* We walk up along the ancestors, and for each parent, we grab its preceding/following @@ -1041,6 +1035,7 @@ bool QAbstractXmlNodeModel::isDeepEqual(const QXmlNodeModelIndex &n1, } /* Fallthrough, so we check the children. */ + Q_FALLTHROUGH(); } case QXmlNodeModelIndex::Document: { @@ -1070,11 +1065,8 @@ bool QAbstractXmlNodeModel::isDeepEqual(const QXmlNodeModelIndex &n1, return true; } case QXmlNodeModelIndex::Attribute: - /* Fallthrough */ case QXmlNodeModelIndex::ProcessingInstruction: - /* Fallthrough. */ case QXmlNodeModelIndex::Text: - /* Fallthrough. */ case QXmlNodeModelIndex::Comment: return n1.stringValue() == n2.stringValue(); case QXmlNodeModelIndex::Namespace: diff --git a/src/xmlpatterns/api/qcoloringmessagehandler.cpp b/src/xmlpatterns/api/qcoloringmessagehandler.cpp index 544a0ae..6ee6c95 100644 --- a/src/xmlpatterns/api/qcoloringmessagehandler.cpp +++ b/src/xmlpatterns/api/qcoloringmessagehandler.cpp @@ -134,7 +134,6 @@ void ColoringMessageHandler::handleMessage(QtMsgType type, break; } case QtCriticalMsg: - /* Fallthrough. */ case QtDebugMsg: case QtInfoMsg: { @@ -178,9 +177,7 @@ QString ColoringMessageHandler::colorifyDescription(const QString &in) const currentColor = RunningText; continue; } - /* Fallthrough, */ case QXmlStreamReader::StartDocument: - /* Fallthrough, */ case QXmlStreamReader::EndDocument: continue; default: diff --git a/src/xmlpatterns/data/qatomiccomparator.cpp b/src/xmlpatterns/data/qatomiccomparator.cpp index 0e25819..c5c4208 100644 --- a/src/xmlpatterns/data/qatomiccomparator.cpp +++ b/src/xmlpatterns/data/qatomiccomparator.cpp @@ -79,9 +79,7 @@ QString AtomicComparator::displayName(const AtomicComparator::Operator op, case OperatorLessOrEqual: return QLatin1String(">="); case OperatorLessThanNaNLeast: - /* Fallthrough. */ case OperatorLessThanNaNGreatest: - /* Fallthrough. */ case OperatorLessThan: return QLatin1String(">"); case OperatorNotEqual: @@ -100,9 +98,7 @@ QString AtomicComparator::displayName(const AtomicComparator::Operator op, case OperatorLessOrEqual: return QLatin1String("le"); case OperatorLessThanNaNLeast: - /* Fallthrough. */ case OperatorLessThanNaNGreatest: - /* Fallthrough. */ case OperatorLessThan: return QLatin1String("lt"); case OperatorNotEqual: diff --git a/src/xmlpatterns/data/qatomicvalue.cpp b/src/xmlpatterns/data/qatomicvalue.cpp index 8e41827..0c813a8 100644 --- a/src/xmlpatterns/data/qatomicvalue.cpp +++ b/src/xmlpatterns/data/qatomicvalue.cpp @@ -135,7 +135,8 @@ Item AtomicValue::toXDM(const QVariant &value) switch(value.userType()) { case QVariant::Char: - /* Fallthrough. A single codepoint is a string in XQuery. */ + /* A single codepoint is a string in XQuery. */ + Q_FALLTHROUGH(); case QVariant::String: return AtomicString::fromValue(value.toString()); case QVariant::Url: @@ -149,9 +150,7 @@ Item AtomicValue::toXDM(const QVariant &value) case QVariant::ByteArray: return HexBinary::fromValue(value.toByteArray()); case QVariant::Int: - /* Fallthrough. */ case QVariant::LongLong: - /* Fallthrough. */ case QVariant::UInt: return Integer::fromValue(value.toLongLong()); case QVariant::ULongLong: @@ -203,9 +202,7 @@ ItemType::Ptr AtomicValue::qtToXDMType(const QXmlItem &item) switch(int(v.type())) { case QVariant::Char: - /* Fallthrough. */ case QVariant::String: - /* Fallthrough. */ case QVariant::Url: return BuiltinTypes::xsString; case QVariant::Bool: @@ -213,7 +210,6 @@ ItemType::Ptr AtomicValue::qtToXDMType(const QXmlItem &item) case QVariant::ByteArray: return BuiltinTypes::xsBase64Binary; case QVariant::Int: - /* Fallthrough. */ case QVariant::LongLong: return BuiltinTypes::xsInteger; case QVariant::ULongLong: @@ -221,7 +217,6 @@ ItemType::Ptr AtomicValue::qtToXDMType(const QXmlItem &item) case QVariant::Date: return BuiltinTypes::xsDate; case QVariant::DateTime: - /* Fallthrough. */ case QVariant::Time: return BuiltinTypes::xsDateTime; case QMetaType::Float: diff --git a/src/xmlpatterns/data/qderivedstring_p.h b/src/xmlpatterns/data/qderivedstring_p.h index ead2311..b37e77e 100644 --- a/src/xmlpatterns/data/qderivedstring_p.h +++ b/src/xmlpatterns/data/qderivedstring_p.h @@ -285,11 +285,8 @@ namespace QPatternist return error(np, simplified); } case TypeID: - /* Fallthrough. */ case TypeIDREF: - /* Fallthrough. */ case TypeENTITY: - /* Fallthrough. */ case TypeNCName: { /* We treat xs:ID, xs:ENTITY, xs:IDREF and xs:NCName in the exact same diff --git a/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h b/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h index a082292..028cac7 100644 --- a/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h +++ b/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h @@ -118,7 +118,6 @@ compare(const Item &oand1, return !comp->equals(oand1, oand2); case AtomicComparator::OperatorLessThanNaNLeast: case AtomicComparator::OperatorLessThanNaNGreatest: - /* Fallthrough. */ case AtomicComparator::OperatorLessThan: return comp->compare(oand1, op, oand2) == AtomicComparator::LessThan; case AtomicComparator::OperatorGreaterThan: diff --git a/src/xmlpatterns/expr/qevaluationcache_tpl_p.h b/src/xmlpatterns/expr/qevaluationcache_tpl_p.h index d269517..26f53b5 100644 --- a/src/xmlpatterns/expr/qevaluationcache_tpl_p.h +++ b/src/xmlpatterns/expr/qevaluationcache_tpl_p.h @@ -141,7 +141,7 @@ Item::Iterator::Ptr EvaluationCache<IsForGlobal>::evaluateSequence(const Dynamic cell.inUse = true; cell.sourceIterator = m_operand->evaluateSequence(IsForGlobal ? topFocusContext(context) : context); cell.cacheState = ItemSequenceCacheCell::PartiallyPopulated; - /* Fallthrough. */ + Q_FALLTHROUGH(); } case ItemSequenceCacheCell::PartiallyPopulated: { diff --git a/src/xmlpatterns/functions/qerrorfn.cpp b/src/xmlpatterns/functions/qerrorfn.cpp index 19e9440..90f18c0 100644 --- a/src/xmlpatterns/functions/qerrorfn.cpp +++ b/src/xmlpatterns/functions/qerrorfn.cpp @@ -61,10 +61,11 @@ Item ErrorFN::evaluateSingleton(const DynamicContext::Ptr &context) const return Item(); } case 3: - /* Fallthrough, we don't use the 'error object' param. */ + /* Fallthrough, we don't use the 'error object' param. */ + Q_FALLTHROUGH(); case 2: msg = m_operands.at(1)->evaluateSingleton(context).stringValue(); - /* Fall through. */ + Q_FALLTHROUGH(); case 1: { const QNameValue::Ptr qName(m_operands.first()->evaluateSingleton(context).as<QNameValue>()); diff --git a/src/xmlpatterns/functions/qsystempropertyfn.cpp b/src/xmlpatterns/functions/qsystempropertyfn.cpp index 188a9a6..71a8d68 100644 --- a/src/xmlpatterns/functions/qsystempropertyfn.cpp +++ b/src/xmlpatterns/functions/qsystempropertyfn.cpp @@ -85,11 +85,8 @@ QString SystemPropertyFN::retrieveProperty(const QXmlName name) case StandardLocalNames::product_version: return QLatin1String("0.1"); case StandardLocalNames::is_schema_aware: - /* Fallthrough. */ case StandardLocalNames::supports_backwards_compatibility: - /* Fallthrough. */ case StandardLocalNames::supports_serialization: - /* Fallthrough. */ return QLatin1String("no"); default: return QString(); diff --git a/src/xmlpatterns/parser/qquerytransformparser.cpp b/src/xmlpatterns/parser/qquerytransformparser.cpp index 73a3560..501a78b 100644 --- a/src/xmlpatterns/parser/qquerytransformparser.cpp +++ b/src/xmlpatterns/parser/qquerytransformparser.cpp @@ -977,7 +977,6 @@ static Expression::Ptr pushVariable(const QXmlName name, switch(type) { case VariableDeclaration::FunctionArgument: - /* Fallthrough. */ case VariableDeclaration::ExpressionVariable: { slot = parseInfo->allocateExpressionSlot(); @@ -7857,11 +7856,8 @@ QString Tokenizer::tokenToString(const Token &token) switch(token.type) { case T_NCNAME: - /* Fallthrough. */ case T_QNAME: - /* Fallthrough. */ case T_NUMBER: - /* Fallthrough. */ case T_XPATH2_NUMBER: return token.value; case T_STRING_LITERAL: diff --git a/src/xmlpatterns/parser/qtokenlookup.cpp b/src/xmlpatterns/parser/qtokenlookup.cpp index b3f36c9..54d53ac 100644 --- a/src/xmlpatterns/parser/qtokenlookup.cpp +++ b/src/xmlpatterns/parser/qtokenlookup.cpp @@ -134,7 +134,7 @@ TokenLookup::hash (const char *str, unsigned int len) { default: hval += asso_values[(unsigned char)str[2]]; - /*FALLTHROUGH*/ + Q_FALLTHROUGH(); case 2: case 1: hval += asso_values[(unsigned char)str[0]]; diff --git a/src/xmlpatterns/parser/qtokenrevealer.cpp b/src/xmlpatterns/parser/qtokenrevealer.cpp index 1c41484..486c40d 100644 --- a/src/xmlpatterns/parser/qtokenrevealer.cpp +++ b/src/xmlpatterns/parser/qtokenrevealer.cpp @@ -83,7 +83,6 @@ Tokenizer::Token TokenRevealer::nextToken(YYLTYPE *const sourceLocator) break; } case T_SEMI_COLON: - /* Fallthrough. */ case T_COMMA: { m_result += asString + QLatin1Char('\n') + m_indentationString; diff --git a/src/xmlpatterns/parser/querytransformparser.ypp b/src/xmlpatterns/parser/querytransformparser.ypp index 338bfe4..3a26b0d 100644 --- a/src/xmlpatterns/parser/querytransformparser.ypp +++ b/src/xmlpatterns/parser/querytransformparser.ypp @@ -906,7 +906,6 @@ static Expression::Ptr pushVariable(const QXmlName name, switch(type) { case VariableDeclaration::FunctionArgument: - /* Fallthrough. */ case VariableDeclaration::ExpressionVariable: { slot = parseInfo->allocateExpressionSlot(); @@ -4648,11 +4647,8 @@ QString Tokenizer::tokenToString(const Token &token) switch(token.type) { case T_NCNAME: - /* Fallthrough. */ case T_QNAME: - /* Fallthrough. */ case T_NUMBER: - /* Fallthrough. */ case T_XPATH2_NUMBER: return token.value; case T_STRING_LITERAL: diff --git a/src/xmlpatterns/parser/qxquerytokenizer.cpp b/src/xmlpatterns/parser/qxquerytokenizer.cpp index 5279a74..a88e2d1 100644 --- a/src/xmlpatterns/parser/qxquerytokenizer.cpp +++ b/src/xmlpatterns/parser/qxquerytokenizer.cpp @@ -105,7 +105,7 @@ int XQueryTokenizer::peekForColonColon() const { if (peekAhead((pos - m_pos) + 1) == ':') return pos - m_pos; - /* Fallthrough. */ + Q_FALLTHROUGH(); } default: return -1; @@ -167,7 +167,7 @@ QString XQueryTokenizer::normalizeEOL(const QString &input, if (i + 1 < len && input.at(i + 1) == QLatin1Char('\n')) ++i; - /* Else, fallthrough. */ + Q_FALLTHROUGH(); } case '\n': { @@ -223,7 +223,6 @@ Tokenizer::TokenType XQueryTokenizer::consumeComment() break; } case '\n': - /* Fallthrough. */ case '\r': { /* We want to count \r\n as a single line break. */ @@ -303,6 +302,7 @@ Tokenizer::TokenType XQueryTokenizer::consumeWhitespace() else return comment; } + Q_FALLTHROUGH(); } default: return T_SUCCESS; @@ -765,7 +765,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() switch(state()) { case XMLSpaceDecl: - /* Fallthrough. */ case NamespaceKeyword: { switch(peekCurrent()) @@ -773,7 +772,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() case ',': return tokenAndAdvance(T_COMMA); case '"': - /* Fallthrough. */ case '\'': { setState(NamespaceDecl); @@ -792,7 +790,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() switch(keyword->token) { case T_INHERIT: - /* Fallthrough. */ case T_NO_INHERIT: { setState(Default); @@ -804,9 +801,7 @@ Tokenizer::Token XQueryTokenizer::nextToken() break; } case T_ORDERED: - /* Fallthrough. */ case T_UNORDERED: - /* Fallthrough. */ case T_STRIP: { setState(Default); @@ -816,6 +811,7 @@ Tokenizer::Token XQueryTokenizer::nextToken() { if (state() != NamespaceKeyword) setState(Default); + break; } default: break; @@ -837,7 +833,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() case ';': return tokenAndChangeState(T_SEMI_COLON, Default); case '\'': - /* Fallthrough. */ case '\"': return tokenizeStringLiteral(); } @@ -865,15 +860,14 @@ Tokenizer::Token XQueryTokenizer::nextToken() setState(AfterAxisSeparator); return Token(T_COLONCOLON); } - /* Fallthrough. */ + Q_FALLTHROUGH(); } case AfterAxisSeparator: - /* Fallthrough. */ case Default: /* State Operator and state Default have a lot of tokens in common except * for minor differences. So we treat them the same way, and sprinkles logic * here and there to handle the small differences. */ - /* Fallthrough. */ + Q_FALLTHROUGH(); case Operator: { switch(peekCurrent()) @@ -928,7 +922,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() return tokenAndChangeState(T_DOT, Operator); } case '\'': - /* Fallthrough. */ case '"': { setState(Operator); @@ -998,6 +991,7 @@ Tokenizer::Token XQueryTokenizer::nextToken() return tokenAndChangeState(T_COMMENT_START, XMLComment); } /* Fallthrough. It's a syntax error, and this is a good way to report it. */ + Q_FALLTHROUGH(); } default: { @@ -1290,7 +1284,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() switch(keyword2->token) { case T_VARIABLE: - /* Fallthrough. */ case T_FUNCTION: { m_tokenStack.push(Token(keyword2->token)); @@ -1304,7 +1297,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() return Token(keyword->token); } case T_COPY_NAMESPACES: - /* Fallthrough. */ case T_ORDERING: { m_tokenStack.push(Token(keyword2->token)); @@ -1319,7 +1311,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() return Token(keyword->token); } case T_NAMESPACE: - /* Fallthrough. */ case T_BASEURI: { m_tokenStack.push(Token(keyword2->token)); @@ -1399,7 +1390,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() switch(keyword2->token) { case T_SCHEMA: - /* Fallthrough. */ case T_MODULE: { setState(NamespaceKeyword); @@ -1506,7 +1496,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() case '?': return tokenAndAdvance(T_QUESTION); case '\'': - /* Fallthrough. */ case '"': return tokenizeStringLiteral(); } @@ -1544,7 +1533,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() return tokenAndAdvance(T_RPAREN); } case '\'': - /* Fallthrough. */ case '"': return tokenizeStringLiteral(); default: @@ -1575,7 +1563,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() switch(peekCurrent()) { case '\'': - /* Fallthrough. */ case '"': return tokenizeStringLiteral(); case ';': @@ -1645,7 +1632,6 @@ Tokenizer::Token XQueryTokenizer::nextToken() Q_ASSERT(false); } case AposAttributeContent: - /* Fallthrough. */ case QuotAttributeContent: { const QChar sep(state() == AposAttributeContent ? QLatin1Char('\'') : QLatin1Char('"')); @@ -1764,9 +1750,9 @@ Tokenizer::Token XQueryTokenizer::nextToken() ++m_pos; break; } + Q_FALLTHROUGH(); } case 0xA: - /* Fallthrough. */ case 0x9: { result.append(QLatin1Char(' ')); @@ -1917,7 +1903,7 @@ Tokenizer::Token XQueryTokenizer::nextToken() /* We want to translate \r\n into \n. */ if (peekAhead(-1) == '\r') break; - /* else, fallthrough. */ + Q_FALLTHROUGH(); } case '\r': { @@ -2188,9 +2174,7 @@ Tokenizer::Token XQueryTokenizer::nextToken(YYLTYPE *const sourceLocator) switch(retval.type) { case T_MODULE: - /* Fallthrough.*/ case T_SCHEMA: - /* Fallthrough.*/ case T_COPY_NAMESPACES: { setState(NamespaceKeyword); @@ -2202,7 +2186,6 @@ Tokenizer::Token XQueryTokenizer::nextToken(YYLTYPE *const sourceLocator) break; } case T_AS: - /* Fallthrough. */ case T_OF: { setState(ItemType); diff --git a/src/xmlpatterns/parser/qxslttokenizer.cpp b/src/xmlpatterns/parser/qxslttokenizer.cpp index 5ad6713..38e0374 100644 --- a/src/xmlpatterns/parser/qxslttokenizer.cpp +++ b/src/xmlpatterns/parser/qxslttokenizer.cpp @@ -562,7 +562,6 @@ QString XSLTTokenizer::readElementText() continue; } case QXmlStreamReader::Comment: - /* Fallthrough. */ case QXmlStreamReader::ProcessingInstruction: continue; case QXmlStreamReader::EndElement: @@ -718,11 +717,8 @@ void XSLTTokenizer::handleStandardAttributes(const bool isXSLTElement) switch(toToken(att.name())) { case Type: - /* Fallthrough. */ case Validation: - /* Fallthrough. */ case UseAttributeSets: - /* Fallthrough. */ case Version: /* These are handled by other function such as * handleValidationAttributes() and handleXSLTVersion(). */ @@ -1236,7 +1232,6 @@ void XSLTTokenizer::insideChoose(TokenSource::Queue *const to) break; } case QXmlStreamReader::Comment: - /* Fallthrough. */ case QXmlStreamReader::ProcessingInstruction: continue; case QXmlStreamReader::Characters: @@ -1245,10 +1240,9 @@ void XSLTTokenizer::insideChoose(TokenSource::Queue *const to) * 4.2 Stripping Whitespace from the Stylesheet. */ if(isWhitespace()) continue; - /* Fallthrough. */ + Q_FALLTHROUGH(); } default: - /* Fallthrough. */ unexpectedContent(); break; } @@ -2071,7 +2065,6 @@ bool XSLTTokenizer::insideSequenceConstructor(TokenSource::Queue *const to, return hasWrittenExpression; } case QXmlStreamReader::ProcessingInstruction: - /* Fallthrough. */ case QXmlStreamReader::Comment: /* We do nothing, we just ignore them. */ continue; @@ -2152,6 +2145,7 @@ void XSLTTokenizer::queueWithParams(const XSLTTokenLookup::NodeName parentName, } else unexpectedContent(); + Q_FALLTHROUGH(); } case QXmlStreamReader::EndElement: { @@ -2161,7 +2155,6 @@ void XSLTTokenizer::queueWithParams(const XSLTTokenLookup::NodeName parentName, continue; } case QXmlStreamReader::ProcessingInstruction: - /* Fallthrough. */ case QXmlStreamReader::Comment: continue; case QXmlStreamReader::Characters: @@ -2240,7 +2233,7 @@ void XSLTTokenizer::queueParams(const XSLTTokenLookup::NodeName parentName, { if(whitespaceToSkip()) continue; - /* Fallthrough. */ + Q_FALLTHROUGH(); } case QXmlStreamReader::EndElement: return; @@ -2326,13 +2319,12 @@ void XSLTTokenizer::insideAttributeSet() case QXmlStreamReader::EndElement: return; case QXmlStreamReader::ProcessingInstruction: - /* Fallthrough. */ case QXmlStreamReader::Comment: continue; case QXmlStreamReader::Characters: if(whitespaceToSkip()) continue; - /* Fallthrough. */ + Q_FALLTHROUGH(); default: unexpectedContent(); } @@ -2383,7 +2375,6 @@ void XSLTTokenizer::insideStylesheetModule() break; } case StripSpace: - /* Fallthrough. */ case PreserveSpace: { // TODO @elements @@ -2531,9 +2522,7 @@ void XSLTTokenizer::queueSorting(const bool oneSortRequired, switch(currentElementName()) { case PerformSort: - /* Fallthrough. */ case ForEach: - /* Fallthrough. */ case ApplyTemplates: return; default: @@ -2644,7 +2633,6 @@ void XSLTTokenizer::queueSorting(const bool oneSortRequired, break; } case QXmlStreamReader::ProcessingInstruction: - /* Fallthrough. */ case QXmlStreamReader::Comment: continue; default: diff --git a/src/xmlpatterns/projection/qdocumentprojector.cpp b/src/xmlpatterns/projection/qdocumentprojector.cpp index f7ef361..57ff931 100644 --- a/src/xmlpatterns/projection/qdocumentprojector.cpp +++ b/src/xmlpatterns/projection/qdocumentprojector.cpp @@ -65,7 +65,7 @@ void DocumentProjector::startElement(const QXmlName &name) case ProjectedExpression::KeepSubtree: { m_receiver->startElement(name); - /* Fallthrough. */ + Q_FALLTHROUGH(); } case ProjectedExpression::Skip: { |