refactor(Core): NULL -> nullptr (#3275)

* NULL to nullptr

* NULL to nullptr

* NULL to nullptr

* NULL to nullptr

* NULL to nullptr

Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
Kitzunu
2020-08-31 11:55:09 +02:00
committed by GitHub
parent 38903b5dfb
commit 1f89282b22
325 changed files with 2348 additions and 2348 deletions

View File

@@ -109,7 +109,7 @@ bool LoginQueryHolder::Initialize()
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILCOUNT);
stmt->setUInt32(0, lowGuid);
stmt->setUInt64(1, uint64(time(NULL)));
stmt->setUInt64(1, uint64(time(nullptr)));
res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOAD_MAIL_COUNT, stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_MAILDATE);
@@ -478,7 +478,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
}
_charCreateCallback.NextStage();
HandleCharCreateCallback(PreparedQueryResult(NULL), createInfo); // Will jump to case 3
HandleCharCreateCallback(PreparedQueryResult(nullptr), createInfo); // Will jump to case 3
}
break;
case 3:
@@ -755,7 +755,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recvData)
{
if (PlayerLoading() || GetPlayer() != NULL)
if (PlayerLoading() || GetPlayer() != nullptr)
{
sLog->outError("Player tries to login again, AccountId = %d", GetAccountId());
KickPlayer("Player tries to login again");
@@ -848,7 +848,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recvData)
return;
}
sess->SetPlayer(NULL);
sess->SetPlayer(nullptr);
SetPlayer(p);
p->SetSession(this);
delete p->PlayerTalkClass;
@@ -882,7 +882,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
// "GetAccountId() == db stored account id" checked in LoadFromDB (prevent login not own character using cheating tools)
if (!pCurrChar->LoadFromDB(GUID_LOPART(playerGuid), holder))
{
SetPlayer(NULL);
SetPlayer(nullptr);
KickPlayer("HandlePlayerLoginFromDB"); // disconnect client, player no set to session and it will not deleted or saved at kick
delete pCurrChar; // delete it manually
delete holder; // delete all unprocessed queries
@@ -926,7 +926,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
if (uint32 guildId = Player::GetGuildIdFromStorage(pCurrChar->GetGUIDLow()))
{
Guild* guild = sGuildMgr->GetGuildById(guildId);
Guild::Member const* member = guild ? guild->GetMember(pCurrChar->GetGUID()) : NULL;
Guild::Member const* member = guild ? guild->GetMember(pCurrChar->GetGUID()) : nullptr;
if (member)
{
pCurrChar->SetInGuild(guildId);
@@ -1017,7 +1017,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
if (mapDiff->resetTime)
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty()))
{
uint32 timeleft = uint32(timeReset - time(NULL));
uint32 timeleft = uint32(timeReset - time(nullptr));
pCurrChar->SendInstanceResetWarning(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty(), timeleft, true);
}
@@ -1026,7 +1026,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
if (!t->IsInMap(pCurrChar))
{
t->RemovePassenger(pCurrChar);
pCurrChar->m_transport = NULL;
pCurrChar->m_transport = nullptr;
pCurrChar->m_movementInfo.transport.Reset();
pCurrChar->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
}
@@ -1186,7 +1186,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder)
if ((isReferrer && pCurrChar->GetSession()->GetAccountId() == itr->second->GetRecruiterId()) || (!isReferrer && pCurrChar->GetSession()->GetRecruiterId() == itr->second->GetAccountId()))
{
Player * rf = itr->second->GetPlayer();
if (rf != NULL)
if (rf != nullptr)
{
pCurrChar->SendUpdateToPlayer(rf);
rf->SendUpdateToPlayer(pCurrChar);
@@ -1309,7 +1309,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
if (mapDiff->resetTime)
if (time_t timeReset = sInstanceSaveMgr->GetResetTimeFor(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty()))
{
uint32 timeleft = uint32(timeReset - time(NULL));
uint32 timeleft = uint32(timeReset - time(nullptr));
GetPlayer()->SendInstanceResetWarning(pCurrChar->GetMap()->GetId(), pCurrChar->GetMap()->GetDifficulty(), timeleft, true);
}
@@ -1976,7 +1976,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
if (_player->IsInCombat() && i != EQUIPMENT_SLOT_MAINHAND && i != EQUIPMENT_SLOT_OFFHAND && i != EQUIPMENT_SLOT_RANGED)
continue;
Item* item = NULL;
Item* item = nullptr;
if (itemGuid > 0)
item = _player->GetItemByGuid(itemGuid);
@@ -1989,7 +1989,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
if (uItem->IsEquipped()) {
msg = _player->CanUnequipItem(dstpos, true);
if (msg != EQUIP_ERR_OK) {
_player->SendEquipError(msg, uItem, NULL);
_player->SendEquipError(msg, uItem, nullptr);
continue;
}
}
@@ -2004,7 +2004,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
_player->StoreItem(sDest, uItem, true);
}
else
_player->SendEquipError(msg, uItem, NULL);
_player->SendEquipError(msg, uItem, nullptr);
continue;
}
@@ -2018,7 +2018,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData)
uint16 _candidatePos;
msg = _player->CanEquipItem(NULL_SLOT, _candidatePos, item, true);
if (msg != EQUIP_ERR_OK) {
_player->SendEquipError(msg, item, NULL);
_player->SendEquipError(msg, item, nullptr);
continue;
}
}