[General] Change NULL to nullptr

0.6.1
Koncord 8 years ago
parent 2b1b4ce2f1
commit 5b2cab4c6b

@ -183,7 +183,7 @@ void CellController::removeLocalActorRecord(std::string actorIndex)
bool CellController::isLocalActor(MWWorld::Ptr ptr)
{
if (ptr.mRef == NULL)
if (ptr.mRef == nullptr)
return false;
std::string mapIndex = generateMapIndex(ptr);
@ -231,7 +231,7 @@ bool CellController::isDedicatedActor(int refNumIndex, int mpNum)
bool CellController::isDedicatedActor(MWWorld::Ptr ptr)
{
if (ptr.mRef == NULL)
if (ptr.mRef == nullptr)
return false;
std::string mapIndex = generateMapIndex(ptr);
@ -313,7 +313,7 @@ MWWorld::CellStore *CellController::getCellStore(const ESM::Cell& cell)
}
catch (std::exception&)
{
cellStore = NULL;
cellStore = nullptr;
}
}

@ -92,7 +92,7 @@ void mwmp::GUIController::showDialogList(const mwmp::BasePlayer::GUIMessageBox &
{
MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager();
windowManager->removeDialog(mListBox);
mListBox = NULL;
mListBox = nullptr;
std::vector<std::string> list;
@ -360,7 +360,7 @@ void mwmp::GUIController::setGlobalMapMarkerTooltip(MWGui::MapWindow *mapWindow,
if (!destNotes.empty())
{
MWGui::LocalMapBase::MarkerUserData data (NULL);
MWGui::LocalMapBase::MarkerUserData data (nullptr);
data.notes = destNotes;
data.caption = markerWidget->getUserString("Caption_TextOneLine");

@ -71,7 +71,7 @@ Attack *MechanicsHelper::getLocalAttack(const MWWorld::Ptr& ptr)
else if (mwmp::Main::get().getCellController()->isLocalActor(ptr))
return &mwmp::Main::get().getCellController()->getLocalActor(ptr)->attack;
return NULL;
return nullptr;
}
Attack *MechanicsHelper::getDedicatedAttack(const MWWorld::Ptr& ptr)
@ -81,7 +81,7 @@ Attack *MechanicsHelper::getDedicatedAttack(const MWWorld::Ptr& ptr)
else if (mwmp::Main::get().getCellController()->isDedicatedActor(ptr))
return &mwmp::Main::get().getCellController()->getDedicatedActor(ptr)->attack;
return NULL;
return nullptr;
}
MWWorld::Ptr MechanicsHelper::getPlayerPtr(const Target& target)
@ -90,11 +90,11 @@ MWWorld::Ptr MechanicsHelper::getPlayerPtr(const Target& target)
{
if (target.guid == mwmp::Main::get().getLocalPlayer()->guid)
return MWBase::Environment::get().getWorld()->getPlayerPtr();
else if (PlayerList::getPlayer(target.guid) != NULL)
else if (PlayerList::getPlayer(target.guid) != nullptr)
return PlayerList::getPlayer(target.guid)->getPtr();
}
return NULL;
return nullptr;
}
void MechanicsHelper::assignAttackTarget(Attack* attack, const MWWorld::Ptr& target)
@ -154,7 +154,7 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker)
{
if (attack.target.guid == mwmp::Main::get().getLocalPlayer()->guid)
victim = MWBase::Environment::get().getWorld()->getPlayerPtr();
else if (PlayerList::getPlayer(attack.target.guid) != NULL)
else if (PlayerList::getPlayer(attack.target.guid) != nullptr)
victim = PlayerList::getPlayer(attack.target.guid)->getPtr();
}
else
@ -182,7 +182,7 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker)
weapon = MWWorld::Ptr();
}
if (victim.mRef != NULL)
if (victim.mRef != nullptr)
{
bool healthdmg = true;

@ -91,7 +91,7 @@ void PlayerList::createPlayer(RakNet::RakNetGUID guid)
dedicPlayer->state = 0;
world->deleteObject(dedicPlayer->ptr);
delete dedicPlayer->reference;
dedicPlayer->reference = NULL;
dedicPlayer->reference = nullptr;
reset = true;
}
}
@ -255,7 +255,7 @@ DedicatedPlayer *PlayerList::getPlayer(const MWWorld::Ptr &ptr)
bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr)
{
if (ptr.mRef == NULL)
if (ptr.mRef == nullptr)
return false;
return (getPlayer(ptr) != 0);

@ -14,7 +14,7 @@
using namespace std;
Log *Log::sLog = NULL;
Log *Log::sLog = nullptr;
Log::Log(int logLevel) : logLevel(logLevel)
{
@ -23,17 +23,17 @@ Log::Log(int logLevel) : logLevel(logLevel)
void Log::Create(int logLevel)
{
if (sLog != NULL)
if (sLog != nullptr)
return;
sLog = new Log(logLevel);
}
void Log::Delete()
{
if (sLog == NULL)
if (sLog == nullptr)
return;
delete sLog;
sLog = NULL;
sLog = nullptr;
}
const Log &Log::Get()
@ -98,7 +98,7 @@ void Log::print(int level, bool hasPrefix, const char *file, int line, const cha
sstr << '\n';
va_list args;
va_start(args, message);
vector<char> buf((unsigned long) (vsnprintf(NULL, 0, sstr.str().c_str(), args) + 1));
vector<char> buf((unsigned long) (vsnprintf(nullptr, 0, sstr.str().c_str(), args) + 1));
va_end(args);
va_start(args, message);
vsnprintf(buf.data(), buf.size(), sstr.str().c_str(), args);

Loading…
Cancel
Save