summaryrefslogtreecommitdiff
path: root/src/utils/cpu.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/utils/cpu.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/utils/cpu.cpp')
-rw-r--r--src/utils/cpu.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/utils/cpu.cpp b/src/utils/cpu.cpp
index 91f49f5a7..93353baf5 100644
--- a/src/utils/cpu.cpp
+++ b/src/utils/cpu.cpp
@@ -62,9 +62,9 @@ void Cpu::detect()
#elif defined(__linux__) || defined(__linux)
FILE *file = fopen("/proc/cpuinfo", "r");
char buf[1001];
- if (!file)
+ if (file == nullptr)
return;
- while (fgets(buf, 1000, file))
+ while (fgets(buf, 1000, file) != nullptr)
{
std::string str = buf;
if (findFirst(str, "flags"))
@@ -102,7 +102,7 @@ void Cpu::detect()
}
}
fclose(file);
- if (logger)
+ if (logger != nullptr)
logger->log("cpu features was not detected");
#else // OTHER
@@ -114,24 +114,24 @@ void Cpu::detect()
void Cpu::printFlags()
{
- if (!logger)
+ if (logger == nullptr)
return;
std::string str("CPU features:");
- if (mCpuFlags & FEATURE_MMX)
+ if ((mCpuFlags & FEATURE_MMX) != 0u)
str.append(" mmx");
- if (mCpuFlags & FEATURE_SSE)
+ if ((mCpuFlags & FEATURE_SSE) != 0u)
str.append(" sse");
- if (mCpuFlags & FEATURE_SSE2)
+ if ((mCpuFlags & FEATURE_SSE2) != 0u)
str.append(" sse2");
- if (mCpuFlags & FEATURE_SSSE3)
+ if ((mCpuFlags & FEATURE_SSSE3) != 0u)
str.append(" ssse3");
- if (mCpuFlags & FEATURE_SSE4)
+ if ((mCpuFlags & FEATURE_SSE4) != 0u)
str.append(" sse4");
- if (mCpuFlags & FEATURE_SSE42)
+ if ((mCpuFlags & FEATURE_SSE42) != 0u)
str.append(" sse4_2");
- if (mCpuFlags & FEATURE_AVX)
+ if ((mCpuFlags & FEATURE_AVX) != 0u)
str.append(" avx");
- if (mCpuFlags & FEATURE_AVX2)
+ if ((mCpuFlags & FEATURE_AVX2) != 0u)
str.append(" avx2");
logger->log(str);
}