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/widgets/icon.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz manaplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/widgets/icon.cpp')
-rw-r--r-- | src/gui/widgets/icon.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp index 8cb43db6d..dbe46a21a 100644 --- a/src/gui/widgets/icon.cpp +++ b/src/gui/widgets/icon.cpp @@ -39,7 +39,7 @@ Icon::Icon(const Widget2 *const widget, mImage(Loader::getImage(file)), mAutoRelease(autoRelease) { - if (mImage) + if (mImage != nullptr) { const SDL_Rect &bounds = mImage->mBounds; setSize(bounds.w, bounds.h); @@ -54,7 +54,7 @@ Icon::Icon(const Widget2 *const widget, mImage(image), mAutoRelease(autoRelease) { - if (mImage) + if (mImage != nullptr) { const SDL_Rect &bounds = mImage->mBounds; setSize(bounds.w, bounds.h); @@ -64,16 +64,16 @@ Icon::Icon(const Widget2 *const widget, Icon::~Icon() { - if (gui) + if (gui != nullptr) gui->removeDragged(this); - if (mImage && mAutoRelease == AutoRelease_true) + if ((mImage != nullptr) && mAutoRelease == AutoRelease_true) mImage->decRef(); } void Icon::setImage(Image *const image) { mImage = image; - if (mImage) + if (mImage != nullptr) { const SDL_Rect &bounds = mImage->mBounds; setSize(bounds.w, bounds.h); @@ -83,7 +83,7 @@ void Icon::setImage(Image *const image) void Icon::draw(Graphics *const graphics) { BLOCK_START("Icon::draw") - if (mImage) + if (mImage != nullptr) { graphics->drawImage(mImage, (mDimension.width - mImage->mBounds.w) / 2, @@ -95,7 +95,7 @@ void Icon::draw(Graphics *const graphics) void Icon::safeDraw(Graphics *const graphics) { BLOCK_START("Icon::draw") - if (mImage) + if (mImage != nullptr) { graphics->drawImage(mImage, (mDimension.width - mImage->mBounds.w) / 2, |