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

This reverts commit 8e2160f33e.
This commit is contained in:
DarthArgus
2016-02-11 21:19:18 -06:00
parent 8e2160f33e
commit dd9db6d350
937 changed files with 14983 additions and 14983 deletions
@@ -117,7 +117,7 @@ unsigned GenericAPICore::submitRequest(GenericRequest *req, GenericResponse *res
}
req->setTrack(m_currTrack);
res->setTrack(m_currTrack);
time_t timeout = time(NULL) + m_requestTimeout;
time_t timeout = time(nullptr) + m_requestTimeout;
req->setTimeout(timeout);
res->setTimeout(timeout);
@@ -136,7 +136,7 @@ void GenericAPICore::process()
if (!m_suspended)
{
// Process timeout on pending requests
while((m_outCount > 0) && ((req = m_outboundQueue.front().first)->getTimeout() <= time(NULL)))
while((m_outCount > 0) && ((req = m_outboundQueue.front().first)->getTimeout() <= time(nullptr)))
{
--m_outCount;
res = m_outboundQueue.front().second;
@@ -148,7 +148,7 @@ void GenericAPICore::process()
}
// Process timeout on pending responses
while((m_pendingCount > 0) && ((res = (*m_pending.begin()).second)->getTimeout() <= time(NULL)))
while((m_pendingCount > 0) && ((res = (*m_pending.begin()).second)->getTimeout() <= time(nullptr)))
{
--m_pendingCount;
m_pending.erase(m_pending.begin());
@@ -161,7 +161,7 @@ void GenericAPICore::process()
pair<GenericRequest *, GenericResponse *> out_pair = m_outboundQueue.front();
req = out_pair.first;
res = out_pair.second;
GenericConnection *con = NULL;
GenericConnection *con = nullptr;
if (req->getMappedServerTrack() == 0) // request has no originating "owner" server
{
con = getNextActiveConnection(); // it does not matter which server we send this to
@@ -178,7 +178,7 @@ void GenericAPICore::process()
}
}
if (con != NULL)
if (con != nullptr)
{
Base::ByteStream msg;
req->pack(msg);
@@ -213,7 +213,7 @@ GenericConnection *GenericAPICore::getNextActiveConnection()
unsigned startIndex = m_nextConnectionIndex;
unsigned maxIndex = m_serverConnections.size() - 1;
GenericConnection *con = NULL;
GenericConnection *con = nullptr;
//loop until we find an active connection, or until we get back
// to where we started
@@ -233,7 +233,7 @@ GenericConnection *GenericAPICore::getNextActiveConnection()
//went past end of vector, start back at 0
m_nextConnectionIndex = 0;
}
}while (con == NULL && m_nextConnectionIndex != startIndex);
}while (con == nullptr && m_nextConnectionIndex != startIndex);
return con;
}
@@ -259,7 +259,7 @@ ServerTrackObject *GenericAPICore::findServer(unsigned server_track)
{
std::map<unsigned, ServerTrackObject *>::iterator iter = m_serverTracks.find(server_track);
if (iter == m_serverTracks.end())
return NULL;
return nullptr;
ServerTrackObject *stobj = (*iter).second;
m_serverTracks.erase(server_track);
return stobj;
@@ -22,7 +22,7 @@ using namespace Base;
GenericConnection::GenericConnection(const char *host, short port, GenericAPICore *apiCore, unsigned reconnectTimeout, unsigned noDataTimeoutSecs, unsigned noAckTimeoutSecs, unsigned incomingBufSizeInKB, unsigned outgoingBufSizeInKB, unsigned keepAlive, unsigned maxRecvMessageSizeInKB)
: m_bConnected(CON_NONE),
m_apiCore(apiCore),
m_con(NULL),
m_con(nullptr),
m_host(host),
m_port(port),
m_lastTrack(123455), //random choice != 1
@@ -47,8 +47,8 @@ GenericConnection::~GenericConnection()
{
if(m_con)
{
m_con->SetHandler(NULL);
m_con->Disconnect();//don't worry about onterminated being called, we've set it's handler to null, so it wont
m_con->SetHandler(nullptr);
m_con->Disconnect();//don't worry about onterminated being called, we've set it's handler to nullptr, so it wont
m_con->Release();
}
@@ -61,7 +61,7 @@ void GenericConnection::disconnect()
{
m_con->Disconnect();
//no need to release, since callback to onTerminated releases it, and callback is allways made m_con->Release();
m_con = NULL;
m_con = nullptr;
}
m_conState = CON_DISCONNECT;
m_bConnected = CON_NONE;
@@ -74,7 +74,7 @@ void GenericConnection::OnTerminated(TcpConnection *con)
if(m_con)
{
m_con->Release();
m_con = NULL;
m_con = nullptr;
}
m_conState = CON_DISCONNECT;
m_bConnected = CON_NONE;
@@ -90,7 +90,7 @@ void GenericConnection::OnRoutePacket(TcpConnection *con, const unsigned char *d
get(iter, type);
get(iter, track);
GenericResponse *res = NULL;
GenericResponse *res = nullptr;
// the following if block is a temporary fix that prevents
// a crash with a game team in which they occasionally find
@@ -148,7 +148,7 @@ void GenericConnection::process()
{
m_con->SetHandler(this);
m_conState = CON_NEGOTIATE;
m_conTimeout = time(NULL) + m_reconnectTimeout;
m_conTimeout = time(nullptr) + m_reconnectTimeout;
}
break;
case CON_NEGOTIATE:
@@ -169,12 +169,12 @@ void GenericConnection::process()
put(msg, m_apiCore->getGameCode());
Send(msg);
}
else if(time(NULL) > m_conTimeout)
else if(time(nullptr) > m_conTimeout)
{
// we did not connect
m_con->Disconnect();
//no need to release, since callback to onTerminated releases it, and callback is allways made m_con->Release();
m_con = NULL;
m_con = nullptr;
m_conState = CON_DISCONNECT;
m_bConnected = CON_NONE;
}
@@ -190,7 +190,7 @@ void GenericConnection::process()
{
m_con->Disconnect();
//no need to release, since callback to onTerminated releases it, and callback is allways made m_con->Release();
m_con = NULL;
m_con = nullptr;
}
}
m_manager->GiveTime();