From a11eea98b57be9fe22f725fd15ecb89f1a2de172 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 6 Jan 2019 09:39:35 +0100 Subject: [PATCH] - replaced some NULLs with nullptr. --- src/b_bot.cpp | 28 ++++++++++---------- src/b_think.cpp | 2 +- src/dsectoreffect.cpp | 14 +++++----- src/fragglescript/t_script.cpp | 48 +++++++++++++++++----------------- src/fragglescript/t_script.h | 2 +- src/p_interaction.cpp | 2 +- src/p_pillar.cpp | 8 +++--- src/r_data/r_interpolate.h | 2 +- 8 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/b_bot.cpp b/src/b_bot.cpp index 25418acca3..f02184282b 100644 --- a/src/b_bot.cpp +++ b/src/b_bot.cpp @@ -71,14 +71,14 @@ DBot::DBot () void DBot::Clear () { - player = NULL; + player = nullptr; Angle = 0.; - dest = NULL; - prev = NULL; - enemy = NULL; - missile = NULL; - mate = NULL; - last_mate = NULL; + dest = nullptr; + prev = nullptr; + enemy = nullptr; + missile = nullptr; + mate = nullptr; + last_mate = nullptr; memset(&skill, 0, sizeof(skill)); t_active = 0; t_respawn = 0; @@ -138,7 +138,7 @@ void DBot::Tick () { Super::Tick (); - if (player->mo == NULL || bglobal.freeze) + if (player->mo == nullptr || bglobal.freeze) { return; } @@ -176,7 +176,7 @@ CCMD (addbot) if (argv.argc() > 1) bglobal.SpawnBot (argv[1]); else - bglobal.SpawnBot (NULL); + bglobal.SpawnBot (nullptr); } void FCajunMaster::ClearPlayer (int i, bool keepTeam) @@ -184,7 +184,7 @@ void FCajunMaster::ClearPlayer (int i, bool keepTeam) if (players[i].mo) { players[i].mo->Destroy (); - players[i].mo = NULL; + players[i].mo = nullptr; } botinfo_t *bot = botinfo; while (bot && stricmp (players[i].userinfo.GetName(), bot->name)) @@ -194,10 +194,10 @@ void FCajunMaster::ClearPlayer (int i, bool keepTeam) bot->inuse = BOTINUSE_No; bot->lastteam = keepTeam ? players[i].userinfo.GetTeam() : TEAM_NONE; } - if (players[i].Bot != NULL) + if (players[i].Bot != nullptr) { players[i].Bot->Destroy (); - players[i].Bot = NULL; + players[i].Bot = nullptr; } players[i].~player_t(); ::new(&players[i]) player_t; @@ -261,7 +261,7 @@ void InitBotStuff() while (sc.GetString()) { PClassActor *wcls = PClass::FindActor(sc.String); - if (wcls != NULL && wcls->IsDescendantOf(NAME_Weapon)) + if (wcls != nullptr && wcls->IsDescendantOf(NAME_Weapon)) { BotInfoData bi = {}; sc.MustGetStringName(","); @@ -306,7 +306,7 @@ void InitBotStuff() for(unsigned i=0;iflags3|=MF3_WARNBOT; } diff --git a/src/b_think.cpp b/src/b_think.cpp index 74aa3a6aca..020da8c5d5 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -63,7 +63,7 @@ void DBot::Think () memset (cmd, 0, sizeof(*cmd)); if (enemy && enemy->health <= 0) - enemy = NULL; + enemy = nullptr; if (player->mo->health > 0) //Still alive { diff --git a/src/dsectoreffect.cpp b/src/dsectoreffect.cpp index cee696dfbf..c3711f3f74 100644 --- a/src/dsectoreffect.cpp +++ b/src/dsectoreffect.cpp @@ -39,7 +39,7 @@ IMPLEMENT_CLASS(DSectorEffect, false, false) DSectorEffect::DSectorEffect () : DThinker(STAT_SECTOREFFECT) { - m_Sector = NULL; + m_Sector = nullptr; } void DSectorEffect::OnDestroy() @@ -48,15 +48,15 @@ void DSectorEffect::OnDestroy() { if (m_Sector->floordata == this) { - m_Sector->floordata = NULL; + m_Sector->floordata = nullptr; } if (m_Sector->ceilingdata == this) { - m_Sector->ceilingdata = NULL; + m_Sector->ceilingdata = nullptr; } if (m_Sector->lightingdata == this) { - m_Sector->lightingdata = NULL; + m_Sector->lightingdata = nullptr; } } Super::OnDestroy(); @@ -91,7 +91,7 @@ IMPLEMENT_POINTERS_END DMover::DMover (sector_t *sector) : DSectorEffect (sector) { - interpolation = NULL; + interpolation = nullptr; } void DMover::OnDestroy() @@ -108,10 +108,10 @@ void DMover::Serialize(FSerializer &arc) void DMover::StopInterpolation(bool force) { - if (interpolation != NULL) + if (interpolation != nullptr) { interpolation->DelRef(force); - interpolation = NULL; + interpolation = nullptr; } } diff --git a/src/fragglescript/t_script.cpp b/src/fragglescript/t_script.cpp index a686015fdc..9fb156fee3 100644 --- a/src/fragglescript/t_script.cpp +++ b/src/fragglescript/t_script.cpp @@ -109,7 +109,7 @@ void DFsScript::ClearChildren() for(j=0;jDestroy(); - children[j]=NULL; + children[j]=nullptr; } } @@ -123,15 +123,15 @@ DFsScript::DFsScript() { int i; - for(i=0; itrigger = trigger; - if (owner == NULL) + if (owner == nullptr) { - for(int i=0; i< VARIABLESLOTS; i++) variables[i] = NULL; + for(int i=0; i< VARIABLESLOTS; i++) variables[i] = nullptr; } else { @@ -320,7 +320,7 @@ void DRunningScript::OnDestroy() current->Destroy(); current = next; // go to next in chain } - variables[i] = NULL; + variables[i] = nullptr; } Super::OnDestroy(); } @@ -395,16 +395,16 @@ void DFraggleThinker::OnDestroy() { DRunningScript *q = p; p = p->next; - q->prev = q->next = NULL; + q->prev = q->next = nullptr; q->Destroy(); } - RunningScripts = NULL; + RunningScripts = nullptr; GlobalScript->Destroy(); - GlobalScript = NULL; + GlobalScript = nullptr; LevelScript->Destroy(); - LevelScript = NULL; + LevelScript = nullptr; SpawnedThings.Clear(); Super::OnDestroy(); @@ -508,7 +508,7 @@ void DFraggleThinker::Tick() { current->script->variables[i] = current->variables[i]; GC::WriteBarrier(current->script, current->variables[i]); - current->variables[i] = NULL; + current->variables[i] = nullptr; } current->script->trigger = current->trigger; // copy trigger diff --git a/src/fragglescript/t_script.h b/src/fragglescript/t_script.h index 65914e02d4..11c0c0ba49 100644 --- a/src/fragglescript/t_script.h +++ b/src/fragglescript/t_script.h @@ -232,7 +232,7 @@ public: DFsSection() { - next = NULL; + next = nullptr; } void Serialize(FSerializer &ar); diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index ff921aefda..b775eb3024 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -104,7 +104,7 @@ void P_TouchSpecialThing (AActor *special, AActor *toucher) if (toucher->player != NULL && toucher->player->Bot != NULL && special == toucher->player->Bot->dest) { toucher->player->Bot->prev = toucher->player->Bot->dest; - toucher->player->Bot->dest = NULL; + toucher->player->Bot->dest = nullptr; } special->CallTouch (toucher); } diff --git a/src/p_pillar.cpp b/src/p_pillar.cpp index aa916facaf..8503c1d7e0 100644 --- a/src/p_pillar.cpp +++ b/src/p_pillar.cpp @@ -54,15 +54,15 @@ DPillar::DPillar () void DPillar::OnDestroy() { - if (m_Interp_Ceiling != NULL) + if (m_Interp_Ceiling != nullptr) { m_Interp_Ceiling->DelRef(); - m_Interp_Ceiling = NULL; + m_Interp_Ceiling = nullptr; } - if (m_Interp_Floor != NULL) + if (m_Interp_Floor != nullptr) { m_Interp_Floor->DelRef(); - m_Interp_Floor = NULL; + m_Interp_Floor = nullptr; } Super::OnDestroy(); } diff --git a/src/r_data/r_interpolate.h b/src/r_data/r_interpolate.h index cc0ed8bbce..dabfa3a1e6 100644 --- a/src/r_data/r_interpolate.h +++ b/src/r_data/r_interpolate.h @@ -52,7 +52,7 @@ struct FInterpolator public: FInterpolator() { - Head = NULL; + Head = nullptr; didInterp = false; count = 0; }