newer standards prefer nullptr over NULL - this is most of them but there are others too

This commit is contained in:
DarthArgus
2016-02-11 15:16:14 -06:00
parent a7f2d0ea6a
commit 3e4cc36e7e
937 changed files with 14983 additions and 14983 deletions
@@ -14,7 +14,7 @@
namespace ConsoleManagerNamespace
{
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
}
using namespace ConsoleManagerNamespace;
@@ -30,7 +30,7 @@
//-----------------------------------------------------------------------
DataLookup *DataLookup::ms_theInstance = NULL;
DataLookup *DataLookup::ms_theInstance = nullptr;
//-----------------------------------------------------------------------
@@ -524,7 +524,7 @@ void DataLookup::deleteReservationList(uint32 stationId)
reservationList * rl = rlIter->second;
if (!rl)
{
WARNING_STRICT_FATAL(true, ("Reservation list for stationID %lu is NULL", stationId));
WARNING_STRICT_FATAL(true, ("Reservation list for stationID %lu is nullptr", stationId));
return;
}
reservationList::iterator i;
@@ -46,7 +46,7 @@
// ----------------------------------------------------------------------
DatabaseProcess *DatabaseProcess::ms_theInstance = NULL;
DatabaseProcess *DatabaseProcess::ms_theInstance = nullptr;
// ----------------------------------------------------------------------
@@ -627,7 +627,7 @@ void DatabaseProcess::sendToCommoditiesServer(GameNetworkMessage const &message,
commoditiesConnection->send(message,reliable);
}
else
DEBUG_REPORT_LOG(true, ("commoditiesConnection is NULL\n"));
DEBUG_REPORT_LOG(true, ("commoditiesConnection is nullptr\n"));
}
// ----------------------------------------------------------------------
@@ -23,7 +23,7 @@ ImmediateDeleteCustomPersistStep::ImmediateDeleteCustomPersistStep() :
ImmediateDeleteCustomPersistStep::~ImmediateDeleteCustomPersistStep()
{
delete m_objects;
m_objects = NULL;
m_objects = nullptr;
}
// ----------------------------------------------------------------------
@@ -27,7 +27,7 @@
// ======================================================================
LazyDeleter * LazyDeleter::ms_instance=NULL;
LazyDeleter * LazyDeleter::ms_instance=nullptr;
// ======================================================================
@@ -80,13 +80,13 @@ void LazyDeleter::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
LazyDeleter::LazyDeleter() :
m_workerThread(NULL), // Avoid starting the worker thread until the other member variables are initialized
m_workerThread(nullptr), // Avoid starting the worker thread until the other member variables are initialized
m_incomingObjects(new std::vector<NetworkId>),
m_objectsToDelete(new std::deque<NetworkId>),
m_objectListLock(new Mutex),
@@ -113,11 +113,11 @@ LazyDeleter::~LazyDeleter()
delete m_objectsToDelete;
delete m_objectListLock;
m_workerThread = NULL;
m_incomingObjects = NULL;
m_objectsToDelete = NULL;
m_objectListLock = NULL;
m_session = NULL;
m_workerThread = nullptr;
m_incomingObjects = nullptr;
m_objectsToDelete = nullptr;
m_objectListLock = nullptr;
m_session = nullptr;
}
// ----------------------------------------------------------------------
@@ -55,7 +55,7 @@
// ======================================================================
Loader *Loader::ms_instance = NULL;
Loader *Loader::ms_instance = nullptr;
// ======================================================================
@@ -72,7 +72,7 @@ void Loader::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
@@ -442,7 +442,7 @@ void Loader::receiveMessage(const MessageDispatch::Emitter & source, const Messa
{
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
ValidateCharacterForLoginMessage msg(ri);
verifyCharacter(msg.getSuid(), msg.getCharacterId(), NULL);
verifyCharacter(msg.getSuid(), msg.getCharacterId(), nullptr);
}
else if(message.isType("TransferGetLoginLocationData"))
{
@@ -647,7 +647,7 @@ void Loader::checkVersionNumber(int expectedVersion, bool fatalOnMismatch)
void Loader::requestChunk(uint32 processId,int nodeX, int nodeZ, const std::string &sceneId)
{
ObjectLocator * const regularLocator=new ChunkLocator(nodeX, nodeZ, sceneId, processId, true);
ObjectLocator * goldLocator=NULL;
ObjectLocator * goldLocator=nullptr;
if (ConfigServerDatabase::getEnableGoldDatabase())
goldLocator = new ChunkLocator(nodeX, nodeZ, sceneId, processId, false);
addLocatorsForServer(processId, regularLocator, goldLocator);
@@ -671,7 +671,7 @@ void Loader::requestCharacter(const NetworkId &characterId, uint32 gameServerId)
i=m_multipleLoginLock.find(characterId);
if (i==m_multipleLoginLock.end())
{
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), NULL);
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), nullptr);
DEBUG_REPORT_LOG(true,("Adding multipleLoginLock for %s\n",characterId.getValueString().c_str()));
m_multipleLoginLock[characterId] = gameServerId;
@@ -684,7 +684,7 @@ void Loader::requestCharacter(const NetworkId &characterId, uint32 gameServerId)
}
}
else
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), NULL);
addLocatorsForServer(gameServerId, new CharacterLocator(characterId), nullptr);
}
// ----------------------------------------------------------------------
@@ -692,7 +692,7 @@ void Loader::requestCharacter(const NetworkId &characterId, uint32 gameServerId)
void Loader::loadContainedObject(const NetworkId &containerId, const NetworkId &objectId, uint32 gameServerId)
{
LOG("AuctionRetrieval", ("Loader::received loadContainedObject for loading object %s for retrieval", objectId.getValueString().c_str()));
addLocatorsForServer(gameServerId, new ContainedObjectLocator(containerId,objectId), NULL);
addLocatorsForServer(gameServerId, new ContainedObjectLocator(containerId,objectId), nullptr);
}
@@ -700,7 +700,7 @@ void Loader::loadContainedObject(const NetworkId &containerId, const NetworkId &
void Loader::loadContents(const NetworkId &containerId, uint32 gameServerId)
{
addLocatorsForServer(gameServerId, new ContentsLocator(containerId), NULL);
addLocatorsForServer(gameServerId, new ContentsLocator(containerId), nullptr);
}
// ----------------------------------------------------------------------
@@ -820,7 +820,7 @@ void Loader::removeLoadLock(const NetworkId &characterId)
if (i->second!=0)
{
DEBUG_REPORT_LOG(true,("Now handling delayed login request for character %s\n",characterId.getValueString().c_str()));
addLocatorsForServer(i->second, new CharacterLocator(characterId), NULL);
addLocatorsForServer(i->second, new CharacterLocator(characterId), nullptr);
}
m_loadLock.erase(i);
@@ -16,7 +16,7 @@
// ======================================================================
MessageToManager *MessageToManager::ms_instance=NULL;
MessageToManager *MessageToManager::ms_instance=nullptr;
// ======================================================================
@@ -34,7 +34,7 @@ void MessageToManager::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
@@ -51,7 +51,7 @@ MessageToManager::~MessageToManager()
for (MessagesByObjectType::iterator i=m_messagesByObject.begin(); i!=m_messagesByObject.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -71,7 +71,7 @@ void MessageToManager::handleMessageTo(const MessageToPayload &data)
{
DEBUG_WARNING(true,("Received message %s twice.",data.getMessageId().getValueString().c_str()));
delete i->second;
i->second = NULL;
i->second = nullptr;
}
m_messagesByObject[theKey]=new MessageToPayload(data);
@@ -127,7 +127,7 @@ void MessageToManager::removeMessage(const MessageToId &messageId)
if (j!=m_messagesByObject.end())
{
delete j->second;
j->second=NULL;
j->second=nullptr;
m_messagesByObject.erase(j);
}
m_messageToObjectMap.erase(i);
@@ -70,7 +70,7 @@
// ======================================================================
Persister *Persister::ms_instance=NULL;
Persister *Persister::ms_instance=nullptr;
// ======================================================================
@@ -88,7 +88,7 @@ void Persister::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
//-----------------------------------------------------------------------
@@ -108,9 +108,9 @@ Persister::Persister() :
m_charactersToDeleteThisSaveCycle(new CharactersToDeleteType),
m_charactersToDeleteNextSaveCycle(new CharactersToDeleteType),
m_timeSinceLastSave(0),
m_messageSnapshot(NULL),
m_commoditiesSnapshot(NULL),
m_arbitraryGameDataSnapshot(NULL),
m_messageSnapshot(nullptr),
m_commoditiesSnapshot(nullptr),
m_arbitraryGameDataSnapshot(nullptr),
m_saveStartTime(0),
m_totalSaveTime(0),
m_maxSaveTime(0),
@@ -181,15 +181,15 @@ Persister::~Persister()
m_currentSnapshots.clear();
m_newObjectSnapshots.clear();
m_objectSnapshotMap.clear();
m_messageSnapshot = NULL;
m_commoditiesSnapshot = NULL;
m_arbitraryGameDataSnapshot = NULL;
m_messageSnapshot = nullptr;
m_commoditiesSnapshot = nullptr;
m_arbitraryGameDataSnapshot = nullptr;
delete m_charactersToDeleteThisSaveCycle;
m_charactersToDeleteThisSaveCycle = NULL;
m_charactersToDeleteThisSaveCycle = nullptr;
delete m_charactersToDeleteNextSaveCycle;
m_charactersToDeleteNextSaveCycle = NULL;
m_charactersToDeleteNextSaveCycle = nullptr;
}
// ----------------------------------------------------------------------
@@ -283,7 +283,7 @@ void Persister::onFrameBarrierReached()
/**
* Moves the current & new object snapshots onto the queue to be saved.
*
* Does nothing if these snapshots are null.
* Does nothing if these snapshots are nullptr.
*/
void Persister::startSave(void)
@@ -351,9 +351,9 @@ void Persister::startSave(void)
m_currentSnapshots.clear();
m_newObjectSnapshots.clear();
m_objectSnapshotMap.clear();
m_messageSnapshot = NULL;
m_commoditiesSnapshot = NULL;
m_arbitraryGameDataSnapshot = NULL;
m_messageSnapshot = nullptr;
m_commoditiesSnapshot = nullptr;
m_arbitraryGameDataSnapshot = nullptr;
// prepare the list of characters to delete during the next save cycle
if (m_charactersToDeleteNextSaveCycle && m_charactersToDeleteThisSaveCycle)
@@ -515,7 +515,7 @@ void Persister::newObject(uint32 serverId, const NetworkId &objectId, int templa
return;
}
Snapshot *snap=NULL;
Snapshot *snap=nullptr;
PendingCharactersType::iterator chardata=m_pendingCharacters.find(objectId);
if (chardata!=m_pendingCharacters.end())
@@ -543,7 +543,7 @@ void Persister::newObject(uint32 serverId, const NetworkId &objectId, int templa
else
{
// Add the object to the appropriate snapshot
snap=NULL;
snap=nullptr;
{
ObjectSnapshotMap::const_iterator j=m_objectSnapshotMap.find(container);
if (j!=m_objectSnapshotMap.end() && j->second->getMode() == DB::ModeQuery::mode_INSERT)
@@ -728,7 +728,7 @@ void Persister::receiveMessage(const MessageDispatch::Emitter & source, const Me
Archive::ReadIterator ri = static_cast<const GameNetworkMessage &>(message).getByteStream().begin();
RenameCharacterMessageEx msg(ri);
renameCharacter(sourceGameServer, static_cast<int8>(msg.getRenameCharacterMessageSource()), msg.getStationId(), msg.getCharacterId(), msg.getNewName(), msg.getOldName(), msg.getLastNameChangeOnly(), msg.getRequestedBy(), NULL);
renameCharacter(sourceGameServer, static_cast<int8>(msg.getRenameCharacterMessageSource()), msg.getStationId(), msg.getCharacterId(), msg.getNewName(), msg.getOldName(), msg.getLastNameChangeOnly(), msg.getRequestedBy(), nullptr);
}
else if (message.isType("UnloadedPlayerMessage"))
{
@@ -19,7 +19,7 @@
TaskGetBiography::TaskGetBiography(const NetworkId &owner, uint32 requestingProcess) :
m_owner(owner),
m_requestingProcess(requestingProcess),
m_bio(NULL)
m_bio(nullptr)
{
}
@@ -28,7 +28,7 @@ TaskGetBiography::TaskGetBiography(const NetworkId &owner, uint32 requestingProc
TaskGetBiography::~TaskGetBiography()
{
delete m_bio;
m_bio=NULL;
m_bio=nullptr;
}
// ----------------------------------------------------------------------
@@ -53,7 +53,7 @@ bool TaskGetBiography::process(DB::Session *session)
void TaskGetBiography::onComplete()
{
WARNING_STRICT_FATAL(!m_bio,("In TaskGetBiography::onComplete, but m_bio is NULL\n"));
WARNING_STRICT_FATAL(!m_bio,("In TaskGetBiography::onComplete, but m_bio is nullptr\n"));
if (m_bio)
{
BiographyMessage msg(m_owner, *m_bio);
@@ -24,7 +24,7 @@ TaskSetBiography::TaskSetBiography(const NetworkId &owner, const Unicode::String
TaskSetBiography::~TaskSetBiography()
{
delete m_bio;
m_bio=NULL;
m_bio=nullptr;
}
// ----------------------------------------------------------------------