diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-30 21:18:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-30 21:18:24 +0300 |
commit | 9ff808fb20962884d56147d46c8e4de915a0735d (patch) | |
tree | b09025e75c2e57a48e5be971953edbc14b466846 | |
parent | aaa274245a584c633dcfdb5444bbc1dc21c0c28f (diff) | |
download | plus-9ff808fb20962884d56147d46c8e4de915a0735d.tar.gz plus-9ff808fb20962884d56147d46c8e4de915a0735d.tar.bz2 plus-9ff808fb20962884d56147d46c8e4de915a0735d.tar.xz plus-9ff808fb20962884d56147d46c8e4de915a0735d.zip |
Disable noexcept for clang and old gcc versions.
32 files changed, 262 insertions, 242 deletions
diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 0eac9807d..2ee96f73c 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -66,7 +66,7 @@ class ActorSprite notfinal : public CompoundSprite, public Actor /** * Returns the type of the ActorSprite. */ - virtual ActorTypeT getType() const noexcept A_WARN_UNUSED + virtual ActorTypeT getType() const noexcept2 A_WARN_UNUSED { return ActorType::Unknown; } virtual void logic(); diff --git a/src/being/being.cpp b/src/being/being.cpp index 927353231..b1ca910e0 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -4403,7 +4403,7 @@ bool Being::isSellShopEnabled() const restrict2 #endif } -void Being::serverRemove() restrict2 noexcept +void Being::serverRemove() restrict2 noexcept2 { // remove some flags what can survive player remove and next visible mTrickDead = false; diff --git a/src/being/being.h b/src/being/being.h index 7010a2918..0386f3290 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -68,7 +68,7 @@ extern volatile int cur_time; struct NextSoundInfo final { - NextSoundInfo() noexcept : + NextSoundInfo() noexcept2 : sound(nullptr), x(0), y(0), @@ -106,7 +106,7 @@ class Being notfinal : public ActorSprite, virtual ~Being(); - ActorTypeT getType() const restrict2 noexcept override final + ActorTypeT getType() const restrict2 noexcept2 override final A_WARN_UNUSED { return mType; } @@ -118,14 +118,14 @@ class Being notfinal : public ActorSprite, /** * Returns the time spent in the current action. */ - int getActionTime() const restrict2 noexcept A_WARN_UNUSED + int getActionTime() const restrict2 noexcept2 A_WARN_UNUSED { return mActionTime; } /** * Set the current action time. * @see Ea::BeingHandler that set it to tick time. */ - void setActionTime(const int actionTime) restrict2 noexcept + void setActionTime(const int actionTime) restrict2 noexcept2 { mActionTime = actionTime; } /** @@ -141,19 +141,19 @@ class Being notfinal : public ActorSprite, /** * Returns the destination for this being. */ - const Vector &getDestination() const restrict2 noexcept A_WARN_UNUSED + const Vector &getDestination() const restrict2 noexcept2 A_WARN_UNUSED { return mDest; } /** * Returns the tile x coord */ - int getTileX() const restrict2 noexcept override A_WARN_UNUSED + int getTileX() const restrict2 noexcept2 override A_WARN_UNUSED { return mX; } /** * Returns the tile y coord */ - int getTileY() const restrict2 noexcept override A_WARN_UNUSED + int getTileY() const restrict2 noexcept2 override A_WARN_UNUSED { return mY; } /** @@ -208,10 +208,10 @@ class Being notfinal : public ActorSprite, /** * Returns the name of the being. */ - const std::string &getName() const restrict2 noexcept A_WARN_UNUSED + const std::string &getName() const restrict2 noexcept2 A_WARN_UNUSED { return mName; } - const std::string &getExtName() const restrict2 noexcept A_WARN_UNUSED + const std::string &getExtName() const restrict2 noexcept2 A_WARN_UNUSED { return mExtName; } /** @@ -221,7 +221,7 @@ class Being notfinal : public ActorSprite, */ void setName(const std::string &restrict name) restrict2; - bool getShowName() const noexcept A_WARN_UNUSED + bool getShowName() const noexcept2 A_WARN_UNUSED { return mShowName; } void setShowName(const bool doShowName) restrict2; @@ -231,11 +231,11 @@ class Being notfinal : public ActorSprite, */ void setPartyName(const std::string &restrict name) restrict2; - const std::string &getPartyName() const restrict2 noexcept + const std::string &getPartyName() const restrict2 noexcept2 A_WARN_UNUSED { return mPartyName; } - const std::string &getGuildName() const restrict2 noexcept + const std::string &getGuildName() const restrict2 noexcept2 A_WARN_UNUSED { return mGuildName; } @@ -276,7 +276,7 @@ class Being notfinal : public ActorSprite, /** * Returns all guilds the being is in. */ - const std::map<int, Guild*> &getGuilds() const restrict2 noexcept + const std::map<int, Guild*> &getGuilds() const restrict2 noexcept2 A_WARN_UNUSED { return mGuilds; } @@ -291,7 +291,7 @@ class Being notfinal : public ActorSprite, int16_t getNumberOfGuilds() const restrict2 A_WARN_UNUSED { return CAST_S16(mGuilds.size()); } - bool isInParty() const restrict2 noexcept A_WARN_UNUSED + bool isInParty() const restrict2 noexcept2 A_WARN_UNUSED { return mParty; } void setParty(Party *restrict const party) restrict2; @@ -300,7 +300,7 @@ class Being notfinal : public ActorSprite, void updateGuild() restrict2; - Party *getParty() const restrict2 noexcept A_WARN_UNUSED + Party *getParty() const restrict2 noexcept2 A_WARN_UNUSED { return mParty; } /** @@ -352,7 +352,7 @@ class Being notfinal : public ActorSprite, const int offsetX, const int offsetY) const restrict2 A_NONNULL(2); - BeingTypeId getSubType() const restrict2 noexcept A_WARN_UNUSED + BeingTypeId getSubType() const restrict2 noexcept2 A_WARN_UNUSED { return mSubType; } /** @@ -361,7 +361,7 @@ class Being notfinal : public ActorSprite, void setSubtype(const BeingTypeId subtype, const uint16_t look) restrict2; - const BeingInfo *getInfo() const restrict2 noexcept A_WARN_UNUSED + const BeingInfo *getInfo() const restrict2 noexcept2 A_WARN_UNUSED { return mInfo; } TargetCursorSizeT getTargetCursorSize() const restrict2 override final @@ -410,21 +410,21 @@ class Being notfinal : public ActorSprite, /** * Gets the walk speed in pixels per second. */ - int getWalkSpeed() const restrict2 noexcept A_WARN_UNUSED + int getWalkSpeed() const restrict2 noexcept2 A_WARN_UNUSED { return mWalkSpeed; } /** * Sets the attack speed. * @todo In what unit? */ - void setAttackSpeed(const int speed) restrict2 noexcept + void setAttackSpeed(const int speed) restrict2 noexcept2 { mAttackSpeed = speed; } /** * Gets the attack speed. * @todo In what unit? */ - int getAttackSpeed() const restrict2 noexcept A_WARN_UNUSED + int getAttackSpeed() const restrict2 noexcept2 A_WARN_UNUSED { return mAttackSpeed; } /** @@ -436,19 +436,19 @@ class Being notfinal : public ActorSprite, /** * Get the being's action currently performed. */ - BeingActionT getCurrentAction() const restrict2 noexcept A_WARN_UNUSED + BeingActionT getCurrentAction() const restrict2 noexcept2 A_WARN_UNUSED { return mAction; } /** * Returns whether this being is still alive. */ - bool isAlive() const restrict2 noexcept A_WARN_UNUSED + bool isAlive() const restrict2 noexcept2 A_WARN_UNUSED { return mAction != BeingAction::DEAD; } /** * Returns the current direction. */ - uint8_t getDirection() const restrict2 noexcept A_WARN_UNUSED + uint8_t getDirection() const restrict2 noexcept2 A_WARN_UNUSED { return mDirection; } /** @@ -456,16 +456,16 @@ class Being notfinal : public ActorSprite, */ virtual void setDirection(const uint8_t direction) restrict2; - void setDirectionDelayed(const uint8_t direction) restrict2 noexcept + void setDirectionDelayed(const uint8_t direction) restrict2 noexcept2 { mDirectionDelayed = direction; } - uint8_t getDirectionDelayed() const restrict2 noexcept A_WARN_UNUSED + uint8_t getDirectionDelayed() const restrict2 noexcept2 A_WARN_UNUSED { return mDirectionDelayed; } /** * Returns the direction the being is facing. */ - SpriteDirection::Type getSpriteDirection() const restrict2 noexcept + SpriteDirection::Type getSpriteDirection() const restrict2 noexcept2 A_WARN_UNUSED { return mSpriteDirection; } @@ -503,13 +503,13 @@ class Being notfinal : public ActorSprite, * Returns the path this being is following. An empty path is returned * when this being isn't following any path currently. */ - const Path &getPath() const restrict2 noexcept A_WARN_UNUSED + const Path &getPath() const restrict2 noexcept2 A_WARN_UNUSED { return mPath; } - int getDistance() const restrict2 noexcept A_WARN_UNUSED + int getDistance() const restrict2 noexcept2 A_WARN_UNUSED { return mDistance; } - void setDistance(const int n) restrict2 noexcept + void setDistance(const int n) restrict2 noexcept2 { mDistance = n; } /** @@ -547,24 +547,24 @@ class Being notfinal : public ActorSprite, void flashName(const int time) restrict2; - int getDamageTaken() const restrict2 noexcept A_WARN_UNUSED + int getDamageTaken() const restrict2 noexcept2 A_WARN_UNUSED { return mDamageTaken; } - void setDamageTaken(const int damage) restrict2 noexcept + void setDamageTaken(const int damage) restrict2 noexcept2 { mDamageTaken = damage; } void updateName() restrict2; - void setLevel(const int n) restrict2 noexcept + void setLevel(const int n) restrict2 noexcept2 { mLevel = n; } virtual int getLevel() const restrict2 A_WARN_UNUSED { return mLevel; } - void setReachable(const ReachableT n) restrict2 noexcept + void setReachable(const ReachableT n) restrict2 noexcept2 { mReachable = n; } - ReachableT getReachable() const restrict2 noexcept A_WARN_UNUSED + ReachableT getReachable() const restrict2 noexcept2 A_WARN_UNUSED { return mReachable; } static void reReadConfig(); @@ -580,7 +580,7 @@ class Being notfinal : public ActorSprite, */ virtual void setGender(const GenderT gender) restrict2; - GenderT getGender() const restrict2 noexcept A_WARN_UNUSED + GenderT getGender() const restrict2 noexcept2 A_WARN_UNUSED { return mGender; } /** @@ -613,7 +613,7 @@ class Being notfinal : public ActorSprite, /** * Whether or not this player is a GM. */ - bool isGM() const restrict2 noexcept A_WARN_UNUSED + bool isGM() const restrict2 noexcept2 A_WARN_UNUSED { return mIsGM; } /** @@ -621,7 +621,7 @@ class Being notfinal : public ActorSprite, */ void setGM(const bool gm) restrict2; - bool canTalk() const restrict2 noexcept A_WARN_UNUSED + bool canTalk() const restrict2 noexcept2 A_WARN_UNUSED { return mType == ActorType::Npc; } void talkTo() const restrict2; @@ -655,60 +655,60 @@ class Being notfinal : public ActorSprite, const int x, const int y) const restrict2 A_NONNULL(2); - void setMoveTime() restrict2 noexcept + void setMoveTime() restrict2 noexcept2 { mMoveTime = cur_time; } - void setAttackTime() restrict2 noexcept + void setAttackTime() restrict2 noexcept2 { mAttackTime = cur_time; } - void setTalkTime() restrict2 noexcept + void setTalkTime() restrict2 noexcept2 { mTalkTime = cur_time; } - void setTestTime() restrict2 noexcept + void setTestTime() restrict2 noexcept2 { mTestTime = cur_time; } - void setOtherTime() restrict2 noexcept + void setOtherTime() restrict2 noexcept2 { mOtherTime = cur_time; } - int getMoveTime() const restrict2 noexcept + int getMoveTime() const restrict2 noexcept2 { return mMoveTime; } - int getAttackTime() const restrict2 noexcept + int getAttackTime() const restrict2 noexcept2 { return mAttackTime; } - int getTalkTime() const restrict2 noexcept + int getTalkTime() const restrict2 noexcept2 { return mTalkTime; } - int getTestTime() const restrict2 noexcept + int getTestTime() const restrict2 noexcept2 { return mTestTime; } - int getOtherTime() const restrict2 noexcept + int getOtherTime() const restrict2 noexcept2 { return mOtherTime; } void resetCounters() restrict2; void updateColors() restrict2; - void setEnemy(const bool n) restrict2 noexcept + void setEnemy(const bool n) restrict2 noexcept2 { mEnemy = n; } - const std::string &getIp() const restrict2 noexcept A_WARN_UNUSED + const std::string &getIp() const restrict2 noexcept2 A_WARN_UNUSED { return mIp; } - void setIp(const std::string &restrict ip) restrict2 noexcept + void setIp(const std::string &restrict ip) restrict2 noexcept2 { mIp = ip; } - unsigned int getPvpRank() const restrict2 noexcept A_WARN_UNUSED + unsigned int getPvpRank() const restrict2 noexcept2 A_WARN_UNUSED { return mPvpRank; } - void setPvpRank(const unsigned int rank) restrict2 noexcept + void setPvpRank(const unsigned int rank) restrict2 noexcept2 { mPvpRank = rank; } void setHP(const int n) restrict2; void setMaxHP(const int hp) restrict2; - int getHP() const restrict2 noexcept A_WARN_UNUSED + int getHP() const restrict2 noexcept2 A_WARN_UNUSED { return mHP; } uint8_t calcDirection(const int dstX, @@ -716,28 +716,28 @@ class Being notfinal : public ActorSprite, uint8_t calcDirection() const restrict2 A_WARN_UNUSED; - void setAttackDelay(const int n) restrict2 noexcept + void setAttackDelay(const int n) restrict2 noexcept2 { mAttackDelay = n; } - int getAttackDelay() const restrict2 noexcept A_WARN_UNUSED + int getAttackDelay() const restrict2 noexcept2 A_WARN_UNUSED { return mAttackDelay; } - int getMinHit() const restrict2 noexcept A_WARN_UNUSED + int getMinHit() const restrict2 noexcept2 A_WARN_UNUSED { return mMinHit; } - void setMinHit(const int n) restrict2 noexcept + void setMinHit(const int n) restrict2 noexcept2 { mMinHit = n; } - int getMaxHit() const restrict2 noexcept A_WARN_UNUSED + int getMaxHit() const restrict2 noexcept2 A_WARN_UNUSED { return mMaxHit; } - void setMaxHit(const int n) restrict2 noexcept + void setMaxHit(const int n) restrict2 noexcept2 { mMaxHit = n; } int getCriticalHit() const restrict2 A_WARN_UNUSED { return mCriticalHit; } - void setCriticalHit(const int n) restrict2 noexcept + void setCriticalHit(const int n) restrict2 noexcept2 { mCriticalHit = n; } void updateHit(const int amount) restrict2; @@ -746,10 +746,10 @@ class Being notfinal : public ActorSprite, void undressItemById(const int id) restrict2; - int getGoodStatus() const restrict2 noexcept A_WARN_UNUSED + int getGoodStatus() const restrict2 noexcept2 A_WARN_UNUSED { return mGoodStatus; } - void setGoodStatus(const int n) restrict2 noexcept + void setGoodStatus(const int n) restrict2 noexcept2 { mGoodStatus = n; } std::string getGenderSign() const restrict2 A_WARN_UNUSED; @@ -758,10 +758,10 @@ class Being notfinal : public ActorSprite, void updateComment() restrict2; - const std::string getComment() const restrict2 noexcept A_WARN_UNUSED + const std::string getComment() const restrict2 noexcept2 A_WARN_UNUSED { return mComment; } - void setComment(const std::string &restrict n) restrict2 noexcept + void setComment(const std::string &restrict n) restrict2 noexcept2 { mComment = n; } static void clearCache(); @@ -774,7 +774,7 @@ class Being notfinal : public ActorSprite, const std::string &restrict comment, const ActorTypeT &restrict type); - bool isAdvanced() const restrict2 noexcept A_WARN_UNUSED + bool isAdvanced() const restrict2 noexcept2 A_WARN_UNUSED { return mAdvanced; } void setAdvanced(const bool n) restrict2 @@ -789,7 +789,7 @@ class Being notfinal : public ActorSprite, /** * Sets the attack range. */ - void setAttackRange(const int range) restrict2 noexcept + void setAttackRange(const int range) restrict2 noexcept2 { mAttackRange = range; } /* @@ -804,10 +804,10 @@ class Being notfinal : public ActorSprite, void updatePercentHP() restrict2; - void setRaceName(const std::string &restrict name) restrict2 noexcept + void setRaceName(const std::string &restrict name) restrict2 noexcept2 { mRaceName = name; } - std::string getRaceName() const restrict2 noexcept A_WARN_UNUSED + std::string getRaceName() const restrict2 noexcept2 A_WARN_UNUSED { return mRaceName; } int getSpriteID(const int slot) const restrict2 A_WARN_UNUSED; @@ -820,10 +820,10 @@ class Being notfinal : public ActorSprite, void setHairColor(const unsigned int slot, const ItemColor color) restrict2; - void setHairColor(const ItemColor color) restrict2 noexcept + void setHairColor(const ItemColor color) restrict2 noexcept2 { mHairColor = color; } - ItemColor getHairColor() const noexcept A_WARN_UNUSED + ItemColor getHairColor() const noexcept2 A_WARN_UNUSED { return mHairColor; } void recalcSpritesOrder() restrict2; @@ -857,16 +857,16 @@ class Being notfinal : public ActorSprite, void fixPetSpawnPos(int &restrict dstX, int &restrict dstY) const restrict2; - const std::vector<Being*> &getPets() const restrict2 noexcept + const std::vector<Being*> &getPets() const restrict2 noexcept2 { return mPets; } Being *getFirstPet() restrict2 { return mPets.empty() ? nullptr : mPets[0]; } - void setOwner(Being *restrict const owner) restrict2 noexcept + void setOwner(Being *restrict const owner) restrict2 noexcept2 { mOwner = owner; } - Being *getOwner() const restrict2 noexcept + Being *getOwner() const restrict2 noexcept2 { return mOwner; } void unassignPet(const Being *restrict const pet) restrict2; @@ -880,7 +880,7 @@ class Being notfinal : public ActorSprite, const bool main, const int x, const int y) const restrict2; - uint16_t getLook() const restrict2 noexcept + uint16_t getLook() const restrict2 noexcept2 { return mLook; } void setLook(const uint16_t look) restrict2; @@ -903,10 +903,10 @@ class Being notfinal : public ActorSprite, void recreateItemParticles() restrict2; - void incUsage() restrict2 noexcept + void incUsage() restrict2 noexcept2 { mUsageCounter ++; } - int decUsage() restrict2 noexcept + int decUsage() restrict2 noexcept2 { return --mUsageCounter; } virtual int getLastAttackX() const restrict2 @@ -920,7 +920,7 @@ class Being notfinal : public ActorSprite, void setChat(ChatObject *restrict const obj) restrict2; - ChatObject *getChat() const restrict2 noexcept + ChatObject *getChat() const restrict2 noexcept2 { return mChat; } void setRiding(const bool b) restrict2 override final; @@ -931,17 +931,17 @@ class Being notfinal : public ActorSprite, void setSellBoard(const std::string &restrict text) restrict2; - std::string getSellBoard() const restrict2 noexcept A_WARN_UNUSED + std::string getSellBoard() const restrict2 noexcept2 A_WARN_UNUSED { return mSellBoard; } void setBuyBoard(const std::string &restrict text) restrict2; - std::string getBuyBoard() const restrict2 noexcept A_WARN_UNUSED + std::string getBuyBoard() const restrict2 noexcept2 A_WARN_UNUSED { return mBuyBoard; } void setSpiritBalls(const unsigned int balls) restrict2; - unsigned int getSpiritBalls() const restrict2 noexcept A_WARN_UNUSED + unsigned int getSpiritBalls() const restrict2 noexcept2 A_WARN_UNUSED { return mSpiritBalls; } void stopCast(const bool b) override final; @@ -949,32 +949,32 @@ class Being notfinal : public ActorSprite, void setCreatorId(const BeingId id) { mCreatorId = id; } - BeingId getCreatorId() const noexcept A_WARN_UNUSED + BeingId getCreatorId() const noexcept2 A_WARN_UNUSED { return mCreatorId; } #endif - void setKarma(const int karma) restrict2 noexcept + void setKarma(const int karma) restrict2 noexcept2 { mKarma = karma; } - int getKarma() const restrict2 noexcept A_WARN_UNUSED + int getKarma() const restrict2 noexcept2 A_WARN_UNUSED { return mKarma; } - void setManner(const int manner) restrict2 noexcept + void setManner(const int manner) restrict2 noexcept2 { mManner = manner; } - int getManner() const restrict2 noexcept A_WARN_UNUSED + int getManner() const restrict2 noexcept2 A_WARN_UNUSED { return mManner; } - void disablePetAi() restrict2 noexcept + void disablePetAi() restrict2 noexcept2 { mPetAi = false; } - void enablePetAi() restrict2 noexcept + void enablePetAi() restrict2 noexcept2 { mPetAi = true; } - int getAreaSize() const restrict2 noexcept A_WARN_UNUSED + int getAreaSize() const restrict2 noexcept2 A_WARN_UNUSED { return mAreaSize; } - void setAreaSize(const int areaSize) restrict2 noexcept + void setAreaSize(const int areaSize) restrict2 noexcept2 { mAreaSize = areaSize; } void setTeamId(const uint16_t teamId) restrict2; @@ -997,10 +997,10 @@ class Being notfinal : public ActorSprite, void showBadges(const bool show) restrict2; - uint16_t getTeamId() const restrict2 noexcept A_WARN_UNUSED + uint16_t getTeamId() const restrict2 noexcept2 A_WARN_UNUSED { return mTeamId; } - void serverRemove() restrict2 noexcept; + void serverRemove() restrict2 noexcept2; protected: void drawPlayerSpriteAt(Graphics *restrict const graphics, diff --git a/src/being/flooritem.h b/src/being/flooritem.h index 1b5b87d3e..dc3c6fd0c 100644 --- a/src/being/flooritem.h +++ b/src/being/flooritem.h @@ -68,7 +68,7 @@ class FloorItem final : public ActorSprite void postInit(Map *const map, int subX, int subY); - ActorTypeT getType() const noexcept override final A_WARN_UNUSED + ActorTypeT getType() const noexcept2 override final A_WARN_UNUSED { return ActorType::FloorItem; } void draw(Graphics *const graphics, diff --git a/src/gui/fonts/font.cpp b/src/gui/fonts/font.cpp index 0f36e5f0e..ffd1db347 100644 --- a/src/gui/fonts/font.cpp +++ b/src/gui/fonts/font.cpp @@ -366,7 +366,7 @@ int Font::getStringIndexAt(const std::string& text, const int x) const return CAST_S32(sz); } -const TextChunkList *Font::getCache() const noexcept +const TextChunkList *Font::getCache() const noexcept2 { return mCache; } diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h index 2a3131fa3..ef7ff9a5a 100644 --- a/src/gui/fonts/font.h +++ b/src/gui/fonts/font.h @@ -101,7 +101,7 @@ class Font final int getHeight() const restrict2 A_WARN_UNUSED; - const TextChunkList *getCache() const restrict2 noexcept + const TextChunkList *getCache() const restrict2 noexcept2 A_CONST A_WARN_UNUSED; /** @@ -120,10 +120,10 @@ class Font final void slowLogic(const int rnd) restrict2; - unsigned int getCreateCounter() const restrict2 noexcept A_WARN_UNUSED + unsigned int getCreateCounter() const restrict2 noexcept2 A_WARN_UNUSED { return mCreateCounter; } - unsigned int getDeleteCounter() const restrict2 noexcept A_WARN_UNUSED + unsigned int getDeleteCounter() const restrict2 noexcept2 A_WARN_UNUSED { return mDeleteCounter; } int getStringIndexAt(const std::string &restrict text, diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index f4456518a..6556cc385 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -71,6 +71,7 @@ #include "gui/widgets/widget2.h" #include <list> + #include "localconsts.h" class ActionListener; @@ -167,7 +168,7 @@ class Widget notfinal : public Widget2 * @see getFrameSize, drawFrame * @since 0.8.0 */ - void setFrameSize(const unsigned int frameSize) noexcept + void setFrameSize(const unsigned int frameSize) noexcept2 { mFrameSize = frameSize; } /** @@ -184,7 +185,7 @@ class Widget notfinal : public Widget2 * @see setFrameSize, drawFrame * @since 0.8.0 */ - unsigned int getFrameSize() const noexcept A_WARN_UNUSED + unsigned int getFrameSize() const noexcept2 A_WARN_UNUSED { return mFrameSize; } /** @@ -204,7 +205,7 @@ class Widget notfinal : public Widget2 * has no parent. * @since 0.1.0 */ - Widget* getParent() const noexcept A_WARN_UNUSED + Widget* getParent() const noexcept2 A_WARN_UNUSED { return mParent; } /** @@ -331,7 +332,7 @@ class Widget notfinal : public Widget2 * @see getDimension, setX, getX, setY, getY, setPosition * @since 0.1.0 */ - const Rect& getDimension() const noexcept A_WARN_UNUSED + const Rect& getDimension() const noexcept2 A_WARN_UNUSED { return mDimension; } /** @@ -370,7 +371,7 @@ class Widget notfinal : public Widget2 * @see isEnabled * @since 0.1.0 */ - void setEnabled(const bool enabled) noexcept + void setEnabled(const bool enabled) noexcept2 { mEnabled = enabled; } /** @@ -410,7 +411,7 @@ class Widget notfinal : public Widget2 * @see getBaseColor * @since 0.1.0 */ - void setBaseColor(const Color& color) noexcept + void setBaseColor(const Color& color) noexcept2 { mBaseColor = color; } /** @@ -420,7 +421,7 @@ class Widget notfinal : public Widget2 * @see setBaseColor * @since 0.1.0 */ - const Color& getBaseColor() const noexcept A_WARN_UNUSED + const Color& getBaseColor() const noexcept2 A_WARN_UNUSED { return mBaseColor; } /** @@ -430,7 +431,7 @@ class Widget notfinal : public Widget2 * @see getForegroundColor * @since 0.1.0 */ - void setForegroundColor(const Color& color) noexcept + void setForegroundColor(const Color& color) noexcept2 { mForegroundColor = color; } /** @@ -439,7 +440,7 @@ class Widget notfinal : public Widget2 * @see setForegroundColor * @since 0.1.0 */ - const Color& getForegroundColor() const noexcept A_WARN_UNUSED + const Color& getForegroundColor() const noexcept2 A_WARN_UNUSED { return mForegroundColor; } /** @@ -449,7 +450,7 @@ class Widget notfinal : public Widget2 * @see setBackgroundColor * @since 0.1.0 */ - void setBackgroundColor(const Color &color) noexcept + void setBackgroundColor(const Color &color) noexcept2 { mBackgroundColor = color; } /** @@ -458,7 +459,7 @@ class Widget notfinal : public Widget2 * @see setBackgroundColor * @since 0.1.0 */ - const Color &getBackgroundColor() const noexcept A_WARN_UNUSED + const Color &getBackgroundColor() const noexcept2 A_WARN_UNUSED { return mBackgroundColor; } /** @@ -501,7 +502,7 @@ class Widget notfinal : public Widget2 * @see setFocusHandler * @since 0.1.0 */ - FocusHandler* getFocusHandler() noexcept A_WARN_UNUSED + FocusHandler* getFocusHandler() noexcept2 A_WARN_UNUSED { return mFocusHandler; } /** @@ -636,7 +637,7 @@ class Widget notfinal : public Widget2 * @see getActionEventId * @since 0.6.0 */ - void setActionEventId(const std::string &actionEventId) noexcept + void setActionEventId(const std::string &actionEventId) noexcept2 { mActionEventId = actionEventId; } /** @@ -646,7 +647,7 @@ class Widget notfinal : public Widget2 * @see setActionEventId * @since 0.6.0 */ - const std::string &getActionEventId() const noexcept + const std::string &getActionEventId() const noexcept2 { return mActionEventId; } /** @@ -732,7 +733,7 @@ class Widget notfinal : public Widget2 * @see setTabInEnabled * @since 0.1.0 */ - bool isTabInEnabled() const noexcept A_WARN_UNUSED + bool isTabInEnabled() const noexcept2 A_WARN_UNUSED { return mTabIn; } /** @@ -745,7 +746,7 @@ class Widget notfinal : public Widget2 * @see isTabInEnabled * @since 0.1.0 */ - void setTabInEnabled(const bool enabled) noexcept + void setTabInEnabled(const bool enabled) noexcept2 { mTabIn = enabled; } /** @@ -758,7 +759,7 @@ class Widget notfinal : public Widget2 * @see setTabOutEnabled * @since 0.1.0 */ - bool isTabOutEnabled() const noexcept A_WARN_UNUSED + bool isTabOutEnabled() const noexcept2 A_WARN_UNUSED { return mTabOut; } /** @@ -771,7 +772,7 @@ class Widget notfinal : public Widget2 * @see isTabOutEnabled * @since 0.1.0 */ - void setTabOutEnabled(const bool enabled) noexcept + void setTabOutEnabled(const bool enabled) noexcept2 { mTabOut = enabled; } /** @@ -995,7 +996,7 @@ class Widget notfinal : public Widget2 * @see setId * @since 0.8.0 */ - const std::string& getId() const noexcept A_WARN_UNUSED + const std::string& getId() const noexcept2 A_WARN_UNUSED { return mId; } /** @@ -1010,16 +1011,16 @@ class Widget notfinal : public Widget2 */ virtual void showPart(const Rect &rectangle); - bool isAllowLogic() const noexcept A_WARN_UNUSED + bool isAllowLogic() const noexcept2 A_WARN_UNUSED { return mAllowLogic; } - void setMouseConsume(const bool b) noexcept + void setMouseConsume(const bool b) noexcept2 { mMouseConsume = b; } - bool isMouseConsume() const noexcept A_WARN_UNUSED + bool isMouseConsume() const noexcept2 A_WARN_UNUSED { return mMouseConsume; } - void setRedraw(const bool b) noexcept + void setRedraw(const bool b) noexcept2 { mRedraw = b; } static void distributeWindowResizeEvent(); diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 3367d8924..77af3d216 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -28,6 +28,8 @@ #include "gui/themecolorsidoperators.h" #include "gui/theme.h" +#include "localconsts.h" + class Widget; class Widget2 notfinal diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index 26e858185..0db51a7d7 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -96,20 +96,20 @@ class InputManager final /** * Set the index of the new key to be assigned. */ - void setNewKeyIndex(const InputActionT value) restrict2 noexcept + void setNewKeyIndex(const InputActionT value) restrict2 noexcept2 { mNewKeyIndex = value; } /** * Set a reference to the key setup window. */ void setSetupInput(Setup_Input *restrict const setupInput) - restrict2 noexcept A_NONNULL(2) + restrict2 noexcept2 A_NONNULL(2) { mSetupInput = setupInput; } /** * Get the index of the new key to be assigned. */ - InputActionT getNewKeyIndex() const restrict2 noexcept A_WARN_UNUSED + InputActionT getNewKeyIndex() const restrict2 noexcept2 A_WARN_UNUSED { return mNewKeyIndex; } void updateKeyActionMap(KeyToActionMap &restrict actionMap, diff --git a/src/localconsts.h b/src/localconsts.h index dc63ad87b..df49f8098 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -27,6 +27,8 @@ #define CAST_U32 static_cast<uint32_t> #define CAST_SIZE static_cast<size_t> +//#define noexcept2 + #define GCC_VERSION (__GNUC__ * 10000 \ + __GNUC_MINOR__ * 100 \ + __GNUC_PATCHLEVEL__) @@ -38,27 +40,42 @@ #define override #define constexpr #define constexpr2 +#define noexcept2 #define noexcept #define A_DELETE(func) #define A_DELETE_COPY(func) #else // !defined(__GXX_EXPERIMENTAL_CXX0X__) #if GCC_VERSION < 40700 + +#if defined(__clang__) && __cplusplus > 201100L +#else // __clang__ #define final #define override #define constexpr #define noexcept +#endif // __clang__ +#define noexcept2 + // #define A_DELETE // #define A_DELETE_COPY #else // GCC_VERSION < 40700 #define ADVGCC #if GCC_VERSION < 40900 #define constexpr2 +#define noexcept2 #else // GCC_VERSION < 40900 #if __cpp_constexpr >= 201304 #define constexpr2 constexpr #else // __cpp_constexpr >= 201304 #define constexpr2 #endif // __cpp_constexpr >= 201304 + +#ifdef __clang__ +#define noexcept2 +#else // __clang__ +#define noexcept2 noexcept +#endif // __clang__ + #endif // GCC_VERSION < 40900 #endif // GCC_VERSION < 40700 #undef Z_NULL diff --git a/src/particle/particle.h b/src/particle/particle.h index 0cce98180..57c6dd40a 100644 --- a/src/particle/particle.h +++ b/src/particle/particle.h @@ -117,21 +117,21 @@ class Particle notfinal : public Actor /** * Sets the time in game ticks until the particle is destroyed. */ - void setLifetime(const int lifetime) restrict2 noexcept + void setLifetime(const int lifetime) restrict2 noexcept2 { mLifetimeLeft = lifetime; mLifetimePast = 0; } /** * Sets the age of the pixel in game ticks where the particle has * faded in completely. */ - void setFadeOut(const int fadeOut) restrict2 noexcept + void setFadeOut(const int fadeOut) restrict2 noexcept2 { mFadeOut = fadeOut; } /** * Sets the remaining particle lifetime where the particle starts to * fade out. */ - void setFadeIn(const int fadeIn) restrict2 noexcept + void setFadeIn(const int fadeIn) restrict2 noexcept2 { mFadeIn = fadeIn; } /** @@ -139,38 +139,38 @@ class Particle notfinal : public Actor */ void setVelocity(const float x, const float y, - const float z) restrict2 noexcept + const float z) restrict2 noexcept2 { mVelocity.x = x; mVelocity.y = y; mVelocity.z = z; } /** * Sets the downward acceleration. */ - void setGravity(const float gravity) restrict2 noexcept + void setGravity(const float gravity) restrict2 noexcept2 { mGravity = gravity; } /** * Sets the ammount of random vector changes */ - void setRandomness(const int r) restrict2 noexcept + void setRandomness(const int r) restrict2 noexcept2 { mRandomness = r; } /** * Sets the ammount of velocity particles retain after * hitting the ground. */ - void setBounce(const float bouncieness) restrict2 noexcept + void setBounce(const float bouncieness) restrict2 noexcept2 { mBounce = bouncieness; } /** * Sets the flag if the particle is supposed to be moved by its parent */ - void setFollow(const bool follow) restrict2 noexcept + void setFollow(const bool follow) restrict2 noexcept2 { mFollow = follow; } /** * Gets the flag if the particle is supposed to be moved by its parent */ - bool doesFollow() const restrict2 noexcept A_WARN_UNUSED + bool doesFollow() const restrict2 noexcept2 A_WARN_UNUSED { return mFollow; } /** @@ -179,7 +179,7 @@ class Particle notfinal : public Actor */ void setDestination(Particle *restrict const target, const float accel, - const float moment) restrict2 noexcept A_NONNULL(2) + const float moment) restrict2 noexcept2 A_NONNULL(2) { mTarget = target; mAcceleration = accel; mMomentum = moment; } /** @@ -196,10 +196,10 @@ class Particle notfinal : public Actor */ void adjustEmitterSize(const int w, const int h) restrict2; - void setAllowSizeAdjust(const bool adjust) restrict2 noexcept + void setAllowSizeAdjust(const bool adjust) restrict2 noexcept2 { mAllowSizeAdjust = adjust; } - bool isAlive() const restrict2 noexcept A_WARN_UNUSED + bool isAlive() const restrict2 noexcept2 A_WARN_UNUSED { return mAlive == AliveStatus::ALIVE; } void prepareToDie() restrict2; @@ -207,20 +207,20 @@ class Particle notfinal : public Actor /** * Determines whether the particle and its children are all dead */ - bool isExtinct() const restrict2 noexcept A_WARN_UNUSED + bool isExtinct() const restrict2 noexcept2 A_WARN_UNUSED { return !isAlive() && mChildParticles.empty(); } /** * Manually marks the particle for deletion. */ - void kill() restrict2 noexcept + void kill() restrict2 noexcept2 { mAlive = AliveStatus::DEAD_OTHER; mAutoDelete = true; } /** * After calling this function the particle will only request * deletion when kill() is called */ - void disableAutoDelete() restrict2 noexcept + void disableAutoDelete() restrict2 noexcept2 { mAutoDelete = false; } /** We consider particles (at least for now) to be one layer-sprites */ diff --git a/src/render/graphics.h b/src/render/graphics.h index 8334d315d..dda3363e6 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -135,7 +135,7 @@ class Graphics notfinal mRect.h = static_cast<RectSize>(height); } - SDL_Window *getWindow() const restrict2 noexcept + SDL_Window *getWindow() const restrict2 noexcept2 { return mWindow; } /** @@ -144,7 +144,7 @@ class Graphics notfinal */ void setSync(const bool sync) restrict2; - bool getSync() const restrict2 noexcept A_WARN_UNUSED + bool getSync() const restrict2 noexcept2 A_WARN_UNUSED { return mSync; } /** @@ -274,37 +274,37 @@ class Graphics notfinal ClipRect &getTopClip() const restrict2 A_WARN_UNUSED { return mClipStack.top(); } - void setRedraw(const bool n) restrict2 noexcept + void setRedraw(const bool n) restrict2 noexcept2 { mRedraw = n; } - bool getRedraw() const restrict2 noexcept A_WARN_UNUSED + bool getRedraw() const restrict2 noexcept2 A_WARN_UNUSED { return mRedraw; } - void setSecure(const bool n) restrict2 noexcept + void setSecure(const bool n) restrict2 noexcept2 { mSecure = n; } - bool getSecure() const restrict2 noexcept A_WARN_UNUSED + bool getSecure() const restrict2 noexcept2 A_WARN_UNUSED { return mSecure; } - int getBpp() const restrict2 noexcept A_WARN_UNUSED + int getBpp() const restrict2 noexcept2 A_WARN_UNUSED { return mBpp; } - bool getFullScreen() const restrict2 noexcept A_WARN_UNUSED + bool getFullScreen() const restrict2 noexcept2 A_WARN_UNUSED { return mFullscreen; } - bool getHWAccel() const restrict2 noexcept A_WARN_UNUSED + bool getHWAccel() const restrict2 noexcept2 A_WARN_UNUSED { return mHWAccel; } - bool getDoubleBuffer() const restrict2 noexcept A_WARN_UNUSED + bool getDoubleBuffer() const restrict2 noexcept2 A_WARN_UNUSED { return mDoubleBuffer; } - RenderType getOpenGL() const restrict2 noexcept A_WARN_UNUSED + RenderType getOpenGL() const restrict2 noexcept2 A_WARN_UNUSED { return mOpenGL; } - void setNoFrame(const bool n) restrict2 noexcept + void setNoFrame(const bool n) restrict2 noexcept2 { mNoFrame = n; } - const std::string &getName() const restrict2 noexcept A_WARN_UNUSED + const std::string &getName() const restrict2 noexcept2 A_WARN_UNUSED { return mName; } virtual void initArrays(const int vertCount A_UNUSED) restrict2 @@ -316,7 +316,7 @@ class Graphics notfinal mAlpha = (color.a != 255); } - const Color &getColor() const restrict2 noexcept + const Color &getColor() const restrict2 noexcept2 { return mColor; } #ifdef DEBUG_DRAW_CALLS @@ -356,10 +356,10 @@ class Graphics notfinal virtual void completeCache() restrict2 = 0; - int getScale() const restrict2 noexcept + int getScale() const restrict2 noexcept2 { return mScale; } - virtual bool isAllowScale() const restrict2 noexcept + virtual bool isAllowScale() const restrict2 noexcept2 { return false; } void setScale(int scale) restrict2; diff --git a/src/render/imagegraphics.h b/src/render/imagegraphics.h index 8d4a72368..e1bdad741 100644 --- a/src/render/imagegraphics.h +++ b/src/render/imagegraphics.h @@ -45,10 +45,10 @@ class ImegeGraphics final : public Graphics ~ImegeGraphics(); - void setTarget(Image *const target) restrict2 noexcept + void setTarget(Image *const target) restrict2 noexcept2 { mTarget = target; } - Image *getTarget() const restrict2 noexcept + Image *getTarget() const restrict2 noexcept2 { return mTarget; } void beginDraw() restrict2 override final diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h index 8f6652775..3c2e0baf9 100644 --- a/src/render/normalopenglgraphics.h +++ b/src/render/normalopenglgraphics.h @@ -89,7 +89,7 @@ class NormalOpenGLGraphics final : public Graphics #include "render/openglgraphicsdefadvanced.hpp" #ifdef DEBUG_BIND_TEXTURE - unsigned int getBinds() const restrict2 noexcept + unsigned int getBinds() const restrict2 noexcept2 { return mLastBinds; } #endif diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp index 42f61c2be..664686abd 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -34,7 +34,7 @@ public: void updateTextureFormat() restrict2; - bool isAllowScale() const restrict2 noexcept override final + bool isAllowScale() const restrict2 noexcept2 override final { return true; } void clearScreen() const restrict2 override final; diff --git a/src/render/openglgraphicsdefadvanced.hpp b/src/render/openglgraphicsdefadvanced.hpp index c63c6ba7f..1428525ff 100644 --- a/src/render/openglgraphicsdefadvanced.hpp +++ b/src/render/openglgraphicsdefadvanced.hpp @@ -27,7 +27,7 @@ public: void initArrays(const int vertCount) restrict2 override final; #ifdef DEBUG_DRAW_CALLS - unsigned int getDrawCalls() restrict2 const noexcept + unsigned int getDrawCalls() restrict2 const noexcept2 { return mLastDrawCalls; } static unsigned int mDrawCalls; diff --git a/src/render/renderers.cpp b/src/render/renderers.cpp index 6d385d294..a11c438d1 100644 --- a/src/render/renderers.cpp +++ b/src/render/renderers.cpp @@ -22,9 +22,9 @@ #include "debug.h" -static RenderType getDefault() noexcept A_CONST; +static RenderType getDefault() noexcept2 A_CONST; -static RenderType getDefault() noexcept +static RenderType getDefault() noexcept2 { #ifdef USE_OPENGL #ifdef ANDROID @@ -37,7 +37,7 @@ static RenderType getDefault() noexcept #endif } -RenderType intToRenderType(const int mode) noexcept +RenderType intToRenderType(const int mode) noexcept2 { if (mode < 0 || mode >= RENDER_LAST) return getDefault(); diff --git a/src/render/renderers.h b/src/render/renderers.h index 92aade7e9..e668e5039 100644 --- a/src/render/renderers.h +++ b/src/render/renderers.h @@ -25,7 +25,7 @@ #include "localconsts.h" -RenderType intToRenderType(const int mode) noexcept A_CONST; +RenderType intToRenderType(const int mode) noexcept2 A_CONST; #define isBatchDrawRenders(val) ((val) != RENDER_SAFE_OPENGL) diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index 250002d3f..47578bb3f 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -97,7 +97,7 @@ class SDLGraphics final : public Graphics */ ~SDLGraphics(); - void setRendererFlags(const uint32_t flags) restrict noexcept override + void setRendererFlags(const uint32_t flags) restrict noexcept2 override { mRendererFlags = flags; } #include "render/graphicsdef.hpp" diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index ac6970cb1..c1adfe359 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -57,7 +57,7 @@ class SDL2SoftwareGraphics final : public Graphics ~SDL2SoftwareGraphics(); void setRendererFlags(const uint32_t flags) - restrict2 noexcept override final + restrict2 noexcept2 override final { mRendererFlags = flags; } #include "render/graphicsdef.hpp" diff --git a/src/render/shaders/shader.h b/src/render/shaders/shader.h index ca54c0e92..21bc48b30 100644 --- a/src/render/shaders/shader.h +++ b/src/render/shaders/shader.h @@ -34,7 +34,7 @@ class Shader final : public Resource A_DELETE_COPY(Shader) - unsigned int getShaderId() const noexcept + unsigned int getShaderId() const noexcept2 { return mShaderId; } protected: diff --git a/src/render/shaders/shaderprogram.h b/src/render/shaders/shaderprogram.h index 4898798e1..d1c55206e 100644 --- a/src/render/shaders/shaderprogram.h +++ b/src/render/shaders/shaderprogram.h @@ -38,7 +38,7 @@ class ShaderProgram final : public Resource A_DELETE_COPY(ShaderProgram) - unsigned int getProgramId() const noexcept + unsigned int getProgramId() const noexcept2 { return mProgramId; } protected: diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index 0706dfc65..f8faa327b 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -47,10 +47,10 @@ class SurfaceGraphics final : public Graphics ~SurfaceGraphics(); - void setTarget(SDL_Surface *restrict const target) restrict2 noexcept + void setTarget(SDL_Surface *restrict const target) restrict2 noexcept2 { mTarget = target; } - SDL_Surface *getTarget() const restrict2 noexcept + SDL_Surface *getTarget() const restrict2 noexcept2 { return mTarget; } void beginDraw() restrict2 override final @@ -152,10 +152,10 @@ class SurfaceGraphics final : public Graphics restrict2 override final A_NONNULL(2) { } - void setBlitMode(const BlitModeT mode) restrict2 noexcept + void setBlitMode(const BlitModeT mode) restrict2 noexcept2 { mBlitMode = mode; } - BlitModeT getBlitMode() const restrict2 noexcept A_WARN_UNUSED + BlitModeT getBlitMode() const restrict2 noexcept2 A_WARN_UNUSED { return mBlitMode; } void fillRectangle(const Rect &restrict rect A_UNUSED) diff --git a/src/resources/action.cpp b/src/resources/action.cpp index a79614eef..a44cc1aee 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -28,7 +28,7 @@ #include "debug.h" -Action::Action(const std::string &name) noexcept : +Action::Action(const std::string &name) noexcept2 : MemoryCounter(), mAnimations(), mCounterName(name), @@ -42,7 +42,7 @@ Action::~Action() } const Animation *Action::getAnimation(SpriteDirection::Type direction) - const noexcept + const noexcept2 { Animations::const_iterator i = mAnimations.find(direction); @@ -70,12 +70,12 @@ const Animation *Action::getAnimation(SpriteDirection::Type direction) } void Action::setAnimation(const SpriteDirection::Type direction, - Animation *const animation) noexcept + Animation *const animation) noexcept2 { mAnimations[direction] = animation; } -void Action::setLastFrameDelay(const int delay) noexcept +void Action::setLastFrameDelay(const int delay) noexcept2 { FOR_EACH (AnimationIter, it, mAnimations) { diff --git a/src/resources/action.h b/src/resources/action.h index 55a2ed12d..d86846a15 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -39,25 +39,25 @@ class Animation; class Action final : public MemoryCounter { public: - explicit Action(const std::string &name) noexcept; + explicit Action(const std::string &name) noexcept2; A_DELETE_COPY(Action) ~Action(); void setAnimation(const SpriteDirection::Type direction, - Animation *const animation) noexcept; + Animation *const animation) noexcept2; const Animation *getAnimation(SpriteDirection::Type direction) const - noexcept A_WARN_UNUSED; + noexcept2 A_WARN_UNUSED; - unsigned getNumber() const noexcept A_WARN_UNUSED + unsigned getNumber() const noexcept2 A_WARN_UNUSED { return mNumber; } - void setNumber(const unsigned n) noexcept + void setNumber(const unsigned n) noexcept2 { mNumber = n; } - void setLastFrameDelay(const int delay) noexcept; + void setLastFrameDelay(const int delay) noexcept2; int calcMemoryLocal() const override final; diff --git a/src/resources/animation/animation.cpp b/src/resources/animation/animation.cpp index e505bc215..9c3361db5 100644 --- a/src/resources/animation/animation.cpp +++ b/src/resources/animation/animation.cpp @@ -24,14 +24,14 @@ #include "debug.h" -Animation::Animation() noexcept : +Animation::Animation() noexcept2 : mFrames(), mName("animation"), mDuration(0) { } -Animation::Animation(const std::string &name) noexcept : +Animation::Animation(const std::string &name) noexcept2 : mFrames(), mName(name), mDuration(0) @@ -40,7 +40,7 @@ Animation::Animation(const std::string &name) noexcept : void Animation::addFrame(Image *const image, const int delay, const int offsetX, const int offsetY, - const int rand) noexcept + const int rand) noexcept2 { Frame frame = { image, delay, offsetX, offsetY, rand, Frame::ANIMATION, "" }; @@ -48,41 +48,41 @@ void Animation::addFrame(Image *const image, const int delay, mDuration += delay; } -void Animation::addTerminator(const int rand) noexcept +void Animation::addTerminator(const int rand) noexcept2 { addFrame(nullptr, 0, 0, 0, rand); } -bool Animation::isTerminator(const Frame &candidate) noexcept +bool Animation::isTerminator(const Frame &candidate) noexcept2 { return (!candidate.image && candidate.type == Frame::ANIMATION); } -void Animation::addJump(const std::string &name, const int rand) noexcept +void Animation::addJump(const std::string &name, const int rand) noexcept2 { Frame frame = { nullptr, 0, 0, 0, rand, Frame::JUMP, name }; mFrames.push_back(frame); } -void Animation::addLabel(const std::string &name) noexcept +void Animation::addLabel(const std::string &name) noexcept2 { Frame frame = { nullptr, 0, 0, 0, 100, Frame::LABEL, name }; mFrames.push_back(frame); } -void Animation::addGoto(const std::string &name, const int rand) noexcept +void Animation::addGoto(const std::string &name, const int rand) noexcept2 { Frame frame = { nullptr, 0, 0, 0, rand, Frame::GOTO, name }; mFrames.push_back(frame); } -void Animation::addPause(const int delay, const int rand) noexcept +void Animation::addPause(const int delay, const int rand) noexcept2 { Frame frame = { nullptr, delay, 0, 0, rand, Frame::PAUSE, "" }; mFrames.push_back(frame); } -void Animation::setLastFrameDelay(const int delay) noexcept +void Animation::setLastFrameDelay(const int delay) noexcept2 { for (FramesRevIter it = mFrames.rbegin(), it_end = mFrames.rend(); it != it_end; ++ it) diff --git a/src/resources/animation/animation.h b/src/resources/animation/animation.h index 55668f324..7a0ade3fa 100644 --- a/src/resources/animation/animation.h +++ b/src/resources/animation/animation.h @@ -43,38 +43,38 @@ class Animation final : public MemoryCounter friend class SimpleAnimation; public: - Animation() noexcept; + Animation() noexcept2; - explicit Animation(const std::string &name) noexcept; + explicit Animation(const std::string &name) noexcept2; /** * Appends a new animation at the end of the sequence. */ void addFrame(Image *const image, const int delay, const int offsetX, const int offsetY, - const int rand) noexcept; + const int rand) noexcept2; /** * Appends an animation terminator that states that the animation * should not loop. */ - void addTerminator(const int rand) noexcept; + void addTerminator(const int rand) noexcept2; /** * Returns the length of this animation in frames. */ - size_t getLength() const noexcept A_WARN_UNUSED + size_t getLength() const noexcept2 A_WARN_UNUSED { return mFrames.size(); } - void addJump(const std::string &name, const int rand) noexcept; + void addJump(const std::string &name, const int rand) noexcept2; - void addLabel(const std::string &name) noexcept; + void addLabel(const std::string &name) noexcept2; - void addGoto(const std::string &name, const int rand) noexcept; + void addGoto(const std::string &name, const int rand) noexcept2; - void addPause(const int delay, const int rand) noexcept; + void addPause(const int delay, const int rand) noexcept2; - void setLastFrameDelay(const int delay) noexcept; + void setLastFrameDelay(const int delay) noexcept2; typedef std::vector<Frame> Frames; typedef Frames::iterator FramesIter; @@ -82,7 +82,7 @@ class Animation final : public MemoryCounter typedef Frames::reverse_iterator FramesRevIter; #ifdef UNITTESTS - Frames &getFrames() noexcept + Frames &getFrames() noexcept2 { return mFrames; } #endif @@ -94,7 +94,7 @@ class Animation final : public MemoryCounter /** * Determines whether the given animation frame is a terminator. */ - static bool isTerminator(const Frame &phase) noexcept A_WARN_UNUSED; + static bool isTerminator(const Frame &phase) noexcept2 A_WARN_UNUSED; protected: Frames mFrames; diff --git a/src/resources/dye/dyecolor.h b/src/resources/dye/dyecolor.h index a7b5bbd7f..c28428a0d 100644 --- a/src/resources/dye/dyecolor.h +++ b/src/resources/dye/dyecolor.h @@ -25,14 +25,14 @@ struct DyeColor final { - DyeColor() noexcept + DyeColor() noexcept2 { value[3] = 255; } DyeColor(const uint8_t r, const uint8_t g, - const uint8_t b) noexcept + const uint8_t b) noexcept2 { value[0] = r; value[1] = g; @@ -43,7 +43,7 @@ struct DyeColor final DyeColor(const uint8_t r, const uint8_t g, const uint8_t b, - const uint8_t a) noexcept + const uint8_t a) noexcept2 { value[0] = r; value[1] = g; diff --git a/src/resources/map/map.h b/src/resources/map/map.h index 7320bb8d5..99e5002a7 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -174,25 +174,25 @@ class Map final : public Properties, /** * Returns the width of this map in tiles. */ - int getWidth() const restrict2 noexcept A_WARN_UNUSED + int getWidth() const restrict2 noexcept2 A_WARN_UNUSED { return mWidth; } /** * Returns the height of this map in tiles. */ - int getHeight() const restrict2 noexcept A_WARN_UNUSED + int getHeight() const restrict2 noexcept2 A_WARN_UNUSED { return mHeight; } /** * Returns the tile width of this map. */ - int getTileWidth() const restrict2 noexcept A_WARN_UNUSED + int getTileWidth() const restrict2 noexcept2 A_WARN_UNUSED { return mTileWidth; } /** * Returns the tile height used by this map. */ - int getTileHeight() const restrict2 noexcept A_WARN_UNUSED + int getTileHeight() const restrict2 noexcept2 A_WARN_UNUSED { return mTileHeight; } const std::string getMusicFile() const restrict2 A_WARN_UNUSED; @@ -246,16 +246,16 @@ class Map final : public Properties, void saveExtraLayer() const restrict2; - SpecialLayer *getTempLayer() const restrict2 noexcept A_WARN_UNUSED + SpecialLayer *getTempLayer() const restrict2 noexcept2 A_WARN_UNUSED { return mTempLayer; } - SpecialLayer *getSpecialLayer() const restrict2 noexcept A_WARN_UNUSED + SpecialLayer *getSpecialLayer() const restrict2 noexcept2 A_WARN_UNUSED { return mSpecialLayer; } - void setHasWarps(const bool n) restrict2 noexcept + void setHasWarps(const bool n) restrict2 noexcept2 { mHasWarps = n; } - bool getHasWarps() const restrict2 noexcept A_WARN_UNUSED + bool getHasWarps() const restrict2 noexcept2 A_WARN_UNUSED { return mHasWarps; } std::string getUserMapDirectory() const restrict2 A_WARN_UNUSED; @@ -279,7 +279,7 @@ class Map final : public Properties, const int x, const int y, const bool addNew = true) restrict2; - const std::vector<MapItem*> &getPortals() const restrict2 noexcept + const std::vector<MapItem*> &getPortals() const restrict2 noexcept2 A_WARN_UNUSED { return mMapPortals; } @@ -300,10 +300,10 @@ class Map final : public Properties, void setPvpMode(const int mode) restrict2; - int getPvpMode() const restrict2 noexcept A_WARN_UNUSED + int getPvpMode() const restrict2 noexcept2 A_WARN_UNUSED { return mPvp; } - const ObjectsLayer* getObjectsLayer() const restrict2 noexcept + const ObjectsLayer* getObjectsLayer() const restrict2 noexcept2 A_WARN_UNUSED { return mObjects; } @@ -318,40 +318,40 @@ class Map final : public Properties, void setActorsFix(const int x, const int y) restrict2; - int getVersion() const restrict2 noexcept A_WARN_UNUSED + int getVersion() const restrict2 noexcept2 A_WARN_UNUSED { return mVersion; } - void setVersion(const int n) restrict2 noexcept + void setVersion(const int n) restrict2 noexcept2 { mVersion = n; } void reduce() restrict2; - void redrawMap() restrict2 noexcept + void redrawMap() restrict2 noexcept2 { mRedrawMap = true; } bool empty() const restrict2 A_WARN_UNUSED { return mLayers.empty(); } - void setCustom(const bool b) restrict2 noexcept + void setCustom(const bool b) restrict2 noexcept2 { mCustom = b; } - bool isCustom() const restrict2 noexcept A_WARN_UNUSED + bool isCustom() const restrict2 noexcept2 A_WARN_UNUSED { return mCustom; } const std::map<int, TileAnimation*> &getTileAnimations() const - restrict2 noexcept A_WARN_UNUSED + restrict2 noexcept2 A_WARN_UNUSED { return mTileAnimations; } - void setAtlas(Resource *restrict const atlas) restrict2 noexcept + void setAtlas(Resource *restrict const atlas) restrict2 noexcept2 { mAtlas = atlas; } - const MetaTile *getMetaTiles() const restrict2 noexcept + const MetaTile *getMetaTiles() const restrict2 noexcept2 { return mMetaTiles; } - const WalkLayer *getWalkLayer() const restrict2 noexcept + const WalkLayer *getWalkLayer() const restrict2 noexcept2 { return mWalkLayer; } - void setWalkLayer(WalkLayer *restrict const layer) restrict2 noexcept + void setWalkLayer(WalkLayer *restrict const layer) restrict2 noexcept2 { mWalkLayer = layer; } void addHeights(const MapHeights *restrict const heights) restrict2 @@ -363,7 +363,7 @@ class Map final : public Properties, void updateDrawLayersList() restrict2; - bool isHeightsPresent() const restrict2 noexcept + bool isHeightsPresent() const restrict2 noexcept2 { return mHeights != nullptr; } void updateConditionLayers() restrict2; @@ -449,7 +449,7 @@ class Map final : public Properties, const int x0, const int y0, const int w0, - const int h0) noexcept : + const int h0) noexcept2 : file(file0), x(x0), y(y0), diff --git a/src/resources/map/maplayer.h b/src/resources/map/maplayer.h index 8aa692549..6db6d344e 100644 --- a/src/resources/map/maplayer.h +++ b/src/resources/map/maplayer.h @@ -142,7 +142,7 @@ class MapLayer final: public MemoryCounter, public ConfigListener const int scrollY, const Actors &actors) const restrict A_NONNULL(2); - bool isFringeLayer() const restrict noexcept A_WARN_UNUSED + bool isFringeLayer() const restrict noexcept2 A_WARN_UNUSED { return mIsFringeLayer; } void setSpecialLayer(const SpecialLayer *restrict const val) restrict @@ -151,10 +151,10 @@ class MapLayer final: public MemoryCounter, public ConfigListener void setTempLayer(const SpecialLayer *restrict const val) restrict { mTempLayer = val; } - int getWidth() const restrict noexcept A_WARN_UNUSED + int getWidth() const restrict noexcept2 A_WARN_UNUSED { return mWidth; } - int getHeight() const restrict noexcept A_WARN_UNUSED + int getHeight() const restrict noexcept2 A_WARN_UNUSED { return mHeight; } void optionChanged(const std::string &restrict value) diff --git a/src/resources/sprite/animatedsprite.cpp b/src/resources/sprite/animatedsprite.cpp index 4daf6f7f6..87fe72a7b 100644 --- a/src/resources/sprite/animatedsprite.cpp +++ b/src/resources/sprite/animatedsprite.cpp @@ -405,7 +405,7 @@ std::string AnimatedSprite::getIdPath() const restrict2 return mSprite->getIdPath(); } -const Image* AnimatedSprite::getImage() const restrict2 noexcept +const Image* AnimatedSprite::getImage() const restrict2 noexcept2 { return mFrame ? mFrame->image : nullptr; } diff --git a/src/resources/sprite/animatedsprite.h b/src/resources/sprite/animatedsprite.h index dcf8045fb..702896be3 100644 --- a/src/resources/sprite/animatedsprite.h +++ b/src/resources/sprite/animatedsprite.h @@ -81,18 +81,18 @@ class AnimatedSprite final : public Sprite int getHeight() const restrict2 override final A_WARN_UNUSED; - const Image* getImage() const restrict2 noexcept override final + const Image* getImage() const restrict2 noexcept2 override final A_WARN_UNUSED; bool setSpriteDirection(const SpriteDirection::Type direction) restrict2 override final; - int getNumberOfLayers() const restrict2 noexcept A_WARN_UNUSED + int getNumberOfLayers() const restrict2 noexcept2 A_WARN_UNUSED { return 1; } std::string getIdPath() const restrict2 A_WARN_UNUSED; - unsigned int getCurrentFrame() const restrict2 noexcept override final + unsigned int getCurrentFrame() const restrict2 noexcept2 override final A_WARN_UNUSED { return mFrameIndex; } @@ -105,19 +105,19 @@ class AnimatedSprite final : public Sprite bool updateNumber(const unsigned num) restrict2 override final; - void clearDelayLoad() restrict2 noexcept + void clearDelayLoad() restrict2 noexcept2 { mDelayLoad = nullptr; } - void setSprite(SpriteDef *restrict const sprite) restrict2 noexcept + void setSprite(SpriteDef *restrict const sprite) restrict2 noexcept2 { mSprite = sprite; } - bool isTerminated() const restrict2 noexcept + bool isTerminated() const restrict2 noexcept2 { return mTerminated; } - static void setEnableCache(const bool b) noexcept + static void setEnableCache(const bool b) noexcept2 { mEnableCache = b; } - void setLastTime(const int time) noexcept + void setLastTime(const int time) noexcept2 { mLastTime = time; } #ifdef UNITTESTS |