summaryrefslogtreecommitdiff
path: root/src/gui/windows/buyselldialog.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/gui/windows/buyselldialog.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/windows/buyselldialog.cpp')
-rw-r--r--src/gui/windows/buyselldialog.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp
index 0914dc43e..009a24839 100644
--- a/src/gui/windows/buyselldialog.cpp
+++ b/src/gui/windows/buyselldialog.cpp
@@ -64,7 +64,7 @@ void BuySellDialog::init()
setWindowName("BuySell");
setCloseButton(true);
- if (setupWindow)
+ if (setupWindow != nullptr)
setupWindow->registerWindowForReset(this);
static const char *const buttonNames[] =
@@ -81,16 +81,18 @@ void BuySellDialog::init()
int x = buttonPadding;
const int y = buttonPadding;
- for (const char *const *curBtn = buttonNames; *curBtn; curBtn++)
+ for (const char *const *curBtn = buttonNames;
+ *curBtn != nullptr;
+ curBtn++)
{
Button *const btn = new Button(this, gettext(*curBtn), *curBtn, this);
- if (!mBuyButton)
+ if (mBuyButton == nullptr)
mBuyButton = btn; // For focus request
btn->setPosition(x, y);
add(btn);
x += btn->getWidth() + buttonPadding;
}
- if (mBuyButton)
+ if (mBuyButton != nullptr)
{
mBuyButton->requestFocus();
setContentSize(x, 2 * y + mBuyButton->getHeight());
@@ -116,7 +118,7 @@ void BuySellDialog::setVisible(Visible visible)
if (visible == Visible_true)
{
- if (mBuyButton)
+ if (mBuyButton != nullptr)
mBuyButton->requestFocus();
}
else
@@ -133,7 +135,7 @@ void BuySellDialog::action(const ActionEvent &event)
if (mNpcId != BeingId_negOne)
{
const Being *const being = actorManager->findBeing(mNpcId);
- if (being)
+ if (being != nullptr)
npcHandler->buy(being);
else
npcHandler->buy(mNpcId);
@@ -158,7 +160,7 @@ void BuySellDialog::closeAll()
{
FOR_EACH (DialogList::const_iterator, it, dialogInstances)
{
- if (*it)
+ if (*it != nullptr)
(*it)->close();
}
}