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/dirs.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | plus-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/dirs.cpp')
-rw-r--r-- | src/dirs.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/dirs.cpp b/src/dirs.cpp index 18005681e..efde80ce9 100644 --- a/src/dirs.cpp +++ b/src/dirs.cpp @@ -263,7 +263,8 @@ void Dirs::initRootDir() const std::string portableName = settings.rootDir + "portable.xml"; struct stat statbuf; - if (!stat(portableName.c_str(), &statbuf) && S_ISREG(statbuf.st_mode)) + if (stat(portableName.c_str(), &statbuf) == 0 && + S_ISREG(statbuf.st_mode)) { std::string dir; Configuration portable; @@ -356,7 +357,7 @@ void Dirs::initLocalDataDir() #endif // __APPLE__ } - if (mkdir_r(settings.localDataDir.c_str())) + if (mkdir_r(settings.localDataDir.c_str()) != 0) { // TRANSLATORS: directory creation error logger->error(strprintf(_("%s doesn't exist and can't be created! " @@ -371,7 +372,7 @@ void Dirs::initTempDir() { settings.tempDir = pathJoin(settings.localDataDir, "temp"); - if (mkdir_r(settings.tempDir.c_str())) + if (mkdir_r(settings.tempDir.c_str()) != 0) { // TRANSLATORS: directory creation error logger->error(strprintf(_("%s doesn't exist and can't be created! " @@ -421,7 +422,7 @@ void Dirs::initConfigDir() logger->log("Generating config dir: " + settings.configDir); } - if (mkdir_r(settings.configDir.c_str())) + if (mkdir_r(settings.configDir.c_str()) != 0) { // TRANSLATORS: directory creation error logger->error(strprintf(_("%s doesn't exist and can't be created! " @@ -531,7 +532,7 @@ void Dirs::initScreenshotDir() if (!settings.options.screenshotDir.empty()) { settings.screenshotDir = settings.options.screenshotDir; - if (mkdir_r(settings.screenshotDir.c_str())) + if (mkdir_r(settings.screenshotDir.c_str()) != 0) { logger->log(strprintf( // TRANSLATORS: directory creation error @@ -584,7 +585,7 @@ void Dirs::initScreenshotDir() void Dirs::initUsersDir() { settings.usersDir = settings.serverConfigDir + "/users/"; - if (mkdir_r(settings.usersDir.c_str())) + if (mkdir_r(settings.usersDir.c_str()) != 0) { // TRANSLATORS: directory creation error logger->error(strprintf(_("%s doesn't exist and can't be created!"), @@ -592,7 +593,7 @@ void Dirs::initUsersDir() } settings.npcsDir = settings.serverConfigDir + "/npcs/"; - if (mkdir_r(settings.npcsDir.c_str())) + if (mkdir_r(settings.npcsDir.c_str()) != 0) { // TRANSLATORS: directory creation error logger->error(strprintf(_("%s doesn't exist and can't be created!"), @@ -600,7 +601,7 @@ void Dirs::initUsersDir() } settings.usersIdDir = settings.serverConfigDir + "/usersid/"; - if (mkdir_r(settings.usersIdDir.c_str())) + if (mkdir_r(settings.usersIdDir.c_str()) != 0) { // TRANSLATORS: directory creation error logger->error(strprintf(_("%s doesn't exist and can't be created!"), |