summaryrefslogtreecommitdiff
path: root/src/utils/translation
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/utils/translation
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmanaplus-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/utils/translation')
-rw-r--r--src/utils/translation/poparser.cpp4
-rw-r--r--src/utils/translation/translationmanager.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp
index 8244fd627..1050cc82e 100644
--- a/src/utils/translation/poparser.cpp
+++ b/src/utils/translation/poparser.cpp
@@ -48,7 +48,7 @@ void PoParser::openFile(const std::string &name)
int size;
const char *buf = VirtFs::loadFile(getFileName(name), size);
- if (buf)
+ if (buf != nullptr)
{
mFile.str(std::string(buf, size));
delete [] buf;
@@ -66,7 +66,7 @@ PoDict *PoParser::load(const std::string &restrict lang,
logger->log("loading lang: %s, file: %s", lang.c_str(), fileName.c_str());
setLang(lang);
- if (!dict)
+ if (dict == nullptr)
mDict = getDict();
else
mDict = dict;
diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp
index 67527b06a..aa0dd47da 100644
--- a/src/utils/translation/translationmanager.cpp
+++ b/src/utils/translation/translationmanager.cpp
@@ -90,7 +90,7 @@ PoDict *TranslationManager::loadLang(const LangVect &lang,
if (!name.empty())
return parser.load(name, subName + name, dict);
logger->log("can't find client data translation");
- if (dict)
+ if (dict != nullptr)
return dict;
return PoParser::getEmptyDict();
}
@@ -99,14 +99,14 @@ bool TranslationManager::translateFile(const std::string &fileName,
PoDict *const dict,
StringVect &lines)
{
- if (!dict || fileName.empty())
+ if ((dict == nullptr) || fileName.empty())
return false;
int contentsLength;
const char *fileContents = VirtFs::loadFile(fileName,
contentsLength);
- if (!fileContents)
+ if (fileContents == nullptr)
{
logger->log("Couldn't load file: %s", fileName.c_str());
return false;