From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/resources/db/emotedb.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/resources/db/emotedb.cpp') diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp index 7d9e47e8b..085f81abe 100644 --- a/src/resources/db/emotedb.cpp +++ b/src/resources/db/emotedb.cpp @@ -75,7 +75,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName, XML::Document doc(fileName, UseVirtFs_true, skipError); XmlNodePtrConst rootNode = doc.rootNode(); - if (!rootNode || !xmlNameEqual(rootNode, "emotes")) + if ((rootNode == nullptr) || !xmlNameEqual(rootNode, "emotes")) { logger->log("Emote Database: Error while loading %s!", fileName.c_str()); @@ -113,7 +113,7 @@ void EmoteDB::loadXmlFile(const std::string &fileName, currentInfo = mEmoteInfos[id]; else currentInfo = new EmoteInfo; - if (!currentInfo) + if (currentInfo == nullptr) continue; currentInfo->time = XML::getProperty(emoteNode, "time", 500); currentInfo->effectId = XML::getProperty(emoteNode, "effect", -1); @@ -152,7 +152,7 @@ void EmoteDB::loadSpecialXmlFile(const std::string &fileName, XML::Document doc(fileName, UseVirtFs_true, skipError); XmlNodePtrConst rootNode = doc.rootNode(); - if (!rootNode || !xmlNameEqual(rootNode, "emotes")) + if ((rootNode == nullptr) || !xmlNameEqual(rootNode, "emotes")) { logger->log1("Emote Database: Error while loading" " manaplus_emotes.xml!"); @@ -186,7 +186,7 @@ void EmoteDB::loadSpecialXmlFile(const std::string &fileName, EmoteInfo *currentInfo = nullptr; if (mEmoteInfos.find(id) != mEmoteInfos.end()) currentInfo = mEmoteInfos[id]; - if (!currentInfo) + if (currentInfo == nullptr) currentInfo = new EmoteInfo; currentInfo->time = XML::getProperty(emoteNode, "time", 500); currentInfo->effectId = XML::getProperty(emoteNode, "effect", -1); @@ -226,7 +226,7 @@ void EmoteDB::unload() { FOR_EACH (EmoteInfos::const_iterator, i, mEmoteInfos) { - if (i->second) + if (i->second != nullptr) { std::list &sprites = i->second->sprites; while (!sprites.empty()) @@ -295,7 +295,7 @@ const EmoteInfo *EmoteDB::get2(int id, const bool allowNull) const EmoteSprite *EmoteDB::getSprite(const int id, const bool allowNull) { const EmoteInfo *const info = get(id, allowNull); - if (!info) + if (info == nullptr) return nullptr; return info->sprites.front(); -- cgit v1.2.3-70-g09d2