From f799a226b1025bf7158bc00dff35ee060f57a137 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Mar 2017 12:59:19 +0200 Subject: Cleanup implicit fallthroughs in xmlpatterns Use Q_FALLTHOUGH instead of comments, and use it consistently. Change-Id: Ieaf4867b612e624774011275b90cdd3678a29fe9 Reviewed-by: Marc Mutz --- src/xmlpatterns/data/qatomiccomparator.cpp | 4 ---- src/xmlpatterns/data/qatomicvalue.cpp | 9 ++------- src/xmlpatterns/data/qderivedstring_p.h | 3 --- 3 files changed, 2 insertions(+), 14 deletions(-) (limited to 'src/xmlpatterns/data') 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 -- cgit v1.2.1