From db57af5a0d7aa0687a19fef1cd385bee0f26f7b6 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 3 Sep 2019 08:50:13 +0200 Subject: [PATCH] QRegexp: Fix MSVC2019 warning about fallthrough not being followed by a case label Move fallthrough down, fixing: tools\qregexp.cpp(3014): warning C4468: 'fallthrough': attribute must be followed by a case label or a default label tools\qregexp.cpp(3054): warning C4468: 'fallthrough': attribute must be followed by a case label or a default label tools\qregexp.cpp(3100): warning C4468: 'fallthrough': attribute must be followed by a case label or a default label Change-Id: If25ddec5dc1d4929a3383729aabad89f5879e316 Reviewed-by: Edward Welbourne Reviewed-by: Samuel Gaist --- src/corelib/tools/qregexp.cpp | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index ef24c952eb0..adca8624f9e 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -3009,12 +3009,10 @@ int QRegExpEngine::getEscape() yyCharClass->addSingleton(0x005f); // '_' return Tok_CharClass; case 'I': - if (xmlSchemaExtensions) { - yyCharClass->setNegative(!yyCharClass->negative()); - Q_FALLTHROUGH(); - } else { + if (!xmlSchemaExtensions) break; - } + yyCharClass->setNegative(!yyCharClass->negative()); + Q_FALLTHROUGH(); case 'i': if (xmlSchemaExtensions) { yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) | @@ -3049,12 +3047,10 @@ int QRegExpEngine::getEscape() break; } case 'C': - if (xmlSchemaExtensions) { - yyCharClass->setNegative(!yyCharClass->negative()); - Q_FALLTHROUGH(); - } else { + if (!xmlSchemaExtensions) break; - } + yyCharClass->setNegative(!yyCharClass->negative()); + Q_FALLTHROUGH(); case 'c': if (xmlSchemaExtensions) { yyCharClass->addCategories(FLAG(QChar::Mark_NonSpacing) | @@ -3095,12 +3091,10 @@ int QRegExpEngine::getEscape() break; } case 'P': - if (xmlSchemaExtensions) { - yyCharClass->setNegative(!yyCharClass->negative()); - Q_FALLTHROUGH(); - } else { + if (!xmlSchemaExtensions) break; - } + yyCharClass->setNegative(!yyCharClass->negative()); + Q_FALLTHROUGH(); case 'p': if (xmlSchemaExtensions) { if (yyCh != '{') {