diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/palette.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | plus-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/gui/palette.cpp')
-rw-r--r-- | src/gui/palette.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index c3e3a6fa8..25f8084e9 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -93,7 +93,7 @@ void Palette::advanceGradient() for (size_t i = 0, sz = mGradVector.size(); i < sz; i++) { ColorElem *const elem A_NONNULLPOINTER = mGradVector[i]; - if (!elem) + if (elem == nullptr) continue; int delay = elem->delay; @@ -110,9 +110,9 @@ void Palette::advanceGradient() % (delay * numOfColors); const int gradIndex = elem->gradientIndex; - const int pos = delay ? (gradIndex % delay) : gradIndex; + const int pos = delay != 0 ? (gradIndex % delay) : gradIndex; int colIndex; - if (delay) + if (delay != 0) colIndex = gradIndex / delay; else colIndex = gradIndex; @@ -133,9 +133,9 @@ void Palette::advanceGradient() } else if (grad == GradientType::SPECTRUM) { - if (colIndex % 2) + if ((colIndex % 2) != 0) { // falling curve - if (delay) + if (delay != 0) { colVal = CAST_S32(255.0 * (cos(M_PI * pos / delay) + 1) / 2); @@ -148,7 +148,7 @@ void Palette::advanceGradient() } else { // ascending curve - if (delay) + if (delay != 0) { colVal = CAST_S32(255.0 * (cos(M_PI * (delay - pos) / delay) + 1) / 2); @@ -175,7 +175,7 @@ void Palette::advanceGradient() double startColVal; double destColVal; - if (delay) + if (delay != 0) startColVal = (cos(M_PI * pos / delay) + 1) / 2; else startColVal = 0; @@ -193,7 +193,7 @@ void Palette::advanceGradient() } } - if (advance) + if (advance != 0) mRainbowTime = tick_time; } } |