summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2021-11-20 18:04:35 +0300
committerDenis Shienkov <denis.shienkov@gmail.com>2021-11-22 17:56:20 +0000
commit7c1f8137257e28299c5ec0fe030d9b9ba9ff55bf (patch)
tree0ea2ad91452c92c9ee882d695dbbef90a67281a9 /src
parent55d0e01789f9b197ecb45413644873aea806e1ae (diff)
downloadqbs-7c1f8137257e28299c5ec0fe030d9b9ba9ff55bf.tar.gz
Fix Clang-Tidy & Clazy 'llvm-else-after-return' warnings
Change-Id: I16649525d797c980c0ba1357b3671b683c4fde25 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/app/qbs-setup-toolchains/iarewprobe.cpp4
-rw-r--r--src/app/qbs-setup-toolchains/keilprobe.cpp6
-rw-r--r--src/app/qbs/parser/commandlineparser.cpp3
-rw-r--r--src/lib/corelib/api/changeset.cpp3
-rw-r--r--src/lib/corelib/api/qmljsrewriter.cpp24
-rw-r--r--src/lib/corelib/api/runenvironment.cpp10
-rw-r--r--src/lib/corelib/generators/generatorutils.cpp3
-rw-r--r--src/lib/corelib/language/evaluator.cpp9
-rw-r--r--src/lib/corelib/language/moduleloader.cpp16
-rw-r--r--src/lib/corelib/parser/qmlerror.cpp8
-rw-r--r--src/lib/corelib/parser/qmljsengine_p.cpp4
-rw-r--r--src/lib/corelib/parser/qmljslexer.cpp18
-rw-r--r--src/lib/corelib/tools/executablefinder.cpp2
-rw-r--r--src/lib/corelib/tools/id.cpp3
-rw-r--r--src/lib/corelib/tools/scripttools.cpp3
-rw-r--r--src/lib/corelib/tools/vsenvironmentdetector.cpp6
-rw-r--r--src/lib/pkgconfig/pcpackage.cpp32
-rw-r--r--src/lib/pkgconfig/pcparser.cpp3
-rw-r--r--src/plugins/generator/keiluv/keiluvfilesgroupspropertygroup.cpp16
-rw-r--r--src/plugins/generator/visualstudio/visualstudiogenerator.cpp2
-rw-r--r--src/plugins/scanner/cpp/Lexer.cpp5
-rw-r--r--src/shared/json/json.cpp5
22 files changed, 86 insertions, 99 deletions
diff --git a/src/app/qbs-setup-toolchains/iarewprobe.cpp b/src/app/qbs-setup-toolchains/iarewprobe.cpp
index 6c1506778..10845e4bc 100644
--- a/src/app/qbs-setup-toolchains/iarewprobe.cpp
+++ b/src/app/qbs-setup-toolchains/iarewprobe.cpp
@@ -177,9 +177,9 @@ static Version dumpIarCompilerVersion(const QFileInfo &compiler)
}
const QString arch = guessIarArchitecture(compiler);
- if (arch == QLatin1String("arm")) {
+ if (arch == QLatin1String("arm"))
return Version{verCode / 1000000, (verCode / 1000) % 1000, verCode % 1000};
- } else if (arch == QLatin1String("avr")
+ if (arch == QLatin1String("avr")
|| arch == QLatin1String("mcs51")
|| arch == QLatin1String("stm8")
|| arch == QLatin1String("msp430")
diff --git a/src/app/qbs-setup-toolchains/keilprobe.cpp b/src/app/qbs-setup-toolchains/keilprobe.cpp
index a4b61397a..9a54a7861 100644
--- a/src/app/qbs-setup-toolchains/keilprobe.cpp
+++ b/src/app/qbs-setup-toolchains/keilprobe.cpp
@@ -307,11 +307,11 @@ static Version dumpArmClangCompilerVersion(const QFileInfo &compiler)
static Version dumpKeilCompilerVersion(const QFileInfo &compiler)
{
const QString arch = guessKeilArchitecture(compiler);
- if (arch == QLatin1String("mcs51") || arch == QLatin1String("mcs251")) {
+ if (arch == QLatin1String("mcs51") || arch == QLatin1String("mcs251"))
return dumpMcsCompilerVersion(compiler);
- } else if (arch == QLatin1String("c166")) {
+ if (arch == QLatin1String("c166"))
return dumpC166CompilerVersion(compiler);
- } else if (arch == QLatin1String("arm")) {
+ if (arch == QLatin1String("arm")) {
if (isArmClangCompiler(compiler))
return dumpArmClangCompilerVersion(compiler);
return dumpArmCCCompilerVersion(compiler);
diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp
index 5d3c14ebb..cc7da79dc 100644
--- a/src/app/qbs/parser/commandlineparser.cpp
+++ b/src/app/qbs/parser/commandlineparser.cpp
@@ -582,8 +582,7 @@ QString CommandLineParser::CommandLineParserPrivate::propertyName(const QString
// Make fully-qualified, ie "platform" -> "qbs.platform"
if (aCommandLineName.contains(QLatin1Char('.')))
return aCommandLineName;
- else
- return QLatin1String("qbs.") + aCommandLineName;
+ return QLatin1String("qbs.") + aCommandLineName;
}
bool CommandLineParser::CommandLineParserPrivate::checkForExistingBuildConfiguration(
diff --git a/src/lib/corelib/api/changeset.cpp b/src/lib/corelib/api/changeset.cpp
index 2cfdd6428..218e18fb2 100644
--- a/src/lib/corelib/api/changeset.cpp
+++ b/src/lib/corelib/api/changeset.cpp
@@ -60,9 +60,8 @@ static bool overlaps(int posA, int lengthA, int posB, int lengthB) {
|| (posA <= posB && posA + lengthA > posB)
// A contained in B
|| (posB < posA && posB + lengthB > posA + lengthA);
- } else {
- return (posB > posA && posB < posA + lengthA);
}
+ return (posB > posA && posB < posA + lengthA);
}
bool ChangeSet::hasOverlap(int pos, int length)
diff --git a/src/lib/corelib/api/qmljsrewriter.cpp b/src/lib/corelib/api/qmljsrewriter.cpp
index b7e573e07..46cd10b95 100644
--- a/src/lib/corelib/api/qmljsrewriter.cpp
+++ b/src/lib/corelib/api/qmljsrewriter.cpp
@@ -188,8 +188,7 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
if (lastObjectDef)
return lastObjectDef;
- else
- return lastNonObjectDef;
+ return lastNonObjectDef;
}
UiArrayMemberList *Rewriter::searchMemberToInsertAfter(UiArrayMemberList *members,
@@ -221,8 +220,7 @@ UiArrayMemberList *Rewriter::searchMemberToInsertAfter(UiArrayMemberList *member
if (lastObjectDef)
return lastObjectDef;
- else
- return lastNonObjectDef;
+ return lastNonObjectDef;
}
UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *members,
@@ -301,7 +299,8 @@ void Rewriter::changeBinding(UiObjectInitializer *ast,
break;
// for grouped properties:
- } else if (!prefix.isEmpty()) {
+ }
+ if (!prefix.isEmpty()) {
if (auto def = cast<UiObjectDefinition *>(member)) {
if (toString(def->qualifiedTypeNameId) == prefix)
changeBinding(def->initializer, suffix, newValue, binding);
@@ -355,22 +354,20 @@ bool Rewriter::isMatchingPropertyMember(const QString &propertyName,
{
if (auto publicMember = cast<UiPublicMember*>(member))
return publicMember->name == propertyName;
- else if (auto objectBinding = cast<UiObjectBinding*>(member))
+ if (auto objectBinding = cast<UiObjectBinding*>(member))
return toString(objectBinding->qualifiedId) == propertyName;
- else if (auto scriptBinding = cast<UiScriptBinding*>(member))
+ if (auto scriptBinding = cast<UiScriptBinding*>(member))
return toString(scriptBinding->qualifiedId) == propertyName;
- else if (auto arrayBinding = cast<UiArrayBinding*>(member))
+ if (auto arrayBinding = cast<UiArrayBinding*>(member))
return toString(arrayBinding->qualifiedId) == propertyName;
- else
- return false;
+ return false;
}
bool Rewriter::nextMemberOnSameLine(UiObjectMemberList *members)
{
if (members && members->next && members->next->member)
return members->next->member->firstSourceLocation().startLine == members->member->lastSourceLocation().startLine;
- else
- return false;
+ return false;
}
void Rewriter::insertIntoArray(UiArrayBinding *ast, const QString &newValue)
@@ -465,7 +462,8 @@ bool Rewriter::includeSurroundingWhitespace(const QString &source, int &start, i
paragraphFound = true;
paragraphSkipped = true;
break;
- } else if (end == source.length()) {
+ }
+ if (end == source.length()) {
break;
}
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp
index 1bd9735ee..2544f549e 100644
--- a/src/lib/corelib/api/runenvironment.cpp
+++ b/src/lib/corelib/api/runenvironment.cpp
@@ -314,11 +314,8 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
if (process.error() == QProcess::FailedToStart) {
throw ErrorInfo(Tr::tr("The process '%1' could not be started: %2")
.arg(targetExecutable, process.errorString()));
- } else {
- d->logger.qbsWarning()
- << "QProcess error: " << process.errorString();
}
-
+ d->logger.qbsWarning() << "QProcess error: " << process.errorString();
return EXIT_FAILURE;
}
@@ -457,11 +454,8 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
#endif
throw ErrorInfo(Tr::tr("The process '%1' could not be started: %2")
.arg(targetExecutable, errorPrefixString + process.errorString()));
- } else {
- d->logger.qbsWarning()
- << "QProcess error: " << process.errorString();
}
-
+ d->logger.qbsWarning() << "QProcess error: " << process.errorString();
return EXIT_FAILURE;
}
return process.exitCode();
diff --git a/src/lib/corelib/generators/generatorutils.cpp b/src/lib/corelib/generators/generatorutils.cpp
index 3767c9467..8089592c9 100644
--- a/src/lib/corelib/generators/generatorutils.cpp
+++ b/src/lib/corelib/generators/generatorutils.cpp
@@ -142,7 +142,8 @@ QString targetBinary(const ProductData &qbsProduct)
const auto &type = qbsProduct.type();
if (type.contains(QLatin1String("application"))) {
return QFileInfo(qbsProduct.targetExecutable()).fileName();
- } else if (type.contains(QLatin1String("staticlibrary"))) {
+ }
+ if (type.contains(QLatin1String("staticlibrary"))) {
for (const auto &artifact : qbsProduct.targetArtifacts()) {
if (artifact.fileTags().contains(QLatin1String("staticlibrary")))
return QFileInfo(artifact.filePath()).fileName();
diff --git a/src/lib/corelib/language/evaluator.cpp b/src/lib/corelib/language/evaluator.cpp
index b6fa06c8c..3f3719894 100644
--- a/src/lib/corelib/language/evaluator.cpp
+++ b/src/lib/corelib/language/evaluator.cpp
@@ -117,9 +117,9 @@ QString Evaluator::stringValue(const Item *item, const QString &name,
static QStringList toStringList(const QScriptValue &scriptValue)
{
- if (scriptValue.isString()) {
+ if (scriptValue.isString())
return {scriptValue.toString()};
- } else if (scriptValue.isArray()) {
+ if (scriptValue.isArray()) {
QStringList lst;
int i = 0;
forever {
@@ -277,10 +277,9 @@ void throwOnEvaluationError(ScriptEngine *engine, const QScriptValue &scriptValu
if (v.isNumber())
line = v.toInt32();
throw ErrorInfo(message, CodeLocation(filePath, line, -1, false));
- } else {
- message = value.toString();
- throw ErrorInfo(message, provideFallbackCodeLocation());
}
+ message = value.toString();
+ throw ErrorInfo(message, provideFallbackCodeLocation());
}
} // namespace Internal
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index 2f109256c..07f293691 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -1192,14 +1192,13 @@ void ModuleLoader::adjustDependenciesForMultiplexing(const ProductContext &produ
multiplexId);
return;
- } else {
- // Otherwise collect partial matches and decide later
- const auto dependencyMultiplexConfig =
- MultiplexInfo::multiplexIdToVariantMap(dependency->multiplexConfigurationId);
-
- if (multiplexConfigurationIntersects(dependencyMultiplexConfig, productMultiplexConfig))
- multiplexIds << dependency->multiplexConfigurationId;
}
+ // Otherwise collect partial matches and decide later
+ const auto dependencyMultiplexConfig = MultiplexInfo::multiplexIdToVariantMap(
+ dependency->multiplexConfigurationId);
+
+ if (multiplexConfigurationIntersects(dependencyMultiplexConfig, productMultiplexConfig))
+ multiplexIds << dependency->multiplexConfigurationId;
} else {
// (2b), (3b) or (3c)
const bool profileMatch = !profilesPropertyIsSet || profiles.empty()
@@ -3838,7 +3837,8 @@ void ModuleLoader::addProductModuleDependencies(ProductContext *productContext,
multiplexConfigIdProp)->value().toString();
depsToAdd.push_back(dep);
break;
- } else if (profileMatch) {
+ }
+ if (profileMatch) {
dep.multiplexConfigurationId = dependencies.at(i)->multiplexConfigurationId;
depsToAdd.push_back(dep);
}
diff --git a/src/lib/corelib/parser/qmlerror.cpp b/src/lib/corelib/parser/qmlerror.cpp
index 8a8118290..157d1690f 100644
--- a/src/lib/corelib/parser/qmlerror.cpp
+++ b/src/lib/corelib/parser/qmlerror.cpp
@@ -149,7 +149,7 @@ bool QmlError::isValid() const
QUrl QmlError::url() const
{
if (d) return d->url;
- else return {};
+ return {};
}
/*!
@@ -167,7 +167,7 @@ void QmlError::setUrl(const QUrl &url)
QString QmlError::description() const
{
if (d) return d->description;
- else return {};
+ return {};
}
/*!
@@ -185,7 +185,7 @@ void QmlError::setDescription(const QString &description)
int QmlError::line() const
{
if (d) return d->line;
- else return -1;
+ return -1;
}
/*!
@@ -203,7 +203,7 @@ void QmlError::setLine(int line)
int QmlError::column() const
{
if (d) return d->column;
- else return -1;
+ return -1;
}
/*!
diff --git a/src/lib/corelib/parser/qmljsengine_p.cpp b/src/lib/corelib/parser/qmljsengine_p.cpp
index 11bf8a3f3..67da09825 100644
--- a/src/lib/corelib/parser/qmljsengine_p.cpp
+++ b/src/lib/corelib/parser/qmljsengine_p.cpp
@@ -50,9 +50,9 @@ static int toDigit(char c)
{
if ((c >= '0') && (c <= '9'))
return c - '0';
- else if ((c >= 'a') && (c <= 'z'))
+ if ((c >= 'a') && (c <= 'z'))
return 10 + c - 'a';
- else if ((c >= 'A') && (c <= 'Z'))
+ if ((c >= 'A') && (c <= 'Z'))
return 10 + c - 'A';
return -1;
}
diff --git a/src/lib/corelib/parser/qmljslexer.cpp b/src/lib/corelib/parser/qmljslexer.cpp
index db3004fc8..684be9317 100644
--- a/src/lib/corelib/parser/qmljslexer.cpp
+++ b/src/lib/corelib/parser/qmljslexer.cpp
@@ -69,10 +69,9 @@ static unsigned char convertHex(ushort c)
{
if (c >= '0' && c <= '9')
return (c - '0');
- else if (c >= 'a' && c <= 'f')
+ if (c >= 'a' && c <= 'f')
return (c - 'a' + 10);
- else
- return (c - 'A' + 10);
+ return (c - 'A' + 10);
}
static QChar convertHex(QChar c1, QChar c2)
@@ -297,10 +296,9 @@ again:
_tokenLine = _currentLineNumber;
_tokenStartPtr = _codePtr - 1; // ### TODO: insert it before the optional \r sequence.
return T_SEMICOLON;
- } else {
- _terminator = true;
- syncProhibitAutomaticSemicolon();
}
+ _terminator = true;
+ syncProhibitAutomaticSemicolon();
}
scanChar();
@@ -352,7 +350,8 @@ again:
return T_GT_GT_GT_EQ;
}
return T_GT_GT_GT;
- } else if (_char == QLatin1Char('=')) {
+ }
+ if (_char == QLatin1Char('=')) {
scanChar();
return T_GT_GT_EQ;
}
@@ -556,7 +555,8 @@ again:
while (!_char.isNull()) {
if (_char == QLatin1Char('\n') || _char == QLatin1Char('\\')) {
break;
- } else if (_char == quote) {
+ }
+ if (_char == quote) {
_tokenSpell = _engine->midRef(
int(startCode - _code.unicode() - 1), int(_codePtr - startCode));
scanChar();
@@ -920,7 +920,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
while (! _char.isNull() && ! isLineTerminator()) {
if (_char == QLatin1Char(']'))
break;
- else if (_char == QLatin1Char('\\')) {
+ if (_char == QLatin1Char('\\')) {
// regular expression backslash sequence
_tokenText += _char;
scanChar();
diff --git a/src/lib/corelib/tools/executablefinder.cpp b/src/lib/corelib/tools/executablefinder.cpp
index a02fbdc98..5bf531551 100644
--- a/src/lib/corelib/tools/executablefinder.cpp
+++ b/src/lib/corelib/tools/executablefinder.cpp
@@ -76,7 +76,7 @@ QString ExecutableFinder::findExecutable(const QString &path, const QString &wor
//if (FileInfo::fileName(filePath) == filePath)
if (!FileInfo::isAbsolute(filePath))
return findInPath(filePath, workingDirPath);
- else if (HostOsInfo::isWindowsHost())
+ if (HostOsInfo::isWindowsHost())
return findBySuffix(filePath);
return filePath;
}
diff --git a/src/lib/corelib/tools/id.cpp b/src/lib/corelib/tools/id.cpp
index 33cfd60f7..b4c791f75 100644
--- a/src/lib/corelib/tools/id.cpp
+++ b/src/lib/corelib/tools/id.cpp
@@ -272,8 +272,7 @@ bool Id::operator==(const char *name) const
const auto string = getStringFromId(m_id);
if (!string.isNull() && name)
return strcmp(string.data(), name) == 0;
- else
- return false;
+ return false;
}
bool Id::alphabeticallyBefore(Id other) const
diff --git a/src/lib/corelib/tools/scripttools.cpp b/src/lib/corelib/tools/scripttools.cpp
index adf930cf0..ed88520fc 100644
--- a/src/lib/corelib/tools/scripttools.cpp
+++ b/src/lib/corelib/tools/scripttools.cpp
@@ -62,8 +62,7 @@ QVariant getConfigProperty(const QVariantMap &cfg, const QStringList &name)
{
if (name.length() == 1)
return cfg.value(name.front());
- else
- return getConfigProperty(cfg.value(name.front()).toMap(), name.mid(1));
+ return getConfigProperty(cfg.value(name.front()).toMap(), name.mid(1));
}
TemporaryGlobalObjectSetter::TemporaryGlobalObjectSetter(const QScriptValue &object)
diff --git a/src/lib/corelib/tools/vsenvironmentdetector.cpp b/src/lib/corelib/tools/vsenvironmentdetector.cpp
index 82dff578f..06c34a79d 100644
--- a/src/lib/corelib/tools/vsenvironmentdetector.cpp
+++ b/src/lib/corelib/tools/vsenvironmentdetector.cpp
@@ -124,14 +124,12 @@ QString VsEnvironmentDetector::findVcVarsAllBat(const MSVC &msvc,
QString fullPath = dir.absoluteFilePath(path);
if (dir.exists(path))
return fullPath;
- else
- searchedPaths.push_back(fullPath);
+ searchedPaths.push_back(fullPath);
path = QStringLiteral("Auxiliary/Build/") + vcvarsallbat;
fullPath = dir.absoluteFilePath(path);
if (dir.exists(path))
return fullPath;
- else
- searchedPaths.push_back(fullPath);
+ searchedPaths.push_back(fullPath);
return {};
}
diff --git a/src/lib/pkgconfig/pcpackage.cpp b/src/lib/pkgconfig/pcpackage.cpp
index cba783708..984936bd1 100644
--- a/src/lib/pkgconfig/pcpackage.cpp
+++ b/src/lib/pkgconfig/pcpackage.cpp
@@ -67,25 +67,25 @@ std::optional<PcPackage::Flag::Type> PcPackage::Flag::typeFromString(std::string
{
if (s == "LibraryName")
return Type::LibraryName;
- else if (s == "StaticLibraryName")
+ if (s == "StaticLibraryName")
return Type::StaticLibraryName;
- else if (s == "LibraryPath")
+ if (s == "LibraryPath")
return Type::LibraryPath;
- else if (s == "Framework")
+ if (s == "Framework")
return Type::Framework;
- else if (s == "FrameworkPath")
+ if (s == "FrameworkPath")
return Type::FrameworkPath;
- else if (s == "LinkerFlag")
+ if (s == "LinkerFlag")
return Type::LinkerFlag;
- else if (s == "IncludePath")
+ if (s == "IncludePath")
return Type::IncludePath;
- else if (s == "SystemIncludePath")
+ if (s == "SystemIncludePath")
return Type::SystemIncludePath;
- else if (s == "DirAfterIncludePath")
+ if (s == "DirAfterIncludePath")
return Type::DirAfterIncludePath;
- else if (s == "Define")
+ if (s == "Define")
return Type::Define;
- else if (s == "CompilerFlag")
+ if (s == "CompilerFlag")
return Type::CompilerFlag;
return std::nullopt;
}
@@ -108,17 +108,17 @@ std::optional<ComparisonType> PcPackage::RequiredVersion::comparisonFromString(s
{
if (s == "LessThan")
return ComparisonType::LessThan;
- else if (s == "GreaterThan")
+ if (s == "GreaterThan")
return ComparisonType::GreaterThan;
- else if (s == "LessThanEqual")
+ if (s == "LessThanEqual")
return ComparisonType::LessThanEqual;
- else if (s == "GreaterThanEqual")
+ if (s == "GreaterThanEqual")
return ComparisonType::GreaterThanEqual;
- else if (s == "Equal")
+ if (s == "Equal")
return ComparisonType::Equal;
- else if (s == "NotEqual")
+ if (s == "NotEqual")
return ComparisonType::NotEqual;
- else if (s == "AlwaysMatch")
+ if (s == "AlwaysMatch")
return ComparisonType::AlwaysMatch;
return std::nullopt;
}
diff --git a/src/lib/pkgconfig/pcparser.cpp b/src/lib/pkgconfig/pcparser.cpp
index 20e92a600..8eaaf30a7 100644
--- a/src/lib/pkgconfig/pcparser.cpp
+++ b/src/lib/pkgconfig/pcparser.cpp
@@ -81,9 +81,8 @@ bool readOneLine(std::ifstream &file, std::string &line)
line += '\\';
return n_read > 0;
- } else {
- n_read++;
}
+ n_read++;
if (c == '\r') {
n_read--;
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();
diff --git a/src/shared/json/json.cpp b/src/shared/json/json.cpp
index 048cd46e4..c5eac719b 100644
--- a/src/shared/json/json.cpp
+++ b/src/shared/json/json.cpp
@@ -3650,8 +3650,7 @@ bool JsonDocument::operator==(const JsonDocument &other) const
if (d->header->root()->isObject())
return JsonObject(d, static_cast<Internal::Object *>(d->header->root()))
== JsonObject(other.d, static_cast<Internal::Object *>(other.d->header->root()));
- else
- return JsonArray(d, static_cast<Internal::Array *>(d->header->root()))
+ return JsonArray(d, static_cast<Internal::Array *>(d->header->root()))
== JsonArray(other.d, static_cast<Internal::Array *>(other.d->header->root()));
}
@@ -4209,7 +4208,7 @@ bool Parser::parseArray()
char token = nextToken();
if (token == EndArray)
break;
- else if (token != ValueSeparator) {
+ if (token != ValueSeparator) {
if (!eatSpace())
lastError = JsonParseError::UnterminatedArray;
else