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;

View File

@@ -17,8 +17,8 @@ RealmSocket::Session::Session() = default;
RealmSocket::Session::~Session() = default;
RealmSocket::RealmSocket() :
input_buffer_(4096), session_(nullptr),
_remoteAddress(), _remotePort(0)
input_buffer_(4096),
_remoteAddress()
{
reference_counting_policy().value(ACE_Event_Handler::Reference_Counting_Policy::ENABLED);

View File

@@ -59,9 +59,9 @@ private:
ssize_t noblk_send(ACE_Message_Block& message_block);
ACE_Message_Block input_buffer_;
Session* session_;
Session* session_{nullptr};
std::string _remoteAddress;
uint16 _remotePort;
uint16 _remotePort{0};
};
#endif /* __REALMSOCKET_H__ */

View File

@@ -8,7 +8,7 @@
#include "RealmList.h"
#include "DatabaseEnv.h"
RealmList::RealmList() : m_UpdateInterval(0), m_NextUpdateTime(time(nullptr)) { }
RealmList::RealmList() : m_NextUpdateTime(time(nullptr)) { }
RealmList* RealmList::instance()
{

View File

@@ -63,7 +63,7 @@ private:
void UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build);
RealmMap m_realms;
uint32 m_UpdateInterval;
uint32 m_UpdateInterval{0};
time_t m_NextUpdateTime;
};