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
@@ -51,7 +51,7 @@ void CSToolConnection::validateCSTool(uint32 toolId, apiResult result, const api
p_connection->m_bSecure = true;
}
// if we have a null session type, then we aren't connected to the
// if we have a nullptr session type, then we aren't connected to the
// Session Server and are in debug mode.
//
// if we *do* have a good session, then check the admin table for access level.
@@ -71,7 +71,7 @@ void CSToolConnection::validateCSTool(uint32 toolId, apiResult result, const api
bool canLogin = isInternal; // we always have to be internal.
if (sessionNull)
{
// null session means we can skip everything else.
// nullptr session means we can skip everything else.
canLogin = canLogin && true;
accessLevel = 100;
}
@@ -282,13 +282,13 @@ void CentralServerConnection::onReceive(const Archive::ByteStream & message)
else if(m.isType("GcwScoreStatRaw"))
{
GenericValueTypeMessage<std::pair<std::string, std::pair<std::map<std::string, std::pair<int64, int64> >, std::map<std::string, std::pair<int64, int64> > > > > const msg(ri);
LoginServer::getInstance().sendToAllClusters(msg, NULL, 0, msg.getValue().first.c_str());
LoginServer::getInstance().sendToAllClusters(msg, nullptr, 0, msg.getValue().first.c_str());
}
else if(m.isType("GcwScoreStatPct"))
{
GenericValueTypeMessage<std::pair<std::string, std::pair<std::map<std::string, int>, std::map<std::string, int> > > > const msg(ri);
LoginServer::getInstance().sendToAllClusters(msg, NULL, 0, msg.getValue().first.c_str());
LoginServer::getInstance().sendToAllClusters(msg, nullptr, 0, msg.getValue().first.c_str());
}
}
@@ -100,7 +100,7 @@ void ClientConnection::onReceive(const Archive::ByteStream & message)
// client has an idea of how much difference there is between
// the client's Epoch time and the server Epoch time
GenericValueTypeMessage<int32> const serverNowEpochTime(
"ServerNowEpochTime", static_cast<int32>(::time(NULL)));
"ServerNowEpochTime", static_cast<int32>(::time(nullptr)));
send(serverNowEpochTime, true);
LoginClientId id(ri);
@@ -202,7 +202,7 @@ void ClientConnection::validateClient(const std::string & id, const std::string
LOG("LoginClientConnection", ("validateClient() for stationId (%lu) at IP (%s), id (%s) key (%s), skipping validating session", m_stationId, getRemoteAddress().c_str(), id.c_str(), key.c_str()));
LoginServer::getInstance().onValidateClient(suid, id, this, true, NULL, 0xFFFFFFFF, 0xFFFFFFFF);
LoginServer::getInstance().onValidateClient(suid, id, this, true, nullptr, 0xFFFFFFFF, 0xFFFFFFFF);
}
}
@@ -14,7 +14,7 @@
namespace ConsoleManagerNamespace
{
ConsoleCommandParser * s_consoleCommandParserRoot = NULL;
ConsoleCommandParser * s_consoleCommandParserRoot = nullptr;
}
using namespace ConsoleManagerNamespace;
@@ -130,7 +130,7 @@ LoginServer::LoginServer() :
Singleton<LoginServer>(),
MessageDispatch::Receiver(),
done(false),
m_centralService(NULL),
m_centralService(nullptr),
clientService(0),
pingService(0),
keyServer(0),
@@ -391,7 +391,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
{
CentralServerConnection * connection = const_cast<CentralServerConnection*>(safe_cast<const CentralServerConnection *>(&source));
DEBUG_REPORT_LOG(true, ("Cluster connection %s opened\n", msg.getClusterName().c_str()));
ClusterListEntry *cle=NULL;
ClusterListEntry *cle=nullptr;
if (ConfigLoginServer::getDevelopmentMode())
{
// in this mode, we trust the name sent by the cluster and we dynamically add clusters we don't know about
@@ -410,7 +410,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
{
WARNING(true,("Server %i is named \"%s\" in the database. The server at the specified address (%s:%hu) reports its name as \"%s\". It will not be allowed in the service. Either the name in the database or the name in Central's config file should be corrected.\n",cle->m_clusterId, cle->m_clusterName.c_str(), connection->getRemoteAddress().c_str(), connection->getRemotePort(), msg.getClusterName().c_str()));
disconnectCluster(*cle,true,false);
cle=NULL;
cle=nullptr;
}
}
@@ -589,7 +589,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
// for testing purpose when not using session authentication, store
// the account feature Ids locally in memory, which will get cleared
// (obviously) when the LoginServer is restarted
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = NULL;
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = nullptr;
if (msg.getGameCode() == PlatformGameCode::SWG)
nonSessionTestingAccountFeatureIds = &s_nonSessionTestingAccountSwgFeatureIds;
else if (msg.getGameCode() == PlatformGameCode::SWGTCG)
@@ -648,7 +648,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
// for testing purpose when not using session authentication, store
// the account feature Ids locally in memory, which will get cleared
// (obviously) when the LoginServer is restarted
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = NULL;
std::map<uint32, std::map<uint32, int> > * nonSessionTestingAccountFeatureIds = nullptr;
if (msg.getGameCode() == PlatformGameCode::SWG)
nonSessionTestingAccountFeatureIds = &s_nonSessionTestingAccountSwgFeatureIds;
else if (msg.getGameCode() == PlatformGameCode::SWGTCG)
@@ -826,7 +826,7 @@ void LoginServer::receiveMessage(const MessageDispatch::Emitter & source, const
const CentralServerConnection *conn = dynamic_cast<const CentralServerConnection *>(&source);
if (conn)
DatabaseConnection::getInstance().renameCharacter(conn->getClusterId(), msg.getCharacterId(), msg.getNewName(), NULL);
DatabaseConnection::getInstance().renameCharacter(conn->getClusterId(), msg.getCharacterId(), msg.getNewName(), nullptr);
else
WARNING_STRICT_FATAL(true,("Got RenameCharacterMessage from something other than CentralServerConnection.\n"));
}
@@ -1461,11 +1461,11 @@ LoginServer::ClusterListEntry *LoginServer::findClusterByName(const std::string
ClusterListType::iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
NOT_NULL(*i); // not legal to push null pointers on the vector
NOT_NULL(*i); // not legal to push nullptr pointers on the vector
if ((*i)->m_clusterName == clusterName)
return *i;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -1555,7 +1555,7 @@ void LoginServer::sendClusterStatus(ClientConnection &conn) const
// 5) Cluster has told us its ready for players
if (cle && cle->m_clusterId!=0 && cle->m_connected && !cle->m_connectionServers.empty() && (clientIsPrivate || !cle->m_secret))
{
DEBUG_FATAL(!cle->m_centralServerConnection,("Programmer bug: m_connected was true but m_centralServerConnection was NULL\n"));
DEBUG_FATAL(!cle->m_centralServerConnection,("Programmer bug: m_connected was true but m_centralServerConnection was nullptr\n"));
LoginClusterStatus::ClusterData item;
item.m_clusterId = cle->m_clusterId;
item.m_timeZone = cle->m_timeZone;
@@ -1840,12 +1840,12 @@ LoginServer::ClusterListEntry * LoginServer::findClusterById(uint32 clusterId)
ClusterListType::const_iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
NOT_NULL(*i); // not legal to push null pointers on the vector
NOT_NULL(*i); // not legal to push nullptr pointers on the vector
if ((*i)->m_clusterId == clusterId)
return *i;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -1859,12 +1859,12 @@ LoginServer::ClusterListEntry * LoginServer::findClusterByConnection(const Centr
ClusterListType::const_iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
NOT_NULL(*i); // not legal to push null pointers on the vector
NOT_NULL(*i); // not legal to push nullptr pointers on the vector
if ((*i)->m_centralServerConnection == connection)
return *i;
}
return NULL;
return nullptr;
}
// ----------------------------------------------------------------------
@@ -1908,12 +1908,12 @@ void LoginServer::setDone(const bool isDone)
// ----------------------------------------------------------------------
void LoginServer::sendToAllClusters(GameNetworkMessage const & message, Connection const * excludeCentralConnection /*= NULL*/, uint32 excludeClusterId /*= 0*/, char const * excludeClusterName /*= NULL*/)
void LoginServer::sendToAllClusters(GameNetworkMessage const & message, Connection const * excludeCentralConnection /*= nullptr*/, uint32 excludeClusterId /*= 0*/, char const * excludeClusterName /*= nullptr*/)
{
ClusterListType::const_iterator i;
for (i=m_clusterList.begin(); i!=m_clusterList.end(); ++i)
{
if (NON_NULL(*i)->m_connected && (*i)->m_centralServerConnection && ((*i)->m_centralServerConnection != excludeCentralConnection) && ((*i)->m_clusterId != excludeClusterId) && ((excludeClusterName == NULL) || _stricmp(excludeClusterName, (*i)->m_centralServerConnection->getClusterName().c_str())))
if (NON_NULL(*i)->m_connected && (*i)->m_centralServerConnection && ((*i)->m_centralServerConnection != excludeCentralConnection) && ((*i)->m_clusterId != excludeClusterId) && ((excludeClusterName == nullptr) || _stricmp(excludeClusterName, (*i)->m_centralServerConnection->getClusterName().c_str())))
(*i)->m_centralServerConnection->send(message,true);
}
}
@@ -64,7 +64,7 @@ public:
void validateAccount (const StationId& stationId, uint32 clusterId, uint32 subscriptionBits, bool canCreateRegular, bool canCreateJedi, bool canSkipTutorial, unsigned int track, std::vector<std::pair<NetworkId, std::string> > const & consumedRewardEvents, std::vector<std::pair<NetworkId, std::string> > const & claimedRewardItems);
void validateAccountForTransfer(const TransferRequestMoveValidation & request, uint32 clusterId, uint32 sourceCharacterTemplateId, bool canCreateRegular, bool canCreateJedi);
void sendToCluster (uint32 clusterId, const GameNetworkMessage &message);
void sendToAllClusters (GameNetworkMessage const & message, Connection const * excludeCentralConnection = NULL, uint32 excludeClusterId = 0, char const * excludeClusterName = NULL);
void sendToAllClusters (GameNetworkMessage const & message, Connection const * excludeCentralConnection = nullptr, uint32 excludeClusterId = 0, char const * excludeClusterName = nullptr);
bool areAllClustersUp () const;
void getClusterIds (stdvector<uint32>::fwd result);
void performAccountTransfer (const AvatarList &avatars, TransferAccountData * transferAccountData);
@@ -435,7 +435,7 @@ void SessionApiClient::NotifySessionKick(const char ** sessionList,
void SessionApiClient::checkStatusForPurge(StationId account)
{
GetAccountSubscription(account, PlatformGameCode::SWG, NULL);
GetAccountSubscription(account, PlatformGameCode::SWG, nullptr);
}
//------------------------------------------------------------------------------------------
@@ -58,7 +58,7 @@ void TaskCreateCharacter::onComplete()
// let all other galaxies know that a new character has been created for the station account
GenericValueTypeMessage<StationId> const ncc("NewCharacterCreated", m_stationId);
LoginServer::getInstance().sendToAllClusters(ncc, NULL, m_clusterId);
LoginServer::getInstance().sendToAllClusters(ncc, nullptr, m_clusterId);
}
// ======================================================================
@@ -14,7 +14,7 @@
// ======================================================================
TaskGetCharactersForDelete::TaskGetCharactersForDelete (StationId stationId, int clusterGroupId) :
TaskGetAvatarList(stationId, clusterGroupId, NULL)
TaskGetAvatarList(stationId, clusterGroupId, nullptr)
{
}