From 5c4c66c0873e2b21d87929ab7e3389883c4ee074 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 16 Jan 2018 05:45:52 +0300 Subject: Fix code style. --- src/being/being.cpp | 3 +-- src/gui/windows/charselectdialog.cpp | 1 + src/gui/windows/chatwindow.cpp | 2 +- src/net/tmwa/guildhandler.h | 6 ++---- src/resources/mapreader.cpp | 2 +- src/utils/gettexthelper.cpp | 7 ++----- src/utils/stringutils.cpp | 2 +- 7 files changed, 9 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/being/being.cpp b/src/being/being.cpp index c7c9e1769..da67becda 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3062,8 +3062,7 @@ void Being::setSpriteCards(const unsigned int slot, if (!filename.empty()) { - if (color.empty()) - color = info.getDyeColorsString(colorId); + color = info.getDyeColorsString(colorId); equipmentSprite = AnimatedSprite::delayedLoad( pathJoin(paths.getStringValue("sprites"), diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 46810c2cd..5038195d2 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -164,6 +164,7 @@ CharSelectDialog::CharSelectDialog(LoginData &data) : CharSelectDialog::~CharSelectDialog() { + mDeleteDialog = nullptr; } void CharSelectDialog::postInit() diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d0284af94..0b4d550dd 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -1741,7 +1741,7 @@ bool ChatWindow::resortChatLog(std::string line, tryRemoveColors); } } - else if ((localChatTab != nullptr) && channel.empty()) + else if (localChatTab != nullptr) { localChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors); } diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h index 215eba679..de64641fc 100644 --- a/src/net/tmwa/guildhandler.h +++ b/src/net/tmwa/guildhandler.h @@ -70,8 +70,7 @@ class GuildHandler final : public Net::GuildHandler void checkMaster() const override final; - void requestAlliance(const Being *const being) const override final - ; + void requestAlliance(const Being *const being) const override final; void requestAllianceResponse(const int beingId, const bool accept) const override final; @@ -85,8 +84,7 @@ class GuildHandler final : public Net::GuildHandler const int payRate, const std::string &name) const override final; - void requestOpposition(const Being *const being) const override final - ; + void requestOpposition(const Being *const being) const override final; void breakGuild(const std::string &name) const override final; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index e4f603779..e5e7374fe 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -189,7 +189,7 @@ PRAGMACLANG6GCC(GCC diagnostic pop) outLength = bufferSize - strm.avail_out; (void) inflateEnd(&strm); - return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; + return Z_OK; } int inflateMemory(unsigned char *restrict const in, diff --git a/src/utils/gettexthelper.cpp b/src/utils/gettexthelper.cpp index 422c7d36f..9b8f16352 100644 --- a/src/utils/gettexthelper.cpp +++ b/src/utils/gettexthelper.cpp @@ -73,11 +73,8 @@ static std::string setLangEnv() putenv(const_cast(("LANGUAGE=" + lang).c_str())); #else // WIN32 - if (!lang.empty()) - { - setEnv("LANG", lang.c_str()); - setEnv("LANGUAGE", lang.c_str()); - } + setEnv("LANG", lang.c_str()); + setEnv("LANGUAGE", lang.c_str()); #endif // WIN32 } diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index c91dfd932..6ec7817ed 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -588,7 +588,7 @@ std::string combineDye3(std::string file, } return file.append("|").append(str); } - if (dye.empty() || file.empty()) + if (file.empty()) return file; return file.append("|").append(dye); } -- cgit v1.2.3-70-g09d2