From f9030497b6196ce2fadb6b6ada5d784be227d9a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 1 May 2014 15:14:16 +0300 Subject: Add missing const. --- src/being/actorsprite.cpp | 2 +- src/being/actorsprite.h | 2 +- src/being/being.h | 8 ++++---- src/being/beingcacheentry.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/being') diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index 29fa1290c..75d337bd5 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -208,7 +208,7 @@ void ActorSprite::updateStatusEffect(const int index, const bool newStatus) handleStatusEffect(effect, index); } -void ActorSprite::handleStatusEffect(StatusEffect *const effect, +void ActorSprite::handleStatusEffect(const StatusEffect *const effect, const int effectId) { if (!effect) diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 76e90182d..fd90aba09 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -210,7 +210,7 @@ protected: * \param The StatusEffect to effect * \param effectId -1 for stun, otherwise the effect index */ - virtual void handleStatusEffect(StatusEffect *const effect, + virtual void handleStatusEffect(const StatusEffect *const effect, const int effectId); void setupSpriteDisplay(const SpriteDisplay &display, diff --git a/src/being/being.h b/src/being/being.h index 793454ca2..2a6ec9195 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -474,7 +474,7 @@ class Being : public ActorSprite, public ConfigListener /** * Sets the walk speed in pixels per second. */ - void setWalkSpeed(Vector speed) + void setWalkSpeed(const Vector &speed) { mWalkSpeed = speed; mSpeed = speed.x; } /** @@ -725,7 +725,7 @@ class Being : public ActorSprite, public ConfigListener const std::string &getIp() const A_WARN_UNUSED { return mIp; } - void setIp(std::string ip) + void setIp(const std::string &ip) { mIp = ip; } unsigned int getPvpRank() const A_WARN_UNUSED @@ -791,7 +791,7 @@ class Being : public ActorSprite, public ConfigListener const std::string getComment() const A_WARN_UNUSED { return mComment; } - void setComment(std::string n) + void setComment(const std::string &n) { mComment = n; } static void clearCache(); @@ -829,7 +829,7 @@ class Being : public ActorSprite, public ConfigListener void updatePercentHP(); - void setRaceName(std::string name) + void setRaceName(const std::string &name) { mRaceName = name; } std::string getRaceName() const A_WARN_UNUSED diff --git a/src/being/beingcacheentry.h b/src/being/beingcacheentry.h index af60a9090..c2c9aa513 100644 --- a/src/being/beingcacheentry.h +++ b/src/being/beingcacheentry.h @@ -97,7 +97,7 @@ class BeingCacheEntry final std::string getIp() const { return mIp; } - void setIp(std::string ip) + void setIp(const std::string &ip) { mIp = ip; } bool isAdvanced() const -- cgit v1.2.3-70-g09d2