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
@@ -16,7 +16,7 @@
DataTable * AdminAccountManager::ms_adminTable = 0;
bool AdminAccountManager::ms_installed = false;
std::string *AdminAccountManager::ms_dataTableName = NULL;
std::string *AdminAccountManager::ms_dataTableName = nullptr;
//-----------------------------------------------------------------------
@@ -42,7 +42,7 @@ void AdminAccountManager::remove()
DataTableManager::close(*ms_dataTableName);
ms_installed = false;
delete ms_dataTableName;
ms_dataTableName = NULL;
ms_dataTableName = nullptr;
}
//-----------------------------------------------------------------------
@@ -135,7 +135,7 @@ void ChatLogManagerNamespace::addChatLogEntry(Unicode::String const &fromPlayer,
}
else
{
Unicode::String const *finalMessage = NULL;
Unicode::String const *finalMessage = nullptr;
// Add the new string to the master message list, or if it already exists, just increase the reference count
@@ -36,7 +36,7 @@ namespace ClusterWideDataManagerListNamespace
struct QueuedRequestInfo
{
QueuedRequestInfo() : processId(0), requestTime(0.0), request(NULL), server(NULL) {};
QueuedRequestInfo() : processId(0), requestTime(0.0), request(nullptr), server(nullptr) {};
unsigned long processId;
float requestTime;
@@ -272,7 +272,7 @@ void ClusterWideDataManagerList::onGameServerDisconnect(unsigned long const proc
ClusterWideDataManagerListNamespace::ServerLockListConstRange range = ClusterWideDataManagerListNamespace::s_serverLockList.equal_range(processId);
ClusterWideDataManager * manager = NULL;
ClusterWideDataManager * manager = nullptr;
for (ClusterWideDataManagerListNamespace::ServerLockList::const_iterator iter2 = range.first; iter2 != range.second; ++iter2)
{
manager = ClusterWideDataManagerListNamespace::getClusterWideDataManager((iter2->second).managerName, false);
@@ -327,7 +327,7 @@ ClusterWideDataManager * ClusterWideDataManagerListNamespace::getClusterWideData
return manager;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -205,7 +205,7 @@ void FreeCtsDataTableNamespace::loadData()
tokensSourceClusterList.clear();
tokensTargetClusterList.clear();
if (Unicode::tokenize(Unicode::narrowToWide(sourceClusterList), tokensSourceClusterList, &clusterListDelimiters, NULL) && (tokensSourceClusterList.size() > 0) && Unicode::tokenize(Unicode::narrowToWide(targetClusterList), tokensTargetClusterList, &clusterListDelimiters, NULL) && (tokensTargetClusterList.size() > 0))
if (Unicode::tokenize(Unicode::narrowToWide(sourceClusterList), tokensSourceClusterList, &clusterListDelimiters, nullptr) && (tokensSourceClusterList.size() > 0) && Unicode::tokenize(Unicode::narrowToWide(targetClusterList), tokensTargetClusterList, &clusterListDelimiters, nullptr) && (tokensTargetClusterList.size() > 0))
{
for (tokensIter = tokensTargetClusterList.begin(); tokensIter != tokensTargetClusterList.end(); ++tokensIter)
freeCtsInfo.targetCluster[Unicode::wideToNarrow(Unicode::toLower(*tokensIter))] = Unicode::wideToNarrow(*tokensIter);
@@ -258,9 +258,9 @@ void FreeCtsDataTableNamespace::loadData()
time_t FreeCtsDataTableNamespace::convertToEpoch(int const year, int const month, int const day, int const hour, int const minute, int const second)
{
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
struct tm * timeinfo = ::localtime(&timeNow);
FATAL(!timeinfo, ("::localtime() returns NULL"));
FATAL(!timeinfo, ("::localtime() returns nullptr"));
// greater than zero if Daylight Saving Time is in effect,
// zero if Daylight Saving Time is not in effect,
@@ -288,7 +288,7 @@ time_t FreeCtsDataTableNamespace::convertToEpoch(int const year, int const month
// "opposite" standard/daylight period than the current time,
// and it should be OK
timeinfo = ::localtime(&convertedTime);
FATAL(!timeinfo, ("::localtime() returns NULL"));
FATAL(!timeinfo, ("::localtime() returns nullptr"));
if ((timeinfo->tm_year != (year - 1900)) ||
(timeinfo->tm_mon != (month - 1)) ||
@@ -342,9 +342,9 @@ FreeCtsDataTable::FreeCtsInfo const * FreeCtsDataTable::isFreeCtsSourceCluster(s
loadData();
if (s_freeCtsList.empty())
return NULL;
return nullptr;
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
std::pair<std::multimap<std::string, FreeCtsInfo>::const_iterator, std::multimap<std::string, FreeCtsInfo>::const_iterator> range = s_freeCtsList.equal_range(Unicode::toLower(sourceCluster));
for (std::multimap<std::string, FreeCtsInfo>::const_iterator iter = range.first; iter != range.second; ++iter)
{
@@ -355,7 +355,7 @@ FreeCtsDataTable::FreeCtsInfo const * FreeCtsDataTable::isFreeCtsSourceCluster(s
return &(iter->second);
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -366,15 +366,15 @@ FreeCtsDataTable::FreeCtsInfo const * FreeCtsDataTable::wouldCharacterTransferBe
loadData();
if (s_freeCtsList.empty())
return NULL;
return nullptr;
if ((sourceCharacterCreateTime <= 0) && !ignoreTimeRestriction)
return NULL;
return nullptr;
if (sourceStationId != targetStationId)
return NULL;
return nullptr;
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
std::string const lowerTargetCluster(Unicode::toLower(targetCluster));
std::pair<std::multimap<std::string, FreeCtsInfo>::const_iterator, std::multimap<std::string, FreeCtsInfo>::const_iterator> range = s_freeCtsList.equal_range(Unicode::toLower(sourceCluster));
@@ -396,7 +396,7 @@ FreeCtsDataTable::FreeCtsInfo const * FreeCtsDataTable::wouldCharacterTransferBe
}
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -407,12 +407,12 @@ FreeCtsDataTable::FreeCtsInfo const * FreeCtsDataTable::getFreeCtsInfoForCharact
loadData();
if (s_freeCtsList.empty())
return NULL;
return nullptr;
if ((sourceCharacterCreateTime <= 0) && !ignoreTimeRestriction)
return NULL;
return nullptr;
time_t const timeNow = ::time(NULL);
time_t const timeNow = ::time(nullptr);
std::pair<std::multimap<std::string, FreeCtsInfo>::const_iterator, std::multimap<std::string, FreeCtsInfo>::const_iterator> range = s_freeCtsList.equal_range(Unicode::toLower(sourceCluster));
for (std::multimap<std::string, FreeCtsInfo>::const_iterator iter = range.first; iter != range.second; ++iter)
{
@@ -429,5 +429,5 @@ FreeCtsDataTable::FreeCtsInfo const * FreeCtsDataTable::getFreeCtsInfoForCharact
return &(iter->second);
}
return NULL;
return nullptr;
}