summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-30 13:05:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-30 13:11:34 +0300
commit0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9 (patch)
tree077c2ff59d6656096aa0acaaf4dd6bf4fb7867f7
parent6b1684d33dec02eb6308bb3d8d3707f4d5252ba5 (diff)
downloadManaVerse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.gz
ManaVerse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.bz2
ManaVerse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.xz
ManaVerse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.zip
Add unused warnings to other files.
-rw-r--r--src/gui/widgets/avatarlistbox.h4
-rw-r--r--src/gui/widgets/battletab.h2
-rw-r--r--src/gui/widgets/browserbox.h18
-rw-r--r--src/gui/widgets/button.h8
-rw-r--r--src/gui/widgets/channeltab.h2
-rw-r--r--src/gui/widgets/chattab.h12
-rw-r--r--src/gui/widgets/dropdown.h2
-rw-r--r--src/gui/widgets/extendedlistbox.h2
-rw-r--r--src/gui/widgets/extendedlistmodel.h2
-rw-r--r--src/gui/widgets/extendednamesmodel.h12
-rw-r--r--src/gui/widgets/flowcontainer.h4
-rw-r--r--src/gui/widgets/guildchattab.h2
-rw-r--r--src/gui/widgets/guitable.h22
-rw-r--r--src/gui/widgets/icon.h2
-rw-r--r--src/gui/widgets/inttextfield.h2
-rw-r--r--src/gui/widgets/itemcontainer.h5
-rw-r--r--src/gui/widgets/layout.h16
-rw-r--r--src/gui/widgets/layouthelper.h4
-rw-r--r--src/gui/widgets/namesmodel.h8
-rw-r--r--src/gui/widgets/playerbox.h2
-rw-r--r--src/gui/widgets/popup.h10
-rw-r--r--src/gui/widgets/progressbar.h6
-rw-r--r--src/gui/widgets/radiogroup.h3
-rw-r--r--src/gui/widgets/scrollarea.h2
-rw-r--r--src/gui/widgets/setupitem.cpp2
-rw-r--r--src/gui/widgets/setupitem.h8
-rw-r--r--src/gui/widgets/setuptab.h2
-rw-r--r--src/gui/widgets/setuptabscroll.h4
-rw-r--r--src/gui/widgets/shopitems.h13
-rw-r--r--src/gui/widgets/shoplistbox.h2
-rw-r--r--src/gui/widgets/shortcutcontainer.h9
-rw-r--r--src/gui/widgets/sliderlist.h6
-rw-r--r--src/gui/widgets/tab.h8
-rw-r--r--src/gui/widgets/tabbedarea.h28
-rw-r--r--src/gui/widgets/tablemodel.h26
-rw-r--r--src/gui/widgets/tabstrip.h3
-rw-r--r--src/gui/widgets/textbox.h2
-rw-r--r--src/gui/widgets/textfield.h2
-rw-r--r--src/gui/widgets/textpreview.h2
-rw-r--r--src/gui/widgets/tradetab.h2
-rw-r--r--src/gui/widgets/whispertab.h4
-rw-r--r--src/gui/widgets/widget2.h6
-rw-r--r--src/gui/widgets/widgetgroup.h3
-rw-r--r--src/gui/widgets/window.h39
-rw-r--r--src/guichan/include/guichan/actionevent.hpp2
-rw-r--r--src/guichan/include/guichan/basiccontainer.hpp7
-rw-r--r--src/guichan/include/guichan/event.hpp4
-rw-r--r--src/guichan/include/guichan/exception.hpp8
-rw-r--r--src/guichan/include/guichan/focushandler.hpp16
-rw-r--r--src/guichan/include/guichan/font.hpp8
-rw-r--r--src/guichan/include/guichan/gui.hpp14
-rw-r--r--src/guichan/include/guichan/image.hpp8
-rw-r--r--src/guichan/include/guichan/input.hpp4
-rw-r--r--src/guichan/include/guichan/inputevent.hpp10
-rw-r--r--src/guichan/include/guichan/key.hpp8
-rw-r--r--src/guichan/include/guichan/keyevent.hpp6
-rw-r--r--src/guichan/include/guichan/keyinput.hpp12
-rw-r--r--src/guichan/include/guichan/listmodel.hpp6
-rw-r--r--src/guichan/include/guichan/mouseevent.hpp10
-rw-r--r--src/guichan/include/guichan/mouseinput.hpp10
-rw-r--r--src/guichan/include/guichan/platform.hpp4
-rw-r--r--src/guichan/include/guichan/rectangle.hpp6
-rw-r--r--src/guichan/include/guichan/widget.hpp63
-rw-r--r--src/net/charhandler.h6
-rw-r--r--src/net/download.h4
-rw-r--r--src/net/ea/beinghandler.h2
-rw-r--r--src/net/ea/charserverhandler.h6
-rw-r--r--src/net/ea/gamehandler.h4
-rw-r--r--src/net/ea/gui/guildtab.h2
-rw-r--r--src/net/ea/gui/partytab.h2
-rw-r--r--src/net/ea/guildhandler.h2
-rw-r--r--src/net/ea/inventoryhandler.h10
-rw-r--r--src/net/ea/loginhandler.h12
-rw-r--r--src/net/ea/network.h12
-rw-r--r--src/net/ea/npchandler.h3
-rw-r--r--src/net/ea/partyhandler.h7
-rw-r--r--src/net/ea/playerhandler.h6
-rw-r--r--src/net/eathena/gamehandler.h4
-rw-r--r--src/net/eathena/loginhandler.h8
-rw-r--r--src/net/eathena/network.h4
-rw-r--r--src/net/eathena/npchandler.h2
-rw-r--r--src/net/gamehandler.h4
-rw-r--r--src/net/inventoryhandler.h2
-rw-r--r--src/net/loginhandler.h18
-rw-r--r--src/net/messagein.h8
-rw-r--r--src/net/messageout.h4
-rw-r--r--src/net/net.h32
-rw-r--r--src/net/packetcounters.h8
-rw-r--r--src/net/partyhandler.h4
-rw-r--r--src/net/playerhandler.h7
-rw-r--r--src/net/serverinfo.h4
-rw-r--r--src/net/tmwa/gamehandler.h4
-rw-r--r--src/net/tmwa/loginhandler.h8
-rw-r--r--src/net/tmwa/network.h4
-rw-r--r--src/net/tmwa/npchandler.h2
-rw-r--r--src/resources/action.h4
-rw-r--r--src/resources/animation.h4
-rw-r--r--src/resources/atlasmanager.h13
-rw-r--r--src/resources/beinginfo.h31
-rw-r--r--src/resources/chardb.h16
-rw-r--r--src/resources/colordb.h6
-rw-r--r--src/resources/cursor.h4
-rw-r--r--src/resources/dye.h8
-rw-r--r--src/resources/emotedb.h15
-rw-r--r--src/resources/image.h32
-rw-r--r--src/resources/imagehelper.h21
-rw-r--r--src/resources/imageset.h12
-rw-r--r--src/resources/itemdb.h11
-rw-r--r--src/resources/iteminfo.h67
-rw-r--r--src/resources/mapdb.h6
-rw-r--r--src/resources/mapreader.h10
-rw-r--r--src/resources/monsterdb.h4
-rw-r--r--src/resources/music.h2
-rw-r--r--src/resources/npcdb.h4
-rw-r--r--src/resources/openglimagehelper.h18
-rw-r--r--src/resources/resource.h8
-rw-r--r--src/resources/resourcemanager.h60
-rw-r--r--src/resources/sdlimagehelper.h15
-rw-r--r--src/resources/specialdb.h5
-rw-r--r--src/resources/spritedef.h11
-rw-r--r--src/resources/subimage.h2
-rw-r--r--src/resources/wallpaper.h3
-rw-r--r--src/utils/base64.h8
-rw-r--r--src/utils/copynpaste.h4
124 files changed, 593 insertions, 545 deletions
diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h
index ae9e2c734..0600feda2 100644
--- a/src/gui/widgets/avatarlistbox.h
+++ b/src/gui/widgets/avatarlistbox.h
@@ -37,9 +37,9 @@ class Image;
class AvatarListModel : public gcn::ListModel
{
public:
- virtual Avatar *getAvatarAt(const int i) = 0;
+ virtual Avatar *getAvatarAt(const int i) A_WARN_UNUSED = 0;
- std::string getElementAt(int i) override
+ std::string getElementAt(int i) override A_WARN_UNUSED
{ return getAvatarAt(i)->getName(); }
};
diff --git a/src/gui/widgets/battletab.h b/src/gui/widgets/battletab.h
index d8fe49314..abe0d6e78 100644
--- a/src/gui/widgets/battletab.h
+++ b/src/gui/widgets/battletab.h
@@ -37,7 +37,7 @@ class BattleTab final : public ChatTab
~BattleTab();
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_BATTLE; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index ceb4b1b3f..591d83a07 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -117,12 +117,6 @@ class BrowserBox final : public gcn::Widget,
{ mMaxRows = max; };
/**
- * Disable links & user defined colors to be used in chat input.
- */
-/*
- void disableLinksAndUserColors();
-*/
- /**
* Adds a text row to the browser.
*/
void addRow(const std::string &row, const bool atTop = false);
@@ -139,10 +133,6 @@ class BrowserBox final : public gcn::Widget,
*/
void clearRows();
-// void setSize(int width, int height);
-
-// void widgetResized(const gcn::Event &event);
-
/**
* Handles mouse actions.
*/
@@ -192,10 +182,10 @@ class BrowserBox final : public gcn::Widget,
typedef std::list<std::string> TextRows;
- TextRows &getRows()
+ TextRows &getRows() A_WARN_UNUSED
{ return mTextRows; }
- bool hasRows() const
+ bool hasRows() const A_WARN_UNUSED
{ return !mTextRows.empty(); }
void setAlwaysUpdate(bool n)
@@ -207,10 +197,10 @@ class BrowserBox final : public gcn::Widget,
void setEnableImages(bool n)
{ mEnableImages = n; }
- std::string getTextAtPos(const int x, const int y) const;
+ std::string getTextAtPos(const int x, const int y) const A_WARN_UNUSED;
private:
- int calcHeight();
+ int calcHeight() A_WARN_UNUSED;
typedef TextRows::iterator TextRowIterator;
typedef TextRows::const_iterator TextRowCIter;
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 59fda30e6..25fa0da02 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -103,16 +103,16 @@ class Button final : public gcn::Button,
void setDescription(std::string text)
{ mDescription = text; }
- std::string getDescription() const
+ std::string getDescription() const A_WARN_UNUSED
{ return mDescription; }
- unsigned getClickCount() const
+ unsigned getClickCount() const A_WARN_UNUSED
{ return mClickCount; }
void setTag(int tag)
{ mTag = tag; }
- int getTag() const
+ int getTag() const A_WARN_UNUSED
{ return mTag; }
void setStick(bool b)
@@ -135,7 +135,7 @@ class Button final : public gcn::Button,
void keyReleased(gcn::KeyEvent &keyEvent) override;
- bool isPressed2() const;
+ bool isPressed2() const A_WARN_UNUSED;
private:
void init();
diff --git a/src/gui/widgets/channeltab.h b/src/gui/widgets/channeltab.h
index f2a42f03c..e0dbfb043 100644
--- a/src/gui/widgets/channeltab.h
+++ b/src/gui/widgets/channeltab.h
@@ -35,7 +35,7 @@ class ChannelTab final : public ChatTab
public:
A_DELETE_COPY(ChannelTab)
- Channel *getChannel() const
+ Channel *getChannel() const A_WARN_UNUSED
{ return mChannel; }
void showHelp() override;
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 2a6b826f6..5a1dc2e82 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -133,31 +133,31 @@ class ChatTab : public Tab
/**
* Returns type of the being.
*/
- virtual int getType() const;
+ virtual int getType() const A_WARN_UNUSED;
virtual void saveToLogFile(std::string &msg);
- std::list<std::string> &getRows() const
+ std::list<std::string> &getRows() const A_WARN_UNUSED
{ return mTextOutput->getRows(); }
- bool hasRows() const
+ bool hasRows() const A_WARN_UNUSED
{ return mTextOutput->hasRows(); }
void loadFromLogFile(std::string name);
- bool getAllowHighlight() const
+ bool getAllowHighlight() const A_WARN_UNUSED
{ return mAllowHightlight; }
void setAllowHighlight(const bool n)
{ mAllowHightlight = n; }
- bool getRemoveNames() const
+ bool getRemoveNames() const A_WARN_UNUSED
{ return mRemoveNames; }
void setRemoveNames(const bool n)
{ mRemoveNames = n; }
- bool getNoAway() const
+ bool getNoAway() const A_WARN_UNUSED
{ return mNoAway; }
void setNoAway(const bool n)
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index ac1b23484..d02b86672 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -88,7 +88,7 @@ class DropDown final : public gcn::DropDown,
void setSelectedString(std::string str);
- std::string getSelectedString() const;
+ std::string getSelectedString() const A_WARN_UNUSED;
void adjustHeight();
diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h
index 07280da5a..32fd274aa 100644
--- a/src/gui/widgets/extendedlistbox.h
+++ b/src/gui/widgets/extendedlistbox.h
@@ -41,7 +41,7 @@ class ExtendedListBox final : public ListBox
*/
void draw(gcn::Graphics *graphics) override;
- unsigned int getRowHeight() const override
+ unsigned int getRowHeight() const override A_WARN_UNUSED
{ return mRowHeight; }
void setRowHeight(unsigned int n)
diff --git a/src/gui/widgets/extendedlistmodel.h b/src/gui/widgets/extendedlistmodel.h
index 48b75dc95..536323b36 100644
--- a/src/gui/widgets/extendedlistmodel.h
+++ b/src/gui/widgets/extendedlistmodel.h
@@ -28,7 +28,7 @@
class ExtendedListModel : public gcn::ListModel
{
public:
- virtual const Image *getImageAt(int i) = 0;
+ virtual const Image *getImageAt(int i) A_WARN_UNUSED = 0;
};
#endif
diff --git a/src/gui/widgets/extendednamesmodel.h b/src/gui/widgets/extendednamesmodel.h
index 3078f977f..64941d089 100644
--- a/src/gui/widgets/extendednamesmodel.h
+++ b/src/gui/widgets/extendednamesmodel.h
@@ -36,19 +36,19 @@ class ExtendedNamesModel : public ExtendedListModel
virtual ~ExtendedNamesModel();
- virtual int getNumberOfElements() override;
+ virtual int getNumberOfElements() override A_WARN_UNUSED;
- virtual std::string getElementAt(int i) override;
+ virtual std::string getElementAt(int i) override A_WARN_UNUSED;
- virtual const Image *getImageAt(int i) override;
+ virtual const Image *getImageAt(int i) override A_WARN_UNUSED;
- StringVect &getNames()
+ StringVect &getNames() A_WARN_UNUSED
{ return mNames; }
- std::vector<Image*> &getImages()
+ std::vector<Image*> &getImages() A_WARN_UNUSED
{ return mImages; }
- size_t size()
+ size_t size() A_WARN_UNUSED
{ return mNames.size(); }
void clear();
diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h
index 744ee25d8..0dc39dde2 100644
--- a/src/gui/widgets/flowcontainer.h
+++ b/src/gui/widgets/flowcontainer.h
@@ -57,10 +57,10 @@ class FlowContainer final : public Container,
*/
void widgetResized(const gcn::Event &event) override;
- int getBoxWidth() const
+ int getBoxWidth() const A_WARN_UNUSED
{ return mBoxWidth; }
- int getBoxHeight() const
+ int getBoxHeight() const A_WARN_UNUSED
{ return mBoxHeight; }
void add(gcn::Widget *widget);
diff --git a/src/gui/widgets/guildchattab.h b/src/gui/widgets/guildchattab.h
index 603088a43..f376eddf8 100644
--- a/src/gui/widgets/guildchattab.h
+++ b/src/gui/widgets/guildchattab.h
@@ -44,7 +44,7 @@ class GuildChatTab final : public ChatTab
void saveToLogFile(std::string &msg) override;
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_GUILD; }
void playNewMessageSound() override;
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index 704276026..38026d5ab 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -66,7 +66,7 @@ public:
/**
* Retrieves the active table model
*/
- TableModel *getModel() const;
+ TableModel *getModel() const A_WARN_UNUSED;
/**
* Sets the table model
@@ -80,21 +80,21 @@ public:
void setSelected(int row, int column);
- int getSelectedRow() const;
+ int getSelectedRow() const A_WARN_UNUSED;
- int getSelectedColumn() const;
+ int getSelectedColumn() const A_WARN_UNUSED;
void setSelectedRow(int selected);
void setSelectedColumn(int selected);
- bool isWrappingEnabled() const
+ bool isWrappingEnabled() const A_WARN_UNUSED
{ return mWrappingEnabled; }
void setWrappingEnabled(bool wrappingEnabled)
{ mWrappingEnabled = wrappingEnabled; }
- gcn::Rectangle getChildrenArea() override;
+ gcn::Rectangle getChildrenArea() override A_WARN_UNUSED;
/**
* Toggle whether to use linewise selection mode, in which the table selects
@@ -112,7 +112,7 @@ public:
// Inherited from Widget
virtual void draw(gcn::Graphics* graphics) override;
- virtual gcn::Widget *getWidgetAt(int x, int y) override;
+ virtual gcn::Widget *getWidgetAt(int x, int y) override A_WARN_UNUSED;
virtual void moveToTop(gcn::Widget *child) override;
@@ -138,7 +138,7 @@ public:
*
* @return True if the table is opaque, false otherwise.
*/
- virtual bool isOpaque() const
+ virtual bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
// Inherited from MouseListener
@@ -159,12 +159,12 @@ protected:
/** Installs all action listeners on inner widgets. */
virtual void installActionListeners();
- virtual int getRowHeight() const;
- virtual int getColumnWidth(int i) const;
+ virtual int getRowHeight() const A_WARN_UNUSED;
+ virtual int getColumnWidth(int i) const A_WARN_UNUSED;
private:
- int getRowForY(int y) const; // -1 on error
- int getColumnForX(int x) const; // -1 on error
+ int getRowForY(int y) const A_WARN_UNUSED; // -1 on error
+ int getColumnForX(int x) const A_WARN_UNUSED; // -1 on error
void recomputeDimensions();
bool mLinewiseMode;
bool mWrappingEnabled;
diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h
index 761bbe584..90ab1a3bb 100644
--- a/src/gui/widgets/icon.h
+++ b/src/gui/widgets/icon.h
@@ -55,7 +55,7 @@ class Icon final : public gcn::Widget,
/**
* Gets the current Image.
*/
- Image *getImage() const
+ Image *getImage() const A_WARN_UNUSED
{ return mImage; }
/**
diff --git a/src/gui/widgets/inttextfield.h b/src/gui/widgets/inttextfield.h
index 1435fcccd..ee031687e 100644
--- a/src/gui/widgets/inttextfield.h
+++ b/src/gui/widgets/inttextfield.h
@@ -48,7 +48,7 @@ class IntTextField final : public TextField
/**
* Returns the value in the text box.
*/
- int getValue() const;
+ int getValue() const A_WARN_UNUSED;
/**
* Reset the field to the default value.
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index fed91e5ca..a8dbf3215 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -105,7 +105,7 @@ class ItemContainer final : public gcn::Widget,
/**
* Returns the selected item.
*/
- Item *getSelectedItem() const;
+ Item *getSelectedItem() const A_WARN_UNUSED;
/**
* Sets selected item to NULL.
@@ -135,7 +135,7 @@ class ItemContainer final : public gcn::Widget,
void updateMatrix();
- bool getClickCount()
+ bool getClickCount() A_WARN_UNUSED
{ return mClicks; }
private:
@@ -192,7 +192,6 @@ class ItemContainer final : public gcn::Widget,
*/
int getSlotIndex(const int x, const int y) const;
-
Inventory *mInventory;
int mGridColumns, mGridRows;
Image *mSelImg;
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 895cf6019..b1788343c 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -44,13 +44,13 @@ class ContainerPlacer final
/**
* Gets the pointed cell.
*/
- LayoutCell &getCell()
+ LayoutCell &getCell() A_WARN_UNUSED
{ return *mCell; }
/**
* Returns a placer for the same container but to an inner cell.
*/
- ContainerPlacer at(const int x, const int y);
+ ContainerPlacer at(const int x, const int y) A_WARN_UNUSED;
/**
* Adds the given widget to the container and places it in the layout.
@@ -81,7 +81,7 @@ class LayoutArray final
* Returns a reference on the cell at given position.
*/
LayoutCell &at(const int x, const int y,
- const int w = 1, const int h = 1);
+ const int w = 1, const int h = 1) A_WARN_UNUSED;
/**
* Places a widget in a given cell.
@@ -141,12 +141,12 @@ class LayoutArray final
* Gets the column/row sizes along a given axis.
* @param upp target size for the array. Ignored if AUTO_DEF.
*/
- std::vector<int> getSizes(const int dim, int upp) const;
+ std::vector<int> getSizes(const int dim, int upp) const A_WARN_UNUSED;
/**
* Gets the total size along a given axis.
*/
- int getSize(const int dim) const;
+ int getSize(const int dim) const A_WARN_UNUSED;
std::vector<int> mSizes[2];
std::vector< std::vector < LayoutCell * > > mCells;
@@ -226,7 +226,7 @@ class LayoutCell
/**
* @see LayoutArray::at
*/
- LayoutCell &at(int x, int y)
+ LayoutCell &at(int x, int y) A_WARN_UNUSED
{ return getArray().at(x, y); }
/**
@@ -268,10 +268,10 @@ class LayoutCell
void setType(int t)
{ mType = t; }
- int getWidth() const
+ int getWidth() const A_WARN_UNUSED
{ return mExtent[0]; }
- int getHeight() const
+ int getHeight() const A_WARN_UNUSED
{ return mExtent[1]; }
void setWidth(int w)
diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h
index 75443d8ac..c1ede2611 100644
--- a/src/gui/widgets/layouthelper.h
+++ b/src/gui/widgets/layouthelper.h
@@ -50,7 +50,7 @@ class LayoutHelper final : public gcn::WidgetListener
/**
* Gets the layout handler.
*/
- const Layout &getLayout() const;
+ const Layout &getLayout() const A_WARN_UNUSED;
/**
* Computes the position of the widgets according to the current
@@ -73,7 +73,7 @@ class LayoutHelper final : public gcn::WidgetListener
/**
* Returns a proxy for adding widgets in an inner table of the layout.
*/
- ContainerPlacer getPlacer(const int x, const int y);
+ ContainerPlacer getPlacer(const int x, const int y) A_WARN_UNUSED;
/**
* Called whenever the managed container changes size.
diff --git a/src/gui/widgets/namesmodel.h b/src/gui/widgets/namesmodel.h
index 9138f90ce..7f3ba934d 100644
--- a/src/gui/widgets/namesmodel.h
+++ b/src/gui/widgets/namesmodel.h
@@ -36,14 +36,14 @@ class NamesModel : public gcn::ListModel
virtual ~NamesModel();
- virtual int getNumberOfElements() override;
+ virtual int getNumberOfElements() override A_WARN_UNUSED;
- virtual std::string getElementAt(int i) override;
+ virtual std::string getElementAt(int i) override A_WARN_UNUSED;
- StringVect &getNames()
+ StringVect &getNames() A_WARN_UNUSED
{ return mNames; }
- size_t size()
+ size_t size() A_WARN_UNUSED
{ return mNames.size(); }
void clear()
diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h
index d7729f5be..0833b63c3 100644
--- a/src/gui/widgets/playerbox.h
+++ b/src/gui/widgets/playerbox.h
@@ -77,7 +77,7 @@ class PlayerBox final : public Widget2,
*/
void drawFrame(gcn::Graphics *graphics) override;
- Being *getBeing()
+ Being *getBeing() A_WARN_UNUSED
{ return mBeing; }
private:
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 278980322..bc2acffe3 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -95,7 +95,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMinWidth(const int width);
- int getMinWidth() const
+ int getMinWidth() const A_WARN_UNUSED
{ return mMinWidth; }
/**
@@ -103,7 +103,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMinHeight(const int height);
- int getMinHeight() const
+ int getMinHeight() const A_WARN_UNUSED
{ return mMinHeight; }
/**
@@ -111,7 +111,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMaxWidth(const int width);
- int getMaxWidth() const
+ int getMaxWidth() const A_WARN_UNUSED
{ return mMaxWidth; }
/**
@@ -119,7 +119,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMaxHeight(const int height);
- int getMaxHeight() const
+ int getMaxHeight() const A_WARN_UNUSED
{ return mMaxHeight; }
/**
@@ -129,7 +129,7 @@ class Popup : public Container, public gcn::MouseListener,
* @return The padding of the popup.
* @see setPadding
*/
- int getPadding() const
+ int getPadding() const A_WARN_UNUSED
{ return mPadding; }
void setPadding(int padding)
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index c754bcb6b..599292da5 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -81,7 +81,7 @@ class ProgressBar final : public gcn::Widget,
/**
* Returns the current progress.
*/
- float getProgress() const
+ float getProgress() const A_WARN_UNUSED
{ return mProgress; }
/**
@@ -98,7 +98,7 @@ class ProgressBar final : public gcn::Widget,
/**
* Returns the color of the progress bar.
*/
- const gcn::Color &getColor() const
+ const gcn::Color &getColor() const A_WARN_UNUSED
{ return mColor; }
/**
@@ -110,7 +110,7 @@ class ProgressBar final : public gcn::Widget,
/**
* Returns the text shown on the progress bar.
*/
- const std::string &text() const
+ const std::string &text() const A_WARN_UNUSED
{ return mText; }
/**
diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h
index 57555c771..86f01fc79 100644
--- a/src/gui/widgets/radiogroup.h
+++ b/src/gui/widgets/radiogroup.h
@@ -34,7 +34,8 @@ class RadioGroup final : public WidgetGroup
A_DELETE_COPY(RadioGroup)
- gcn::Widget *createWidget(const std::string &name) override;
+ gcn::Widget *createWidget(const std::string &name)
+ override A_WARN_UNUSED;
};
#endif
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index d771819e6..c018763d9 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -98,7 +98,7 @@ class ScrollArea final : public gcn::ScrollArea,
/**
* Returns whether the widget draws its background or not.
*/
- bool isOpaque() const
+ bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
/**
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 437290bbf..3a273e419 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -134,7 +134,7 @@ void SetupItem::save() const
cfg->setValue(mKeyName, mValue);
}
-std::string SetupItem::getActionEventId()
+std::string SetupItem::getActionEventId() const
{
if (!mWidget)
return "";
diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h
index 87e32bdaa..ec1a1de0b 100644
--- a/src/gui/widgets/setupitem.h
+++ b/src/gui/widgets/setupitem.h
@@ -85,12 +85,12 @@ class SetupItem : public gcn::ActionListener,
void setWidget(gcn::Widget *widget)
{ mWidget = widget; }
- gcn::Widget *getWidget() const
+ gcn::Widget *getWidget() const A_WARN_UNUSED
{ return mWidget; }
- Configuration *getConfig() const;
+ Configuration *getConfig() const A_WARN_UNUSED;
- virtual std::string getActionEventId();
+ virtual std::string getActionEventId() const A_WARN_UNUSED;
virtual void action(const gcn::ActionEvent &event) override;
@@ -102,7 +102,7 @@ class SetupItem : public gcn::ActionListener,
virtual void externalUpdated(std::string eventName);
- bool isMainConfig() const
+ bool isMainConfig() const A_WARN_UNUSED
{ return mMainConfig; }
void fixFirstItemSize(gcn::Widget *const widget);
diff --git a/src/gui/widgets/setuptab.h b/src/gui/widgets/setuptab.h
index dfcb3b315..66922120e 100644
--- a/src/gui/widgets/setuptab.h
+++ b/src/gui/widgets/setuptab.h
@@ -41,7 +41,7 @@ class SetupTab : public Container, public gcn::ActionListener
A_DELETE_COPY(SetupTab)
- const std::string &getName() const
+ const std::string &getName() const A_WARN_UNUSED
{ return mName; }
/**
diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h
index ab8d7e5d9..a0c37c9a8 100644
--- a/src/gui/widgets/setuptabscroll.h
+++ b/src/gui/widgets/setuptabscroll.h
@@ -45,7 +45,7 @@ class SetupTabScroll : public SetupTab
void addControl(SetupItem *const widget, const std::string &event);
- VertContainer *getContainer() const
+ VertContainer *getContainer() const A_WARN_UNUSED
{ return mContainer; }
virtual void apply() override;
@@ -57,7 +57,7 @@ class SetupTabScroll : public SetupTab
virtual void action(const gcn::ActionEvent &event A_UNUSED) override
{ }
- int getPreferredFirstItemSize()
+ int getPreferredFirstItemSize() A_WARN_UNUSED
{ return mPreferredFirstItemSize; }
protected:
diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h
index 5a9e36151..56c686242 100644
--- a/src/gui/widgets/shopitems.h
+++ b/src/gui/widgets/shopitems.h
@@ -81,10 +81,10 @@ class ShopItems final : public gcn::ListModel
/**
* Returns the number of items in the shop.
*/
- int getNumberOfElements() override
+ int getNumberOfElements() override A_WARN_UNUSED
{ return static_cast<int>(mShopItems.size()); }
- bool empty() const
+ bool empty() const A_WARN_UNUSED
{ return mShopItems.empty(); }
/**
@@ -92,12 +92,12 @@ class ShopItems final : public gcn::ListModel
*
* @param i the index to retrieve
*/
- std::string getElementAt(int i) override;
+ std::string getElementAt(int i) override A_WARN_UNUSED;
/**
* Returns the item number i in the shop.
*/
- ShopItem *at(unsigned int i) const;
+ ShopItem *at(unsigned int i) const A_WARN_UNUSED;
/**
* Removes an element from the shop.
@@ -118,7 +118,7 @@ class ShopItems final : public gcn::ListModel
*/
void clear();
- std::vector<ShopItem*> &items()
+ std::vector<ShopItem*> &items() A_WARN_UNUSED
{ return mShopItems; }
private:
@@ -128,7 +128,8 @@ class ShopItems final : public gcn::ListModel
*
* @return the item found or 0
*/
- ShopItem *findItem(const int id, const unsigned char color) const;
+ ShopItem *findItem(const int id,
+ const unsigned char color) const A_WARN_UNUSED;
/** The list of items in the shop. */
std::vector<ShopItem*> mShopItems;
diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h
index cafa88d66..9e9b6884b 100644
--- a/src/gui/widgets/shoplistbox.h
+++ b/src/gui/widgets/shoplistbox.h
@@ -61,7 +61,7 @@ class ShopListBox final : public ListBox
/**
* Returns the height of a row.
*/
- unsigned int getRowHeight() const override
+ unsigned int getRowHeight() const override A_WARN_UNUSED
{ return mRowHeight; }
/**
diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h
index f4851cf63..7cb51cbc5 100644
--- a/src/gui/widgets/shortcutcontainer.h
+++ b/src/gui/widgets/shortcutcontainer.h
@@ -81,13 +81,13 @@ class ShortcutContainer : public gcn::Widget,
*/
virtual void mouseReleased(gcn::MouseEvent &event) override = 0;
- int getMaxItems() const
+ int getMaxItems() const A_WARN_UNUSED
{ return mMaxItems; }
- int getBoxWidth() const
+ int getBoxWidth() const A_WARN_UNUSED
{ return mBoxWidth; }
- int getBoxHeight() const
+ int getBoxHeight() const A_WARN_UNUSED
{ return mBoxHeight; }
protected:
@@ -98,7 +98,8 @@ class ShortcutContainer : public gcn::Widget,
* @param pointY Y coordinate of the point.
* @return index on success, -1 on failure.
*/
- int getIndexFromGrid(const int pointX, const int pointY) const;
+ int getIndexFromGrid(const int pointX,
+ const int pointY) const A_WARN_UNUSED;
Image *mBackgroundImg;
static float mAlpha;
diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h
index 1e57b1101..42e6cb575 100644
--- a/src/gui/widgets/sliderlist.h
+++ b/src/gui/widgets/sliderlist.h
@@ -60,19 +60,19 @@ class SliderList final : public Container,
void setSelectedString(std::string str);
- std::string getSelectedString() const;
+ std::string getSelectedString() const A_WARN_UNUSED;
void setSelected(int idx);
void adjustSize();
- int getSelected()
+ int getSelected() A_WARN_UNUSED
{ return mSelectedIndex; }
protected:
void updateLabel();
- int getMaxLabelWidth();
+ int getMaxLabelWidth() A_WARN_UNUSED;
Button *mButtons[2];
Label *mLabel;
diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h
index 7947ea01a..3589b2905 100644
--- a/src/gui/widgets/tab.h
+++ b/src/gui/widgets/tab.h
@@ -99,7 +99,7 @@ class Tab : public gcn::BasicContainer,
void setFlash(const int flash)
{ mFlash = flash; }
- int getFlash() const
+ int getFlash() const A_WARN_UNUSED
{ return mFlash; }
void widgetResized(const gcn::Event &event) override;
@@ -108,18 +108,18 @@ class Tab : public gcn::BasicContainer,
void setLabelFont(gcn::Font *const font);
- Label *getLabel() const
+ Label *getLabel() const A_WARN_UNUSED
{ return mLabel; }
void adjustSize();
void setTabbedArea(TabbedArea* tabbedArea);
- TabbedArea* getTabbedArea();
+ TabbedArea* getTabbedArea() A_WARN_UNUSED;
void setCaption(const std::string& caption);
- const std::string &getCaption() const;
+ const std::string &getCaption() const A_WARN_UNUSED;
void mouseEntered(gcn::MouseEvent &mouseEvent) override;
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index e25183885..9c66acbfe 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -64,26 +64,26 @@ class TabbedArea final : public Widget2,
*
* @todo Remove this method when upgrading to Guichan 0.9.0
*/
- int getNumberOfTabs() const;
+ int getNumberOfTabs() const A_WARN_UNUSED;
/**
* Return tab with specified name as caption.
*/
- Tab *getTab(const std::string &name) const;
+ Tab *getTab(const std::string &name) const A_WARN_UNUSED;
- Tab *getTabByIndex(const int index) const;
+ Tab *getTabByIndex(const int index) const A_WARN_UNUSED;
- gcn::Widget *getWidgetByIndex(const int index) const;
+ gcn::Widget *getWidgetByIndex(const int index) const A_WARN_UNUSED;
/**
* Returns the widget with the tab that has specified caption
*/
- gcn::Widget *getWidget(const std::string &name) const;
+ gcn::Widget *getWidget(const std::string &name) const A_WARN_UNUSED;
/**
* Returns the widget for the current tab
*/
- gcn::Widget *getCurrentWidget();
+ gcn::Widget *getCurrentWidget() A_WARN_UNUSED;
/**
* Add a tab. Overridden since it needs to size the widget.
@@ -95,9 +95,9 @@ class TabbedArea final : public Widget2,
void addTab(const std::string &caption, gcn::Widget *const widget);
- bool isTabSelected(unsigned int index) const;
+ bool isTabSelected(unsigned int index) const A_WARN_UNUSED;
- bool isTabSelected(Tab* tab);
+ bool isTabSelected(Tab* tab) A_WARN_UNUSED;
/**
* Overload the remove tab function as it's broken in guichan 0.8.
@@ -111,22 +111,22 @@ class TabbedArea final : public Widget2,
*/
void logic() override;
- int getContainerHeight() const
+ int getContainerHeight() const A_WARN_UNUSED
{ return mWidgetContainer->getHeight(); }
void setSelectedTab(Tab *tab);
void setSelectedTab(unsigned int index);
- int getSelectedTabIndex() const;
+ int getSelectedTabIndex() const A_WARN_UNUSED;
- Tab* getSelectedTab()
+ Tab* getSelectedTab() A_WARN_UNUSED
{ return mSelectedTab; }
void setOpaque(bool opaque)
{ mOpaque = opaque; }
- bool isOpaque() const
+ bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
void adjustSize();
@@ -155,13 +155,13 @@ class TabbedArea final : public Widget2,
void setRightMargin(int n)
{ mRightMargin = n; }
- int getRightMargin() const
+ int getRightMargin() const A_WARN_UNUSED
{ return mRightMargin; }
void setFollowDownScroll(bool n)
{ mFollowDownScroll = n; }
- bool getFollowDownScroll() const
+ bool getFollowDownScroll() const A_WARN_UNUSED
{ return mFollowDownScroll; }
void fixSize()
diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h
index 6fa820467..3f6c465a4 100644
--- a/src/gui/widgets/tablemodel.h
+++ b/src/gui/widgets/tablemodel.h
@@ -63,27 +63,28 @@ public:
/**
* Determines the number of rows (lines) in the table
*/
- virtual int getRows() const = 0;
+ virtual int getRows() const A_WARN_UNUSED = 0;
/**
* Determines the number of columns in each row
*/
- virtual int getColumns() const = 0;
+ virtual int getColumns() const A_WARN_UNUSED = 0;
/**
* Determines the height for each row
*/
- virtual int getRowHeight() const = 0;
+ virtual int getRowHeight() const A_WARN_UNUSED = 0;
/**
* Determines the width of each individual column
*/
- virtual int getColumnWidth(int index) const = 0;
+ virtual int getColumnWidth(int index) const A_WARN_UNUSED = 0;
/**
* Retrieves the widget stored at the specified location within the table.
*/
- virtual gcn::Widget *getElementAt(int row, int column) const = 0;
+ virtual gcn::Widget *getElementAt(int row, int column)
+ const A_WARN_UNUSED = 0;
virtual void installListener(TableModelListener *const listener);
@@ -142,13 +143,14 @@ public:
*/
virtual void resize();
- virtual int getRows() const;
- virtual int getColumns() const;
- virtual int getRowHeight() const override;
- virtual int getWidth() const;
- virtual int getHeight() const;
- virtual int getColumnWidth(int index) const;
- virtual gcn::Widget *getElementAt(int row, int column) const override;
+ virtual int getRows() const A_WARN_UNUSED;
+ virtual int getColumns() const A_WARN_UNUSED;
+ virtual int getRowHeight() const override A_WARN_UNUSED;
+ virtual int getWidth() const A_WARN_UNUSED;
+ virtual int getHeight() const A_WARN_UNUSED;
+ virtual int getColumnWidth(int index) const A_WARN_UNUSED;
+ virtual gcn::Widget *getElementAt(int row, int column)
+ const override A_WARN_UNUSED;
protected:
int mRows, mColumns;
diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h
index 7af9cbd78..a3d81bf97 100644
--- a/src/gui/widgets/tabstrip.h
+++ b/src/gui/widgets/tabstrip.h
@@ -38,7 +38,8 @@ class TabStrip final : public WidgetGroup
A_DELETE_COPY(TabStrip)
- gcn::Widget *createWidget(const std::string &name) override;
+ gcn::Widget *createWidget(const std::string &name)
+ override A_WARN_UNUSED;
void action(const gcn::ActionEvent &event) override;
};
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index 73de248cf..51402fad7 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -55,7 +55,7 @@ class TextBox final : public gcn::TextBox,
/**
* Get the minimum text width for the text box.
*/
- int getMinWidth() const
+ int getMinWidth() const A_WARN_UNUSED
{ return mMinWidth; }
void keyPressed(gcn::KeyEvent& keyEvent) override;
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index f4592e292..34ca88b4a 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -104,7 +104,7 @@ class TextField : public gcn::TextField,
/**
* Return the value for a numeric field
*/
- int getValue() const;
+ int getValue() const A_WARN_UNUSED;
void setSendAlwaysEvents(bool b)
{ mSendAlwaysEvents = b; }
diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h
index 6af6cccf9..2d8dc6c74 100644
--- a/src/gui/widgets/textpreview.h
+++ b/src/gui/widgets/textpreview.h
@@ -121,7 +121,7 @@ class TextPreview final : public gcn::Widget,
* Gets opacity for this widget (whether or not the background color
* is shown below the widget)
*/
- bool isOpaque() const
+ bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
void adjustSize();
diff --git a/src/gui/widgets/tradetab.h b/src/gui/widgets/tradetab.h
index a7d1bb0c7..0283db9a4 100644
--- a/src/gui/widgets/tradetab.h
+++ b/src/gui/widgets/tradetab.h
@@ -37,7 +37,7 @@ class TradeTab final : public ChatTab
~TradeTab();
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_TRADE; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h
index cef656816..185865058 100644
--- a/src/gui/widgets/whispertab.h
+++ b/src/gui/widgets/whispertab.h
@@ -35,7 +35,7 @@ class WhisperTab final : public ChatTab
public:
A_DELETE_COPY(WhisperTab)
- const std::string &getNick() const
+ const std::string &getNick() const A_WARN_UNUSED
{ return mNick; }
void showHelp() override;
@@ -43,7 +43,7 @@ class WhisperTab final : public ChatTab
bool handleCommand(const std::string &type,
const std::string &args) override;
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_WHISPER; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index ed2533287..3b4060899 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -42,13 +42,15 @@ class Widget2
}
inline const gcn::Color &getThemeColor(const int type,
- const int alpha = 255) const
+ const int alpha = 255)
+ const A_WARN_UNUSED
{
return Theme::getThemeColor(mPaletteOffset + type, alpha);
}
inline const gcn::Color &getThemeCharColor(const signed char c,
- bool &valid) const
+ bool &valid)
+ const A_WARN_UNUSED
{
const int colorId = Theme::getThemeIdByChar(c, valid);
if (valid)
diff --git a/src/gui/widgets/widgetgroup.h b/src/gui/widgets/widgetgroup.h
index 40b472a7b..69a6b1874 100644
--- a/src/gui/widgets/widgetgroup.h
+++ b/src/gui/widgets/widgetgroup.h
@@ -52,7 +52,8 @@ class WidgetGroup : public Container,
void widgetResized(const gcn::Event &event) override;
- virtual Widget *createWidget(const std::string &name) = 0;
+ virtual Widget *createWidget(const std::string &name)
+ A_WARN_UNUSED = 0;
protected:
int mSpacing;
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 73cd1c2be..2f70bf763 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -131,14 +131,14 @@ class Window : public gcn::Window,
/**
* Returns whether the window can be resized.
*/
- bool isResizable() const;
+ bool isResizable() const A_WARN_UNUSED;
/**
* Sets the minimum width of the window.
*/
void setMinWidth(int width);
- int getMinWidth() const
+ int getMinWidth() const A_WARN_UNUSED
{ return mMinWinWidth; }
/**
@@ -146,7 +146,7 @@ class Window : public gcn::Window,
*/
void setMinHeight(int height);
- int getMinHeight() const
+ int getMinHeight() const A_WARN_UNUSED
{ return mMinWinHeight; }
/**
@@ -154,7 +154,7 @@ class Window : public gcn::Window,
*/
void setMaxWidth(const int width);
- int getMaxWidth() const
+ int getMaxWidth() const A_WARN_UNUSED
{ return mMaxWinWidth; }
/**
@@ -162,7 +162,7 @@ class Window : public gcn::Window,
*/
void setMaxHeight(const int height);
- int getMaxHeight() const
+ int getMaxHeight() const A_WARN_UNUSED
{ return mMaxWinHeight; }
/**
@@ -186,7 +186,7 @@ class Window : public gcn::Window,
/**
* Returns whether the window is sticky.
*/
- bool isSticky() const
+ bool isSticky() const A_WARN_UNUSED
{ return mSticky; }
/**
@@ -197,7 +197,7 @@ class Window : public gcn::Window,
/**
* Returns whether the window sticky locking window.
*/
- bool isStickyButtonLock() const
+ bool isStickyButtonLock() const A_WARN_UNUSED
{ return mStickyButtonLock; }
/**
@@ -215,7 +215,7 @@ class Window : public gcn::Window,
/**
* Returns whether the window is visible by default.
*/
- bool isDefaultVisible() const
+ bool isDefaultVisible() const A_WARN_UNUSED
{ return mDefaultVisible; }
/**
@@ -292,7 +292,7 @@ class Window : public gcn::Window,
/**
* Returns the name of the window. This is not the window title.
*/
- const std::string &getWindowName() const
+ const std::string &getWindowName() const A_WARN_UNUSED
{ return mWindowName; }
/**
@@ -348,7 +348,7 @@ class Window : public gcn::Window,
/**
* Gets the layout handler for this window.
*/
- Layout &getLayout();
+ Layout &getLayout() A_WARN_UNUSED;
/**
* Clears the window's layout (useful for redesigning the window). Does
@@ -375,7 +375,7 @@ class Window : public gcn::Window,
/**
* Returns a proxy for adding widgets in an inner table of the layout.
*/
- ContainerPlacer getPlacer(const int x, const int y);
+ ContainerPlacer getPlacer(const int x, const int y) A_WARN_UNUSED;
/**
* Positions the window in the center of it's parent.
@@ -402,11 +402,11 @@ class Window : public gcn::Window,
/**
* Gets the alpha value used by the window, in a GUIChan usable format.
*/
- int getGuiAlpha();
+ int getGuiAlpha() A_WARN_UNUSED;
- gcn::Rectangle getWindowArea() const;
+ gcn::Rectangle getWindowArea() const A_WARN_UNUSED;
- bool isResizeAllowed(const gcn::MouseEvent &event) const;
+ bool isResizeAllowed(const gcn::MouseEvent &event) const A_WARN_UNUSED;
void setCaptionFont(gcn::Font *font)
{ mCaptionFont = font; }
@@ -415,16 +415,17 @@ class Window : public gcn::Window,
{ mPlayVisibleSound = b; }
protected:
- bool canMove() const;
+ bool canMove() const A_WARN_UNUSED;
- int getOption(const std::string &name, const int def = 0) const;
+ int getOption(const std::string &name,
+ const int def = 0) const A_WARN_UNUSED;
- bool getOptionBool(std::string name);
+ bool getOptionBool(std::string name) A_WARN_UNUSED;
void setTitlePadding(int p)
{ mTitlePadding = p; }
- int getTitlePadding() const
+ int getTitlePadding() const A_WARN_UNUSED
{ return mTitlePadding; }
Skin *mSkin; /**< Skin in use by this window */
@@ -457,7 +458,7 @@ class Window : public gcn::Window,
*
* @see ResizeHandles
*/
- int getResizeHandles(const gcn::MouseEvent &event);
+ int getResizeHandles(const gcn::MouseEvent &event) A_WARN_UNUSED;
Image *mGrip; /**< Resize grip */
Window *mParent; /**< The parent window */
diff --git a/src/guichan/include/guichan/actionevent.hpp b/src/guichan/include/guichan/actionevent.hpp
index 082f7bdef..0d70c54ce 100644
--- a/src/guichan/include/guichan/actionevent.hpp
+++ b/src/guichan/include/guichan/actionevent.hpp
@@ -103,7 +103,7 @@ namespace gcn
*
* @return The identifier of the event.
*/
- const std::string& getId() const;
+ const std::string& getId() const A_WARN_UNUSED;
protected:
/**
diff --git a/src/guichan/include/guichan/basiccontainer.hpp b/src/guichan/include/guichan/basiccontainer.hpp
index 9c1a22b2e..fb6e1a54e 100644
--- a/src/guichan/include/guichan/basiccontainer.hpp
+++ b/src/guichan/include/guichan/basiccontainer.hpp
@@ -89,14 +89,13 @@ namespace gcn
*/
virtual void showWidgetPart(Widget* widget, Rectangle area);
-
// Inherited from Widget
virtual void moveToTop(Widget* widget);
virtual void moveToBottom(Widget* widget);
- virtual Rectangle getChildrenArea();
+ virtual Rectangle getChildrenArea() A_WARN_UNUSED;
virtual void focusNext();
@@ -108,7 +107,7 @@ namespace gcn
void setInternalFocusHandler(FocusHandler* focusHandler);
- virtual Widget *getWidgetAt(int x, int y);
+ virtual Widget *getWidgetAt(int x, int y) A_WARN_UNUSED;
// Inherited from DeathListener
@@ -161,7 +160,7 @@ namespace gcn
* @return The widget with the corrosponding id,
NULL of no widget is found.
*/
- virtual Widget* findWidgetById(const std::string& id);
+ virtual Widget* findWidgetById(const std::string& id) A_WARN_UNUSED;
/**
* Typedef.
diff --git a/src/guichan/include/guichan/event.hpp b/src/guichan/include/guichan/event.hpp
index c6afee48c..5657b473a 100644
--- a/src/guichan/include/guichan/event.hpp
+++ b/src/guichan/include/guichan/event.hpp
@@ -83,11 +83,9 @@ namespace gcn
*
* @return The source widget of the event.
*/
- Widget* getSource() const;
-
+ Widget* getSource() const A_WARN_UNUSED;
protected:
-
/**
* Holds the source widget of the event.
*/
diff --git a/src/guichan/include/guichan/exception.hpp b/src/guichan/include/guichan/exception.hpp
index 0e929ebe1..cf0051846 100644
--- a/src/guichan/include/guichan/exception.hpp
+++ b/src/guichan/include/guichan/exception.hpp
@@ -124,28 +124,28 @@ namespace gcn
*
* @return The function name where the exception occured.
*/
- const std::string& getFunction() const;
+ const std::string& getFunction() const A_WARN_UNUSED;
/**
* Gets the error message of the exception.
*
* @return The error message of the exception.
*/
- const std::string& getMessage() const;
+ const std::string& getMessage() const A_WARN_UNUSED;
/**
* Gets the filename where the exception occured.
*
* @return The filename where the exception occured.
*/
- const std::string& getFilename() const;
+ const std::string& getFilename() const A_WARN_UNUSED;
/**
* Gets the line number where the exception occured.
*
* @return The line number where the exception occured.
*/
- unsigned int getLine() const;
+ unsigned int getLine() const A_WARN_UNUSED;
protected:
/**
diff --git a/src/guichan/include/guichan/focushandler.hpp b/src/guichan/include/guichan/focushandler.hpp
index 716f3966a..6cf971522 100644
--- a/src/guichan/include/guichan/focushandler.hpp
+++ b/src/guichan/include/guichan/focushandler.hpp
@@ -157,7 +157,7 @@ namespace gcn
*
* @return The widget with focus. NULL if no widget has focus.
*/
- virtual Widget* getFocused() const;
+ virtual Widget* getFocused() const A_WARN_UNUSED;
/**
* Gets the widget with modal focus.
@@ -165,7 +165,7 @@ namespace gcn
* @return The widget with modal focus. NULL if no widget has
* modal focus.
*/
- virtual Widget* getModalFocused() const;
+ virtual Widget* getModalFocused() const A_WARN_UNUSED;
/**
* Gets the widget with modal mouse input focus.
@@ -173,7 +173,7 @@ namespace gcn
* @return The widget with modal mouse input focus. NULL if
* no widget has modal mouse input focus.
*/
- virtual Widget* getModalMouseInputFocused() const;
+ virtual Widget* getModalMouseInputFocused() const A_WARN_UNUSED;
/**
* Focuses the next widget added to a conainer.
@@ -240,7 +240,7 @@ namespace gcn
* @return the widget being dragged.
* @see setDraggedWidget
*/
- virtual Widget* getDraggedWidget();
+ virtual Widget* getDraggedWidget() A_WARN_UNUSED;
/**
* Sets the widget being dragged. Used by the Gui class to
@@ -258,7 +258,7 @@ namespace gcn
* @return The last widget with the mouse.
* @see setLastWidgetWithMouse
*/
- virtual Widget* getLastWidgetWithMouse();
+ virtual Widget* getLastWidgetWithMouse() A_WARN_UNUSED;
/**
* Sets the last widget with the mouse. Used by the Gui class
@@ -275,7 +275,7 @@ namespace gcn
* @return The last widget with modal focus.
* @see setLastWidgetWithModalFocus
*/
- virtual Widget* getLastWidgetWithModalFocus();
+ virtual Widget* getLastWidgetWithModalFocus() A_WARN_UNUSED;
/**
* Sets the last widget with modal focus.
@@ -291,7 +291,7 @@ namespace gcn
* @return The last widget with modal mouse input focus.
* @see setLastWidgetWithModalMouseInputFocus
*/
- virtual Widget* getLastWidgetWithModalMouseInputFocus();
+ virtual Widget* getLastWidgetWithModalMouseInputFocus() A_WARN_UNUSED;
/**
* Sets the last widget with modal mouse input focus.
@@ -308,7 +308,7 @@ namespace gcn
* @return The last widget pressed.
* @see setLastWidgetPressed
*/
- virtual Widget* getLastWidgetPressed();
+ virtual Widget* getLastWidgetPressed() A_WARN_UNUSED;
/**
* Sets the last widget pressed. Used by the Gui class to keep track
diff --git a/src/guichan/include/guichan/font.hpp b/src/guichan/include/guichan/font.hpp
index cc177928e..e780b3808 100644
--- a/src/guichan/include/guichan/font.hpp
+++ b/src/guichan/include/guichan/font.hpp
@@ -48,6 +48,8 @@
#include <string>
#include "guichan/platform.hpp"
+#include "localconsts.h"
+
namespace gcn
{
class Graphics;
@@ -74,14 +76,14 @@ namespace gcn
* @param text The string to return the width of.
* @return The width of a string.
*/
- virtual int getWidth(const std::string& text) const = 0;
+ virtual int getWidth(const std::string& text) const A_WARN_UNUSED = 0;
/**
* Gets the height of the glyphs in the font.
*
* @return The height of the glyphs int the font.
*/
- virtual int getHeight() const = 0;
+ virtual int getHeight() const A_WARN_UNUSED = 0;
/**
* Gets a string index in a string providing an x coordinate.
@@ -93,7 +95,7 @@ namespace gcn
* @return A string index in a string providing an x coordinate.
*/
virtual int getStringIndexAt(const std::string& text,
- const int x) const;
+ const int x) const A_WARN_UNUSED;
/**
* Draws a string.
diff --git a/src/guichan/include/guichan/gui.hpp b/src/guichan/include/guichan/gui.hpp
index 782983dd4..a8bdfa6d5 100644
--- a/src/guichan/include/guichan/gui.hpp
+++ b/src/guichan/include/guichan/gui.hpp
@@ -128,7 +128,7 @@ namespace gcn
* @return The top widget. NULL if no top widget has been set.
* @since 0.1.0
*/
- virtual Widget* getTop() const;
+ virtual Widget* getTop() const A_WARN_UNUSED;
/**
* Sets the graphics object to use for drawing.
@@ -149,7 +149,7 @@ namespace gcn
* OpenLayerGraphics, OpenGLGraphics, SDLGraphics
* @since 0.1.0
*/
- virtual Graphics* getGraphics() const;
+ virtual Graphics* getGraphics() const A_WARN_UNUSED;
/**
* Sets the input object to use for input handling.
@@ -170,7 +170,7 @@ namespace gcn
* SDLInput
* @since 0.1.0
*/
- virtual Input* getInput() const;
+ virtual Input* getInput() const A_WARN_UNUSED;
/**
* Performs logic of the GUI. By calling this function all logic
@@ -384,7 +384,7 @@ namespace gcn
* @return The widget at a certain position.
* @since 0.6.0
*/
- virtual Widget* getWidgetAt(int x, int y);
+ virtual Widget* getWidgetAt(int x, int y) A_WARN_UNUSED;
/**
* Gets the source of the mouse event.
@@ -392,7 +392,7 @@ namespace gcn
* @return The source widget of the mouse event.
* @since 0.6.0
*/
- virtual Widget* getMouseEventSource(int x, int y);
+ virtual Widget* getMouseEventSource(int x, int y) A_WARN_UNUSED;
/**
* Gets the source of the key event.
@@ -400,7 +400,7 @@ namespace gcn
* @return The source widget of the key event.
* @since 0.6.0
*/
- virtual Widget* getKeyEventSource();
+ virtual Widget* getKeyEventSource() A_WARN_UNUSED;
/**
* Holds the top widget.
@@ -441,7 +441,7 @@ namespace gcn
* Holds the global key listeners of the Gui.
*/
KeyListenerList mKeyListeners;
-
+
/**
* True if shift is pressed, false otherwise.
*/
diff --git a/src/guichan/include/guichan/image.hpp b/src/guichan/include/guichan/image.hpp
index 7e4ad7b78..1933df293 100644
--- a/src/guichan/include/guichan/image.hpp
+++ b/src/guichan/include/guichan/image.hpp
@@ -49,6 +49,8 @@
#include "guichan/platform.hpp"
+#include "localconsts.h"
+
namespace gcn
{
class Color;
@@ -95,7 +97,7 @@ namespace gcn
*
* @since 0.1.0
*/
- virtual int getWidth() const = 0;
+ virtual int getWidth() const A_WARN_UNUSED = 0;
/**
* Gets the height of the image.
@@ -104,7 +106,7 @@ namespace gcn
*
* @since 0.1.0
*/
- virtual int getHeight() const = 0;
+ virtual int getHeight() const A_WARN_UNUSED = 0;
/**
* Gets the color of a pixel at coordinate (x, y) in the image.
@@ -118,7 +120,7 @@ namespace gcn
*
* @since 0.5.0
*/
- virtual Color getPixel(int x, int y) = 0;
+ virtual Color getPixel(int x, int y) A_WARN_UNUSED = 0;
/**
* Puts a pixel with a certain color at coordinate (x, y).
diff --git a/src/guichan/include/guichan/input.hpp b/src/guichan/include/guichan/input.hpp
index 673140ec0..229dfe9a6 100644
--- a/src/guichan/include/guichan/input.hpp
+++ b/src/guichan/include/guichan/input.hpp
@@ -79,7 +79,7 @@ namespace gcn
* @return True if the key queue is empty,
* false otherwise.
*/
- virtual bool isKeyQueueEmpty() = 0;
+ virtual bool isKeyQueueEmpty() A_WARN_UNUSED = 0;
/**
* Dequeues the key input queue.
@@ -94,7 +94,7 @@ namespace gcn
* @return True if the mouse queue is empty,
* false otherwise.
*/
- virtual bool isMouseQueueEmpty() = 0;
+ virtual bool isMouseQueueEmpty() A_WARN_UNUSED = 0;
/**
* Dequeues the mouse input queue.
diff --git a/src/guichan/include/guichan/inputevent.hpp b/src/guichan/include/guichan/inputevent.hpp
index 296f14cd2..46b2581c4 100644
--- a/src/guichan/include/guichan/inputevent.hpp
+++ b/src/guichan/include/guichan/inputevent.hpp
@@ -81,7 +81,7 @@ namespace gcn
* @return True if shift was pressed at the same time as the key,
* false otherwise.
*/
- bool isShiftPressed() const;
+ bool isShiftPressed() const A_WARN_UNUSED;
/**
* Checks if control is pressed.
@@ -89,7 +89,7 @@ namespace gcn
* @return True if control was pressed at the same time as the key,
* false otherwise.
*/
- bool isControlPressed() const;
+ bool isControlPressed() const A_WARN_UNUSED;
/**
* Checks if alt is pressed.
@@ -97,7 +97,7 @@ namespace gcn
* @return True if alt was pressed at the same time as the key,
* false otherwise.
*/
- bool isAltPressed() const;
+ bool isAltPressed() const A_WARN_UNUSED;
/**
* Checks whether meta is pressed.
@@ -105,7 +105,7 @@ namespace gcn
* @return True if meta was pressed at the same time as the key,
* false otherwise.
*/
- bool isMetaPressed() const;
+ bool isMetaPressed() const A_WARN_UNUSED;
/**
* Marks the event as consumed. Input event listeners may discard
@@ -126,7 +126,7 @@ namespace gcn
* false otherwise.
* @see consume
*/
- bool isConsumed() const;
+ bool isConsumed() const A_WARN_UNUSED;
protected:
/**
diff --git a/src/guichan/include/guichan/key.hpp b/src/guichan/include/guichan/key.hpp
index c2af0ac60..96785a816 100644
--- a/src/guichan/include/guichan/key.hpp
+++ b/src/guichan/include/guichan/key.hpp
@@ -78,7 +78,7 @@ namespace gcn
* @return True if the key is a letter, number or whitespace,
* false otherwise.
*/
- bool isCharacter() const;
+ bool isCharacter() const A_WARN_UNUSED;
/**
* Checks if a key is a number.
@@ -86,7 +86,7 @@ namespace gcn
* @return True if the key is a number (0-9),
* false otherwise.
*/
- bool isNumber() const;
+ bool isNumber() const A_WARN_UNUSED;
/**
* Checks if a key is a letter.
@@ -94,7 +94,7 @@ namespace gcn
* @return True if the key is a letter (a-z,A-Z),
* false otherwise.
*/
- bool isLetter() const;
+ bool isLetter() const A_WARN_UNUSED;
/**
* Gets the value of the key. If an ascii value exists it
@@ -102,7 +102,7 @@ namespace gcn
*
* @return the value of the key.
*/
- int getValue() const;
+ int getValue() const A_WARN_UNUSED;
/**
* Compares two keys.
diff --git a/src/guichan/include/guichan/keyevent.hpp b/src/guichan/include/guichan/keyevent.hpp
index 5cf1d26c7..968c4f2df 100644
--- a/src/guichan/include/guichan/keyevent.hpp
+++ b/src/guichan/include/guichan/keyevent.hpp
@@ -100,7 +100,7 @@ namespace gcn
*
* @return The type of the event.
*/
- unsigned int getType() const;
+ unsigned int getType() const A_WARN_UNUSED;
/**
* Checks if the key event occured on the numeric pad.
@@ -109,14 +109,14 @@ namespace gcn
* false otherwise.
*
*/
- bool isNumericPad() const;
+ bool isNumericPad() const A_WARN_UNUSED;
/**
* Gets the key of the event.
*
* @return The key of the event.
*/
- const Key& getKey() const;
+ const Key& getKey() const A_WARN_UNUSED;
protected:
/**
diff --git a/src/guichan/include/guichan/keyinput.hpp b/src/guichan/include/guichan/keyinput.hpp
index 06892b660..0694883a3 100644
--- a/src/guichan/include/guichan/keyinput.hpp
+++ b/src/guichan/include/guichan/keyinput.hpp
@@ -95,7 +95,7 @@ namespace gcn
* @return the input type.
* @see setType
*/
- int getType() const;
+ int getType() const A_WARN_UNUSED;
/**
* Sets the key of the key input.
@@ -111,7 +111,7 @@ namespace gcn
* @return The key of the key input.
* @see setKey
*/
- const Key& getKey() const;
+ const Key& getKey() const A_WARN_UNUSED;
/**
* Checks if shift is pressed.
@@ -121,7 +121,7 @@ namespace gcn
* @see setShiftPressed
* @since 0.6.0
*/
- bool isShiftPressed() const;
+ bool isShiftPressed() const A_WARN_UNUSED;
/**
* Sets shift to be pressed at the same time as the key,
@@ -141,7 +141,7 @@ namespace gcn
* @see setControlPressed
* @since 0.6.0
*/
- bool isControlPressed() const;
+ bool isControlPressed() const A_WARN_UNUSED;
/**
* Sets control to be pressed at the same time as the key,
@@ -182,7 +182,7 @@ namespace gcn
* @see setMetaPressed
* @since 0.6.0
*/
- bool isMetaPressed() const;
+ bool isMetaPressed() const A_WARN_UNUSED;
/**
* Sets meta to be pressed at the same time as the key,
@@ -203,7 +203,7 @@ namespace gcn
* @setNumericPad
* @since 0.6.0
*/
- bool isNumericPad() const;
+ bool isNumericPad() const A_WARN_UNUSED;
/**
* Sets the key to be pressed at the numeric pad.
diff --git a/src/guichan/include/guichan/listmodel.hpp b/src/guichan/include/guichan/listmodel.hpp
index bf139afb1..682338f5b 100644
--- a/src/guichan/include/guichan/listmodel.hpp
+++ b/src/guichan/include/guichan/listmodel.hpp
@@ -49,6 +49,8 @@
#include "guichan/platform.hpp"
+#include "localconsts.h"
+
namespace gcn
{
/**
@@ -73,7 +75,7 @@ namespace gcn
*
* @return The number of elements in the list
*/
- virtual int getNumberOfElements() = 0;
+ virtual int getNumberOfElements() A_WARN_UNUSED = 0;
/**
* Gets an element at a certain index in the list.
@@ -81,7 +83,7 @@ namespace gcn
* @param i An index in the list.
* @return An element as a string at the a certain index.
*/
- virtual std::string getElementAt(int i) = 0;
+ virtual std::string getElementAt(int i) A_WARN_UNUSED = 0;
};
}
diff --git a/src/guichan/include/guichan/mouseevent.hpp b/src/guichan/include/guichan/mouseevent.hpp
index ba2200d8d..86d224845 100644
--- a/src/guichan/include/guichan/mouseevent.hpp
+++ b/src/guichan/include/guichan/mouseevent.hpp
@@ -94,7 +94,7 @@ namespace gcn
*
* @return The button of the mouse event.
*/
- unsigned int getButton() const;
+ unsigned int getButton() const A_WARN_UNUSED;
/**
* Gets the x coordinate of the mouse event.
@@ -104,7 +104,7 @@ namespace gcn
* @return The x coordinate of the mouse event.
* @see Widget::addMouseListener, Widget::removeMouseListener
*/
- int getX() const;
+ int getX() const A_WARN_UNUSED;
/**
* Gets the y coordinate of the mouse event.
@@ -114,7 +114,7 @@ namespace gcn
* @return The y coordinate of the mouse event.
* @see Widget::addMouseListener, Widget::removeMouseListener
*/
- int getY() const;
+ int getY() const A_WARN_UNUSED;
/**
* Gets the number of clicks generated with the same button.
@@ -122,14 +122,14 @@ namespace gcn
*
* @return The number of clicks generated with the same button.
*/
- int getClickCount() const;
+ int getClickCount() const A_WARN_UNUSED;
/**
* Gets the type of the event.
*
* @return The type of the event.
*/
- unsigned int getType() const;
+ unsigned int getType() const A_WARN_UNUSED;
/**
* Mouse event types.
diff --git a/src/guichan/include/guichan/mouseinput.hpp b/src/guichan/include/guichan/mouseinput.hpp
index b2fc9d36a..ab286cac1 100644
--- a/src/guichan/include/guichan/mouseinput.hpp
+++ b/src/guichan/include/guichan/mouseinput.hpp
@@ -110,7 +110,7 @@ namespace gcn
* @see setType
* @since 0.1.0
*/
- unsigned int getType() const;
+ unsigned int getType() const A_WARN_UNUSED;
/**
* Sets the button pressed.
@@ -130,7 +130,7 @@ namespace gcn
* @see setButton
* @since 0.1.0
*/
- unsigned int getButton() const;
+ unsigned int getButton() const A_WARN_UNUSED;
/**
* Sets the timestamp for the mouse input.
@@ -150,7 +150,7 @@ namespace gcn
* @see setTimeStamp
* @since 0.1.0
*/
- int getTimeStamp() const;
+ int getTimeStamp() const A_WARN_UNUSED;
/**
* Sets the x coordinate of the mouse input.
@@ -168,7 +168,7 @@ namespace gcn
* @see setX
* @since 0.6.0
*/
- int getX() const;
+ int getX() const A_WARN_UNUSED;
/**
* Sets the y coordinate of the mouse input.
@@ -186,7 +186,7 @@ namespace gcn
* @see setY
* @since 0.6.0
*/
- int getY() const;
+ int getY() const A_WARN_UNUSED;
/**
* Mouse input event types. This enum partially corresponds
diff --git a/src/guichan/include/guichan/platform.hpp b/src/guichan/include/guichan/platform.hpp
index 9e3d1338a..0371f499d 100644
--- a/src/guichan/include/guichan/platform.hpp
+++ b/src/guichan/include/guichan/platform.hpp
@@ -73,8 +73,4 @@
#define GCN_EXTENSION_DECLSPEC
#endif
-//#ifndef NULL
-//#define NULL 0
-//#endif
-
#endif // end GCN_PLATFORM_HPP
diff --git a/src/guichan/include/guichan/rectangle.hpp b/src/guichan/include/guichan/rectangle.hpp
index a4de652a4..0d4d64004 100644
--- a/src/guichan/include/guichan/rectangle.hpp
+++ b/src/guichan/include/guichan/rectangle.hpp
@@ -49,6 +49,8 @@
#include <iostream>
+#include "localconsts.h"
+
namespace gcn
{
/**
@@ -95,7 +97,7 @@ namespace gcn
* @return True if the rectangles intersect, false otherwise.
* @since 0.1.0
*/
- bool isIntersecting(const Rectangle& rectangle) const;
+ bool isIntersecting(const Rectangle& rectangle) const A_WARN_UNUSED;
/**
* Checks if a point is inside the rectangle
@@ -105,7 +107,7 @@ namespace gcn
* @return True if the point is inside the rectangle.
* @since 0.1.0
*/
- bool isPointInRect(int x, int y) const;
+ bool isPointInRect(int x, int y) const A_WARN_UNUSED;
/**
* Output operator for output.
diff --git a/src/guichan/include/guichan/widget.hpp b/src/guichan/include/guichan/widget.hpp
index 26aef1d0d..85c3f0d87 100644
--- a/src/guichan/include/guichan/widget.hpp
+++ b/src/guichan/include/guichan/widget.hpp
@@ -161,7 +161,7 @@ namespace gcn
* @see setFrameSize, drawFrame
* @since 0.8.0
*/
- unsigned int getFrameSize() const;
+ unsigned int getFrameSize() const A_WARN_UNUSED;
/**
* Called for all widgets in the gui each time Gui::logic is called.
@@ -180,7 +180,7 @@ namespace gcn
* has no parent.
* @since 0.1.0
*/
- virtual Widget* getParent() const
+ virtual Widget* getParent() const A_WARN_UNUSED
{ return mParent; }
/**
@@ -201,7 +201,7 @@ namespace gcn
* setDimension, getDimension
* @since 0.1.0
*/
- int getWidth() const
+ int getWidth() const A_WARN_UNUSED
{ return mDimension.width; }
/**
@@ -222,7 +222,7 @@ namespace gcn
* setDimension, getDimension
* @since 0.1.0
*/
- int getHeight() const
+ int getHeight() const A_WARN_UNUSED
{ return mDimension.height; }
/**
@@ -254,7 +254,7 @@ namespace gcn
* @see setX, setY, getY, setPosition, setDimension, getDimension
* @since 0.1.0
*/
- int getX() const
+ int getX() const A_WARN_UNUSED
{ return mDimension.x; }
/**
@@ -275,7 +275,7 @@ namespace gcn
* @see setY, setX, getX, setPosition, setDimension, getDimension
* @since 0.1.0
*/
- int getY() const
+ int getY() const A_WARN_UNUSED
{ return mDimension.y; }
/**
@@ -307,7 +307,7 @@ namespace gcn
* @see getDimension, setX, getX, setY, getY, setPosition
* @since 0.1.0
*/
- const Rectangle& getDimension() const;
+ const Rectangle& getDimension() const A_WARN_UNUSED;
/**
* Sets the widget to be fosusable, or not.
@@ -326,7 +326,7 @@ namespace gcn
* @see setFocusable
* @since 0.1.0
*/
- bool isFocusable() const;
+ bool isFocusable() const A_WARN_UNUSED;
/**
* Checks if the widget is focused.
@@ -334,7 +334,7 @@ namespace gcn
* @return True if the widget is focused, false otherwise.
* @since 0.1.0
*/
- virtual bool isFocused() const;
+ virtual bool isFocused() const A_WARN_UNUSED;
/**
* Sets the widget to enabled, or not. A disabled
@@ -355,7 +355,7 @@ namespace gcn
* @see setEnabled
* @since 0.1.0
*/
- bool isEnabled() const;
+ bool isEnabled() const A_WARN_UNUSED;
/**
* Sets the widget to be visible, or not.
@@ -373,7 +373,7 @@ namespace gcn
* @see setVisible
* @since 0.1.0
*/
- bool isVisible() const
+ bool isVisible() const A_WARN_UNUSED
{ return mVisible && (!mParent || mParent->isVisible()); }
/**
@@ -392,7 +392,7 @@ namespace gcn
* @see setBaseColor
* @since 0.1.0
*/
- const Color& getBaseColor() const;
+ const Color& getBaseColor() const A_WARN_UNUSED;
/**
* Sets the foreground color.
@@ -409,7 +409,7 @@ namespace gcn
* @see setForegroundColor
* @since 0.1.0
*/
- const Color& getForegroundColor() const;
+ const Color& getForegroundColor() const A_WARN_UNUSED;
/**
* Sets the background color.
@@ -426,7 +426,7 @@ namespace gcn
* @see setBackgroundColor
* @since 0.1.0
*/
- const Color& getBackgroundColor() const;
+ const Color& getBackgroundColor() const A_WARN_UNUSED;
/**
* Sets the selection color.
@@ -444,8 +444,8 @@ namespace gcn
* @see setSelectionColor
* @since 0.6.0
*/
- const Color& getSelectionColor() const;
-
+ const Color& getSelectionColor() const A_WARN_UNUSED;
+
/**
* Requests focus for the widget. A widget will only recieve focus
* if it is focusable.
@@ -486,7 +486,7 @@ namespace gcn
* @see _setFocusHandler
* @since 0.1.0
*/
- virtual FocusHandler* _getFocusHandler();
+ virtual FocusHandler* _getFocusHandler() A_WARN_UNUSED;
/**
* Adds an action listener to the widget. When an action event
@@ -662,7 +662,7 @@ namespace gcn
* @see setFont, setGlobalFont
* @since 0.1.0
*/
- Font *getFont() const;
+ Font *getFont() const A_WARN_UNUSED;
/**
* Sets the global font to be used by default for all widgets.
@@ -701,7 +701,7 @@ namespace gcn
* @return True if an instance of the widget exists, false otherwise.
* @since 0.1.0
*/
- static bool widgetExists(const Widget* widget);
+ static bool widgetExists(const Widget* widget) A_WARN_UNUSED;
/**
* Checks if tab in is enabled. Tab in means that you can set focus
@@ -713,7 +713,7 @@ namespace gcn
* @see setTabInEnabled
* @since 0.1.0
*/
- bool isTabInEnabled() const;
+ bool isTabInEnabled() const A_WARN_UNUSED;
/**
* Sets tab in enabled, or not. Tab in means that you can set focus
@@ -737,7 +737,7 @@ namespace gcn
* @see setTabOutEnabled
* @since 0.1.0
*/
- bool isTabOutEnabled() const;
+ bool isTabOutEnabled() const A_WARN_UNUSED;
/**
* Sets tab out enabled. Tab out means that you can lose
@@ -797,7 +797,7 @@ namespace gcn
* @see requestModalFocus, releaseModalFocus
* @since 0.8.0
*/
- virtual bool isModalFocused() const;
+ virtual bool isModalFocused() const A_WARN_UNUSED;
/**
* Checks if the widget or it's parent has modal mouse input focus.
@@ -807,7 +807,7 @@ namespace gcn
* @see requestModalMouseInputFocus, releaseModalMouseInputFocus
* @since 0.8.0
*/
- virtual bool isModalMouseInputFocused() const;
+ virtual bool isModalMouseInputFocused() const A_WARN_UNUSED;
/**
* Gets a widget from a certain position in the widget.
@@ -823,7 +823,7 @@ namespace gcn
* if no widget is found.
* @since 0.6.0
*/
- virtual Widget *getWidgetAt(int x, int y);
+ virtual Widget *getWidgetAt(int x, int y) A_WARN_UNUSED;
/**
* Gets the mouse listeners of the widget.
@@ -831,7 +831,8 @@ namespace gcn
* @return The mouse listeners of the widget.
* @since 0.6.0
*/
- virtual const std::list<MouseListener*>& _getMouseListeners();
+ virtual const std::list<MouseListener*>& _getMouseListeners()
+ A_WARN_UNUSED;
/**
* Gets the key listeners of the widget.
@@ -839,7 +840,8 @@ namespace gcn
* @return The key listeners of the widget.
* @since 0.6.0
*/
- virtual const std::list<KeyListener*>& _getKeyListeners();
+ virtual const std::list<KeyListener*>& _getKeyListeners()
+ A_WARN_UNUSED;
/**
* Gets the focus listeners of the widget.
@@ -847,7 +849,8 @@ namespace gcn
* @return The focus listeners of the widget.
* @since 0.7.0
*/
- virtual const std::list<FocusListener*>& _getFocusListeners();
+ virtual const std::list<FocusListener*>& _getFocusListeners()
+ A_WARN_UNUSED;
/**
* Gets the area of the widget occupied by the widget's children.
@@ -869,7 +872,7 @@ namespace gcn
* @see BasicContainer::drawChildren
* @since 0.1.0
*/
- virtual Rectangle getChildrenArea();
+ virtual Rectangle getChildrenArea() A_WARN_UNUSED;
/**
* Gets the internal focus handler used.
@@ -879,7 +882,7 @@ namespace gcn
* @see setInternalFocusHandler
* @since 0.1.0
*/
- virtual FocusHandler* _getInternalFocusHandler();
+ virtual FocusHandler* _getInternalFocusHandler() A_WARN_UNUSED;
/**
* Sets the internal focus handler. An internal focus handler is
@@ -966,7 +969,7 @@ namespace gcn
* @see setId, BasicContainer::findWidgetById
* @since 0.8.0
*/
- const std::string& getId();
+ const std::string& getId() A_WARN_UNUSED;
/**
* Shows a certain part of a widget in the widget's parent.
diff --git a/src/net/charhandler.h b/src/net/charhandler.h
index 54b7704e7..15f371f26 100644
--- a/src/net/charhandler.h
+++ b/src/net/charhandler.h
@@ -87,11 +87,11 @@ class CharHandler
virtual void switchCharacter() = 0;
- virtual unsigned int baseSprite() const = 0;
+ virtual unsigned int baseSprite() const A_WARN_UNUSED = 0;
- virtual unsigned int hairSprite() const = 0;
+ virtual unsigned int hairSprite() const A_WARN_UNUSED = 0;
- virtual unsigned int maxSprite() const = 0;
+ virtual unsigned int maxSprite() const A_WARN_UNUSED = 0;
virtual void clear() = 0;
diff --git a/src/net/download.h b/src/net/download.h
index 8931c8200..fcfe539ac 100644
--- a/src/net/download.h
+++ b/src/net/download.h
@@ -88,12 +88,12 @@ class Download final
*/
void cancel();
- char *getError();
+ char *getError() A_WARN_UNUSED;
void setIgnoreError(bool n)
{ mIgnoreError = n; }
- static unsigned long fadler32(FILE *file);
+ static unsigned long fadler32(FILE *file) A_WARN_UNUSED;
static void addProxy(CURL *curl);
diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h
index 468368a32..1f9d2a042 100644
--- a/src/net/ea/beinghandler.h
+++ b/src/net/ea/beinghandler.h
@@ -39,7 +39,7 @@ class BeingHandler : public Net::BeingHandler
protected:
virtual void requestNameById(int id) = 0;
- virtual Being *createBeing(int id, short job);
+ virtual Being *createBeing(int id, short job) A_WARN_UNUSED;
virtual void setSprite(Being *being, unsigned int slot, int id,
std::string color = "",
diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h
index f84d2634e..4c150bdca 100644
--- a/src/net/ea/charserverhandler.h
+++ b/src/net/ea/charserverhandler.h
@@ -53,11 +53,11 @@ class CharServerHandler : public Net::CharHandler
virtual void requestCharacters();
- virtual unsigned int baseSprite() const;
+ virtual unsigned int baseSprite() const A_WARN_UNUSED;
- virtual unsigned int hairSprite() const;
+ virtual unsigned int hairSprite() const A_WARN_UNUSED;
- virtual unsigned int maxSprite() const;
+ virtual unsigned int maxSprite() const A_WARN_UNUSED;
virtual void connect() = 0;
diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h
index 186bbaa3c..caedae064 100644
--- a/src/net/ea/gamehandler.h
+++ b/src/net/ea/gamehandler.h
@@ -44,12 +44,12 @@ class GameHandler : public Net::GameHandler, public Listener
virtual void who();
- virtual bool removeDeadBeings() const
+ virtual bool removeDeadBeings() const A_WARN_UNUSED
{ return true; }
virtual void setMap(const std::string &map);
- virtual bool canUseMagicBar() const
+ virtual bool canUseMagicBar() const A_WARN_UNUSED
{ return true; }
virtual void mapLoadedEvent() = 0;
diff --git a/src/net/ea/gui/guildtab.h b/src/net/ea/gui/guildtab.h
index b100edf07..293327c4a 100644
--- a/src/net/ea/gui/guildtab.h
+++ b/src/net/ea/gui/guildtab.h
@@ -47,7 +47,7 @@ class GuildTab : public ChatTab
void saveToLogFile(std::string &msg) override;
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_GUILD; }
void playNewMessageSound() override;
diff --git a/src/net/ea/gui/partytab.h b/src/net/ea/gui/partytab.h
index 1b6b84de7..cfd5bd538 100644
--- a/src/net/ea/gui/partytab.h
+++ b/src/net/ea/gui/partytab.h
@@ -45,7 +45,7 @@ class PartyTab : public ChatTab
bool handleCommand(const std::string &type,
const std::string &args) override;
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_PARTY; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/net/ea/guildhandler.h b/src/net/ea/guildhandler.h
index dd326608e..990eac727 100644
--- a/src/net/ea/guildhandler.h
+++ b/src/net/ea/guildhandler.h
@@ -46,7 +46,7 @@ class GuildHandler : public Net::GuildHandler
void endAlliance(int guildId, int otherGuildId);
- bool isSupported();
+ bool isSupported() A_WARN_UNUSED;
virtual void processGuildCreateResponse(Net::MessageIn &msg);
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index 80ddcc25f..694940a12 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -48,7 +48,7 @@ class EquipBackend : public Equipment::Backend
A_DELETE_COPY(EquipBackend)
- Item *getEquipment(int index) const
+ Item *getEquipment(int index) const A_WARN_UNUSED
{
int invyIndex = mEquipment[index];
if (invyIndex == -1)
@@ -146,7 +146,7 @@ class InventoryHandler : public Net::InventoryHandler
~InventoryHandler();
- bool canSplit(const Item *item) const;
+ bool canSplit(const Item *item) const A_WARN_UNUSED;
void splitItem(const Item *item, int amount);
@@ -154,14 +154,14 @@ class InventoryHandler : public Net::InventoryHandler
void openStorage(int type);
- size_t getSize(int type) const;
+ size_t getSize(int type) const A_WARN_UNUSED;
- int convertFromServerSlot(int serverSlot) const;
+ int convertFromServerSlot(int serverSlot) const A_WARN_UNUSED;
void pushPickup(int floorId)
{ mSentPickups.push(floorId); }
- int getSlot(int eAthenaSlot);
+ int getSlot(int eAthenaSlot) A_WARN_UNUSED;
void processPlayerInventory(Net::MessageIn &msg, bool playerInvintory);
diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h
index bd527418b..eebe73ad5 100644
--- a/src/net/ea/loginhandler.h
+++ b/src/net/ea/loginhandler.h
@@ -45,14 +45,14 @@ class LoginHandler : public Net::LoginHandler
~LoginHandler();
- int supportedOptionalActions() const
+ int supportedOptionalActions() const A_WARN_UNUSED
{ return SetGenderOnRegister; }
- virtual bool isRegistrationEnabled();
+ virtual bool isRegistrationEnabled() A_WARN_UNUSED;
virtual void getRegistrationDetails();
- virtual unsigned int getMaxPasswordLength() const
+ virtual unsigned int getMaxPasswordLength() const A_WARN_UNUSED
{ return 25; }
virtual void loginAccount(LoginData *loginData);
@@ -61,13 +61,13 @@ class LoginHandler : public Net::LoginHandler
virtual void registerAccount(LoginData *loginData);
- virtual Worlds getWorlds() const;
+ virtual Worlds getWorlds() const A_WARN_UNUSED;
virtual void clearWorlds();
- virtual ServerInfo *getCharServer() = 0;
+ virtual ServerInfo *getCharServer() A_WARN_UNUSED = 0;
- const Token &getToken() const
+ const Token &getToken() const A_WARN_UNUSED
{ return mToken; }
virtual void logout();
diff --git a/src/net/ea/network.h b/src/net/ea/network.h
index 4fbf0ebbe..8148fe63c 100644
--- a/src/net/ea/network.h
+++ b/src/net/ea/network.h
@@ -50,19 +50,19 @@ class Network
void disconnect();
- ServerInfo getServer() const
+ ServerInfo getServer() const A_WARN_UNUSED
{ return mServer; }
- int getState() const
+ int getState() const A_WARN_UNUSED
{ return mState; }
- const std::string &getError() const
+ const std::string &getError() const A_WARN_UNUSED
{ return mError; }
- bool isConnected() const
+ bool isConnected() const A_WARN_UNUSED
{ return mState == CONNECTED; }
- int getInSize() const
+ int getInSize() const A_WARN_UNUSED
{ return mInSize; }
void skip(int len);
@@ -86,7 +86,7 @@ class Network
void setError(const std::string &error);
- uint16_t readWord(const int pos) const;
+ uint16_t readWord(const int pos) const A_WARN_UNUSED;
bool realConnect();
diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h
index 6bd038235..053792f6e 100644
--- a/src/net/ea/npchandler.h
+++ b/src/net/ea/npchandler.h
@@ -50,7 +50,8 @@ class NpcHandler : public Net::NpcHandler
void clearDialogs();
- virtual int getNpc(Net::MessageIn &msg, bool haveLength) = 0;
+ virtual int getNpc(Net::MessageIn &msg,
+ bool haveLength) A_WARN_UNUSED = 0;
void processNpcChoice(Net::MessageIn &msg);
diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h
index 47ccd5016..fdd2fd533 100644
--- a/src/net/ea/partyhandler.h
+++ b/src/net/ea/partyhandler.h
@@ -46,10 +46,10 @@ class PartyHandler : public Net::PartyHandler
void requestPartyMembers() const;
- PartyShare getShareExperience() const
+ PartyShare getShareExperience() const A_WARN_UNUSED
{ return mShareExp; }
- PartyShare getShareItems() const
+ PartyShare getShareItems() const A_WARN_UNUSED
{ return mShareItems; }
void reload();
@@ -77,7 +77,8 @@ class PartyHandler : public Net::PartyHandler
virtual void processPartyMessage(Net::MessageIn &msg);
protected:
- PartyShare mShareExp, mShareItems;
+ PartyShare mShareExp;
+ PartyShare mShareItems;
};
extern PartyTab *partyTab;
diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h
index eebb9da96..c090bb126 100644
--- a/src/net/ea/playerhandler.h
+++ b/src/net/ea/playerhandler.h
@@ -47,11 +47,11 @@ class PlayerHandler : public Net::PlayerHandler
bool canCorrectAttributes() const;
- Vector getDefaultWalkSpeed() const;
+ Vector getDefaultWalkSpeed() const A_WARN_UNUSED;
- PlayerInfo::Attribute getJobLocation() const;
+ PlayerInfo::Attribute getJobLocation() const A_WARN_UNUSED;
- PlayerInfo::Attribute getAttackLocation() const;
+ PlayerInfo::Attribute getAttackLocation() const A_WARN_UNUSED;
void processWalkResponse(Net::MessageIn &msg);
diff --git a/src/net/eathena/gamehandler.h b/src/net/eathena/gamehandler.h
index dc661157a..c627341a4 100644
--- a/src/net/eathena/gamehandler.h
+++ b/src/net/eathena/gamehandler.h
@@ -44,7 +44,7 @@ class GameHandler final : public MessageHandler, public Ea::GameHandler
void connect();
- bool isConnected();
+ bool isConnected() A_WARN_UNUSED;
void disconnect();
@@ -60,7 +60,7 @@ class GameHandler final : public MessageHandler, public Ea::GameHandler
void processMapCharId(Net::MessageIn &msg);
- bool mustPing() const
+ bool mustPing() const A_WARN_UNUSED
{ return true; }
};
diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h
index ab7ae482a..2b683f044 100644
--- a/src/net/eathena/loginhandler.h
+++ b/src/net/eathena/loginhandler.h
@@ -49,21 +49,21 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler
void connect();
- bool isConnected();
+ bool isConnected() A_WARN_UNUSED;
void disconnect();
- int supportedOptionalActions() const
+ int supportedOptionalActions() const A_WARN_UNUSED
{ return SetGenderOnRegister; }
- unsigned int getMaxPasswordLength() const
+ unsigned int getMaxPasswordLength() const A_WARN_UNUSED
{ return 25; }
void changePassword(const std::string &username,
const std::string &oldPassword,
const std::string &newPassword);
- ServerInfo *getCharServer();
+ ServerInfo *getCharServer() A_WARN_UNUSED;
void processServerVersion(Net::MessageIn &msg);
diff --git a/src/net/eathena/network.h b/src/net/eathena/network.h
index e66a3c642..745867b48 100644
--- a/src/net/eathena/network.h
+++ b/src/net/eathena/network.h
@@ -60,14 +60,14 @@ class Network final : public Ea::Network
bool messageReady();
- MessageIn *getNextMessage();
+ MessageIn *getNextMessage() A_WARN_UNUSED;
void dispatchMessages();
protected:
friend class MessageOut;
- static Network *instance();
+ static Network *instance() A_WARN_UNUSED;
typedef std::map<uint16_t, MessageHandler*> MessageHandlers;
typedef MessageHandlers::iterator MessageHandlerIterator;
diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h
index cc6dd499d..db03a7eb7 100644
--- a/src/net/eathena/npchandler.h
+++ b/src/net/eathena/npchandler.h
@@ -66,7 +66,7 @@ class NpcHandler final : public MessageHandler, public Ea::NpcHandler
void sellItem(int beingId, int itemId, int amount);
- int getNpc(Net::MessageIn &msg, bool haveLength);
+ int getNpc(Net::MessageIn &msg, bool haveLength) A_WARN_UNUSED;
void processNpcCutin(Net::MessageIn &msg, int npcId);
diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h
index a9713a30a..512972b23 100644
--- a/src/net/gamehandler.h
+++ b/src/net/gamehandler.h
@@ -55,9 +55,9 @@ class GameHandler
/**
* Tells whether the protocol is using the MP status bar
*/
- virtual bool canUseMagicBar() const = 0;
+ virtual bool canUseMagicBar() const A_WARN_UNUSED = 0;
- virtual bool mustPing() const = 0;
+ virtual bool mustPing() const A_WARN_UNUSED = 0;
};
} // namespace Net
diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h
index 5d6062710..9be6daceb 100644
--- a/src/net/inventoryhandler.h
+++ b/src/net/inventoryhandler.h
@@ -60,7 +60,7 @@ class InventoryHandler
int destination) = 0;
// TODO: fix/remove me
- virtual size_t getSize(int type) const = 0;
+ virtual size_t getSize(int type) const A_WARN_UNUSED = 0;
virtual int convertFromServerSlot(int eAthenaSlot) const = 0;
};
diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h
index 1366e30dd..ed2ecc313 100644
--- a/src/net/loginhandler.h
+++ b/src/net/loginhandler.h
@@ -52,34 +52,34 @@ class LoginHandler
void setServer(const ServerInfo &server)
{ mServer = server; }
- ServerInfo getServer() const
+ ServerInfo getServer() const A_WARN_UNUSED
{ return mServer; }
virtual void connect() = 0;
- virtual bool isConnected() = 0;
+ virtual bool isConnected() A_WARN_UNUSED = 0;
virtual void disconnect() = 0;
/**
* @see OptionalAction
*/
- virtual int supportedOptionalActions() const = 0;
+ virtual int supportedOptionalActions() const A_WARN_UNUSED = 0;
- virtual bool isRegistrationEnabled() = 0;
+ virtual bool isRegistrationEnabled() A_WARN_UNUSED = 0;
virtual void getRegistrationDetails() = 0;
- virtual unsigned int getMinUserNameLength() const
+ virtual unsigned int getMinUserNameLength() const A_WARN_UNUSED
{ return 4; }
- virtual unsigned int getMaxUserNameLength() const
+ virtual unsigned int getMaxUserNameLength() const A_WARN_UNUSED
{ return 25; }
- virtual unsigned int getMinPasswordLength() const
+ virtual unsigned int getMinPasswordLength() const A_WARN_UNUSED
{ return 4; }
- virtual unsigned int getMaxPasswordLength() const
+ virtual unsigned int getMaxPasswordLength() const A_WARN_UNUSED
{ return 255; }
virtual void loginAccount(LoginData *loginData) = 0;
@@ -99,7 +99,7 @@ class LoginHandler
virtual void unregisterAccount(const std::string &username,
const std::string &password) = 0;
- virtual Worlds getWorlds() const = 0;
+ virtual Worlds getWorlds() const A_WARN_UNUSED = 0;
virtual void clearWorlds() = 0;
diff --git a/src/net/messagein.h b/src/net/messagein.h
index d8cdf96e2..d17a49f5d 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -45,19 +45,19 @@ class MessageIn
/**
* Returns the message ID.
*/
- int getId() const
+ int getId() const A_WARN_UNUSED
{ return mId; }
/**
* Returns the message length.
*/
- unsigned int getLength() const
+ unsigned int getLength() const A_WARN_UNUSED
{ return mLength; }
/**
* Returns the length of unread data.
*/
- unsigned int getUnreadLength() const
+ unsigned int getUnreadLength() const A_WARN_UNUSED
{ return mLength > mPos ? mLength - mPos : 0; }
virtual unsigned char readInt8(); /**< Reads a byte. */
@@ -105,7 +105,7 @@ class MessageIn
virtual ~MessageIn()
{ }
- static uint8_t fromServerDirection(uint8_t serverDir);
+ static uint8_t fromServerDirection(uint8_t serverDir) A_WARN_UNUSED;
protected:
/**
diff --git a/src/net/messageout.h b/src/net/messageout.h
index 2fb25d38b..89cb02c62 100644
--- a/src/net/messageout.h
+++ b/src/net/messageout.h
@@ -65,12 +65,12 @@ class MessageOut
/**
* Returns the content of the message.
*/
- virtual char *getData() const;
+ virtual char *getData() const A_WARN_UNUSED;
/**
* Returns the length of the data.
*/
- virtual unsigned int getDataSize() const;
+ virtual unsigned int getDataSize() const A_WARN_UNUSED;
virtual ~MessageOut()
{ }
diff --git a/src/net/net.h b/src/net/net.h
index ce320591f..3cc4154f3 100644
--- a/src/net/net.h
+++ b/src/net/net.h
@@ -52,23 +52,23 @@ class SpecialHandler;
class TradeHandler;
class BuySellHandler;
-AdminHandler *getAdminHandler();
-BeingHandler *getBeingHandler();
-CharHandler *getCharHandler();
-ChatHandler *getChatHandler();
-GameHandler *getGameHandler();
-GeneralHandler *getGeneralHandler();
-GuildHandler *getGuildHandler();
-InventoryHandler *getInventoryHandler();
-LoginHandler *getLoginHandler();
-NpcHandler *getNpcHandler();
-PartyHandler *getPartyHandler();
-PlayerHandler *getPlayerHandler();
-SpecialHandler *getSpecialHandler();
-TradeHandler *getTradeHandler();
-BuySellHandler *getBuySellHandler();
+AdminHandler *getAdminHandler() A_WARN_UNUSED;
+BeingHandler *getBeingHandler() A_WARN_UNUSED;
+CharHandler *getCharHandler() A_WARN_UNUSED;
+ChatHandler *getChatHandler() A_WARN_UNUSED;
+GameHandler *getGameHandler() A_WARN_UNUSED;
+GeneralHandler *getGeneralHandler() A_WARN_UNUSED;
+GuildHandler *getGuildHandler() A_WARN_UNUSED;
+InventoryHandler *getInventoryHandler() A_WARN_UNUSED;
+LoginHandler *getLoginHandler() A_WARN_UNUSED;
+NpcHandler *getNpcHandler() A_WARN_UNUSED;
+PartyHandler *getPartyHandler() A_WARN_UNUSED;
+PlayerHandler *getPlayerHandler() A_WARN_UNUSED;
+SpecialHandler *getSpecialHandler() A_WARN_UNUSED;
+TradeHandler *getTradeHandler() A_WARN_UNUSED;
+BuySellHandler *getBuySellHandler() A_WARN_UNUSED;
-ServerInfo::Type getNetworkType();
+ServerInfo::Type getNetworkType() A_WARN_UNUSED;
/**
* Handles server detection and connection
diff --git a/src/net/packetcounters.h b/src/net/packetcounters.h
index 34de55889..f629a8a64 100644
--- a/src/net/packetcounters.h
+++ b/src/net/packetcounters.h
@@ -32,17 +32,17 @@ public:
static void incInPackets();
- static int getInBytes();
+ static int getInBytes() A_WARN_UNUSED;
- static int getInPackets();
+ static int getInPackets() A_WARN_UNUSED;
static void incOutBytes(int cnt);
static void incOutPackets();
- static int getOutBytes();
+ static int getOutBytes() A_WARN_UNUSED;
- static int getOutPackets();
+ static int getOutPackets() A_WARN_UNUSED;
static void update();
diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h
index dd92f78d1..37a1f22c4 100644
--- a/src/net/partyhandler.h
+++ b/src/net/partyhandler.h
@@ -65,11 +65,11 @@ class PartyHandler
virtual void requestPartyMembers() const = 0;
- virtual PartyShare getShareExperience() const = 0;
+ virtual PartyShare getShareExperience() const A_WARN_UNUSED = 0;
virtual void setShareExperience(PartyShare share) = 0;
- virtual PartyShare getShareItems() const = 0;
+ virtual PartyShare getShareItems() const A_WARN_UNUSED = 0;
virtual void setShareItems(PartyShare share) = 0;
diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h
index 66193eedc..ca1ce5ea7 100644
--- a/src/net/playerhandler.h
+++ b/src/net/playerhandler.h
@@ -66,11 +66,12 @@ class PlayerHandler
virtual bool canCorrectAttributes() const = 0;
- virtual PlayerInfo::Attribute getJobLocation() const = 0;
+ virtual PlayerInfo::Attribute getJobLocation() const A_WARN_UNUSED = 0;
- virtual PlayerInfo::Attribute getAttackLocation() const = 0;
+ virtual PlayerInfo::Attribute getAttackLocation()
+ const A_WARN_UNUSED = 0;
- virtual Vector getDefaultWalkSpeed() const = 0;
+ virtual Vector getDefaultWalkSpeed() const A_WARN_UNUSED = 0;
virtual void requestOnlineList() = 0;
diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h
index 7be5957d2..d58bd3286 100644
--- a/src/net/serverinfo.h
+++ b/src/net/serverinfo.h
@@ -74,7 +74,7 @@ public:
version.second = info.version.second;
}
- bool isValid() const
+ bool isValid() const A_WARN_UNUSED
{
return !(hostname.empty() || port == 0 || type == UNKNOWN);
}
@@ -103,7 +103,7 @@ public:
port != other.port);
}
- static Type parseType(const std::string &type)
+ static Type parseType(const std::string &type) A_WARN_UNUSED
{
if (compareStrI(type, "tmwathena") == 0)
return TMWATHENA;
diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h
index 8d0c8f073..da5070cbc 100644
--- a/src/net/tmwa/gamehandler.h
+++ b/src/net/tmwa/gamehandler.h
@@ -44,7 +44,7 @@ class GameHandler final : public MessageHandler, public Ea::GameHandler
void connect();
- bool isConnected();
+ bool isConnected() A_WARN_UNUSED;
void disconnect();
@@ -58,7 +58,7 @@ class GameHandler final : public MessageHandler, public Ea::GameHandler
void mapLoadedEvent();
- bool mustPing() const
+ bool mustPing() const A_WARN_UNUSED
{ return false; }
};
diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h
index 67afbee09..1a78fbb59 100644
--- a/src/net/tmwa/loginhandler.h
+++ b/src/net/tmwa/loginhandler.h
@@ -49,21 +49,21 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler
void connect();
- bool isConnected();
+ bool isConnected() A_WARN_UNUSED;
void disconnect();
- int supportedOptionalActions() const
+ int supportedOptionalActions() const A_WARN_UNUSED
{ return SetGenderOnRegister; }
- unsigned int getMaxPasswordLength() const
+ unsigned int getMaxPasswordLength() const A_WARN_UNUSED
{ return 25; }
void changePassword(const std::string &username,
const std::string &oldPassword,
const std::string &newPassword);
- ServerInfo *getCharServer();
+ ServerInfo *getCharServer() A_WARN_UNUSED;
void processServerVersion(Net::MessageIn &msg);
diff --git a/src/net/tmwa/network.h b/src/net/tmwa/network.h
index 90c48eb19..79b140430 100644
--- a/src/net/tmwa/network.h
+++ b/src/net/tmwa/network.h
@@ -61,14 +61,14 @@ class Network final : public Ea::Network
bool messageReady();
- MessageIn *getNextMessage();
+ MessageIn *getNextMessage() A_WARN_UNUSED;
void dispatchMessages();
protected:
friend class MessageOut;
- static Network *instance();
+ static Network *instance() A_WARN_UNUSED;
typedef std::map<uint16_t, MessageHandler*> MessageHandlers;
typedef MessageHandlers::iterator MessageHandlerIterator;
diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h
index de0f3382a..285d775bb 100644
--- a/src/net/tmwa/npchandler.h
+++ b/src/net/tmwa/npchandler.h
@@ -66,7 +66,7 @@ class NpcHandler final : public MessageHandler, public Ea::NpcHandler
void sellItem(int beingId, int itemId, int amount);
- int getNpc(Net::MessageIn &msg, bool haveLength);
+ int getNpc(Net::MessageIn &msg, bool haveLength) A_WARN_UNUSED;
void processNpcCommand(Net::MessageIn &msg, int npcId);
diff --git a/src/resources/action.h b/src/resources/action.h
index ea1e1d195..8cfeef576 100644
--- a/src/resources/action.h
+++ b/src/resources/action.h
@@ -43,9 +43,9 @@ class Action final
void setAnimation(const int direction, Animation *const animation);
- Animation *getAnimation(int direction) const;
+ Animation *getAnimation(int direction) const A_WARN_UNUSED;
- unsigned getNumber() const
+ unsigned getNumber() const A_WARN_UNUSED
{ return mNumber; }
void setNumber(const unsigned n)
diff --git a/src/resources/animation.h b/src/resources/animation.h
index dd5421735..1e9d34a26 100644
--- a/src/resources/animation.h
+++ b/src/resources/animation.h
@@ -82,7 +82,7 @@ class Animation final
/**
* Returns the length of this animation in frames.
*/
- size_t getLength() const
+ size_t getLength() const A_WARN_UNUSED
{ return mFrames.size(); }
void addJump(const std::string &name, const int rand);
@@ -98,7 +98,7 @@ class Animation final
/**
* Determines whether the given animation frame is a terminator.
*/
- static bool isTerminator(const Frame &phase);
+ static bool isTerminator(const Frame &phase) A_WARN_UNUSED;
protected:
diff --git a/src/resources/atlasmanager.h b/src/resources/atlasmanager.h
index fd0beb4cd..d19cbd224 100644
--- a/src/resources/atlasmanager.h
+++ b/src/resources/atlasmanager.h
@@ -31,7 +31,7 @@
class Resource;
-struct AtlasItem
+struct AtlasItem final
{
AtlasItem(Image *image0) :
image(image0),
@@ -52,7 +52,7 @@ struct AtlasItem
int height;
};
-struct TextureAtlas
+struct TextureAtlas final
{
TextureAtlas() :
atlasImage(nullptr),
@@ -72,7 +72,7 @@ struct TextureAtlas
std::vector <AtlasItem*> items;
};
-class AtlasResource : public Resource
+class AtlasResource final : public Resource
{
public:
AtlasResource()
@@ -89,7 +89,7 @@ class AtlasResource : public Resource
std::vector<TextureAtlas*> atlases;
};
-class AtlasManager
+class AtlasManager final
{
public:
AtlasManager();
@@ -97,7 +97,8 @@ class AtlasManager
A_DELETE_COPY(AtlasManager)
static AtlasResource *loadTextureAtlas(const std::string &name,
- const StringVect &files);
+ const StringVect &files)
+ A_WARN_UNUSED;
static void injectToResources(AtlasResource *resource);
@@ -111,7 +112,7 @@ class AtlasManager
std::vector<TextureAtlas*> &atlases,
std::vector<Image*> &images, int size);
- static SDL_Surface *createSDLAtlas(TextureAtlas *atlas);
+ static SDL_Surface *createSDLAtlas(TextureAtlas *atlas) A_WARN_UNUSED;
static void convertAtlas(TextureAtlas *atlas);
diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h
index e3cfc6581..44f3dcb83 100644
--- a/src/resources/beinginfo.h
+++ b/src/resources/beinginfo.h
@@ -92,12 +92,12 @@ class BeingInfo final
void setName(const std::string &name)
{ mName = name; }
- const std::string &getName() const
+ const std::string &getName() const A_WARN_UNUSED
{ return mName; }
void setDisplay(SpriteDisplay display);
- const SpriteDisplay &getDisplay() const
+ const SpriteDisplay &getDisplay() const A_WARN_UNUSED
{ return mDisplay; }
void setTargetCursorSize(const std::string &size);
@@ -112,22 +112,23 @@ class BeingInfo final
void setHoverCursor(const Cursor::Cursor &cursor)
{ mHoverCursor = cursor; }
- Cursor::Cursor getHoverCursor() const
+ Cursor::Cursor getHoverCursor() const A_WARN_UNUSED
{ return mHoverCursor; }
- ActorSprite::TargetCursorSize getTargetCursorSize() const
+ ActorSprite::TargetCursorSize getTargetCursorSize() const A_WARN_UNUSED
{ return mTargetCursorSize; }
void addSound(const SoundEvent event, const std::string &filename);
- const std::string &getSound(const SoundEvent event) const;
+ const std::string &getSound(const SoundEvent event)
+ const A_WARN_UNUSED;
void addAttack(const int id, std::string action, const int effectId,
const int hitEffectId, const int criticalHitEffectId,
const int missEffectId,
const std::string &missileParticle);
- const Attack *getAttack(const int id) const;
+ const Attack *getAttack(const int id) const A_WARN_UNUSED;
void setWalkMask(const unsigned char mask)
{ mWalkMask = mask; }
@@ -135,34 +136,34 @@ class BeingInfo final
/**
* Gets the way the being is blocked by other objects
*/
- unsigned char getWalkMask() const
+ unsigned char getWalkMask() const A_WARN_UNUSED
{ return mWalkMask; }
void setBlockType(const Map::BlockType &blockType)
{ mBlockType = blockType; }
- Map::BlockType getBlockType() const
+ Map::BlockType getBlockType() const A_WARN_UNUSED
{ return mBlockType; }
void setTargetOffsetX(const int n)
{ mTargetOffsetX = n; }
- int getTargetOffsetX() const
+ int getTargetOffsetX() const A_WARN_UNUSED
{ return mTargetOffsetX; }
void setTargetOffsetY(const int n)
{ mTargetOffsetY = n; }
- int getTargetOffsetY() const
+ int getTargetOffsetY() const A_WARN_UNUSED
{ return mTargetOffsetY; }
void setMaxHP(const int n)
{ mMaxHP = n; }
- int getMaxHP() const
+ int getMaxHP() const A_WARN_UNUSED
{ return mMaxHP; }
- bool isStaticMaxHP() const
+ bool isStaticMaxHP() const A_WARN_UNUSED
{ return mStaticMaxHP; }
void setStaticMaxHP(const bool n)
@@ -171,16 +172,16 @@ class BeingInfo final
void setTargetSelection(const bool n)
{ mTargetSelection = n; }
- bool isTargetSelection() const
+ bool isTargetSelection() const A_WARN_UNUSED
{ return mTargetSelection; }
- int getSortOffsetY() const
+ int getSortOffsetY() const A_WARN_UNUSED
{ return mSortOffsetY; }
void setSortOffsetY(const int n)
{ mSortOffsetY = n; }
- int getDeadSortOffsetY() const
+ int getDeadSortOffsetY() const A_WARN_UNUSED
{ return mDeadSortOffsetY; }
void setDeadSortOffsetY(const int n)
diff --git a/src/resources/chardb.h b/src/resources/chardb.h
index 5d133da00..c44ba6e36 100644
--- a/src/resources/chardb.h
+++ b/src/resources/chardb.h
@@ -47,21 +47,21 @@ namespace CharDB
void loadMinMax(const XmlNodePtr node,
unsigned *const min, unsigned *const max);
- unsigned getMinHairColor();
+ unsigned getMinHairColor() A_WARN_UNUSED;
- unsigned getMaxHairColor();
+ unsigned getMaxHairColor() A_WARN_UNUSED;
- unsigned getMinHairStyle();
+ unsigned getMinHairStyle() A_WARN_UNUSED;
- unsigned getMaxHairStyle();
+ unsigned getMaxHairStyle() A_WARN_UNUSED;
- unsigned getMinStat();
+ unsigned getMinStat() A_WARN_UNUSED;
- unsigned getMaxStat();
+ unsigned getMaxStat() A_WARN_UNUSED;
- unsigned getSumStat();
+ unsigned getSumStat() A_WARN_UNUSED;
- const std::vector<int> &getDefaultItems();
+ const std::vector<int> &getDefaultItems() A_WARN_UNUSED;
}
#endif
diff --git a/src/resources/colordb.h b/src/resources/colordb.h
index 0ac7662ae..4f48ce7b2 100644
--- a/src/resources/colordb.h
+++ b/src/resources/colordb.h
@@ -71,11 +71,11 @@ namespace ColorDB
*/
void unload();
- std::string &getHairColorName(const int id);
+ std::string &getHairColorName(const int id) A_WARN_UNUSED;
- int getHairSize();
+ int getHairSize() A_WARN_UNUSED;
- std::map <int, ItemColor> *getColorsList(std::string name);
+ std::map <int, ItemColor> *getColorsList(std::string name) A_WARN_UNUSED;
// Color DB
typedef std::map<int, ItemColor> Colors;
diff --git a/src/resources/cursor.h b/src/resources/cursor.h
index 4ecbb82de..ae8210c25 100644
--- a/src/resources/cursor.h
+++ b/src/resources/cursor.h
@@ -23,6 +23,8 @@
#include <string>
+#include "localconsts.h"
+
namespace Cursor
{
/**
@@ -54,7 +56,7 @@ namespace Cursor
Cursor cursor;
};
- Cursor stringToCursor(const std::string &name);
+ Cursor stringToCursor(const std::string &name) A_WARN_UNUSED;
}
#endif
diff --git a/src/resources/dye.h b/src/resources/dye.h
index 400010f37..bb0ee7b32 100644
--- a/src/resources/dye.h
+++ b/src/resources/dye.h
@@ -80,7 +80,7 @@ class DyePalette final
*/
void replaceAOGLColor(uint8_t *const color) const;
- static int hexDecode(const signed char c);
+ static int hexDecode(const signed char c) A_WARN_UNUSED;
private:
struct Color
@@ -125,19 +125,19 @@ class Dye final
/**
* Return special dye palete (S)
*/
- DyePalette *getSPalete() const
+ DyePalette *getSPalete() const A_WARN_UNUSED
{ return mDyePalettes[sPaleteIndex]; }
/**
* Return special dye palete (A)
*/
- DyePalette *getAPalete() const
+ DyePalette *getAPalete() const A_WARN_UNUSED
{ return mDyePalettes[aPaleteIndex]; }
/**
* Return dye type for S - 1, for A - 2, 0 for other
*/
- int getType() const;
+ int getType() const A_WARN_UNUSED;
private:
diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h
index 6389d9ada..4dfa1175e 100644
--- a/src/resources/emotedb.h
+++ b/src/resources/emotedb.h
@@ -66,16 +66,21 @@ namespace EmoteDB
void unload();
- const EmoteInfo *get(const int id, const bool allowNull = false);
+ const EmoteInfo *get(const int id,
+ const bool allowNull = false) A_WARN_UNUSED;
const AnimatedSprite *getAnimation(const int id,
- const bool allowNull = false);
+ const bool allowNull = false)
+ A_WARN_UNUSED;
- const AnimatedSprite *getAnimation2(int id, const bool allowNull = false);
+ const AnimatedSprite *getAnimation2(int id,
+ const bool allowNull = false)
+ A_WARN_UNUSED;
- const EmoteSprite *getSprite(const int id, const bool allowNull = false);
+ const EmoteSprite *getSprite(const int id, const bool allowNull = false)
+ A_WARN_UNUSED;
- const int &getLast();
+ const int &getLast() A_WARN_UNUSED;
typedef EmoteInfos::iterator EmoteInfosIterator;
}
diff --git a/src/resources/image.h b/src/resources/image.h
index 87a842aa3..27a34a319 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -85,26 +85,26 @@ class Image : public Resource
/**
* Tells is the image is loaded
*/
- bool isLoaded() const
+ bool isLoaded() const A_WARN_UNUSED
{ return mLoaded; }
/**
* Returns the width of the image.
*/
- inline int getWidth() const // was virtual
+ inline int getWidth() const A_WARN_UNUSED
{ return mBounds.w; }
/**
* Returns the height of the image.
*/
- inline int getHeight() const // was virtual
+ inline int getHeight() const A_WARN_UNUSED
{ return mBounds.h; }
/**
* Tells if the image has got an alpha channel
* @return true if it's true, false otherwise.
*/
- bool hasAlphaChannel() const;
+ bool hasAlphaChannel() const A_WARN_UNUSED;
/**
* Sets the alpha value of this image.
@@ -114,7 +114,7 @@ class Image : public Resource
/**
* Returns the alpha value of this image.
*/
- float getAlpha() const
+ float getAlpha() const A_WARN_UNUSED
{ return mAlpha; }
/**
@@ -124,7 +124,8 @@ class Image : public Resource
* object otherwise.
*/
virtual Image *getSubImage(const int x, const int y,
- const int width, const int height);
+ const int width,
+ const int height) A_WARN_UNUSED;
// SDL only public functions
@@ -137,12 +138,13 @@ class Image : public Resource
*
* @return A new Image* object.
*/
- Image* SDLgetScaledImage(const int width, const int height) const;
+ Image* SDLgetScaledImage(const int width,
+ const int height) const A_WARN_UNUSED;
/**
* Get the alpha Channel of a SDL surface.
*/
- uint8_t *SDLgetAlphaChannel() const
+ uint8_t *SDLgetAlphaChannel() const A_WARN_UNUSED
{ return mAlphaChannel; }
void SDLCleanCache();
@@ -150,13 +152,13 @@ class Image : public Resource
void SDLTerminateAlphaCache();
#ifdef USE_OPENGL
- int getTextureWidth() const
+ int getTextureWidth() const A_WARN_UNUSED
{ return mTexWidth; }
- int getTextureHeight() const
+ int getTextureHeight() const A_WARN_UNUSED
{ return mTexHeight; }
- GLuint getGLImage() const
+ GLuint getGLImage() const A_WARN_UNUSED
{ return mGLImage; }
GLuint mGLImage;
@@ -164,16 +166,16 @@ class Image : public Resource
int mTexHeight;
#endif
- bool isHasAlphaChannel() const
+ bool isHasAlphaChannel() const A_WARN_UNUSED
{ return mHasAlphaChannel; }
- bool isAlphaVisible() const
+ bool isAlphaVisible() const A_WARN_UNUSED
{ return mIsAlphaVisible; }
void setAlphaVisible(const bool b)
{ mIsAlphaVisible = b; }
- bool isAlphaCalculated() const
+ bool isAlphaCalculated() const A_WARN_UNUSED
{ return mIsAlphaCalculated; }
void setAlphaCalculated(const bool b)
@@ -199,7 +201,7 @@ class Image : public Resource
Image(SDL_Surface *const image, const bool hasAlphaChannel = false,
uint8_t *const alphaChannel = nullptr);
- SDL_Surface *getByAlpha(const float alpha);
+ SDL_Surface *getByAlpha(const float alpha) A_WARN_UNUSED;
SDL_Surface *mSDLSurface;
diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h
index 2d25091fd..a11a55e2e 100644
--- a/src/resources/imagehelper.h
+++ b/src/resources/imagehelper.h
@@ -59,33 +59,34 @@ class ImageHelper
* @return <code>NULL</code> if an error occurred, a valid pointer
* otherwise.
*/
- Image *load(SDL_RWops *const rw);
+ Image *load(SDL_RWops *const rw) A_WARN_UNUSED;
#ifdef __GNUC__
- virtual Image *load(SDL_RWops *rw, Dye const &dye) = 0;
+ virtual Image *load(SDL_RWops *rw, Dye const &dye) A_WARN_UNUSED = 0;
- virtual Image *load(SDL_Surface *) = 0;
+ virtual Image *load(SDL_Surface *) A_WARN_UNUSED = 0;
virtual Image *createTextSurface(SDL_Surface *tmpImage,
- float alpha) = 0;
+ float alpha) A_WARN_UNUSED = 0;
- virtual int useOpenGL() = 0;
+ virtual int useOpenGL() A_WARN_UNUSED = 0;
#else
- virtual Image *load(SDL_RWops *rw, Dye const &dye)
+ virtual Image *load(SDL_RWops *rw, Dye const &dye) A_WARN_UNUSED
{ return nullptr; }
- virtual Image *load(SDL_Surface *)
+ virtual Image *load(SDL_Surface *) A_WARN_UNUSED
{ return nullptr; }
virtual Image *createTextSurface(SDL_Surface *const tmpImage,
- const float alpha)
+ const float alpha) A_WARN_UNUSED
{ return nullptr; }
- virtual int useOpenGL()
+ virtual int useOpenGL() A_WARN_UNUSED
{ return 0; }
#endif
- static SDL_Surface *convertTo32Bit(SDL_Surface *const tmpImage);
+ static SDL_Surface *convertTo32Bit(SDL_Surface *const tmpImage)
+ A_WARN_UNUSED;
void dumpSurfaceFormat(const SDL_Surface *const image) const;
diff --git a/src/resources/imageset.h b/src/resources/imageset.h
index b87891249..97d3d71fa 100644
--- a/src/resources/imageset.h
+++ b/src/resources/imageset.h
@@ -53,29 +53,29 @@ class ImageSet : public Resource
/**
* Returns the width of the images in the image set.
*/
- int getWidth() const
+ int getWidth() const A_WARN_UNUSED
{ return mWidth; }
/**
* Returns the height of the images in the image set.
*/
- int getHeight() const
+ int getHeight() const A_WARN_UNUSED
{ return mHeight; }
typedef std::vector<Image*>::size_type size_type;
- Image* get(const size_type i) const;
+ Image* get(const size_type i) const A_WARN_UNUSED;
- size_type size() const
+ size_type size() const A_WARN_UNUSED
{ return mImages.size(); }
- int getOffsetX() const
+ int getOffsetX() const A_WARN_UNUSED
{ return mOffsetX; }
void setOffsetX(const int n)
{ mOffsetX = n; }
- int getOffsetY() const
+ int getOffsetY() const A_WARN_UNUSED
{ return mOffsetY; }
void setOffsetY(const int n)
diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h
index 1e6de3929..bd0b2cdf4 100644
--- a/src/resources/itemdb.h
+++ b/src/resources/itemdb.h
@@ -28,6 +28,8 @@
#include <list>
#include <map>
+#include "localconsts.h"
+
class ItemInfo;
/**
@@ -47,10 +49,10 @@ namespace ItemDB
const StringVect &getTags();
- bool exists(const int id);
+ bool exists(const int id) A_WARN_UNUSED;
- const ItemInfo &get(const int id);
- const ItemInfo &get(const std::string &name);
+ const ItemInfo &get(const int id) A_WARN_UNUSED;
+ const ItemInfo &get(const std::string &name) A_WARN_UNUSED;
// Items database
typedef std::map<int, ItemInfo*> ItemInfos;
@@ -58,7 +60,7 @@ namespace ItemDB
const std::map<int, ItemInfo*> &getItemInfos();
- int getTagId(std::string tagName);
+ int getTagId(std::string tagName) A_WARN_UNUSED;
struct Stat
{
@@ -73,7 +75,6 @@ namespace ItemDB
};
void setStatsList(const std::vector<Stat> &stats);
-
}
#endif
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index cd832bd9d..e8a11c2a5 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -112,53 +112,55 @@ class ItemInfo final
void setId(const int id)
{ mId = id; }
- int getId() const
+ int getId() const A_WARN_UNUSED
{ return mId; }
void setName(const std::string &name)
{ mName = name; }
- const std::string &getName() const
+ const std::string &getName() const A_WARN_UNUSED
{ return mName; }
- const std::string getName(const unsigned char color) const;
+ const std::string getName(const unsigned char color)
+ const A_WARN_UNUSED;
void setParticleEffect(const std::string &particleEffect)
{ mParticle = particleEffect; }
- std::string getParticleEffect() const
+ std::string getParticleEffect() const A_WARN_UNUSED
{ return mParticle; }
void setDisplay(SpriteDisplay display)
{ mDisplay = display; }
- const SpriteDisplay &getDisplay() const
+ const SpriteDisplay &getDisplay() const A_WARN_UNUSED
{ return mDisplay; }
void setDescription(const std::string &description)
{ mDescription = description; }
- const std::string &getDescription() const
+ const std::string &getDescription() const A_WARN_UNUSED
{ return mDescription; }
- const std::string getDescription(const unsigned char color) const;
+ const std::string getDescription(const unsigned char color)
+ const A_WARN_UNUSED;
void setEffect(const std::string &effect)
{ mEffect = effect; }
- const std::string &getEffect() const
+ const std::string &getEffect() const A_WARN_UNUSED
{ return mEffect; }
void setType(const ItemType type)
{ mType = type; }
- ItemType getType() const
+ ItemType getType() const A_WARN_UNUSED
{ return mType; }
void setWeight(const int weight)
{ mWeight = weight; }
- int getWeight() const
+ int getWeight() const A_WARN_UNUSED
{ return mWeight; }
int getView() const
@@ -171,7 +173,7 @@ class ItemInfo final
const Gender gender, const int race);
const std::string &getSprite(const Gender gender,
- const int race) const;
+ const int race) const A_WARN_UNUSED;
void setAttackAction(std::string attackAction);
@@ -179,31 +181,31 @@ class ItemInfo final
void setMissileParticleFile(const std::string &s)
{ mMissileParticleFile = s; }
- const std::string &getMissileParticleFile() const
+ const std::string &getMissileParticleFile() const A_WARN_UNUSED
{ return mMissileParticleFile; }
void setHitEffectId(const int s)
{ mHitEffectId = s; }
- int getHitEffectId() const
+ int getHitEffectId() const A_WARN_UNUSED
{ return mHitEffectId; }
void setCriticalHitEffectId(const int s)
{ mCriticalHitEffectId = s; }
- int getCriticalHitEffectId() const
+ int getCriticalHitEffectId() const A_WARN_UNUSED
{ return mCriticalHitEffectId; }
void setMissEffectId(const int s)
{ mMissEffectId = s; }
- int getMissEffectId() const
+ int getMissEffectId() const A_WARN_UNUSED
{ return mMissEffectId; }
const std::string &getAttackAction() const
{ return mAttackAction; }
- int getAttackRange() const
+ int getAttackRange() const A_WARN_UNUSED
{ return mAttackRange; }
void setAttackRange(const int r)
@@ -212,24 +214,25 @@ class ItemInfo final
void addSound(const EquipmentSoundEvent event,
const std::string &filename);
- const std::string &getSound(const EquipmentSoundEvent event) const;
+ const std::string &getSound(const EquipmentSoundEvent event)
+ const A_WARN_UNUSED;
- int getDrawBefore(const int direction) const;
+ int getDrawBefore(const int direction) const A_WARN_UNUSED;
void setDrawBefore(const int direction, const int n);
- int getDrawAfter(const int direction) const;
+ int getDrawAfter(const int direction) const A_WARN_UNUSED;
void setDrawAfter(const int direction, int n);
- int getDrawPriority(const int direction) const;
+ int getDrawPriority(const int direction) const A_WARN_UNUSED;
void setDrawPriority(const int direction, const int n);
void setSpriteOrder(int *const ptr, const int direction,
const int n, const int def = -1) const;
- std::map<int, int> getTags() const
+ std::map<int, int> getTags() const A_WARN_UNUSED
{ return mTags; }
void addTag(const int tag)
@@ -238,38 +241,38 @@ class ItemInfo final
void setRemoveSprites()
{ mIsRemoveSprites = true; }
- bool isRemoveSprites() const
+ bool isRemoveSprites() const A_WARN_UNUSED
{ return mIsRemoveSprites; }
void setMaxFloorOffset(const int i)
{ maxFloorOffset = i; }
- int getMaxFloorOffset() const
+ int getMaxFloorOffset() const A_WARN_UNUSED
{ return maxFloorOffset; }
- bool isRemoveItemId(int id) const;
+ bool isRemoveItemId(int id) const A_WARN_UNUSED;
/** Effects to be shown when weapon attacks - see also effects.xml */
std::string mMissileParticleFile;
- int getReplaceToSpriteId(int id) const;
+ int getReplaceToSpriteId(int id) const A_WARN_UNUSED;
std::map<int, int> *addReplaceSprite(const int sprite,
const int direction);
- SpriteToItemMap *getSpriteToItemReplaceMap(const int directions) const;
+ SpriteToItemMap *getSpriteToItemReplaceMap(const int directions)
+ const A_WARN_UNUSED;
-// std::string getDyeString(int color) const;
-
- std::string getDyeColorsString(const int color) const;
+ std::string getDyeColorsString(const int color) const A_WARN_UNUSED;
void setColorsList(std::string name);
- bool isHaveColors() const
+ bool isHaveColors() const A_WARN_UNUSED
{ return !mColorList.empty(); }
const std::string replaceColors(std::string str,
- const unsigned char color) const;
+ const unsigned char color)
+ const A_WARN_UNUSED;
void setPickupCursor(const std::string &cursor)
{ return setPickupCursor(Cursor::stringToCursor(cursor)); }
@@ -277,7 +280,7 @@ class ItemInfo final
void setPickupCursor(const Cursor::Cursor &cursor)
{ mPickupCursor = cursor; }
- Cursor::Cursor getPickupCursor() const
+ Cursor::Cursor getPickupCursor() const A_WARN_UNUSED
{ return mPickupCursor; }
int mDrawBefore[10];
diff --git a/src/resources/mapdb.h b/src/resources/mapdb.h
index 32e9f5695..ec2561cd7 100644
--- a/src/resources/mapdb.h
+++ b/src/resources/mapdb.h
@@ -26,6 +26,8 @@
#include <map>
+#include "localconsts.h"
+
/**
* Color information database.
*/
@@ -51,9 +53,9 @@ namespace MapDB
*/
void unload();
- std::string getMapName(const std::string &name);
+ std::string getMapName(const std::string &name) A_WARN_UNUSED;
- MapInfo *getMapAtlas(const std::string &name);
+ MapInfo *getMapAtlas(const std::string &name) A_WARN_UNUSED;
// Maps DB
typedef std::map<std::string, std::string> Maps;
diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h
index 172b8c1c5..4ef3eafc2 100644
--- a/src/resources/mapreader.h
+++ b/src/resources/mapreader.h
@@ -41,16 +41,18 @@ class MapReader final
* Read an XML map from a file.
*/
static Map *readMap(const std::string &filename,
- const std::string &realFilename);
+ const std::string &realFilename) A_WARN_UNUSED;
/**
* Read an XML map from a parsed XML tree. The path is used to find the
* location of referenced tileset images.
*/
- static Map *readMap(XmlNodePtr node, const std::string &path);
+ static Map *readMap(XmlNodePtr node,
+ const std::string &path) A_WARN_UNUSED;
static Map *createEmptyMap(const std::string &filename,
- const std::string &realFilename);
+ const std::string &realFilename)
+ A_WARN_UNUSED;
private:
/**
@@ -72,7 +74,7 @@ class MapReader final
* Reads a tile set.
*/
static Tileset *readTileset(XmlNodePtr node, const std::string &path,
- Map *const map);
+ Map *const map) A_WARN_UNUSED;
};
#endif
diff --git a/src/resources/monsterdb.h b/src/resources/monsterdb.h
index b1c284f48..35cd40dff 100644
--- a/src/resources/monsterdb.h
+++ b/src/resources/monsterdb.h
@@ -23,6 +23,8 @@
#ifndef MONSTER_DB_H
#define MONSTER_DB_H
+#include "localconsts.h"
+
class BeingInfo;
/**
@@ -34,7 +36,7 @@ namespace MonsterDB
void unload();
- BeingInfo *get(const int id);
+ BeingInfo *get(const int id) A_WARN_UNUSED;
}
#endif
diff --git a/src/resources/music.h b/src/resources/music.h
index 039b887d6..bf0a572dc 100644
--- a/src/resources/music.h
+++ b/src/resources/music.h
@@ -55,7 +55,7 @@ class Music final : public Resource
* @return <code>NULL</code> if the an error occurred, a valid pointer
* otherwise.
*/
- static Resource *load(SDL_RWops *const rw);
+ static Resource *load(SDL_RWops *const rw) A_WARN_UNUSED;
/**
* Plays the music.
diff --git a/src/resources/npcdb.h b/src/resources/npcdb.h
index 5d8bea02f..08063da99 100644
--- a/src/resources/npcdb.h
+++ b/src/resources/npcdb.h
@@ -23,6 +23,8 @@
#ifndef NPC_DB_H
#define NPC_DB_H
+#include "localconsts.h"
+
class BeingInfo;
/**
@@ -34,7 +36,7 @@ namespace NPCDB
void unload();
- BeingInfo *get(const int id);
+ BeingInfo *get(const int id) A_WARN_UNUSED;
}
#endif
diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h
index b0428f58a..01ae7f66c 100644
--- a/src/resources/openglimagehelper.h
+++ b/src/resources/openglimagehelper.h
@@ -78,15 +78,15 @@ class OpenGLImageHelper final : public ImageHelper
* @return <code>NULL</code> if an error occurred, a valid pointer
* otherwise.
*/
- Image *load(SDL_RWops *const rw, Dye const &dye);
+ Image *load(SDL_RWops *const rw, Dye const &dye) A_WARN_UNUSED;
/**
* Loads an image from an SDL surface.
*/
- Image *load(SDL_Surface *const tmpImage);
+ Image *load(SDL_Surface *const tmpImage) A_WARN_UNUSED;
Image *createTextSurface(SDL_Surface *const tmpImage,
- const float alpha);
+ const float alpha) A_WARN_UNUSED;
// OpenGL only public functions
@@ -96,10 +96,10 @@ class OpenGLImageHelper final : public ImageHelper
*/
static void setLoadAsOpenGL(int useOpenGL);
- static int getTextureType()
+ static int getTextureType() A_WARN_UNUSED
{ return mTextureType; }
- static int getInternalTextureType()
+ static int getInternalTextureType() A_WARN_UNUSED
{ return mInternalTextureType; }
static void setInternalTextureType(const int n)
@@ -116,9 +116,9 @@ class OpenGLImageHelper final : public ImageHelper
* Tells if the image was loaded using OpenGL or SDL
* @return true if OpenGL, false if SDL.
*/
- int useOpenGL();
+ int useOpenGL() A_WARN_UNUSED;
- static int getTextureSize()
+ static int getTextureSize() A_WARN_UNUSED
{ return mTextureSize; }
static void initTextureSampler(GLint id);
@@ -130,9 +130,9 @@ class OpenGLImageHelper final : public ImageHelper
/**
* Returns the first power of two equal or bigger than the input.
*/
- int powerOfTwo(int input) const;
+ int powerOfTwo(int input) const A_WARN_UNUSED;
- Image *glLoad(SDL_Surface *tmpImage);
+ Image *glLoad(SDL_Surface *tmpImage) A_WARN_UNUSED;
static int mUseOpenGL;
static int mTextureSize;
diff --git a/src/resources/resource.h b/src/resources/resource.h
index 9f07ead75..5ed8938d1 100644
--- a/src/resources/resource.h
+++ b/src/resources/resource.h
@@ -70,23 +70,23 @@ class Resource
/**
* Return the path identifying this resource.
*/
- const std::string &getIdPath() const
+ const std::string &getIdPath() const A_WARN_UNUSED
{ return mIdPath; }
/**
* Return refCount for this resource.
*/
- unsigned getRefCount() const
+ unsigned getRefCount() const A_WARN_UNUSED
{ return mRefCount; }
void setSource(const std::string &str)
{ mSource = str; }
- std::string getSource() const
+ std::string getSource() const A_WARN_UNUSED
{ return mSource; }
#ifdef DEBUG_DUMP_LEAKS
- bool getDumped() const
+ bool getDumped() const A_WARN_UNUSED
{ return mDumped; }
void setDumped(bool n)
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 5cf9e6e8a..220c5f3f3 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -116,17 +116,17 @@ class ResourceManager final
* Checks whether the given file or directory exists in the search path
* (PhysFS)
*/
- bool exists(const std::string &path) const;
+ bool exists(const std::string &path) const A_WARN_UNUSED;
/**
* Checks whether the given file or directory exists
*/
- bool existsLocal(const std::string &path) const;
+ bool existsLocal(const std::string &path) const A_WARN_UNUSED;
/**
* Checks whether the given path is a directory.
*/
- bool isDirectory(const std::string &path) const;
+ bool isDirectory(const std::string &path) const A_WARN_UNUSED;
/**
* Returns the real path to a file. Note that this method will always
@@ -135,7 +135,7 @@ class ResourceManager final
* @param file The file to get the real path to.
* @return The real path.
*/
- std::string getPath(const std::string &file) const;
+ std::string getPath(const std::string &file) const A_WARN_UNUSED;
/**
* Creates a resource and adds it to the resource map.
@@ -147,11 +147,12 @@ class ResourceManager final
* not be generated.
*/
Resource *get(const std::string &idPath, const generator fun,
- const void *const data);
+ const void *const data) A_WARN_UNUSED;
- Resource *getFromCache(const std::string &idPath);
+ Resource *getFromCache(const std::string &idPath) A_WARN_UNUSED;
- Resource *getFromCache(const std::string &filename, const int variant);
+ Resource *getFromCache(const std::string &filename,
+ const int variant) A_WARN_UNUSED;
/**
* Loads a resource from a file and adds it to the resource map.
@@ -161,7 +162,8 @@ class ResourceManager final
* @return A valid resource or <code>NULL</code> if the resource could
* not be loaded.
*/
- Resource *load(const std::string &path, const loader fun);
+ Resource *load(const std::string &path,
+ const loader fun) A_WARN_UNUSED;
/**
* Adds a preformatted resource to the resource map.
@@ -187,42 +189,45 @@ class ResourceManager final
* Convenience wrapper around ResourceManager::get for loading
* images.
*/
- Image *getImage(const std::string &idPath);
+ Image *getImage(const std::string &idPath) A_WARN_UNUSED;
/**
* Convenience wrapper around ResourceManager::get for loading
* songs.
*/
- Music *getMusic(const std::string &idPath);
+ Music *getMusic(const std::string &idPath) A_WARN_UNUSED;
/**
* Convenience wrapper around ResourceManager::get for loading
* samples.
*/
- SoundEffect *getSoundEffect(const std::string &idPath);
+ SoundEffect *getSoundEffect(const std::string &idPath) A_WARN_UNUSED;
/**
* Creates a image set based on the image referenced by the given
* path and the supplied sprite sizes
*/
ImageSet *getImageSet(const std::string &imagePath,
- const int w, const int h);
+ const int w, const int h) A_WARN_UNUSED;
ImageSet *getSubImageSet(Image *const parent,
- const int width, const int height);
+ const int width,
+ const int height) A_WARN_UNUSED;
Image *getSubImage(Image *const parent, const int x, const int y,
- const int width, const int height);
+ const int width, const int height) A_WARN_UNUSED;
#ifdef USE_OPENGL
- Resource *getAtlas(const std::string &name, const StringVect &files);
+ Resource *getAtlas(const std::string &name,
+ const StringVect &files) A_WARN_UNUSED;
#endif
/**
* Creates a sprite definition based on a given path and the supplied
* variant.
*/
- SpriteDef *getSprite(const std::string &path, const int variant = 0);
+ SpriteDef *getSprite(const std::string &path,
+ const int variant = 0) A_WARN_UNUSED;
/**
* Releases a resource, placing it in the set of orphaned resources.
@@ -248,7 +253,8 @@ class ResourceManager final
* @return An allocated byte array containing the data that was loaded,
* or <code>NULL</code> on fail.
*/
- static void *loadFile(const std::string &fileName, int &fileSize);
+ static void *loadFile(const std::string &fileName,
+ int &fileSize) A_WARN_UNUSED;
/**
* Retrieves the contents of a text file (PhysFS).
@@ -259,19 +265,21 @@ class ResourceManager final
/**
* Retrieves the contents of a text file.
*/
- static StringVect loadTextFileLocal(const std::string &fileName);
+ static StringVect loadTextFileLocal(const std::string &fileName)
+ A_WARN_UNUSED;
void saveTextFile(std::string path, std::string name,
std::string text) const;
Image *getRescaled(Image *const image,
- const int width, const int height);
+ const int width, const int height) A_WARN_UNUSED;
/**
* Loads the given filename as an SDL surface. The returned surface is
* expected to be freed by the caller using SDL_FreeSurface.
*/
- SDL_Surface *loadSDLSurface(const std::string &filename) const;
+ SDL_Surface *loadSDLSurface(const std::string &filename)
+ const A_WARN_UNUSED;
void scheduleDelete(SDL_Surface *const surface);
@@ -281,14 +289,14 @@ class ResourceManager final
* Returns an instance of the class, creating one if it does not
* already exist.
*/
- static ResourceManager *getInstance();
+ static ResourceManager *getInstance() A_WARN_UNUSED;
/**
* Deletes the class instance if it exists.
*/
static void deleteInstance();
- int size() const
+ int size() const A_WARN_UNUSED
{ return static_cast<int>(mResources.size()); }
typedef std::map<std::string, Resource*> Resources;
@@ -296,18 +304,18 @@ class ResourceManager final
typedef Resources::const_iterator ResourceCIterator;
#ifdef DEBUG_DUMP_LEAKS
- Resources* getResources()
+ Resources* getResources() A_WARN_UNUSED
{ return &mResources; }
- Resources* getOrphanedResources()
+ Resources* getOrphanedResources() A_WARN_UNUSED
{ return &mOrphanedResources; }
#endif
bool cleanOrphans(const bool always = false);
- bool isInCache(const std::string &idPath) const;
+ bool isInCache(const std::string &idPath) const A_WARN_UNUSED;
- Resource *getTempResource(const std::string &idPath);
+ Resource *getTempResource(const std::string &idPath) A_WARN_UNUSED;
static void addDelayedAnimation(AnimationDelayLoad *const animation)
{ mDelayedAnimations.push_back(animation); }
diff --git a/src/resources/sdlimagehelper.h b/src/resources/sdlimagehelper.h
index ab91825b3..7c6cabaef 100644
--- a/src/resources/sdlimagehelper.h
+++ b/src/resources/sdlimagehelper.h
@@ -57,33 +57,34 @@ class SDLImageHelper final : public ImageHelper
* @return <code>NULL</code> if an error occurred, a valid pointer
* otherwise.
*/
- Image *load(SDL_RWops *const rw, Dye const &dye);
+ Image *load(SDL_RWops *const rw, Dye const &dye) A_WARN_UNUSED;
/**
* Loads an image from an SDL surface.
*/
- Image *load(SDL_Surface *const tmpImage);
+ Image *load(SDL_Surface *const tmpImage) A_WARN_UNUSED;
Image *createTextSurface(SDL_Surface *const tmpImage,
- const float alpha);
+ const float alpha) A_WARN_UNUSED;
static void SDLSetEnableAlphaCache(const bool n)
{ mEnableAlphaCache = n; }
- static bool SDLGetEnableAlphaCache()
+ static bool SDLGetEnableAlphaCache() A_WARN_UNUSED
{ return mEnableAlphaCache; }
/**
* Tells if the image was loaded using OpenGL or SDL
* @return true if OpenGL, false if SDL.
*/
- int useOpenGL();
+ int useOpenGL() A_WARN_UNUSED;
- static SDL_Surface* SDLDuplicateSurface(SDL_Surface *const tmpImage);
+ static SDL_Surface* SDLDuplicateSurface(SDL_Surface *const tmpImage)
+ A_WARN_UNUSED;
protected:
/** SDL_Surface to SDL_Surface Image loader */
- Image *_SDLload(SDL_Surface *tmpImage) const;
+ Image *_SDLload(SDL_Surface *tmpImage) const A_WARN_UNUSED;
static bool mEnableAlphaCache;
};
diff --git a/src/resources/specialdb.h b/src/resources/specialdb.h
index 06f150b73..e23402e3b 100644
--- a/src/resources/specialdb.h
+++ b/src/resources/specialdb.h
@@ -79,9 +79,10 @@ namespace SpecialDB
/** gets the special info for ID. Will return 0 when it is
* a server-specific special.
*/
- SpecialInfo *get(const int id);
+ SpecialInfo *get(const int id) A_WARN_UNUSED;
- SpecialInfo::TargetMode targetModeFromString(const std::string& str);
+ SpecialInfo::TargetMode targetModeFromString(const std::string& str)
+ A_WARN_UNUSED;
}
typedef std::map<int, SpecialInfo *> SpecialInfos;
diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h
index 58ac6cfe9..f3fbdf106 100644
--- a/src/resources/spritedef.h
+++ b/src/resources/spritedef.h
@@ -117,21 +117,22 @@ class SpriteDef final : public Resource
/**
* Loads a sprite definition file.
*/
- static SpriteDef *load(const std::string &file, const int variant);
+ static SpriteDef *load(const std::string &file,
+ const int variant) A_WARN_UNUSED;
/**
* Returns the specified action.
*/
- Action *getAction(const std::string &action, const unsigned num) const;
+ Action *getAction(const std::string &action,
+ const unsigned num) const A_WARN_UNUSED;
- unsigned findNumber(const unsigned num) const;
+ unsigned findNumber(const unsigned num) const A_WARN_UNUSED;
/**
* Converts a string into a SpriteDirection enum.
*/
static SpriteDirection
-
- makeSpriteDirection(const std::string &direction);
+ makeSpriteDirection(const std::string &direction) A_WARN_UNUSED;
void addAction(const unsigned hp, const std::string &name,
Action *const action);
diff --git a/src/resources/subimage.h b/src/resources/subimage.h
index 69e0debab..b3403a727 100644
--- a/src/resources/subimage.h
+++ b/src/resources/subimage.h
@@ -71,7 +71,7 @@ class SubImage final : public Image
* @return <code>NULL</code> if creation failed and a valid
* image otherwise.
*/
- Image *getSubImage(int x, int y, int width, int height);
+ Image *getSubImage(int x, int y, int width, int height) A_WARN_UNUSED;
SDL_Rect mInternalBounds;
diff --git a/src/resources/wallpaper.h b/src/resources/wallpaper.h
index b488595db..989087fa5 100644
--- a/src/resources/wallpaper.h
+++ b/src/resources/wallpaper.h
@@ -47,7 +47,8 @@ class Wallpaper final
* @param height the desired height
* @return the file to use, or empty if no wallpapers are useable
*/
- static std::string getWallpaper(const int width, const int height);
+ static std::string getWallpaper(const int width,
+ const int height) A_WARN_UNUSED;
};
#endif // WALLPAPER_H
diff --git a/src/utils/base64.h b/src/utils/base64.h
index 92c230169..b0c349277 100644
--- a/src/utils/base64.h
+++ b/src/utils/base64.h
@@ -30,7 +30,11 @@
#ifndef BASE64_H
#define BASE64_H
-extern unsigned char *php3_base64_encode(const unsigned char *, int, int *);
-extern unsigned char *php3_base64_decode(const unsigned char *, int, int *);
+#include "localconsts.h"
+
+extern unsigned char *php3_base64_encode(const unsigned char *,
+ int, int *) A_WARN_UNUSED;
+extern unsigned char *php3_base64_decode(const unsigned char *,
+ int, int *) A_WARN_UNUSED;
#endif /* BASE64_H */
diff --git a/src/utils/copynpaste.h b/src/utils/copynpaste.h
index 53f00453b..7bc2536c5 100644
--- a/src/utils/copynpaste.h
+++ b/src/utils/copynpaste.h
@@ -21,6 +21,8 @@
#include <string>
+#include "localconsts.h"
+
/**
* Attempts to retrieve text from the clipboard buffer and inserts it in
* \a text at position \pos. The characters are encoded in utf-8.
@@ -30,6 +32,6 @@
* @return <code>true</code> when successful or <code>false</code> when there
* was a problem retrieving the clipboard buffer.
*/
-bool retrieveBuffer(std::string& text, size_t& pos);
+bool retrieveBuffer(std::string& text, size_t& pos) A_WARN_UNUSED;
bool sendBuffer(std::string& text);