[Cleanup] Use explicit conversions for enum formatting (#4064)

This is prep for updating to fmt 10 which removed implicit conversions
for enums.
This commit is contained in:
hg
2024-02-12 03:58:48 -05:00
committed by GitHub
parent 20c01ef343
commit e920e35a5c
21 changed files with 33 additions and 17 deletions
+2
View File
@@ -64,4 +64,6 @@ typedef enum {
} bodyType;
/* bodytypes above 64 make the mob not show up */
constexpr int format_as(bodyType type) { return static_cast<int>(type); }
#endif
+2
View File
@@ -71,6 +71,8 @@ namespace EQ
bit_DeityAll = UINT32_MAX
};
constexpr int format_as(DeityType type) { return static_cast<int>(type); }
extern DeityTypeBit GetDeityBitmask(DeityType deity_type);
extern std::string GetDeityName(DeityType deity_type);
extern const std::map<DeityType, std::string>& GetDeityMap();
+1
View File
@@ -45,6 +45,7 @@ typedef enum { //EQEmu internal opcodes list
_maxEmuOpcode
} EmuOpcode;
constexpr int format_as(EmuOpcode opcode) { return static_cast<int>(opcode); }
extern const char *OpcodeNames[_maxEmuOpcode+1];
#endif
+1
View File
@@ -81,5 +81,6 @@ typedef enum {
GUILD_ACTION_MEMBERS_DEMOTE_SELF = 30,
} GuildAction;
constexpr int format_as(GuildAction action) { return static_cast<int>(action); }
#endif
+1
View File
@@ -158,6 +158,7 @@ namespace RoF2
slotCursor
};
constexpr int16 format_as(InventorySlots slot) { return static_cast<int16>(slot); }
} // namespace enum_
using namespace enum_;
+2
View File
@@ -162,6 +162,8 @@ namespace EQ
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
#define PACKET_SKILL_ARRAY_SIZE 100
constexpr int format_as(SkillType skill) { return static_cast<int>(skill); }
bool IsTradeskill(SkillType skill);
bool IsSpecializedSkill(SkillType skill);
float GetSkillMeleePushForce(SkillType skill);
+2
View File
@@ -252,6 +252,8 @@ typedef enum {
ActivityCompleted = 2
} ActivityState;
constexpr int format_as(ActivityState state) { return static_cast<int>(state); }
struct ClientActivityInformation {
int activity_id;
int done_count;
+2
View File
@@ -54,6 +54,8 @@ namespace EQ
tintInvalid = textureInvalid
};
constexpr int format_as(TextureSlot slot) { return static_cast<int>(slot); }
const int8 LastTexture = weaponSecondary;
const int8 LastTintableTexture = tintFeet;