aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-04-04 21:16:56 +0200
committerIvan Komissarov <ABBAPOH@gmail.com>2020-04-20 11:11:01 +0000
commitaf385fc34a98023ba2ab854f8890c6983ae57a3a (patch)
treecf84fa82b40d1be513699e7a9fb76c1b5a981d66 /src
parent38ba93338244bde2d77f039953b64f767723e361 (diff)
clang-tidy: Fix 'readability-*' warnings
Treat those as errors except for the 'readability-container-size-empty' Change-Id: I6a8bb9d68fb5bc89697cc42179337d338a51035e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/parser/qmljslexer.cpp8
-rw-r--r--src/lib/corelib/tools/shellutils.cpp4
-rw-r--r--src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp4
-rw-r--r--src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp2
-rw-r--r--src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp2
5 files changed, 9 insertions, 11 deletions
diff --git a/src/lib/corelib/parser/qmljslexer.cpp b/src/lib/corelib/parser/qmljslexer.cpp
index 815f1ef0d..f8e83c338 100644
--- a/src/lib/corelib/parser/qmljslexer.cpp
+++ b/src/lib/corelib/parser/qmljslexer.cpp
@@ -237,10 +237,10 @@ int Lexer::lex()
bool Lexer::isUnicodeEscapeSequence(const QChar *chars)
{
- if (isHexDigit(chars[0]) && isHexDigit(chars[1]) && isHexDigit(chars[2]) && isHexDigit(chars[3]))
- return true;
-
- return false;
+ return isHexDigit(chars[0])
+ && isHexDigit(chars[1])
+ && isHexDigit(chars[2])
+ && isHexDigit(chars[3]);
}
QChar Lexer::decodeUnicodeEscapeCharacter(bool *ok)
diff --git a/src/lib/corelib/tools/shellutils.cpp b/src/lib/corelib/tools/shellutils.cpp
index dae98f337..b60881012 100644
--- a/src/lib/corelib/tools/shellutils.cpp
+++ b/src/lib/corelib/tools/shellutils.cpp
@@ -66,9 +66,7 @@ QString shellInterpreter(const QString &filePath) {
inline static bool isSpecialChar(ushort c, const uchar (&iqm)[16])
{
- if ((c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7))))
- return true;
- return false;
+ return (c < sizeof(iqm) * 8) && (iqm[c / 8] & (1 << (c & 7)));
}
inline static bool hasSpecialChars(const QString &arg, const uchar (&iqm)[16])
diff --git a/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp b/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp
index 0bbfbaafb..a2395e3d7 100644
--- a/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp
+++ b/src/plugins/generator/iarew/archs/arm/armgeneralsettingsgroup_v8.cpp
@@ -105,7 +105,7 @@ struct CpuCoreEntry final
};
// Dictionary of known ARM CPU cores and its compiler options.
-static const CpuCoreEntry cpusDict[] = {
+const CpuCoreEntry cpusDict[] = {
{CpuCoreEntry::Arm7tdmi, "arm7tdmi"}, // same as 'sc100'
{CpuCoreEntry::Arm7tdmis, "arm7tdmi-s"},
{CpuCoreEntry::Arm710t, "arm710t"},
@@ -187,7 +187,7 @@ struct FpuCoreEntry final
};
// Dictionary of known ARM FPU cores and its compiler options.
-static const FpuCoreEntry fpusDict[] = {
+const FpuCoreEntry fpusDict[] = {
{FpuCoreEntry::Vfp2, FpuCoreEntry::NoFpuRegisters, "vfpv2"},
{FpuCoreEntry::Vfp3d16, FpuCoreEntry::Fpu16Registers, "vfpv3_d16"},
{FpuCoreEntry::Vfp3, FpuCoreEntry::Fpu32Registers, "vfpv3"},
diff --git a/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp b/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp
index a4819a90d..f3fb8647d 100644
--- a/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp
+++ b/src/plugins/generator/iarew/archs/avr/avrgeneralsettingsgroup_v7.cpp
@@ -49,7 +49,7 @@ struct TargetMcuEntry final
};
// Dictionary of known AVR MCU's and its compiler options.
-static const TargetMcuEntry mcusDict[] = {
+const TargetMcuEntry mcusDict[] = {
{"AT43USB320A", "at43usb320a"},
{"AT43USB325", "at43usb325"},
{"AT43USB326", "at43usb326"},
diff --git a/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp b/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp
index 0ffbcaa5b..f7e3de3d9 100644
--- a/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp
+++ b/src/plugins/generator/keiluv/archs/arm/armtargetcommonoptionsgroup_v5.cpp
@@ -41,7 +41,7 @@ namespace v5 {
namespace {
-static const struct DeviceEntry {
+const struct DeviceEntry {
QByteArray cpu; // CPU option.
std::set<QByteArray> fpus; // FPU's options.
QByteArray device; // Project file entry.