diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-15 22:40:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-15 22:40:40 +0300 |
commit | b10c6ee0b9c8428f9ed426357a58aa42ee14cbfe (patch) | |
tree | 279df324772bbd8e69aed934940cd4aa8da58999 /src | |
parent | bc5f2bc679b7af67e652fad23f4132e212c78845 (diff) | |
download | mv-b10c6ee0b9c8428f9ed426357a58aa42ee14cbfe.tar.gz mv-b10c6ee0b9c8428f9ed426357a58aa42ee14cbfe.tar.bz2 mv-b10c6ee0b9c8428f9ed426357a58aa42ee14cbfe.tar.xz mv-b10c6ee0b9c8428f9ed426357a58aa42ee14cbfe.zip |
Fix code style.
Diffstat (limited to 'src')
-rw-r--r-- | src/eventsmanager.cpp | 9 | ||||
-rw-r--r-- | src/gui/palette.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/setupitem.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/whoisonline.h | 2 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 1 | ||||
-rw-r--r-- | src/net/eathena/mail2recv.cpp | 2 | ||||
-rw-r--r-- | src/net/ipc.cpp | 5 | ||||
-rw-r--r-- | src/resources/atlas/atlasmanager.h | 6 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 3 |
9 files changed, 17 insertions, 16 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index 41f2a8f3e..1ca458366 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -510,9 +510,11 @@ void EventsManager::logEvent(const SDL_Event &event) break; case SDL_SYSWMEVENT: { - bool res = false; #ifdef USE_X11 - res = X11Logger::logEvent(event); + const bool res = X11Logger::logEvent(event); +#else // USE_X11 + + const bool res = false; #endif // USE_X11 if (res == false) @@ -532,7 +534,8 @@ void EventsManager::logEvent(const SDL_Event &event) #endif // ANDROID default: - logger->assertLog("event: other: %u", event.type); + logger->assertLog("event: other: %u", + CAST_U32(event.type)); break; }; } diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index c7bd7612e..7fcf153fe 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -194,7 +194,6 @@ void Palette::advanceGradient() } } - if (advance != 0) - mRainbowTime = tick_time; + mRainbowTime = tick_time; } } diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 67d52ec0e..cc6ded02e 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -830,7 +830,7 @@ void SetupItemDropDownStr::fromWidget() const int sel = mDropDown->getSelected(); // use first element in model as empty string if (sel == 0 || sel >= mModel->getNumberOfElements()) - mValue = ""; + mValue.clear(); else mValue = mModel->getElementAt(sel); } diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h index 0eb316197..afdb43785 100644 --- a/src/gui/windows/whoisonline.h +++ b/src/gui/windows/whoisonline.h @@ -163,7 +163,7 @@ class WhoIsOnline final : public Window, int mDownloadedBytes; /** Status of the current download. */ - DownloadStatus mDownloadStatus; + WhoIsOnline::DownloadStatus mDownloadStatus; /** Flag that show if current download is complete. */ bool mDownloadComplete; diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 7bdfe7553..0c81000bc 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -295,7 +295,6 @@ static const InputActionData inputActionData InputCondition::KEY_DOWN | InputCondition::GAME | InputCondition::NOTARGET | - InputCondition::KEY_DOWN | InputCondition::NOBLOCK, "sit", UseArgs_false, diff --git a/src/net/eathena/mail2recv.cpp b/src/net/eathena/mail2recv.cpp index 536425386..1afb69d16 100644 --- a/src/net/eathena/mail2recv.cpp +++ b/src/net/eathena/mail2recv.cpp @@ -346,7 +346,7 @@ void Mail2Recv::processMailListPage(Net::MessageIn &msg) mail->type = static_cast<MailMessageType::Type>( msg.readUInt8("type")); mail->sender = msg.readString(24, "sender name"); - mail->time = cur_time - msg.readInt32("reg time"); + mail->time = CAST_S32(cur_time - msg.readInt32("reg time")); mail->strTime = timeToStr(mail->time); mail->expireTime = msg.readInt32("expire time"); mail->title = msg.readString(-1, "title"); diff --git a/src/net/ipc.cpp b/src/net/ipc.cpp index 407f8ca3b..2f910eaed 100644 --- a/src/net/ipc.cpp +++ b/src/net/ipc.cpp @@ -165,8 +165,9 @@ void IPC::start() return; unsigned short port(44007); - if (getenv("IPC_PORT") != nullptr) - port = static_cast<unsigned short>(atoi(getenv("IPC_PORT"))); + const char *const portStr = getenv("IPC_PORT"); + if (portStr != nullptr) + port = static_cast<unsigned short>(atoi(portStr)); logger->log("Starting IPC..."); ipc = new IPC; diff --git a/src/resources/atlas/atlasmanager.h b/src/resources/atlas/atlasmanager.h index 1e5de93b9..4db0d1e4e 100644 --- a/src/resources/atlas/atlasmanager.h +++ b/src/resources/atlas/atlasmanager.h @@ -23,13 +23,13 @@ #ifdef USE_OPENGL -#include "resources/image/image.h" - #include "utils/stringvector.h" +#include "localconsts.h" + class AtlasResource; +class Image; -struct AtlasItem; struct TextureAtlas; class AtlasManager final diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index cdbc7f5cd..98c9baab5 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -22,8 +22,6 @@ #include "resources/resourcemanager/resourcemanager.h" -#include "configuration.h" - #ifdef USE_OPENGL #include "resources/image/image.h" #endif // USE_OPENGL @@ -37,6 +35,7 @@ #include "utils/cast.h" #include "utils/checkutils.h" #include "utils/foreach.h" +#include "utils/stringutils.h" #if !defined(DEBUG_DUMP_LEAKS) && !defined(UNITTESTS) #include "resources/resourcetypes.h" |