From bebb71a3dfadb2b94ba46c0c66f0d40d6ef75e43 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 12 Dec 2016 20:26:59 +0300 Subject: Add noexcept in some files. --- src/being/actor.h | 6 +++--- src/being/actorsprite.h | 4 ++-- src/being/being.h | 6 +++--- src/being/flooritem.h | 24 ++++++++++++------------ src/being/localplayer.h | 34 +++++++++++++++++----------------- src/being/playerrelations.h | 6 ++++-- 6 files changed, 41 insertions(+), 39 deletions(-) (limited to 'src/being') diff --git a/src/being/actor.h b/src/being/actor.h index 72a9810ee..17029fbc5 100644 --- a/src/being/actor.h +++ b/src/being/actor.h @@ -70,7 +70,7 @@ class Actor notfinal /** * Returns the pixel position of this actor. */ - const Vector &getPixelPositionF() const A_WARN_UNUSED + const Vector &getPixelPositionF() const noexcept2 A_WARN_UNUSED { return mPos; } /** @@ -81,7 +81,7 @@ class Actor notfinal /** * Returns the pixels X coordinate of the actor. */ - int getPixelX() const A_WARN_UNUSED + int getPixelX() const noexcept2 A_WARN_UNUSED { return CAST_S32(mPos.x); } /** @@ -124,7 +124,7 @@ class Actor notfinal virtual void setMap(Map *const map); - const Map* getMap() const A_WARN_UNUSED + const Map* getMap() const noexcept2 A_WARN_UNUSED { return mMap; } int mPixelX; diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 4e6d38b73..f01a3eb43 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -58,10 +58,10 @@ class ActorSprite notfinal : public CompoundSprite, public Actor virtual ~ActorSprite(); - BeingId getId() const A_WARN_UNUSED + BeingId getId() const noexcept2 A_WARN_UNUSED { return mId; } - void setId(const BeingId id) + void setId(const BeingId id) noexcept2 { mId = id; } /** diff --git a/src/being/being.h b/src/being/being.h index 581386d3e..e1f97a08b 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -142,13 +142,13 @@ class Being notfinal : public ActorSprite, const int dstY) restrict2; void setCachedDestination(const int dstX, - const int dstY) restrict2 + const int dstY) restrict2 noexcept2 { mCachedX = dstX; mCachedY = dstY; } - int getCachedX() const A_WARN_UNUSED + int getCachedX() const noexcept2 A_WARN_UNUSED { return mCachedX; } - int getCachedY() const A_WARN_UNUSED + int getCachedY() const noexcept2 A_WARN_UNUSED { return mCachedY; } /** diff --git a/src/being/flooritem.h b/src/being/flooritem.h index 7803c6cac..248a8b351 100644 --- a/src/being/flooritem.h +++ b/src/being/flooritem.h @@ -78,7 +78,7 @@ class FloorItem final : public ActorSprite /** * Returns the item ID. */ - int getItemId() const A_WARN_UNUSED + int getItemId() const noexcept2 A_WARN_UNUSED { return mItemId; } /** @@ -95,41 +95,41 @@ class FloorItem final : public ActorSprite int getTileY() const override final A_WARN_UNUSED { return mY; } - void incrementPickup() + void incrementPickup() noexcept2 { mPickupCount ++; } - unsigned getPickupCount() const A_WARN_UNUSED + unsigned getPickupCount() const noexcept2 A_WARN_UNUSED { return mPickupCount; } - ItemColor getColor() const A_WARN_UNUSED + ItemColor getColor() const noexcept2 A_WARN_UNUSED { return mColor; } - bool getShowMsg() const A_WARN_UNUSED + bool getShowMsg() const noexcept2 A_WARN_UNUSED { return mShowMsg; } - void setShowMsg(const bool n) + void setShowMsg(const bool n) noexcept2 { mShowMsg = n; } - void disableHightlight() + void disableHightlight() noexcept2 { mHighlight = false; } - CursorT getHoverCursor() const A_WARN_UNUSED + CursorT getHoverCursor() const noexcept2 A_WARN_UNUSED { return mCursor; } void setCards(const int *const cards, int sz); int getCard(const int index) const; - int getRefine() const A_WARN_UNUSED + int getRefine() const noexcept2 A_WARN_UNUSED { return mRefine; } - ItemTypeT getItemType() const A_WARN_UNUSED + ItemTypeT getItemType() const noexcept2 A_WARN_UNUSED { return mItemType; } - Identified getIdentified() const A_WARN_UNUSED + Identified getIdentified() const noexcept2 A_WARN_UNUSED { return mIdentified; } - Damaged getDamaged() const A_WARN_UNUSED + Damaged getDamaged() const noexcept2 A_WARN_UNUSED { return mDamaged; } private: diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 3a7f4605d..1b97e3a18 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -116,7 +116,7 @@ class LocalPlayer final : public Being, void setGMLevel(const int level); - int getGMLevel() const A_WARN_UNUSED + int getGMLevel() const noexcept2 A_WARN_UNUSED { return mGMLevel; } void stopAttack(const bool keepAttack = false); @@ -150,7 +150,7 @@ class LocalPlayer final : public Being, /** * Gets the walking direction */ - unsigned char getWalkingDir() const A_WARN_UNUSED + unsigned char getWalkingDir() const noexcept2 A_WARN_UNUSED { return mWalkingDir; } /** @@ -192,13 +192,13 @@ class LocalPlayer final : public Being, { mPathSetByMouse = true; } /** Tells if the path has been set by mouse. */ - bool isPathSetByMouse() const A_WARN_UNUSED + bool isPathSetByMouse() const noexcept2 A_WARN_UNUSED { return mPathSetByMouse; } - unsigned int getMoveState() const A_WARN_UNUSED + unsigned int getMoveState() const noexcept2 A_WARN_UNUSED { return mMoveState; } - void setMoveState(const unsigned int n) + void setMoveState(const unsigned int n) noexcept2 { mMoveState = n; } std::string getPingTime() const A_WARN_UNUSED; @@ -240,7 +240,7 @@ class LocalPlayer final : public Being, void setHalfAway(const bool n) { mInactive = n; } - bool getHalfAway() const A_WARN_UNUSED + bool getHalfAway() const noexcept2 A_WARN_UNUSED { return mInactive; } void afkRespond(ChatTab *const tab, const std::string &nick); @@ -272,7 +272,7 @@ class LocalPlayer final : public Being, void setRealPos(const int x, const int y); - bool isServerBuggy() const A_WARN_UNUSED + bool isServerBuggy() const noexcept2 A_WARN_UNUSED { return mIsServerBuggy; } void fixPos(); @@ -308,15 +308,15 @@ class LocalPlayer final : public Being, */ void setNextDest(const int x, const int y); - int getNextDestX() const A_WARN_UNUSED + int getNextDestX() const noexcept2 A_WARN_UNUSED { return mNextDestX; } - int getNextDestY() const A_WARN_UNUSED + int getNextDestY() const noexcept2 A_WARN_UNUSED { return mNextDestY; } void respawn(); - const FloorItem *getPickUpTarget() const A_WARN_UNUSED + const FloorItem *getPickUpTarget() const noexcept2 A_WARN_UNUSED { return mPickUpTarget; } void unSetPickUpTarget() @@ -330,13 +330,13 @@ class LocalPlayer final : public Being, /** * Get the playername followed by the current player. */ - const std::string &getFollow() const A_WARN_UNUSED + const std::string &getFollow() const noexcept2 A_WARN_UNUSED { return mPlayerFollowed; } /** * Get the playername imitated by the current player. */ - const std::string &getImitate() const A_WARN_UNUSED + const std::string &getImitate() const noexcept2 A_WARN_UNUSED { return mPlayerImitated; } /** @@ -350,7 +350,7 @@ class LocalPlayer final : public Being, * Gets if the engine has to check * if the Player Name is to be displayed. */ - bool getCheckNameSetting() const A_WARN_UNUSED + bool getCheckNameSetting() const noexcept2 A_WARN_UNUSED { return mUpdateName; } void fixAttackTarget(); @@ -411,19 +411,19 @@ class LocalPlayer final : public Being, void updateMusic() const; - void setAfkTime(const int v) + void setAfkTime(const int v) noexcept2 { mAfkTime = v; } void setAwayDialog(OkDialog *const dialog) { mAwayDialog = dialog; } - AwayListener *getAwayListener() const A_WARN_UNUSED + AwayListener *getAwayListener() const noexcept2 A_WARN_UNUSED { return mAwayListener; } - void setRename(const bool r) + void setRename(const bool r) noexcept2 { mAllowRename = r; } - bool getRename() const + bool getRename() const noexcept2 { return mAllowRename; } bool canMove() const; diff --git a/src/being/playerrelations.h b/src/being/playerrelations.h index 2c09cd01c..31a007637 100644 --- a/src/being/playerrelations.h +++ b/src/being/playerrelations.h @@ -127,6 +127,7 @@ class PlayerRelationsManager final * \return A player ignore strategy, or nullptr */ const PlayerIgnoreStrategy *getPlayerIgnoreStrategy() const + noexcept2 A_WARN_UNUSED { return mIgnoreStrategy; } @@ -134,6 +135,7 @@ class PlayerRelationsManager final * Sets the strategy to call when ignoring players. */ void setPlayerIgnoreStrategy(PlayerIgnoreStrategy *const strategy) + noexcept2 { mIgnoreStrategy = strategy; } /** @@ -163,7 +165,7 @@ class PlayerRelationsManager final /** * Do we persist our `ignore' setup? */ - bool getPersistIgnores() const + bool getPersistIgnores() const noexcept2 A_WARN_UNUSED { return mPersistIgnores; } void ignoreTrade(const std::string &name) const; @@ -177,7 +179,7 @@ class PlayerRelationsManager final * * @param value Whether to persist ignores */ - void setPersistIgnores(const bool value) + void setPersistIgnores(const bool value) noexcept2 { mPersistIgnores = value; } void addListener(PlayerRelationsListener *const listener) -- cgit v1.2.3-70-g09d2