summaryrefslogtreecommitdiff
path: root/src/net/eathena/mailrecv.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/net/eathena/mailrecv.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/net/eathena/mailrecv.cpp')
-rw-r--r--src/net/eathena/mailrecv.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/net/eathena/mailrecv.cpp b/src/net/eathena/mailrecv.cpp
index 38366d986..c098b6857 100644
--- a/src/net/eathena/mailrecv.cpp
+++ b/src/net/eathena/mailrecv.cpp
@@ -45,7 +45,7 @@ void MailRecv::processMailOpen(Net::MessageIn &msg)
switch (flag)
{
case 0: // open window
- if (mailWindow)
+ if (mailWindow != nullptr)
{
if (!mailWindow->isWindowVisible())
mailWindow->setVisible(Visible_true);
@@ -54,7 +54,7 @@ void MailRecv::processMailOpen(Net::MessageIn &msg)
break;
case 1: // close window
- if (mailWindow)
+ if (mailWindow != nullptr)
{
if (mailWindow->isWindowVisible())
mailWindow->setVisible(Visible_false);
@@ -79,7 +79,7 @@ void MailRecv::processMailList(Net::MessageIn &msg)
MailMessage *const mail = new MailMessage;
mail->id = msg.readInt32("message id");
mail->title = msg.readString(40, "title");
- mail->unread = msg.readUInt8("unread flag") ? true : false;
+ mail->unread = msg.readUInt8("unread flag") != 0u ? true : false;
mail->sender = msg.readString(24, "sender name");
mail->time = msg.readInt32("time stamp");
mail->strTime = timeToStr(mail->time);
@@ -99,7 +99,7 @@ void MailRecv::processReadMail(Net::MessageIn &msg)
mail->itemAmount = msg.readInt32("item amount");
mail->itemId = msg.readInt16("item id");
mail->itemType = msg.readInt16("item type");
- mail->itemIdentify = msg.readUInt8("identify");
+ mail->itemIdentify = (msg.readUInt8("identify") != 0u);
mail->itemAttribute = msg.readUInt8("attribute");
mail->itemRefine = msg.readUInt8("refine");
for (int f = 0; f < maxCards; f ++)
@@ -166,9 +166,9 @@ void MailRecv::processSetAttachmentAck(Net::MessageIn &msg)
{
const int index = msg.readInt16("index");
const int flag = msg.readUInt8("flag");
- if (flag)
+ if (flag != 0)
{
- if (index)
+ if (index != 0)
NotifyManager::notify(NotifyTypes::MAIL_ATTACH_ITEM_ERROR);
else
NotifyManager::notify(NotifyTypes::MAIL_ATTACH_MONEY_ERROR);
@@ -179,7 +179,7 @@ void MailRecv::processDeleteAck(Net::MessageIn &msg)
{
const int mail = msg.readInt32("message id");
const int flag = msg.readInt16("fail flag");
- if (flag)
+ if (flag != 0)
{
NotifyManager::notify(NotifyTypes::MAIL_DELETE_ERROR);
}
@@ -194,7 +194,7 @@ void MailRecv::processMailReturn(Net::MessageIn &msg)
{
const int mail = msg.readInt32("message id");
const int flag = msg.readInt16("fail flag");
- if (flag)
+ if (flag != 0)
{
NotifyManager::notify(NotifyTypes::MAIL_RETURN_ERROR);
}