1
0

En masse NULL -> nullptr replace

This commit is contained in:
Tiger Wang
2014-10-20 21:55:07 +01:00
committed by archshift
parent 2ac3a807b7
commit a26541a7c3
211 changed files with 1767 additions and 1745 deletions

View File

@@ -48,9 +48,9 @@ void cSlotArea::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickA
ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots()));
bool bAsync = false;
if (GetSlot(a_SlotNum, a_Player) == NULL)
if (GetSlot(a_SlotNum, a_Player) == nullptr)
{
LOGWARNING("GetSlot(%d) returned NULL! Ignoring click", a_SlotNum);
LOGWARNING("GetSlot(%d) returned nullptr! Ignoring click", a_SlotNum);
return;
}
@@ -791,9 +791,9 @@ void cSlotAreaAnvil::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_C
}
bool bAsync = false;
if (GetSlot(a_SlotNum, a_Player) == NULL)
if (GetSlot(a_SlotNum, a_Player) == nullptr)
{
LOGWARNING("GetSlot(%d) returned NULL! Ignoring click", a_SlotNum);
LOGWARNING("GetSlot(%d) returned nullptr! Ignoring click", a_SlotNum);
return;
}
@@ -980,7 +980,7 @@ void cSlotAreaAnvil::OnTakeResult(cPlayer & a_Player)
m_ParentWindow.SetProperty(0, m_MaximumCost, a_Player);
m_MaximumCost = 0;
((cAnvilWindow*)&m_ParentWindow)->SetRepairedItemName("", NULL);
((cAnvilWindow*)&m_ParentWindow)->SetRepairedItemName("", nullptr);
int PosX, PosY, PosZ;
((cAnvilWindow*)&m_ParentWindow)->GetBlockPos(PosX, PosY, PosZ);
@@ -1238,9 +1238,9 @@ void cSlotAreaBeacon::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_
ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots()));
bool bAsync = false;
if (GetSlot(a_SlotNum, a_Player) == NULL)
if (GetSlot(a_SlotNum, a_Player) == nullptr)
{
LOGWARNING("GetSlot(%d) returned NULL! Ignoring click", a_SlotNum);
LOGWARNING("GetSlot(%d) returned nullptr! Ignoring click", a_SlotNum);
return;
}
@@ -1408,9 +1408,9 @@ void cSlotAreaEnchanting::Clicked(cPlayer & a_Player, int a_SlotNum, eClickActio
ASSERT((a_SlotNum >= 0) && (a_SlotNum < GetNumSlots()));
bool bAsync = false;
if (GetSlot(a_SlotNum, a_Player) == NULL)
if (GetSlot(a_SlotNum, a_Player) == nullptr)
{
LOGWARNING("GetSlot(%d) returned NULL! Ignoring click", a_SlotNum);
LOGWARNING("GetSlot(%d) returned nullptr! Ignoring click", a_SlotNum);
return;
}
@@ -1709,19 +1709,19 @@ cSlotAreaFurnace::~cSlotAreaFurnace()
void cSlotAreaFurnace::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem)
{
if (m_Furnace == NULL)
if (m_Furnace == nullptr)
{
LOGERROR("cSlotAreaFurnace::Clicked(): m_Furnace == NULL");
ASSERT(!"cSlotAreaFurnace::Clicked(): m_Furnace == NULL");
LOGERROR("cSlotAreaFurnace::Clicked(): m_Furnace == nullptr");
ASSERT(!"cSlotAreaFurnace::Clicked(): m_Furnace == nullptr");
return;
}
if (a_SlotNum == 2)
{
bool bAsync = false;
if (GetSlot(a_SlotNum, a_Player) == NULL)
if (GetSlot(a_SlotNum, a_Player) == nullptr)
{
LOGWARNING("GetSlot(%d) returned NULL! Ignoring click", a_SlotNum);
LOGWARNING("GetSlot(%d) returned nullptr! Ignoring click", a_SlotNum);
return;
}
@@ -2071,9 +2071,9 @@ void cSlotAreaArmor::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_C
}
bool bAsync = false;
if (GetSlot(a_SlotNum, a_Player) == NULL)
if (GetSlot(a_SlotNum, a_Player) == nullptr)
{
LOGWARNING("GetSlot(%d) returned NULL! Ignoring click", a_SlotNum);
LOGWARNING("GetSlot(%d) returned nullptr! Ignoring click", a_SlotNum);
return;
}
@@ -2223,15 +2223,15 @@ const cItem * cSlotAreaTemporary::GetSlot(int a_SlotNum, cPlayer & a_Player) con
LOGERROR("cSlotAreaTemporary: player \"%s\" not found for slot %d!", a_Player.GetName().c_str(), a_SlotNum);
ASSERT(!"cSlotAreaTemporary: player not found!");
// Player not found, this should not happen, ever! Return NULL, but things may break by this.
return NULL;
// Player not found, this should not happen, ever! Return nullptr, but things may break by this.
return nullptr;
}
if (a_SlotNum >= (int)(itr->second.size()))
{
LOGERROR("cSlotAreaTemporary: asking for more slots than actually stored!");
ASSERT(!"cSlotAreaTemporary: asking for more slots than actually stored!");
return NULL;
return nullptr;
}
return &(itr->second[a_SlotNum]);
@@ -2320,7 +2320,7 @@ cItem * cSlotAreaTemporary::GetPlayerSlots(cPlayer & a_Player)
cItemMap::iterator itr = m_Items.find(a_Player.GetUniqueID());
if (itr == m_Items.end())
{
return NULL;
return nullptr;
}
return &(itr->second[0]);
}