summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-21 23:19:29 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-21 23:19:29 +0300
commit5d6e4e9a5875d79173e9d2c867567dc26354240e (patch)
treec4970334ea3700e955562755c18b51746c744c60 /src
parent42f47e483da19079a937c4801ca94bd62d8dc970 (diff)
downloadplus-5d6e4e9a5875d79173e9d2c867567dc26354240e.tar.gz
plus-5d6e4e9a5875d79173e9d2c867567dc26354240e.tar.bz2
plus-5d6e4e9a5875d79173e9d2c867567dc26354240e.tar.xz
plus-5d6e4e9a5875d79173e9d2c867567dc26354240e.zip
Change useless if conditions.
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp5
-rw-r--r--src/configmanager.cpp5
-rw-r--r--src/fs/virtfs/fsdirrwops.cpp9
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp3
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))