summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-09-28 00:58:25 +0300
committerAndrei Karas <akaras@inbox.ru>2013-09-28 23:40:11 +0300
commit99906c44cf9208dee4e808e03fddd1f209b6b7fc (patch)
tree8472ed92c0963938dee4290d25cd6c4ebf2e4d81 /src
parentc430b75e370a21a17f80d4ba3acd84111828a462 (diff)
downloadmanaverse-99906c44cf9208dee4e808e03fddd1f209b6b7fc.tar.gz
manaverse-99906c44cf9208dee4e808e03fddd1f209b6b7fc.tar.bz2
manaverse-99906c44cf9208dee4e808e03fddd1f209b6b7fc.tar.xz
manaverse-99906c44cf9208dee4e808e03fddd1f209b6b7fc.zip
add const for methods return values.
Diffstat (limited to 'src')
-rw-r--r--src/animatedsprite.cpp4
-rw-r--r--src/animatedsprite.h4
-rw-r--r--src/being/being.cpp2
-rw-r--r--src/gui/widgets/chattab.h2
-rw-r--r--src/net/ea/inventoryhandler.h2
-rw-r--r--src/resources/action.cpp2
-rw-r--r--src/resources/action.h2
-rw-r--r--src/resources/iteminfo.cpp3
-rw-r--r--src/resources/iteminfo.h6
9 files changed, 14 insertions, 13 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp
index bbfde2adb..0bcb78713 100644
--- a/src/animatedsprite.cpp
+++ b/src/animatedsprite.cpp
@@ -142,7 +142,7 @@ bool AnimatedSprite::play(const std::string &spriteAction)
return false;
mAction = action;
- Animation *const animation = mAction->getAnimation(mDirection);
+ const Animation *const animation = mAction->getAnimation(mDirection);
if (animation && animation != mAnimation && animation->getLength() > 0)
{
@@ -307,7 +307,7 @@ bool AnimatedSprite::setSpriteDirection(const SpriteDirection direction)
if (!mAction)
return false;
- Animation *const animation = mAction->getAnimation(mDirection);
+ const Animation *const animation = mAction->getAnimation(mDirection);
if (animation && animation != mAnimation && animation->getLength() > 0)
{
diff --git a/src/animatedsprite.h b/src/animatedsprite.h
index 6ca44bb80..df287a560 100644
--- a/src/animatedsprite.h
+++ b/src/animatedsprite.h
@@ -136,8 +136,8 @@ class AnimatedSprite final : public Sprite
SpriteDef *mSprite; /**< The sprite definition. */
const Action *mAction; /**< The currently active action. */
- Animation *mAnimation; /**< The currently active animation. */
- Frame *mFrame; /**< The currently active frame. */
+ const Animation *mAnimation; /**< The currently active animation. */
+ const Frame *mFrame; /**< The currently active frame. */
unsigned mNumber;
unsigned mNumber1;
AnimationDelayLoad *mDelayLoad;
diff --git a/src/being/being.cpp b/src/being/being.cpp
index bcf444df3..b9d720671 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2467,7 +2467,7 @@ void Being::recalcSpritesOrder()
if (info.isRemoveSprites())
{
- SpriteToItemMap *const spriteToItems
+ const SpriteToItemMap *const spriteToItems
= info.getSpriteToItemReplaceMap(dir);
if (spriteToItems)
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 55d8f7769..c2ac5a45b 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -143,7 +143,7 @@ class ChatTab : public Tab
virtual void saveToLogFile(const std::string &msg) const;
- std::list<std::string> &getRows() const A_WARN_UNUSED
+ const std::list<std::string> &getRows() const A_WARN_UNUSED
{ return mTextOutput->getRows(); }
bool hasRows() const A_WARN_UNUSED
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index d4dbbbd54..776443cf7 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -51,7 +51,7 @@ class EquipBackend : public Equipment::Backend
A_DELETE_COPY(EquipBackend)
- Item *getEquipment(const int index) const A_WARN_UNUSED
+ Item *getEquipment(const int index) const override A_WARN_UNUSED
{
int invyIndex = mEquipment[index];
if (invyIndex == -1)
diff --git a/src/resources/action.cpp b/src/resources/action.cpp
index b4426daae..9b4d4b57a 100644
--- a/src/resources/action.cpp
+++ b/src/resources/action.cpp
@@ -40,7 +40,7 @@ Action::~Action()
delete_all(mAnimations);
}
-Animation *Action::getAnimation(int direction) const
+const Animation *Action::getAnimation(int direction) const
{
Animations::const_iterator i = mAnimations.find(direction);
diff --git a/src/resources/action.h b/src/resources/action.h
index 16f3d96d5..c3b4852b3 100644
--- a/src/resources/action.h
+++ b/src/resources/action.h
@@ -43,7 +43,7 @@ class Action final
void setAnimation(const int direction, Animation *const animation);
- Animation *getAnimation(int direction) const A_WARN_UNUSED;
+ const Animation *getAnimation(int direction) const A_WARN_UNUSED;
unsigned getNumber() const A_WARN_UNUSED
{ return mNumber; }
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index b4d1d5a69..dd86e3196 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -236,7 +236,8 @@ const std::string ItemInfo::replaceColors(std::string str,
return replaceAll(str, "%Color%", name);
}
-SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(const int direction) const
+const SpriteToItemMap *ItemInfo::getSpriteToItemReplaceMap(const int direction)
+ const
{
if (direction < 0 || direction >= 10)
return nullptr;
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 292089dc5..71a6119af 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -238,7 +238,7 @@ class ItemInfo final
void setSpriteOrder(int *const ptr, const int direction,
const int n, const int def = -1) const;
- std::map<int, int> getTags() const A_WARN_UNUSED
+ const std::map<int, int> &getTags() const A_WARN_UNUSED
{ return mTags; }
void addTag(const int tag)
@@ -272,8 +272,8 @@ class ItemInfo final
std::map<int, int> *addReplaceSprite(const int sprite,
const int direction);
- SpriteToItemMap *getSpriteToItemReplaceMap(const int directions)
- const A_WARN_UNUSED;
+ const SpriteToItemMap *getSpriteToItemReplaceMap(const int directions)
+ const A_WARN_UNUSED;
std::string getDyeColorsString(const int color) const A_WARN_UNUSED;