diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-06-27 15:43:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-08-19 18:38:53 +0000 |
commit | 9f888d2fde9c5413e5519e0914e9b13638760985 (patch) | |
tree | 7e211a2ae70c272ea8041d5100f0c9a67b32de1b /src/corelib/xml | |
parent | 25dd9c521fc064a71db63b110b7973225ee20c02 (diff) |
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>
Diffstat (limited to 'src/corelib/xml')
-rw-r--r-- | src/corelib/xml/qxmlstream.cpp | 24 | ||||
-rw-r--r-- | src/corelib/xml/qxmlstream_p.h | 14 |
2 files changed, 19 insertions, 19 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 83b26d50ab..1ffaeca852 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -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) diff --git a/src/corelib/xml/qxmlstream_p.h b/src/corelib/xml/qxmlstream_p.h index c68d6f0f53..b62cc9ac39 100644 --- a/src/corelib/xml/qxmlstream_p.h +++ b/src/corelib/xml/qxmlstream_p.h @@ -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); |