diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-21 23:19:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-21 23:19:29 +0300 |
commit | 5d6e4e9a5875d79173e9d2c867567dc26354240e (patch) | |
tree | c4970334ea3700e955562755c18b51746c744c60 | |
parent | 42f47e483da19079a937c4801ca94bd62d8dc970 (diff) | |
download | manaplus-5d6e4e9a5875d79173e9d2c867567dc26354240e.tar.gz manaplus-5d6e4e9a5875d79173e9d2c867567dc26354240e.tar.bz2 manaplus-5d6e4e9a5875d79173e9d2c867567dc26354240e.tar.xz manaplus-5d6e4e9a5875d79173e9d2c867567dc26354240e.zip |
Change useless if conditions.
-rw-r--r-- | src/being/being.cpp | 5 | ||||
-rw-r--r-- | src/configmanager.cpp | 5 | ||||
-rw-r--r-- | src/fs/virtfs/fsdirrwops.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/spellshortcutcontainer.cpp | 3 |
4 files changed, 9 insertions, 13 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 89fc9bfd1..914462892 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3242,10 +3242,7 @@ void Being::setSpriteColor(const unsigned int slot, const int id = beingSlot.spriteId; // id = 0 means unequip - if (id == 0) - { - } - else + if (id != 0) { const ItemInfo &info = ItemDB::get(id); const std::string &restrict filename = info.getSprite( diff --git a/src/configmanager.cpp b/src/configmanager.cpp index 804d597ce..1039c5a01 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -386,12 +386,13 @@ void ConfigManager::checkConfigVersion() config.setValue("customcursor", false); #endif // ANDROID } +#ifdef ANDROID if (version < 4) { -#ifdef ANDROID config.setValue("showDidYouKnow", false); -#endif // ANDROID } +#endif // ANDROID + if (version < 5) { if (config.getIntValue("speech") == BeingSpeech::TEXT_OVERHEAD) diff --git a/src/fs/virtfs/fsdirrwops.cpp b/src/fs/virtfs/fsdirrwops.cpp index 009eb5377..47497a9d3 100644 --- a/src/fs/virtfs/fsdirrwops.cpp +++ b/src/fs/virtfs/fsdirrwops.cpp @@ -177,9 +177,9 @@ namespace FsDir const int64_t rc = cnt / size; #endif // USE_FILE_FOPEN +#ifndef USE_FILE_FOPEN if (rc != static_cast<int64_t>(maxnum)) { -#ifndef USE_FILE_FOPEN const int64_t pos = lseek(fd, 0, SEEK_CUR); struct stat statbuf; if (fstat(fd, &statbuf) == -1) @@ -187,8 +187,8 @@ namespace FsDir reportAlways("FsDir::fileLength error."); return CAST_S32(rc); } -#endif // USE_FILE_FOPEN } +#endif // USE_FILE_FOPEN return CAST_S32(rc); } @@ -213,9 +213,9 @@ namespace FsDir const int64_t rc = cnt / size; #endif // USE_FILE_FOPEN +#ifndef USE_FILE_FOPEN if (rc != static_cast<int64_t>(maxnum)) { -#ifndef USE_FILE_FOPEN const int64_t pos = lseek(fd, 0, SEEK_CUR); struct stat statbuf; if (fstat(fd, &statbuf) == -1) @@ -223,8 +223,9 @@ namespace FsDir reportAlways("FsDir::fileLength error."); return CAST_S32(rc); } -#endif // USE_FILE_FOPEN } +#endif // USE_FILE_FOPEN + return CAST_S32(rc); } diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 6cc4def09..ffa23ffa1 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -229,9 +229,6 @@ void SpellShortcutContainer::mousePressed(MouseEvent &event) mSpellClicked = true; event.consume(); } - else if (eventButton == MouseButton::RIGHT) - { - } else if (eventButton == MouseButton::MIDDLE) { if ((spellShortcut == nullptr) || (spellManager == nullptr)) |