diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-04-24 21:33:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-04-24 23:28:10 +0300 |
commit | 64810ef5b4b3d375e7af0f4fc9ee69e235afa568 (patch) | |
tree | 6810d0f27a0e38c99370c3c9e8d08443ffe8d76f /src | |
parent | 9d2eb460fa3569342044b6f3e61d52d86ca8cbb6 (diff) | |
download | mv-64810ef5b4b3d375e7af0f4fc9ee69e235afa568.tar.gz mv-64810ef5b4b3d375e7af0f4fc9ee69e235afa568.tar.bz2 mv-64810ef5b4b3d375e7af0f4fc9ee69e235afa568.tar.xz mv-64810ef5b4b3d375e7af0f4fc9ee69e235afa568.zip |
Fix code style.
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 14 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/setupquickitem.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/setupquickitem.h | 8 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_chat.cpp | 39 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_quick.cpp | 18 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_quick.h | 4 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 1 | ||||
-rw-r--r-- | src/gui/windows/killstats.cpp | 3 | ||||
-rw-r--r-- | src/net/ea/beinghandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/loginhandler.cpp | 3 | ||||
-rw-r--r-- | src/net/eathena/playerhandler.cpp | 1 | ||||
-rw-r--r-- | src/net/tmwa/beinghandler.cpp | 1 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 1 | ||||
-rw-r--r-- | src/resources/dye.cpp | 4 | ||||
-rw-r--r-- | src/resources/dyepalette.cpp | 1 | ||||
-rw-r--r-- | src/test/testlauncher.cpp | 8 |
18 files changed, 56 insertions, 63 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index fefdbf256..a493d9a1a 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1337,6 +1337,7 @@ void Being::setAction(const BeingAction::Action &action, const int attackId) } currentAction = getSpawnAction(); break; + case BeingAction::PRESTAND: default: logger->log("Being::setAction unknown action: " + toString(static_cast<unsigned>(action))); @@ -1748,6 +1749,7 @@ void Being::petLogic() case BeingAction::MOVE: case BeingAction::HURT: case BeingAction::SPAWN: + case BeingAction::PRESTAND: default: directionType = mInfo->getDirectionType(); break; @@ -3110,6 +3112,17 @@ void Being::saveComment(const std::string &restrict name, case ActorType::Npc: dir = settings.npcsDir; break; + case ActorType::Monster: + case ActorType::FloorItem: + case ActorType::Portal: + case ActorType::LocalPet: + case ActorType::Avatar: + case ActorType::Unknown: +#ifdef EATHENA_SUPPORT + case ActorType::Pet: + case ActorType::Mercenary: + case ActorType::Homunculus: +#endif default: return; } @@ -3427,6 +3440,7 @@ void Being::fixPetSpawnPos(int &dstX, int &dstY) const case BeingAction::SPAWN: case BeingAction::HURT: case BeingAction::STAND: + case BeingAction::PRESTAND: default: offsetX1 = mInfo->getTargetOffsetX(); offsetY1 = mInfo->getTargetOffsetY(); diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index e20fa9e02..ba7f4d794 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -693,6 +693,7 @@ bool LocalPlayer::toggleSit() const switch (mAction) { case BeingAction::STAND: + case BeingAction::PRESTAND: case BeingAction::SPAWN: newAction = BeingAction::SIT; break; diff --git a/src/gui/widgets/setupquickitem.cpp b/src/gui/widgets/setupquickitem.cpp index eab3729f3..85b164c0a 100644 --- a/src/gui/widgets/setupquickitem.cpp +++ b/src/gui/widgets/setupquickitem.cpp @@ -30,10 +30,10 @@ #include "debug.h" SetupQuickItem::SetupQuickItem(const std::string &restrict description, - SetupTabScroll *restrict const parent, - const std::string &restrict eventName, - ModifierGetFuncPtr getFunc, - ModifierChangeFuncPtr changeFunc) : + SetupTabScroll *restrict const parent, + const std::string &restrict eventName, + ModifierGetFuncPtr getFunc, + ModifierChangeFuncPtr changeFunc) : SetupItem("", description, "", parent, eventName, false), mHorizont(nullptr), mButton(nullptr), diff --git a/src/gui/widgets/setupquickitem.h b/src/gui/widgets/setupquickitem.h index 40fba204b..70db34131 100644 --- a/src/gui/widgets/setupquickitem.h +++ b/src/gui/widgets/setupquickitem.h @@ -38,10 +38,10 @@ class SetupQuickItem final : public SetupItem, { public: SetupQuickItem(const std::string &restrict description, - SetupTabScroll *restrict const parent, - const std::string &restrict eventName, - ModifierGetFuncPtr getFunc, - ModifierChangeFuncPtr changeFunc); + SetupTabScroll *restrict const parent, + const std::string &restrict eventName, + ModifierGetFuncPtr getFunc, + ModifierChangeFuncPtr changeFunc); A_DELETE_COPY(SetupQuickItem) diff --git a/src/gui/widgets/tabs/setup_chat.cpp b/src/gui/widgets/tabs/setup_chat.cpp index 47a3e4ea5..3b7250b1f 100644 --- a/src/gui/widgets/tabs/setup_chat.cpp +++ b/src/gui/widgets/tabs/setup_chat.cpp @@ -48,14 +48,14 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemLabel(_("Window"), "", this); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Auto hide chat window"), + new SetupItemCheckBox(_("Auto hide chat window"), _("Chat window will be automatically hidden when not in use.\n\n" "Hit Enter or hover mouse to show chat again."), "autohideChat", this, "autohideChatEvent"); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Protect chat focus"), - _("Enables aggressive protection of input focus in chat window.\n\n" + new SetupItemCheckBox(_("Protect chat focus"), + _("Enables aggressive protection of input focus in chat window.\n\n" "Note: no other text inputs will be allowed to receive text input " "when you typing in chat window."), "protectChatFocus", this, "protectChatFocusEvent"); @@ -65,7 +65,7 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemLabel(_("Colors"), "", this); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Remove colors from received chat messages"), + new SetupItemCheckBox(_("Remove colors from received chat messages"), _("Enable this setting to strip colors from incoming chat messages. " "All messages will use default chat text color if this enabled."), "removeColors", this, "removeColorsEvent"); @@ -96,13 +96,13 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemIntTextField(_("Limit max chars in chat line"), _("Limits how many characters will be shown in longest lines " "of text displayed in chat.\n\n" - "Note: long lines can make client slower. Lines longer than this " + "Note: long lines can make client slower. Lines longer than this " "limit will be truncated."), "chatMaxCharLimit", this, "chatMaxCharLimitEvent", 0, 500); // TRANSLATORS: settings option new SetupItemIntTextField(_("Limit max lines in chat"), - _("Limits how many lines chat will keep in scrollback buffer. Chat " + _("Limits how many lines chat will keep in scrollback buffer. Chat " "keeps specified number of last lines of text. Oldest lines exceeding " "this limit are discarded from scrollback buffer.\n\n" "Note: keeping too many lines in scroll buffer can slow client down."), @@ -118,14 +118,14 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : "Note: chat logs can take noticeable amount of disk space over time."), "enableChatLog", this, "enableChatLogEvent"); - // TODO: ask 4144 if popup description is correct. + // TODO: ask 4144 if popup description is correct. // TRANSLATORS: settings option new SetupItemCheckBox(_("Enable debug chat Log"), _("If you enable thus, debug chat tab also will be logged to disk."), "enableDebugLog", this, "enableDebugLogEvent"); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Show chat history"), + new SetupItemCheckBox(_("Show chat history"), _("If this setting enabled, client will load old chat tabs content " "from logs on startup instead of starting with empty chat tabs."), "showChatHistory", this, "showChatHistoryEvent"); @@ -149,7 +149,7 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemLabel(_("Messages"), "", this); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Hide shop messages"), + new SetupItemCheckBox(_("Hide shop messages"), _("If this setting enabled, no messages related to built-in ManaPlus" "shop will be displayed in chat. Disable this setting if you want " "to see shop-related messages.\n\nNote: technically, ManaPlus shop " @@ -195,15 +195,15 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : "serverMsgInDebug", this, "serverMsgInDebugEvent"); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Enable trade tab"), + new SetupItemCheckBox(_("Enable trade tab"), _("Enables trade tab. Trade tab is basically some filter. Messages " "containing words typical for trades will go to Trade tab. This " - "will make General tab less noisy. If this setting is disabled, all " + "will make General tab less noisy. If this setting is disabled, all " "trade related players messages will stay in General tab."), "enableTradeTab", this, "enableTradeTabEvent"); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Enable gm tab"), + new SetupItemCheckBox(_("Enable gm tab"), _("If enabled, GM tab will appear in chat. It displays text related " "GM activity.\n\nNote: this setting only makes difference for " "GMs (Game Masters) since this tab only appears for GMs."), @@ -224,7 +224,7 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : "showAllLang", this, "showAllLangEvent", false); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Enable battle tab"), + new SetupItemCheckBox(_("Enable battle tab"), _("If this setting enabled, Battle tab will appear in chat. This " "tab will contain messages related to battles, like damage and " "experience gain, if battle messages are enabled.\n\n" @@ -239,13 +239,14 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : "showBattleEvents", this, "showBattleEventsEvent"); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Resize chat tabs if need"), + new SetupItemCheckBox(_("Resize chat tabs if need"), _("If this feature enabled, text in chat will be automatically" "adjusted to adapt to appearance of chat input field when you" "typing message and when input field of chat disappears. If disabled, " "chat input area will allways occupy its place, which could be " "otherwise usable for text.\n\n" - "Note: its mostly about jumpy attitude vs less usable space for text."), + "Note: its mostly about jumpy attitude vs " + "less usable space for text."), "hideChatInput", this, "hideChatInputEvent"); @@ -253,7 +254,7 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemLabel(_("Time"), "", this); // TRANSLATORS: settings option - new SetupItemCheckBox(_("Use local time"), + new SetupItemCheckBox(_("Use local time"), _("If this feature enabled, timestamps in chat will use locak times." "If disabled, server time will be used (often it is GMT+0)."), "useLocalTime", this, "useLocalTimeEvent"); @@ -262,14 +263,14 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemLabel(_("Other"), "", this); // TRANSLATORS: settings option - new SetupItemTextField(_("Highlight words (separated by comma)"), - _("Here you can specify some extra words which will also cause " + new SetupItemTextField(_("Highlight words (separated by comma)"), + _("Here you can specify some extra words which will also cause " "highlighting. Use comma to separate words.\n\nNote: frequent" "hilights are annoying - use it with caution."), "highlightWords", this, "highlightWordsEvent"); // TRANSLATORS: settings option - new SetupItemTextField(_("Globals ignore names (separated by comma)"), + new SetupItemTextField(_("Globals ignore names (separated by comma)"), _("This setting allows you to ignore some global messages if " "particular sender (NPC, GM) annoys you too much. Global will be " "moved to Debug instead.\n\nNote: careless use of this feature can " diff --git a/src/gui/widgets/tabs/setup_quick.cpp b/src/gui/widgets/tabs/setup_quick.cpp index 699f20365..a85fdc0ca 100644 --- a/src/gui/widgets/tabs/setup_quick.cpp +++ b/src/gui/widgets/tabs/setup_quick.cpp @@ -31,14 +31,6 @@ #include "gui/widgets/setupquickitem.h" #include "gui/widgets/scrollarea.h" -#include "listeners/uploadlistener.h" - -#include "configuration.h" - -#include "resources/map/mapconsts.h" - -#include "net/net.h" - #include "utils/delete2.h" #include "utils/gettext.h" @@ -120,13 +112,3 @@ Setup_Quick::~Setup_Quick() delete2(mMoveTypeList); delete2(mCrazyMoveTypeList); } - -void Setup_Quick::apply() -{ - SetupTabScroll::apply(); - -} - -void Setup_Quick::externalUpdated() -{ -} diff --git a/src/gui/widgets/tabs/setup_quick.h b/src/gui/widgets/tabs/setup_quick.h index 307e89025..8ae95bb35 100644 --- a/src/gui/widgets/tabs/setup_quick.h +++ b/src/gui/widgets/tabs/setup_quick.h @@ -36,10 +36,6 @@ class Setup_Quick final : public SetupTabScroll ~Setup_Quick(); - void apply() override final; - - void externalUpdated() override final; - protected: NamesModel *mMoveTypeList; diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index fe644ac00..9f51e3583 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -181,7 +181,6 @@ CharSelectDialog::CharSelectDialog(LoginData *const data) : CharSelectDialog::~CharSelectDialog() { - //charServerHandler->clear(); } void CharSelectDialog::postInit() diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index 8f655bbca..b332b961e 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -28,7 +28,6 @@ #include "gui/windows/setupwindow.h" -#include "actormanager.h" #include "client.h" #include "game.h" @@ -37,8 +36,6 @@ #include "enums/being/attributes.h" -#include "resources/map/map.h" - #include "utils/gettext.h" #ifdef WIN32 diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 78e95be55..f5285e8ef 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -23,7 +23,6 @@ #include "net/ea/beinghandler.h" #include "actormanager.h" -#include "configuration.h" #include "game.h" #include "party.h" @@ -34,7 +33,6 @@ #include "gui/windows/botcheckerwindow.h" #include "gui/windows/socialwindow.h" -#include "gui/windows/killstats.h" #include "resources/mapitemtype.h" diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 1ff0e9035..b36bfa2e4 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -984,7 +984,7 @@ void ChatHandler::processChatRoomSettings(Net::MessageIn &msg) const int chatId = msg.readInt32("chat id"); const uint16_t limit = msg.readInt16("limit"); msg.readInt16("users"); - const uint16_t type = msg.readUInt8("type"); + const uint8_t type = msg.readUInt8("type"); const std::string &title = msg.readString(sz, "title"); ChatObject *const chat = localPlayer->getChat(); if (chat && chat->chatId == chatId) diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index 6d8e892e9..573b5212c 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -136,7 +136,8 @@ void LoginHandler::disconnect() } void LoginHandler::changePassword(const std::string &restrict oldPassword, - const std::string &restrict newPassword) const + const std::string &restrict newPassword) + const { if (!serverFeatures->haveChangePassword()) return; diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index aa0cb4f20..2a087ee6a 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -276,6 +276,7 @@ void PlayerHandler::changeAction(const BeingAction::Action &action) const type = 2; break; case BeingAction::STAND: + case BeingAction::PRESTAND: type = 3; break; default: diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 7ef97647e..580b4b3f2 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -34,7 +34,6 @@ #include "input/keyboardconfig.h" -#include "gui/windows/killstats.h" #include "gui/windows/outfitwindow.h" #include "gui/windows/socialwindow.h" diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 48f86daa9..cc11aa8ba 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -202,6 +202,7 @@ void PlayerHandler::changeAction(const BeingAction::Action &action) const type = 2; break; case BeingAction::STAND: + case BeingAction::PRESTAND: type = 3; break; default: diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index b99c967d8..34a1937a5 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -202,7 +202,7 @@ void Dye::normalDye(uint32_t *restrict pixels, const int bufSize) const | (color[2] << 8) | alpha; #endif } -endlabel:; +endlabel:{} } #else // ENABLE_CILKPLUS @@ -317,7 +317,7 @@ void Dye::normalOGLDye(uint32_t *restrict pixels, const int bufSize) const | (color[2] << 16) | alpha; #endif } -endlabel:; +endlabel:{} } #else // ENABLE_CILKPLUS diff --git a/src/resources/dyepalette.cpp b/src/resources/dyepalette.cpp index 9bc5aef7c..44049997a 100644 --- a/src/resources/dyepalette.cpp +++ b/src/resources/dyepalette.cpp @@ -223,7 +223,6 @@ void DyePalette::replaceSColor(uint32_t *restrict pixels, if (!alpha) { // logger->log("skip: %08x", *pixels); - //continue; } else { diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index 74447af7e..b6acf017a 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -470,15 +470,19 @@ int TestLauncher::testDyeSpeed() for (int f = 0; f < sz; f ++) buf[f] = f; +#if defined __linux__ || defined __linux clock_gettime(CLOCK_MONOTONIC, &time1); for (int f = 0; f < 1000; f ++) pal.replaceSColor(buf, sz); clock_gettime(CLOCK_MONOTONIC, &time2); - long diff = ((static_cast<long long int>(time2.tv_sec) * 1000000000LL + static_cast<long long int>(time2.tv_nsec)) / 1) - - ((static_cast<long long int>(time1.tv_sec) * 1000000000LL + static_cast<long long int>(time1.tv_nsec)) / 1); + long diff = ((static_cast<long int>(time2.tv_sec) * 1000000000L + + static_cast<long int>(time2.tv_nsec)) / 1) - + ((static_cast<long int>(time1.tv_sec) * 1000000000L + + static_cast<long int>(time1.tv_nsec)) / 1); printf("time: %ld\n", diff); +#endif return 0; } |