summaryrefslogtreecommitdiff
path: root/src/resources
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 /src/resources
parent6b1684d33dec02eb6308bb3d8d3707f4d5252ba5 (diff)
downloadmv-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.gz
mv-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.bz2
mv-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.xz
mv-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.zip
Add unused warnings to other files.
Diffstat (limited to 'src/resources')
-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
27 files changed, 214 insertions, 178 deletions
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