diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-30 01:19:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-30 13:11:34 +0300 |
commit | 6b1684d33dec02eb6308bb3d8d3707f4d5252ba5 (patch) | |
tree | 4a0a5fd220828b92ef96446fe38dbe67ff446c6c /src/gui | |
parent | 2a70a50c785ce639b76141a3a6887836d22fe12c (diff) | |
download | plus-6b1684d33dec02eb6308bb3d8d3707f4d5252ba5.tar.gz plus-6b1684d33dec02eb6308bb3d8d3707f4d5252ba5.tar.bz2 plus-6b1684d33dec02eb6308bb3d8d3707f4d5252ba5.tar.xz plus-6b1684d33dec02eb6308bb3d8d3707f4d5252ba5.zip |
Add unused warnings to some files.
Diffstat (limited to 'src/gui')
35 files changed, 168 insertions, 151 deletions
diff --git a/src/gui/buydialog.h b/src/gui/buydialog.h index c3f061af4..3b1b05d4d 100644 --- a/src/gui/buydialog.h +++ b/src/gui/buydialog.h @@ -92,7 +92,7 @@ class BuyDialog final : public Window, /** * Returns the number of items in the shop inventory. */ - int getNumberOfElements(); + int getNumberOfElements() A_WARN_UNUSED; /** * Updates the labels according to the selected item. @@ -112,7 +112,7 @@ class BuyDialog final : public Window, /** * Returns true if any instances exist. */ - static bool isActive() + static bool isActive() A_WARN_UNUSED { return !instances.empty(); } /** diff --git a/src/gui/buyselldialog.h b/src/gui/buyselldialog.h index 0d43563f7..c0aa1f643 100644 --- a/src/gui/buyselldialog.h +++ b/src/gui/buyselldialog.h @@ -63,7 +63,7 @@ class BuySellDialog final : public Window, public gcn::ActionListener /** * Returns true if any instances exist. */ - static bool isActive() + static bool isActive() A_WARN_UNUSED { return !instances.empty(); } /** diff --git a/src/gui/charcreatedialog.h b/src/gui/charcreatedialog.h index d2bd57c61..d15812484 100644 --- a/src/gui/charcreatedialog.h +++ b/src/gui/charcreatedialog.h @@ -80,14 +80,14 @@ class CharCreateDialog final : public Window, void keyPressed(gcn::KeyEvent &keyEvent) override; private: - int getDistributedPoints() const; + int getDistributedPoints() const A_WARN_UNUSED; void updateSliders(); /** * Returns the name of the character to create. */ - std::string getName() const; + std::string getName() const A_WARN_UNUSED; /** * Communicate character creation to the server. diff --git a/src/gui/charselectdialog.h b/src/gui/charselectdialog.h index 82b1cae0d..6e819da47 100644 --- a/src/gui/charselectdialog.h +++ b/src/gui/charselectdialog.h @@ -102,7 +102,7 @@ class CharSelectDialog final : public Window, void unlock(); void setLocked(const bool locked); - bool getFocusedContainer(int &container, int &idx); + bool getFocusedContainer(int &container, int &idx) A_WARN_UNUSED; void setFocusedContainer(const int i, const int button); diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index 911b1b1ff..6ffd039ab 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -107,7 +107,7 @@ class ChatWindow final : public Window, /** * Gets the focused tab. */ - ChatTab *getFocused() const; + ChatTab *getFocused() const A_WARN_UNUSED; /** * Clear the given tab. @@ -155,7 +155,7 @@ class ChatWindow final : public Window, /** * Checks whether ChatWindow is Focused or not. */ - bool isInputFocused() const; + bool isInputFocused() const A_WARN_UNUSED; /** * Passes the text to the current tab as input @@ -215,7 +215,7 @@ class ChatWindow final : public Window, */ void setRecordingFile(const std::string &msg); - bool getReturnTogglesChat() const + bool getReturnTogglesChat() const A_WARN_UNUSED { return mReturnToggles; } void setReturnTogglesChat(const bool toggles) @@ -227,9 +227,9 @@ class ChatWindow final : public Window, const Own own = BY_OTHER); WhisperTab *addWhisperTab(const std::string &nick, - const bool switchTo = false); + const bool switchTo = false) A_WARN_UNUSED; - WhisperTab *getWhisperTab(const std::string &nick) const; + WhisperTab *getWhisperTab(const std::string &nick) const A_WARN_UNUSED; void removeAllWhispers(); @@ -253,7 +253,7 @@ class ChatWindow final : public Window, void loadGMCommands(); - std::string doReplace(const std::string &msg) const; + std::string doReplace(const std::string &msg) const A_WARN_UNUSED; void adjustTabSize(); @@ -266,7 +266,7 @@ class ChatWindow final : public Window, void parseHighlights(); - bool findHighlight(const std::string &str); + bool findHighlight(const std::string &str) A_WARN_UNUSED; void copyToClipboard(const int x, const int y) const; diff --git a/src/gui/editdialog.h b/src/gui/editdialog.h index 4d32c1ff9..3c9a0948b 100644 --- a/src/gui/editdialog.h +++ b/src/gui/editdialog.h @@ -58,7 +58,7 @@ class EditDialog final : public Window, public gcn::ActionListener */ void action(const gcn::ActionEvent &event) override; - std::string getMsg() const + std::string getMsg() const A_WARN_UNUSED { return mTextField->getText(); } private: diff --git a/src/gui/editserverdialog.h b/src/gui/editserverdialog.h index 722c0a009..a5a998ab8 100644 --- a/src/gui/editserverdialog.h +++ b/src/gui/editserverdialog.h @@ -49,7 +49,7 @@ class TypeListModel : public gcn::ListModel /** * Used to get number of line in the list */ - int getNumberOfElements() override + int getNumberOfElements() override A_WARN_UNUSED #ifdef EATHENA_SUPPORT #ifdef MANASERV_SUPPORT { return 4; } @@ -67,7 +67,7 @@ class TypeListModel : public gcn::ListModel /** * Used to get an element from the list */ - std::string getElementAt(int elementIndex) override; + std::string getElementAt(int elementIndex) override A_WARN_UNUSED; }; /** diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 3fa5f68cf..6d7baff40 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -429,7 +429,7 @@ void EquipmentWindow::loadSlot(const XmlNodePtr slotNode, mMaxY = y + mBoxSize; } -int EquipmentWindow::parseSlotName(std::string name) const +int EquipmentWindow::parseSlotName(const std::string &name) const { int id = -1; if (name == "shoes" || name == "boot" || name == "boots") diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h index c8cc36fbd..d79ff950f 100644 --- a/src/gui/equipmentwindow.h +++ b/src/gui/equipmentwindow.h @@ -88,7 +88,7 @@ class EquipmentWindow final : public Window, public gcn::ActionListener void mousePressed(gcn::MouseEvent& mouseEvent) override; - Item* getEquipment(int i) const + Item* getEquipment(int i) const A_WARN_UNUSED { return mEquipment ? mEquipment->getEquipment(i) : nullptr; } void setBeing(Being *const being); @@ -104,7 +104,7 @@ class EquipmentWindow final : public Window, public gcn::ActionListener void recalcSize(); private: - Item *getItem(const int x, const int y) const; + Item *getItem(const int x, const int y) const A_WARN_UNUSED; void setSelected(const int index); @@ -121,7 +121,7 @@ class EquipmentWindow final : public Window, public gcn::ActionListener void loadSlot(const XmlNodePtr slotNode, const ImageSet *const imageset); - int parseSlotName(std::string name) const; + int parseSlotName(const std::string &name) const A_WARN_UNUSED; Equipment *mEquipment; diff --git a/src/gui/gui.h b/src/gui/gui.h index e8969d666..74c5404aa 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -84,38 +84,38 @@ class Gui final : public gcn::Gui */ void videoResized() const; - gcn::FocusHandler *getFocusHandler() const + gcn::FocusHandler *getFocusHandler() const A_WARN_UNUSED { return mFocusHandler; } /** * Return game font. */ - SDLFont *getFont() const + SDLFont *getFont() const A_WARN_UNUSED { return mGuiFont; } /** * Return help font. */ - SDLFont *getHelpFont() const + SDLFont *getHelpFont() const A_WARN_UNUSED { return mHelpFont; } /** * Return secure font. */ - SDLFont *getSecureFont() const + SDLFont *getSecureFont() const A_WARN_UNUSED { return mSecureFont; } /** * Return npc font. */ - SDLFont *getNpcFont() const + SDLFont *getNpcFont() const A_WARN_UNUSED { return mNpcFont; } /** * Return the Font used for "Info Particles", i.e. ones showing, what * you picked up, etc. */ - SDLFont *getInfoParticleFont() const + SDLFont *getInfoParticleFont() const A_WARN_UNUSED { return mInfoParticleFont; } /** @@ -137,7 +137,7 @@ class Gui final : public gcn::Gui void resetClickCount(); - MouseEvent *createMouseEvent(Window *widget); + MouseEvent *createMouseEvent(Window *widget) A_WARN_UNUSED; void getAbsolutePosition(gcn::Widget *widget, int &x, int &y); diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 2340e60ed..426a4f6ee 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -79,7 +79,7 @@ class InventoryWindow final : public Window, /** * Returns the selected item. */ - Item* getSelectedItem() const; + Item* getSelectedItem() const A_WARN_UNUSED; /** * Unselect item @@ -124,13 +124,13 @@ class InventoryWindow final : public Window, void slotsChanged(Inventory *const inventory); - bool isMainInventory() const + bool isMainInventory() const A_WARN_UNUSED { return mInventory->isMainInventory(); } /** * Returns true if any instances exist. */ - static bool isStorageActive() + static bool isStorageActive() A_WARN_UNUSED { return instances.size() > 1; } void updateDropButton(); @@ -140,7 +140,7 @@ class InventoryWindow final : public Window, void updateButtons(const Item *item = nullptr); - bool isInputFocused() const; + bool isInputFocused() const A_WARN_UNUSED; void widgetResized(const gcn::Event &event) override; diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp index eb0471aeb..234218e8c 100644 --- a/src/gui/ministatuswindow.cpp +++ b/src/gui/ministatuswindow.cpp @@ -134,8 +134,9 @@ MiniStatusWindow::~MiniStatusWindow() ProgressBar *MiniStatusWindow::createBar(const float progress, const int width, const int height, - const int color, std::string name, - std::string description) + const int color, + const std::string &name, + const std::string &description) { ProgressBar *const bar = new ProgressBar(this, progress, width, height, color); diff --git a/src/gui/ministatuswindow.h b/src/gui/ministatuswindow.h index 36acb7fb9..16d010669 100644 --- a/src/gui/ministatuswindow.h +++ b/src/gui/ministatuswindow.h @@ -84,17 +84,18 @@ class MiniStatusWindow final : public Popup, void slotsChanged(Inventory *const inventory); - std::vector <ProgressBar*> &getBars() + std::vector <ProgressBar*> &getBars() A_WARN_UNUSED { return mBars; } - gcn::Rectangle getChildrenArea(); + gcn::Rectangle getChildrenArea() A_WARN_UNUSED; private: bool isInBar(ProgressBar *bar, int x, int y) const; ProgressBar *createBar(const float progress, const int width, const int height, const int color, - std::string name, std::string description); + const std::string &name, + const std::string &description) A_WARN_UNUSED; void loadBars(); diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index a3e9eec9c..79999aa07 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -110,17 +110,17 @@ class NpcDialog final : public Window, public gcn::ActionListener, /** * Returns the number of items in the choices list. */ - int getNumberOfElements() override; + int getNumberOfElements() override A_WARN_UNUSED; /** * Returns the name of item number i of the choices list. */ - std::string getElementAt(int i) override; + std::string getElementAt(int i) override A_WARN_UNUSED; /** * Returns the image of item number i of the choices list. */ - const Image *getImageAt(int i) override; + const Image *getImageAt(int i) override A_WARN_UNUSED; /** * Makes this dialog request a choice selection from the user. @@ -144,11 +144,11 @@ class NpcDialog final : public Window, public gcn::ActionListener, */ void textRequest(const std::string &defaultText = ""); - bool isInputFocused() const; + bool isInputFocused() const A_WARN_UNUSED; - bool isTextInputFocused() const; + bool isTextInputFocused() const A_WARN_UNUSED; - static bool isAnyInputFocused(); + static bool isAnyInputFocused() A_WARN_UNUSED; /** * Requests a interger from the user. @@ -165,14 +165,14 @@ class NpcDialog final : public Window, public gcn::ActionListener, /** * Returns true if any instances exist. */ - static bool isActive() + static bool isActive() A_WARN_UNUSED { return !instances.empty(); } /** * Returns the first active instance. Useful for pushing user * interaction. */ - static NpcDialog *getActive(); + static NpcDialog *getActive() A_WARN_UNUSED; /** * Closes all instances. diff --git a/src/gui/npcpostdialog.h b/src/gui/npcpostdialog.h index 8e2bdd588..71dffb2f6 100644 --- a/src/gui/npcpostdialog.h +++ b/src/gui/npcpostdialog.h @@ -52,7 +52,7 @@ public: /** * Returns true if any instances exist. */ - static bool isActive() + static bool isActive() A_WARN_UNUSED { return !instances.empty(); } /** diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h index e6e910042..c70d97fa6 100644 --- a/src/gui/outfitwindow.h +++ b/src/gui/outfitwindow.h @@ -74,7 +74,7 @@ class OutfitWindow final : public Window, private gcn::ActionListener void setItemSelected(const Item *const item); - bool isItemSelected() const + bool isItemSelected() const A_WARN_UNUSED { return mItemSelected > 0; } void wearOutfit(const int outfit, const bool unwearEmpty = true, @@ -104,7 +104,7 @@ class OutfitWindow final : public Window, private gcn::ActionListener void showCurrentOutfit(); - std::string keyName(const int number) const; + std::string keyName(const int number) const A_WARN_UNUSED; void clearCurrentOutfit(); @@ -117,7 +117,8 @@ class OutfitWindow final : public Window, private gcn::ActionListener CheckBox *mAwayOutfitCheck; Label *mKeyLabel; - int getIndexFromGrid(const int pointX, const int pointY) const; + int getIndexFromGrid(const int pointX, + const int pointY) const A_WARN_UNUSED; int mBoxWidth; int mBoxHeight; diff --git a/src/gui/palette.h b/src/gui/palette.h index f18e4ed38..e36f59aae 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -67,9 +67,9 @@ class Palette * * @return the requested color or Palette::BLACK */ - const gcn::Color &getCharColor(const signed char c, bool &valid); + const gcn::Color &getCharColor(const signed char c, bool &valid) A_WARN_UNUSED; - int getIdByChar(const signed char c, bool &valid); + int getIdByChar(const signed char c, bool &valid) A_WARN_UNUSED; /** * Gets the color associated with the type. Sets the alpha channel @@ -80,7 +80,7 @@ class Palette * * @return the requested color */ - inline const gcn::Color &getColor(int type, int alpha = 255) + inline const gcn::Color &getColor(int type, int alpha = 255) A_WARN_UNUSED { if (type >= static_cast<signed>(mColors.size()) || type < 0) { @@ -93,7 +93,7 @@ class Palette return *col; } - inline const gcn::Color &getColorWithAlpha(int type) + inline const gcn::Color &getColorWithAlpha(int type) A_WARN_UNUSED { gcn::Color* col = &mColors[type].color; col->a = mColors[type].delay; @@ -107,7 +107,7 @@ class Palette * * @return the gradient type of the color with the given index */ - inline GradientType getGradientType(int type) const + inline GradientType getGradientType(int type) const A_WARN_UNUSED { return mColors[type].grad; } /** @@ -117,7 +117,7 @@ class Palette * * @return the color char of the color with the given index */ - inline char getColorChar(int type) const + inline char getColorChar(int type) const A_WARN_UNUSED { return mColors[type].ch; } /** @@ -127,7 +127,7 @@ class Palette * * @return the gradient delay of the color with the given index */ - inline int getGradientDelay(int type) const + inline int getGradientDelay(int type) const A_WARN_UNUSED { return mColors[type].delay; } /** @@ -135,7 +135,8 @@ class Palette */ static void advanceGradients(); - static gcn::Color produceHPColor(int hp, int maxHp, int alpha = 255); + static gcn::Color produceHPColor(int hp, int maxHp, + int alpha = 255) A_WARN_UNUSED; protected: /** Colors used for the rainbow gradient */ @@ -200,7 +201,7 @@ class Palette gradientIndex = rand(); } - inline int getRGB() const + inline int getRGB() const A_WARN_UNUSED { return (committedColor.r << 16) | (committedColor.g << 8) | committedColor.b; diff --git a/src/gui/registerdialog.h b/src/gui/registerdialog.h index 7d375c691..0c7cf9f77 100644 --- a/src/gui/registerdialog.h +++ b/src/gui/registerdialog.h @@ -20,8 +20,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef REGISTER_H -#define REGISTER_H +#ifndef REGISTERDIALOG_H +#define REGISTERDIALOG_H #include "gui/widgets/window.h" diff --git a/src/gui/sdlfont.h b/src/gui/sdlfont.h index 818ef7541..3086abf0a 100644 --- a/src/gui/sdlfont.h +++ b/src/gui/sdlfont.h @@ -69,11 +69,11 @@ class SDLFont final : public gcn::Font void createSDLTextChunk(SDLTextChunk *const chunk); - virtual int getWidth(const std::string &text) const; + virtual int getWidth(const std::string &text) const A_WARN_UNUSED; - virtual int getHeight() const; + virtual int getHeight() const A_WARN_UNUSED; - std::list<SDLTextChunk> *getCache() + std::list<SDLTextChunk> *getCache() A_WARN_UNUSED { return mCache; } /** @@ -89,10 +89,10 @@ class SDLFont final : public gcn::Font void slowLogic(); - int getCreateCounter() const + int getCreateCounter() const A_WARN_UNUSED { return mCreateCounter; } - int getDeleteCounter() const + int getDeleteCounter() const A_WARN_UNUSED { return mDeleteCounter; } private: diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h index cb9e50f30..c3b0d14e7 100644 --- a/src/gui/sdlinput.h +++ b/src/gui/sdlinput.h @@ -155,18 +155,18 @@ public: virtual void _pollInput() { } - virtual KeyInput dequeueKeyInput2(); + virtual KeyInput dequeueKeyInput2() A_WARN_UNUSED; - virtual gcn::KeyInput dequeueKeyInput() + virtual gcn::KeyInput dequeueKeyInput() A_WARN_UNUSED { return gcn::KeyInput(); } // Inherited from Input - virtual bool isKeyQueueEmpty(); + virtual bool isKeyQueueEmpty() A_WARN_UNUSED; - virtual bool isMouseQueueEmpty(); + virtual bool isMouseQueueEmpty() A_WARN_UNUSED; - virtual gcn::MouseInput dequeueMouseInput(); + virtual gcn::MouseInput dequeueMouseInput() A_WARN_UNUSED; protected: /** @@ -176,7 +176,7 @@ protected: * @param button an SDL mouse button. * @return a Guichan mouse button. */ - static int convertMouseButton(const int button); + static int convertMouseButton(const int button) A_WARN_UNUSED; /** * Converts an SDL event key to a key value. @@ -185,7 +185,7 @@ protected: * @return a key value. * @see Key */ - static int convertKeyCharacter(const SDL_Event &event); + static int convertKeyCharacter(const SDL_Event &event) A_WARN_UNUSED; std::queue<KeyInput> mKeyInputQueue; std::queue<gcn::MouseInput> mMouseInputQueue; diff --git a/src/gui/selldialog.h b/src/gui/selldialog.h index 2e257ec52..447665bf7 100644 --- a/src/gui/selldialog.h +++ b/src/gui/selldialog.h @@ -107,7 +107,7 @@ class SellDialog final : public Window, /** * Returns true if any instances exist. */ - static bool isActive() + static bool isActive() A_WARN_UNUSED { return !instances.empty(); } /** diff --git a/src/gui/serverdialog.h b/src/gui/serverdialog.h index 0e5764865..740c35a95 100644 --- a/src/gui/serverdialog.h +++ b/src/gui/serverdialog.h @@ -63,17 +63,17 @@ class ServersListModel final : public gcn::ListModel /** * Used to get number of line in the list */ - int getNumberOfElements() override; + int getNumberOfElements() override A_WARN_UNUSED; /** * Used to get an element from the list */ - std::string getElementAt(int elementIndex) override; + std::string getElementAt(int elementIndex) override A_WARN_UNUSED; /** * Used to get the corresponding Server struct */ - const ServerInfo &getServer(const int elementIndex) const + const ServerInfo &getServer(const int elementIndex) const A_WARN_UNUSED { return mServers->at(elementIndex); } void setVersionString(const int index, const std::string &version); diff --git a/src/gui/setup_input.h b/src/gui/setup_input.h index 188be4a26..186c094be 100644 --- a/src/gui/setup_input.h +++ b/src/gui/setup_input.h @@ -32,6 +32,7 @@ class Button; class ListBox; +class KeyListModel; class TabStrip; struct SetupActionData; @@ -77,9 +78,9 @@ class Setup_Input final : public SetupTab */ void keyUnresolved(); - int keyToSetupData(const int index) const; + int keyToSetupData(const int index) const A_WARN_UNUSED; - std::string keyToString(const int index) const; + std::string keyToString(const int index) const A_WARN_UNUSED; private: void fixTranslations() const; @@ -88,7 +89,7 @@ class Setup_Input final : public SetupTab const int actionStart, const int actionEnd, const std::string &text) const; - class KeyListModel *mKeyListModel; + KeyListModel *mKeyListModel; ListBox *mKeyList; Button *mAssignKeyButton; diff --git a/src/gui/shopwindow.h b/src/gui/shopwindow.h index b04a3a474..90fd09b6c 100644 --- a/src/gui/shopwindow.h +++ b/src/gui/shopwindow.h @@ -90,7 +90,7 @@ class ShopWindow final : public Window, public gcn::ActionListener, /** * Returns true if any instances exist. */ - static bool isActive() + static bool isActive() A_WARN_UNUSED { return !instances.empty(); } void setItemSelected(const int id) @@ -113,7 +113,7 @@ class ShopWindow final : public Window, public gcn::ActionListener, void setAcceptPlayer(std::string name) { mAcceptPlayer = name; } - const std::string &getAcceptPlayer() const + const std::string &getAcceptPlayer() const A_WARN_UNUSED { return mAcceptPlayer; } void sendMessage(const std::string &nick, std::string data, @@ -124,15 +124,16 @@ class ShopWindow final : public Window, public gcn::ActionListener, void processRequest(std::string nick, std::string data, const int mode); - bool findShopItem(const ShopItem *const shopItem, const int mode); + bool findShopItem(const ShopItem *const shopItem, + const int mode) A_WARN_UNUSED; - static int sumAmount(const Item *const shopItem); + static int sumAmount(const Item *const shopItem) A_WARN_UNUSED; void updateTimes(); - bool checkFloodCounter(int &counterTime) const; + bool checkFloodCounter(int &counterTime) const A_WARN_UNUSED; - bool isShopEmpty() const; + bool isShopEmpty() const A_WARN_UNUSED; private: void startTrade(); diff --git a/src/gui/shortcutwindow.h b/src/gui/shortcutwindow.h index e87d4706e..f5d0fbab3 100644 --- a/src/gui/shortcutwindow.h +++ b/src/gui/shortcutwindow.h @@ -57,7 +57,7 @@ class ShortcutWindow final : public Window void addTab(std::string name, ShortcutContainer *const content); - int getTabIndex() const; + int getTabIndex() const A_WARN_UNUSED; void widgetHidden(const gcn::Event &event) override; diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index ccbb20064..6b33207b7 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -114,9 +114,9 @@ class SkillDialog final : public Window, public gcn::ActionListener void addSkill(const int id, const int level, const int range, const bool modifiable); - SkillInfo* getSkill(int id); + SkillInfo* getSkill(int id) A_WARN_UNUSED; - bool hasSkills() const + bool hasSkills() const A_WARN_UNUSED { return !mSkills.empty(); } void widgetResized(const gcn::Event &event) override; diff --git a/src/gui/socialwindow.h b/src/gui/socialwindow.h index 06d00b9f0..20e4861d0 100644 --- a/src/gui/socialwindow.h +++ b/src/gui/socialwindow.h @@ -93,7 +93,7 @@ public: void updatePortalNames(); - int getPortalIndex(const int x, const int y); + int getPortalIndex(const int x, const int y) A_WARN_UNUSED; void addPortal(const int x, const int y); @@ -103,13 +103,13 @@ public: void prevTab(); - Map* getMap() const + Map* getMap() const A_WARN_UNUSED { return mMap; } void setMap(Map *const map) { mMap = map; mProcessedPortals = false; } - bool getProcessedPortals() const + bool getProcessedPortals() const A_WARN_UNUSED { return mProcessedPortals; } void setProcessedPortals(const bool n) diff --git a/src/gui/textdialog.h b/src/gui/textdialog.h index 7f3f7119f..07aa22bf6 100644 --- a/src/gui/textdialog.h +++ b/src/gui/textdialog.h @@ -59,11 +59,11 @@ public: /** * Get the text in the textfield */ - const std::string &getText() const; + const std::string &getText() const A_WARN_UNUSED; void setText(std::string text); - static bool isActive() + static bool isActive() A_WARN_UNUSED { return instances; } void close(); diff --git a/src/gui/theme.h b/src/gui/theme.h index 5cf1a50f4..a19e93812 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -64,55 +64,55 @@ class Skin final * name if a dialog for skin selection for a specific window type is * done. */ - const std::string &getName() const + const std::string &getName() const A_WARN_UNUSED { return mName; } /** * Returns the skin's xml file path. */ - const std::string &getFilePath() const + const std::string &getFilePath() const A_WARN_UNUSED { return mFilePath; } /** * Returns the background skin. */ - ImageRect &getBorder() const + ImageRect &getBorder() const A_WARN_UNUSED { return *mBorder; } /** * Returns the image used by a close button for this skin. */ - Image *getCloseImage(const bool state) const + Image *getCloseImage(const bool state) const A_WARN_UNUSED { return state ? mCloseImageHighlighted : mCloseImage; } /** * Returns the image used by a sticky button for this skin. */ - Image *getStickyImage(const bool state) const + Image *getStickyImage(const bool state) const A_WARN_UNUSED { return state ? mStickyImageDown : mStickyImageUp; } /** * Returns the minimum width which can be used with this skin. */ - int getMinWidth() const; + int getMinWidth() const A_WARN_UNUSED; /** * Returns the minimum height which can be used with this skin. */ - int getMinHeight() const; + int getMinHeight() const A_WARN_UNUSED; /** * Updates the alpha value of the skin */ void updateAlpha(const float minimumOpacityAllowed = 0.0f); - int getPadding() const + int getPadding() const A_WARN_UNUSED { return mPadding; } - int getTitlePadding() const + int getTitlePadding() const A_WARN_UNUSED { return mTitlePadding; } - int getOption(const std::string &name) const + int getOption(const std::string &name) const A_WARN_UNUSED { if (mOptions->find(name) != mOptions->end()) return (*mOptions)[name]; @@ -120,7 +120,8 @@ class Skin final return 0; } - int getOption(const std::string &name, const int def) const + int getOption(const std::string &name, + const int def) const A_WARN_UNUSED { if (mOptions->find(name) != mOptions->end()) return (*mOptions)[name]; @@ -148,7 +149,7 @@ class Theme final : public Palette, public ConfigListener public: A_DELETE_COPY(Theme) - static Theme *instance(); + static Theme *instance() A_WARN_UNUSED; static void deleteInstance(); @@ -156,10 +157,10 @@ class Theme final : public Palette, public ConfigListener static void selectSkin(); - static std::string getThemePath() + static std::string getThemePath() A_WARN_UNUSED { return mThemePath; } - static std::string getThemeName() + static std::string getThemeName() A_WARN_UNUSED { return mThemeName; } static void fillSkinsList(StringVect &list); @@ -172,16 +173,19 @@ class Theme final : public Palette, public ConfigListener * Returns the patch to the given gui resource relative to the theme * or, if it isn't in the theme, relative to 'graphics/gui'. */ - static std::string resolveThemePath(const std::string &path); + static std::string resolveThemePath(const std::string &path) + A_WARN_UNUSED; - static Image *getImageFromTheme(const std::string &path); + static Image *getImageFromTheme(const std::string &path) A_WARN_UNUSED; static ImageSet *getImageSetFromTheme(const std::string &path, - const int w, const int h); + const int w, + const int h) A_WARN_UNUSED; ImageSet *getImageSetFromThemeXml(const std::string &name, const std::string &name2, - const int w, const int h) const; + const int w, + const int h) const A_WARN_UNUSED; enum ThemePalette { BROWSERBOX = 0, @@ -298,28 +302,30 @@ class Theme final : public Palette, public ConfigListener */ inline static const gcn::Color &getThemeColor(const int type, const int alpha = 255) + A_WARN_UNUSED { return mInstance->getColor(type, alpha); } static const gcn::Color &getThemeCharColor(const signed char c, - bool &valid) + bool &valid) A_WARN_UNUSED { return mInstance->getCharColor(c, valid); } - static int getThemeIdByChar(const signed char c, bool &valid) + static int getThemeIdByChar(const signed char c, + bool &valid) A_WARN_UNUSED { return mInstance->getIdByChar(c, valid); } static gcn::Color getProgressColor(const int type, - const float progress); + const float progress) A_WARN_UNUSED; /** * Loads a skin. */ Skin *load(const std::string &filename, const std::string &filename2, const bool full = true, const std::string - &defaultPath = getThemePath()); + &defaultPath = getThemePath()) A_WARN_UNUSED; Skin *loadSkinRect(ImageRect &image, const std::string &name, const std::string &name2, const int start = 0, - const int end = 8); + const int end = 8) A_WARN_UNUSED; void unload(Skin *const skin); @@ -331,7 +337,7 @@ class Theme final : public Palette, public ConfigListener /** * Get the minimum opacity allowed to skins. */ - float getMinimumOpacity() const + float getMinimumOpacity() const A_WARN_UNUSED { return mMinimumOpacity; } /** @@ -350,16 +356,18 @@ class Theme final : public Palette, public ConfigListener const int end = 8) const; static Image *getImageFromThemeXml(const std::string &name, - const std::string &name2); + const std::string &name2) + A_WARN_UNUSED; - static ThemeInfo *loadInfo(const std::string &themeName); + static ThemeInfo *loadInfo(const std::string &themeName) A_WARN_UNUSED; private: Theme(); ~Theme(); - Skin *readSkin(const std::string &filename0, const bool full); + Skin *readSkin(const std::string &filename0, + const bool full) A_WARN_UNUSED; // Map containing all window skins typedef std::map<std::string, Skin*> Skins; @@ -371,7 +379,7 @@ class Theme final : public Palette, public ConfigListener static std::string mThemeName; static Theme *mInstance; - static bool tryThemePath(std::string themePath); + static bool tryThemePath(std::string themePath) A_WARN_UNUSED; void loadColors(std::string file = ""); diff --git a/src/gui/tradewindow.h b/src/gui/tradewindow.h index 1763771f3..4636a41e9 100644 --- a/src/gui/tradewindow.h +++ b/src/gui/tradewindow.h @@ -137,12 +137,12 @@ class TradeWindow final : public Window, void initTrade(std::string nick); - std::string getAutoTradeNick() const + std::string getAutoTradeNick() const A_WARN_UNUSED { return mAutoAddToNick; } - bool checkItem(const Item *const item) const; + bool checkItem(const Item *const item) const A_WARN_UNUSED; - bool isInpupFocused() const; + bool isInpupFocused() const A_WARN_UNUSED; private: enum Status diff --git a/src/gui/updaterwindow.h b/src/gui/updaterwindow.h index d4fc1257e..1eb2c38f9 100644 --- a/src/gui/updaterwindow.h +++ b/src/gui/updaterwindow.h @@ -151,7 +151,7 @@ private: void *stream); static bool validateFile(const std::string &filePath, - const unsigned long hash); + const unsigned long hash) A_WARN_UNUSED; enum UpdateDownloadStatus { diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h index 1242554d7..43decd601 100644 --- a/src/gui/userpalette.h +++ b/src/gui/userpalette.h @@ -98,7 +98,8 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the requested committed color */ - inline const gcn::Color &getCommittedColor(const int type) const + inline const gcn::Color &getCommittedColor(const int type) + const A_WARN_UNUSED { return mColors[type].committedColor; } @@ -110,7 +111,8 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the requested test color */ - inline const gcn::Color &getTestColor(const int type) const + inline const gcn::Color &getTestColor(const int type) + const A_WARN_UNUSED { return mColors[type].testColor; } /** @@ -152,7 +154,7 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the number of colors known */ - inline int getNumberOfElements() override + inline int getNumberOfElements() override A_WARN_UNUSED { return static_cast<int>(mColors.size()); } /** @@ -162,7 +164,7 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the name of the color */ - std::string getElementAt(int i) override; + std::string getElementAt(int i) override A_WARN_UNUSED; /** * Commit the colors @@ -183,7 +185,7 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the color type of the color with the given index */ - int getColorTypeAt(int i); + int getColorTypeAt(int i) A_WARN_UNUSED; private: /** @@ -212,7 +214,8 @@ class UserPalette final : public Palette, public gcn::ListModel * * @return the transformed string */ - static std::string getConfigName(const std::string &typeName); + static std::string getConfigName(const std::string &typeName) + A_WARN_UNUSED; /** * Initialise color diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 2803b1b97..c370f1e3b 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -196,25 +196,25 @@ class Viewport final : public WindowContainer, /** * Returns camera x offset in pixels. */ - int getCameraX() const + int getCameraX() const A_WARN_UNUSED { return mPixelViewX; } /** * Returns camera y offset in pixels. */ - int getCameraY() const + int getCameraY() const A_WARN_UNUSED { return mPixelViewY; } /** * Returns mouse x in pixels. */ - int getMouseX() const + int getMouseX() const A_WARN_UNUSED { return mMouseX; } /** * Returns mouse y in pixels. */ - int getMouseY() const + int getMouseY() const A_WARN_UNUSED { return mMouseY; } /** @@ -226,16 +226,16 @@ class Viewport final : public WindowContainer, /** * Returns the current map object. */ - Map *getCurrentMap() const + Map *getCurrentMap() const A_WARN_UNUSED { return mMap; } - int getDebugPath() const + int getDebugPath() const A_WARN_UNUSED { return mShowDebugPath; } void setDebugPath(const int n) { mShowDebugPath = n; } - int getCameraMode() const + int getCameraMode() const A_WARN_UNUSED { return mCameraMode; } /** @@ -248,15 +248,15 @@ class Viewport final : public WindowContainer, */ void cleanHoverItems(); - Map *getMap() const + Map *getMap() const A_WARN_UNUSED { return mMap; } void moveCamera(const int dx, const int dy); - int getCameraRelativeX() const + int getCameraRelativeX() const A_WARN_UNUSED { return mCameraRelativeX; } - int getCameraRelativeY() const + int getCameraRelativeY() const A_WARN_UNUSED { return mCameraRelativeY; } void setCameraRelativeX(const int n) @@ -265,7 +265,7 @@ class Viewport final : public WindowContainer, void setCameraRelativeY(const int n) { mCameraRelativeY = n; } - bool isPopupMenuVisible() const; + bool isPopupMenuVisible() const A_WARN_UNUSED; void moveCameraToActor(const int actorId, const int x = 0, const int y = 0); diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h index 2b26ad393..fa2955e40 100644 --- a/src/gui/whoisonline.h +++ b/src/gui/whoisonline.h @@ -58,22 +58,22 @@ class OnlinePlayer final A_DELETE_COPY(OnlinePlayer) - const std::string getNick() const + const std::string getNick() const A_WARN_UNUSED { return mNick; } - unsigned char getStaus() const + unsigned char getStaus() const A_WARN_UNUSED { return mStatus; } void setIsGM(const bool b) { mIsGM = b; } - char getVersion() const + char getVersion() const A_WARN_UNUSED { return mVersion; } - char getLevel() const + char getLevel() const A_WARN_UNUSED { return mLevel; } - const std::string getText() const + const std::string getText() const A_WARN_UNUSED { return mText; } void setText(std::string str); @@ -137,10 +137,10 @@ public: void widgetResized(const gcn::Event &event) override; - const std::set<OnlinePlayer*> &getOnlinePlayers() const + const std::set<OnlinePlayer*> &getOnlinePlayers() const A_WARN_UNUSED { return mOnlinePlayers; } - const std::set<std::string> &getOnlineNicks() const + const std::set<std::string> &getOnlineNicks() const A_WARN_UNUSED { return mOnlineNicks; } void setAllowUpdate(const bool n) @@ -169,7 +169,7 @@ private: FILE *stream); const std::string prepareNick(std::string nick, int level, - std::string color) const; + std::string color) const A_WARN_UNUSED; void updateWindow(std::vector<OnlinePlayer*> &friends, std::vector<OnlinePlayer*> &neutral, diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index a1192acce..fb5d3af10 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -65,10 +65,10 @@ class WindowMenu final : public Container, void mouseExited(gcn::MouseEvent& mouseEvent A_UNUSED) override; - std::map <std::string, Button*> &getButtonNames() + std::map <std::string, Button*> &getButtonNames() A_WARN_UNUSED { return mButtonNames; } - std::vector <Button*> &getButtons() + std::vector <Button*> &getButtons() A_WARN_UNUSED { return mButtons; } void showButton(const std::string &name, const bool visible); |