refactor(Core): apply clang-tidy modernize-use-default-member-init (#3827)

This commit is contained in:
Francesco Borzì
2020-12-07 20:34:06 +01:00
committed by GitHub
parent 1cf39b3d22
commit c5a35efd7b
47 changed files with 352 additions and 366 deletions

View File

@@ -14,7 +14,7 @@ template <class T>
class DBCStorageIterator : public std::iterator<std::forward_iterator_tag, T>
{
public:
DBCStorageIterator() : _index(nullptr), _pos(0), _end(0) { }
DBCStorageIterator() : _index(nullptr) { }
DBCStorageIterator(T** index, uint32 size, uint32 pos = 0) : _index(index), _pos(pos), _end(size)
{
if (_pos < _end)
@@ -51,8 +51,8 @@ public:
private:
T** _index;
uint32 _pos;
uint32 _end;
uint32 _pos{0};
uint32 _end{0};
};
#endif // DBCStorageIterator_h__

View File

@@ -2093,32 +2093,32 @@ struct WorldStateUI
// Structures not used for casting to loaded DBC data and not required then packing
struct MapDifficulty
{
MapDifficulty() : resetTime(0), maxPlayers(0), hasErrorMessage(false) {}
MapDifficulty() {}
MapDifficulty(uint32 _resetTime, uint32 _maxPlayers, bool _hasErrorMessage) : resetTime(_resetTime), maxPlayers(_maxPlayers), hasErrorMessage(_hasErrorMessage) {}
uint32 resetTime;
uint32 maxPlayers;
bool hasErrorMessage;
uint32 resetTime{0};
uint32 maxPlayers{0};
bool hasErrorMessage{false};
};
struct TalentSpellPos
{
TalentSpellPos() : talent_id(0), rank(0) {}
TalentSpellPos() {}
TalentSpellPos(uint16 _talent_id, uint8 _rank) : talent_id(_talent_id), rank(_rank) {}
uint16 talent_id;
uint8 rank;
uint16 talent_id{0};
uint8 rank{0};
};
typedef std::map<uint32, TalentSpellPos> TalentSpellPosMap;
struct TaxiPathBySourceAndDestination
{
TaxiPathBySourceAndDestination() : ID(0), price(0) {}
TaxiPathBySourceAndDestination() {}
TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) {}
uint32 ID;
uint32 price;
uint32 ID{0};
uint32 price{0};
};
typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource;
typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource;