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:
@@ -16,7 +16,7 @@
|
||||
#include "Player.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; }
|
||||
inline float GetAge(uint64 t) { return float(time(nullptr) - t) / DAY; }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// GM ticket
|
||||
@@ -24,7 +24,7 @@ GmTicket::GmTicket() : _id(0), _playerGuid(0), _type(TICKET_TYPE_OPEN), _posX(0)
|
||||
_closedBy(0), _resolvedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false),
|
||||
_needResponse(false), _needMoreHelp(false) { }
|
||||
|
||||
GmTicket::GmTicket(Player* player) : _type(TICKET_TYPE_OPEN), _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _resolvedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false), _needMoreHelp(false)
|
||||
GmTicket::GmTicket(Player* player) : _type(TICKET_TYPE_OPEN), _createTime(time(nullptr)), _lastModifiedTime(time(nullptr)), _closedBy(0), _resolvedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false), _needMoreHelp(false)
|
||||
{
|
||||
_id = sTicketMgr->GenerateTicketId();
|
||||
_playerName = player->GetName();
|
||||
@@ -147,7 +147,7 @@ void GmTicket::SendResponse(WorldSession* session) const
|
||||
|
||||
std::string GmTicket::FormatMessageString(ChatHandler& handler, bool detailed) const
|
||||
{
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTGUID, _id);
|
||||
@@ -235,7 +235,7 @@ void GmTicket::SetChatLog(std::list<uint32> time, std::string const& log)
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Ticket manager
|
||||
TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)) { }
|
||||
TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(nullptr)) { }
|
||||
|
||||
TicketMgr::~TicketMgr()
|
||||
{
|
||||
@@ -336,7 +336,7 @@ void TicketMgr::AddTicket(GmTicket* ticket)
|
||||
_ticketList[ticket->GetId()] = ticket;
|
||||
if (!ticket->IsClosed())
|
||||
++_openTicketCount;
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SaveToDB(trans);
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ void TicketMgr::CloseTicket(uint32 ticketId, int64 source)
|
||||
{
|
||||
if (GmTicket* ticket = GetTicket(ticketId))
|
||||
{
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetClosedBy(source);
|
||||
if (source)
|
||||
--_openTicketCount;
|
||||
@@ -366,7 +366,7 @@ void TicketMgr::ResolveAndCloseTicket(uint32 ticketId, int64 source)
|
||||
{
|
||||
if (GmTicket* ticket = GetTicket(ticketId))
|
||||
{
|
||||
SQLTransaction trans = SQLTransaction(NULL);
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
ticket->SetClosedBy(source);
|
||||
ticket->SetResolvedBy(source);
|
||||
if (source)
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
void SetMessage(std::string const& message)
|
||||
{
|
||||
_message = message;
|
||||
_lastModifiedTime = uint64(time(NULL));
|
||||
_lastModifiedTime = uint64(time(nullptr));
|
||||
}
|
||||
void SetComment(std::string const& comment) { _comment = comment; }
|
||||
void SetViewed() { _viewed = true; }
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
if (itr != _ticketList.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GmTicket* GetTicketByPlayer(uint64 playerGuid)
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
if (itr->second && itr->second->IsFromPlayer(playerGuid) && !itr->second->IsClosed())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GmTicket* GetOldestOpenTicket()
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
if (itr->second && !itr->second->IsClosed() && !itr->second->IsCompleted())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AddTicket(GmTicket* ticket);
|
||||
@@ -218,7 +218,7 @@ public:
|
||||
void SetStatus(bool status) { _status = status; }
|
||||
|
||||
uint64 GetLastChange() const { return _lastChange; }
|
||||
void UpdateLastChange() { _lastChange = uint64(time(NULL)); }
|
||||
void UpdateLastChange() { _lastChange = uint64(time(nullptr)); }
|
||||
|
||||
uint32 GenerateTicketId() { return ++_lastTicketId; }
|
||||
uint32 GetOpenTicketCount() const { return _openTicketCount; }
|
||||
|
||||
Reference in New Issue
Block a user