Use nullptr instead of 0 and 0x0

This commit is contained in:
Robert Müller 2022-10-09 17:57:43 +02:00
parent 026ddc3f3a
commit 93d669143d
3 changed files with 16 additions and 16 deletions

View file

@ -702,7 +702,7 @@ int CClient::SnapItemSize(int SnapID, int Index) const
const void *CClient::SnapFindItem(int SnapID, int Type, int ID) const
{
if(!m_aapSnapshots[g_Config.m_ClDummy][SnapID])
return 0x0;
return nullptr;
return m_aapSnapshots[g_Config.m_ClDummy][SnapID]->m_pAltSnap->FindItem(Type, ID);
}
@ -1701,7 +1701,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
const CSnapshot *pDeltaShot = CSnapshot::EmptySnapshot();
if(DeltaTick >= 0)
{
int DeltashotSize = m_aSnapshotStorage[Conn].Get(DeltaTick, 0, &pDeltaShot, 0);
int DeltashotSize = m_aSnapshotStorage[Conn].Get(DeltaTick, nullptr, &pDeltaShot, nullptr);
if(DeltashotSize < 0)
{

View file

@ -1020,7 +1020,7 @@ void CServer::DoSnapshot()
int DeltaTick = -1;
const CSnapshot *pDeltashot = CSnapshot::EmptySnapshot();
{
int DeltashotSize = m_aClients[i].m_Snapshots.Get(m_aClients[i].m_LastAckedSnapshot, 0, &pDeltashot, 0);
int DeltashotSize = m_aClients[i].m_Snapshots.Get(m_aClients[i].m_LastAckedSnapshot, nullptr, &pDeltashot, nullptr);
if(DeltashotSize >= 0)
DeltaTick = m_aClients[i].m_LastAckedSnapshot;
else
@ -1687,7 +1687,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
m_aClients[ClientID].m_SnapRate = CClient::SNAPRATE_FULL;
int64_t TagTime;
if(m_aClients[ClientID].m_Snapshots.Get(m_aClients[ClientID].m_LastAckedSnapshot, &TagTime, 0, 0) >= 0)
if(m_aClients[ClientID].m_Snapshots.Get(m_aClients[ClientID].m_LastAckedSnapshot, &TagTime, nullptr, nullptr) >= 0)
m_aClients[ClientID].m_Latency = (int)(((time_get() - TagTime) * 1000) / time_freq());
// add message to report the input timing

View file

@ -465,8 +465,8 @@ int CSnapshotDelta::UnpackDelta(const CSnapshot *pFrom, CSnapshot *pTo, const vo
void CSnapshotStorage::Init()
{
m_pFirst = 0;
m_pLast = 0;
m_pFirst = nullptr;
m_pLast = nullptr;
}
void CSnapshotStorage::PurgeAll()
@ -481,8 +481,8 @@ void CSnapshotStorage::PurgeAll()
}
// no more snapshots in storage
m_pFirst = 0;
m_pLast = 0;
m_pFirst = nullptr;
m_pLast = nullptr;
}
void CSnapshotStorage::PurgeUntil(int Tick)
@ -501,14 +501,14 @@ void CSnapshotStorage::PurgeUntil(int Tick)
break;
m_pFirst = pNext;
pNext->m_pPrev = 0x0;
pNext->m_pPrev = nullptr;
pHolder = pNext;
}
// no more snapshots in storage
m_pFirst = 0;
m_pLast = 0;
m_pFirst = nullptr;
m_pLast = nullptr;
}
void CSnapshotStorage::Add(int Tick, int64_t Tagtime, int DataSize, const void *pData, int AltDataSize, const void *pAltData)
@ -538,12 +538,12 @@ void CSnapshotStorage::Add(int Tick, int64_t Tagtime, int DataSize, const void *
}
else
{
pHolder->m_pAltSnap = 0;
pHolder->m_pAltSnap = nullptr;
pHolder->m_AltSnapSize = 0;
}
// link
pHolder->m_pNext = 0;
pHolder->m_pNext = nullptr;
pHolder->m_pPrev = m_pLast;
if(m_pLast)
m_pLast->m_pNext = pHolder;
@ -605,7 +605,7 @@ int *CSnapshotBuilder::GetItemData(int Key)
if(GetItem(i)->Key() == Key)
return GetItem(i)->Data();
}
return 0;
return nullptr;
}
int CSnapshotBuilder::Finish(void *pSnapData)
@ -657,7 +657,7 @@ void *CSnapshotBuilder::NewItem(int Type, int ID, int Size)
{
if(ID == -1)
{
return 0;
return nullptr;
}
if(m_DataSize + sizeof(CSnapshotItem) + Size >= CSnapshot::MAX_SIZE ||
@ -665,7 +665,7 @@ void *CSnapshotBuilder::NewItem(int Type, int ID, int Size)
{
dbg_assert(m_DataSize < CSnapshot::MAX_SIZE, "too much data");
dbg_assert(m_NumItems < CSnapshot::MAX_ITEMS, "too many items");
return 0;
return nullptr;
}
bool Extended = false;