From 7c1f8137257e28299c5ec0fe030d9b9ba9ff55bf Mon Sep 17 00:00:00 2001 From: Denis Shienkov Date: Sat, 20 Nov 2021 18:04:35 +0300 Subject: Fix Clang-Tidy & Clazy 'llvm-else-after-return' warnings Change-Id: I16649525d797c980c0ba1357b3671b683c4fde25 Reviewed-by: Christian Kandeler --- .../generator/keiluv/keiluvfilesgroupspropertygroup.cpp | 16 +++++++++------- .../generator/visualstudio/visualstudiogenerator.cpp | 2 +- src/plugins/scanner/cpp/Lexer.cpp | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp b/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp index d1fda9876..b062ebedc 100644 --- a/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp +++ b/src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp @@ -76,22 +76,24 @@ private: if (fileSuffix.compare(QLatin1String("c"), Qt::CaseInsensitive) == 0) { return CSourceFileType; - } else if (fileSuffix.compare(QLatin1String("cpp"), + } + if (fileSuffix.compare(QLatin1String("cpp"), Qt::CaseInsensitive) == 0) { return CppSourceFileType; - } else if (fileSuffix.compare(QLatin1String("s"), + } + if (fileSuffix.compare(QLatin1String("s"), Qt::CaseInsensitive) == 0 || fileSuffix.compare(QLatin1String("a51"), Qt::CaseInsensitive) == 0) { return AssemblerFileType; - } else if (fileSuffix.compare(QLatin1String("lib"), + } + if (fileSuffix.compare(QLatin1String("lib"), Qt::CaseInsensitive) == 0) { return LibraryFileType; - } else { - // All header files, text files and include files - // interpretes as a text file types. - return TextFileType; } + // All header files, text files and include files + // interpretes as a text file types. + return TextFileType; } }; diff --git a/src/plugins/generator/visualstudio/visualstudiogenerator.cpp b/src/plugins/generator/visualstudio/visualstudiogenerator.cpp index ae95e2108..d0c367dd7 100644 --- a/src/plugins/generator/visualstudio/visualstudiogenerator.cpp +++ b/src/plugins/generator/visualstudio/visualstudiogenerator.cpp @@ -153,7 +153,7 @@ VisualStudioGenerator::VisualStudioGenerator(const VisualStudioVersionInfo &vers { if (d->versionInfo.usesVcBuild()) throw ErrorInfo(Tr::tr("VCBuild (Visual Studio 2008 and below) is not supported")); - else if (!d->versionInfo.usesMsBuild()) + if (!d->versionInfo.usesMsBuild()) throw ErrorInfo(Tr::tr("Unknown/unsupported build engine")); Q_ASSERT(d->versionInfo.usesSolutions()); } diff --git a/src/plugins/scanner/cpp/Lexer.cpp b/src/plugins/scanner/cpp/Lexer.cpp index 16556ac73..6bad85c5c 100644 --- a/src/plugins/scanner/cpp/Lexer.cpp +++ b/src/plugins/scanner/cpp/Lexer.cpp @@ -232,7 +232,7 @@ void Lexer::scan_helper(Token *tok) while (_yychar && _yychar != quote) { if (_yychar == '\n') break; - else if (_yychar != '\\') + if (_yychar != '\\') yyinp(); else { yyinp(); // skip `\\' @@ -573,7 +573,8 @@ void Lexer::scan_helper(Token *tok) // const int yylen = _currentChar - yytext; //tok->f.kind = classifyObjCAtKeyword(yytext, yylen); /// ### FIXME break; - } else if (ch == '@' && _yychar == '"') { + } + if (ch == '@' && _yychar == '"') { // objc @string literals ch = _yychar; yyinp(); -- cgit v1.2.3