From 11958b713edb206f593e9a1fd8425f0b592d79e5 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 7 Jan 2019 10:14:52 +0200 Subject: [PATCH] - fixed many compilation errors with GCC and Clang --- src/actorptrselect.cpp | 6 +++--- src/b_func.cpp | 4 ++-- src/b_game.cpp | 6 +++--- src/b_think.cpp | 12 +++++------ src/dobjgc.h | 2 +- src/fragglescript/t_func.cpp | 2 +- src/fragglescript/t_prepro.cpp | 2 +- src/fragglescript/t_variable.cpp | 4 ++-- src/g_game.cpp | 4 ++-- src/g_level.cpp | 6 +++--- src/g_statusbar/shared_sbar.cpp | 8 ++++---- src/intermission/intermission.cpp | 2 +- src/p_acs.cpp | 22 ++++++++++---------- src/p_actionfunctions.cpp | 18 ++++++++-------- src/p_conversation.cpp | 8 ++++---- src/p_doors.cpp | 10 ++++----- src/p_enemy.cpp | 34 +++++++++++++++---------------- src/p_floor.cpp | 16 +++++++-------- src/p_interaction.cpp | 4 ++-- src/p_lnspec.cpp | 8 ++++---- src/p_map.cpp | 2 +- src/p_mobj.cpp | 12 +++++------ src/p_spec.cpp | 2 +- src/r_data/r_interpolate.cpp | 18 ++++++++-------- src/s_sndseq.cpp | 8 ++++---- 25 files changed, 110 insertions(+), 110 deletions(-) diff --git a/src/actorptrselect.cpp b/src/actorptrselect.cpp index da36e44945..8c9057ca7b 100644 --- a/src/actorptrselect.cpp +++ b/src/actorptrselect.cpp @@ -150,7 +150,7 @@ void VerifyTargetChain(AActor *self, bool preciseMissileCheck) { // if any of the actors from self to (inclusive) origin match the next actor, // self has reached/created a loop - self->target = NULL; + self->target = nullptr; return; } if (compare == origin) break; // when "compare" = origin, we know that the next actor is, and should be "next" @@ -176,7 +176,7 @@ void VerifyMasterChain(AActor *self) { if (compare == next) { - self->master = NULL; + self->master = nullptr; return; } if (compare == origin) break; @@ -215,4 +215,4 @@ void ASSIGN_AAPTR(AActor *toActor, int toSlot, AActor *ptr, int flags) toActor->tracer = ptr; break; } -} \ No newline at end of file +} diff --git a/src/b_func.cpp b/src/b_func.cpp index 34a5bd9fdc..0613cacaec 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -351,7 +351,7 @@ AActor *DBot::Choose_Mate () if (mate) { if (mate->health <= 0) - mate = NULL; + mate = nullptr; else last_mate = mate; } @@ -361,7 +361,7 @@ AActor *DBot::Choose_Mate () //Check old_mates status. if (last_mate) if (last_mate->health <= 0) - last_mate = NULL; + last_mate = nullptr; target = NULL; closest_dist = FLT_MAX; diff --git a/src/b_game.cpp b/src/b_game.cpp index 1e6e9c43ae..516986e718 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -174,12 +174,12 @@ void FCajunMaster::Main () void FCajunMaster::Init () { botnum = 0; - firstthing = NULL; + firstthing = nullptr; spawn_tries = 0; freeze = false; observer = false; - body1 = NULL; - body2 = NULL; + body1 = nullptr; + body2 = nullptr; if (ctf && teamplay == false) teamplay = true; //Need teamplay for ctf. (which is not done yet) diff --git a/src/b_think.cpp b/src/b_think.cpp index 020da8c5d5..82954d83e1 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -121,7 +121,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd) (!missile->Vel.X || !missile->Vel.Y || !Check_LOS(missile, SHOOTFOV*3/2))) { sleft = !sleft; - missile = NULL; //Probably ended its travel. + missile = nullptr; //Probably ended its travel. } #if 0 // this has always been broken and without any reference it cannot be fixed. @@ -183,7 +183,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd) } } - dest = NULL; //To let bot turn right + dest = nullptr; //To let bot turn right if (GetBotInfo(player->ReadyWeapon).MoveCombatDist == 0) player->mo->flags &= ~MF_DROPOFF; //Don't jump off any ledges when fighting. @@ -237,7 +237,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd) { if (mate == dest && pr_botmove.Random() < 32) { // [RH] If the mate is the dest, pick a new dest sometimes - dest = NULL; + dest = nullptr; } goto roam; } @@ -264,7 +264,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd) if (dest && !(dest->flags&MF_SPECIAL) && dest->health < 0) { //Roaming after something dead. - dest = NULL; + dest = nullptr; } if (dest == NULL) @@ -333,7 +333,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd) if (!t_roam && dest) { prev = dest; - dest = NULL; + dest = nullptr; } if (t_fight<(AFTERTICS/2)) @@ -438,5 +438,5 @@ void DBot::Set_enemy () } //Verify that that enemy is really something alive that bot can kill. if (enemy && ((enemy->health < 0 || !(enemy->flags&MF_SHOOTABLE)) || player->mo->IsFriend(enemy))) - enemy = NULL; + enemy = nullptr; } diff --git a/src/dobjgc.h b/src/dobjgc.h index ed0370728f..100d27e4d6 100644 --- a/src/dobjgc.h +++ b/src/dobjgc.h @@ -180,7 +180,7 @@ public: return *this; } - T operator=(nullptr_t nul) + T operator=(std::nullptr_t nul) { o = nullptr; return nullptr; diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index 0b1831e3cd..1d6fd18077 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -3311,7 +3311,7 @@ void FParser::SF_Resurrect() mo->Height = mo->GetDefault()->Height; mo->radius = mo->GetDefault()->radius; mo->Revive(); - mo->target = NULL; + mo->target = nullptr; } } diff --git a/src/fragglescript/t_prepro.cpp b/src/fragglescript/t_prepro.cpp index 1cd395c1f8..d5667d7c7b 100644 --- a/src/fragglescript/t_prepro.cpp +++ b/src/fragglescript/t_prepro.cpp @@ -130,7 +130,7 @@ void DFsScript::ClearSections() var->Destroy(); var = next; } - sections[i] = NULL; + sections[i] = nullptr; } } diff --git a/src/fragglescript/t_variable.cpp b/src/fragglescript/t_variable.cpp index 205e997ac9..25776970e4 100644 --- a/src/fragglescript/t_variable.cpp +++ b/src/fragglescript/t_variable.cpp @@ -179,9 +179,9 @@ DFsVariable::DFsVariable(const char * _name) { Name=_name; type=svt_int; - actor = NULL; + actor = nullptr; value.i=0; - next=NULL; + next = nullptr; } //========================================================================== diff --git a/src/g_game.cpp b/src/g_game.cpp index 2ba456f974..da1430d84d 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1698,7 +1698,7 @@ void G_DoPlayerPop(int playernum) players[playernum].mo->Destroy(); } players[playernum].mo = NULL; - players[playernum].camera = NULL; + players[playernum].camera = nullptr; } players[playernum].DestroyPSprites(); @@ -2762,7 +2762,7 @@ bool G_CheckDemoStatus (void) for (int i = 1; i < MAXPLAYERS; i++) playeringame[i] = 0; consoleplayer = 0; - players[0].camera = NULL; + players[0].camera = nullptr; if (StatusBar != NULL) { StatusBar->AttachToPlayer (&players[0]); diff --git a/src/g_level.cpp b/src/g_level.cpp index bf47ce58d8..d5e28a6f5a 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1289,7 +1289,7 @@ void G_StartTravel () { AActor *pawn = players[i].mo; AActor *inv; - players[i].camera = NULL; + players[i].camera = nullptr; // Only living players travel. Dead ones get a new body on the new level. if (players[i].health > 0) @@ -1391,8 +1391,8 @@ int G_FinishTravel () { P_FindFloorCeiling(pawn); } - pawn->target = NULL; - pawn->lastenemy = NULL; + pawn->target = nullptr; + pawn->lastenemy = nullptr; pawn->player->mo = pawn; pawn->player->camera = pawn; pawn->player->viewheight = pawn->player->DefaultViewHeight(); diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index eec393fd26..3d81095ba0 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -436,7 +436,7 @@ void DBaseStatusBar::OnDestroy () msg->Destroy(); msg = next; } - Messages[i] = NULL; + Messages[i] = nullptr; } if (AltHud) AltHud->Destroy(); Super::OnDestroy(); @@ -708,7 +708,7 @@ DHUDMessageBase *DBaseStatusBar::DetachMessage (DHUDMessageBase *msg) if (probe != NULL) { *prev = probe->Next; - probe->Next = NULL; + probe->Next = nullptr; return probe; } } @@ -730,7 +730,7 @@ DHUDMessageBase *DBaseStatusBar::DetachMessage (uint32_t id) if (probe != NULL) { *prev = probe->Next; - probe->Next = NULL; + probe->Next = nullptr; return probe; } } @@ -749,7 +749,7 @@ void DBaseStatusBar::DetachAllMessages () { DHUDMessageBase *probe = Messages[i]; - Messages[i] = NULL; + Messages[i] = nullptr; while (probe != NULL) { DHUDMessageBase *next = probe->Next; diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index b93e4872cc..47d9cec1bd 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -681,7 +681,7 @@ DIntermissionController::DIntermissionController(FIntermissionDescriptor *Desc, mIndex = 0; mAdvance = false; mSentAdvance = false; - mScreen = NULL; + mScreen = nullptr; mFirst = true; mGameState = state; } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 648b8eae1f..84fbe734af 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3915,15 +3915,15 @@ int DoSetMaster (AActor *self, AActor *master) self->flags = (self->flags & ~MF_FRIENDLY) | (master->flags & MF_FRIENDLY); level.total_monsters += self->CountsAsKill(); // Don't attack your new master - if (self->target == self->master) self->target = NULL; - if (self->lastenemy == self->master) self->lastenemy = NULL; - if (self->LastHeard == self->master) self->LastHeard = NULL; + if (self->target == self->master) self->target = nullptr; + if (self->lastenemy == self->master) self->lastenemy = nullptr; + if (self->LastHeard == self->master) self->LastHeard = nullptr; return 1; } else if (master->player) { // [KS] Be friendly to this player - self->master = NULL; + self->master = nullptr; level.total_monsters -= self->CountsAsKill(); self->flags|=MF_FRIENDLY; self->SetFriendPlayer(master->player); @@ -3938,15 +3938,15 @@ int DoSetMaster (AActor *self, AActor *master) } } // And stop attacking him if necessary. - if (self->target == master) self->target = NULL; - if (self->lastenemy == master) self->lastenemy = NULL; - if (self->LastHeard == master) self->LastHeard = NULL; + if (self->target == master) self->target = nullptr; + if (self->lastenemy == master) self->lastenemy = nullptr; + if (self->LastHeard == master) self->LastHeard = nullptr; return 1; } } else { - self->master = NULL; + self->master = nullptr; self->FriendPlayer = 0; // Go back to whatever friendliness we usually have... defs = self->GetDefault(); @@ -3954,9 +3954,9 @@ int DoSetMaster (AActor *self, AActor *master) self->flags = (self->flags & ~MF_FRIENDLY) | (defs->flags & MF_FRIENDLY); level.total_monsters += self->CountsAsKill(); // ...And re-side with our friends. - if (self->target && !self->IsHostile (self->target)) self->target = NULL; - if (self->lastenemy && !self->IsHostile (self->lastenemy)) self->lastenemy = NULL; - if (self->LastHeard && !self->IsHostile (self->LastHeard)) self->LastHeard = NULL; + if (self->target && !self->IsHostile (self->target)) self->target = nullptr; + if (self->lastenemy && !self->IsHostile (self->lastenemy)) self->lastenemy = nullptr; + if (self->LastHeard && !self->IsHostile (self->LastHeard)) self->LastHeard = nullptr; return 1; } } diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 0d205c0d4e..95e667fa24 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -570,7 +570,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RearrangePointers) if (!(PTROP_UNSAFETARGET & flags)) VerifyTargetChain(self); break; case AAPTR_NULL: - self->target = NULL; + self->target = nullptr; // THIS IS NOT "A_ClearTarget", so no other targeting info is removed break; } @@ -587,7 +587,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RearrangePointers) if (!(PTROP_UNSAFEMASTER & flags)) VerifyMasterChain(self); break; case AAPTR_NULL: - self->master = NULL; + self->master = nullptr; break; } @@ -600,7 +600,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RearrangePointers) self->tracer = getmaster; break; // no verification deemed necessary; the engine never follows a tracer chain(?) case AAPTR_NULL: - self->tracer = NULL; + self->tracer = nullptr; break; } return 0; @@ -771,7 +771,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SeekerMissile) { if (flags & SMF_LOOK) { // This monster is no longer seekable, so let us look for another one next time. - self->tracer = NULL; + self->tracer = nullptr; } } return 0; @@ -1981,17 +1981,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_Respawn) // ...Actually it's better off an option, so you have better control over monster behavior. if (!(flags & RSF_KEEPTARGET)) { - self->target = NULL; - self->LastHeard = NULL; - self->lastenemy = NULL; + self->target = nullptr; + self->LastHeard = nullptr; + self->lastenemy = nullptr; } else { // Don't attack yourself (Re: "Marine targets itself after suicide") if (self->target == self) - self->target = NULL; + self->target = nullptr; if (self->lastenemy == self) - self->lastenemy = NULL; + self->lastenemy = nullptr; } self->flags = (defs->flags & ~MF_FRIENDLY) | (self->flags & MF_FRIENDLY); diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index a02d106c1b..5bb9dec505 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -1074,8 +1074,8 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply { npc->flags5 &= ~MF5_INCONVERSATION; player->ConversationFaceTalker = false; - player->ConversationNPC = NULL; - player->ConversationPC = NULL; + player->ConversationNPC = nullptr; + player->ConversationPC = nullptr; player->ConversationNPCAngle = 0.; } @@ -1121,8 +1121,8 @@ void P_ConversationCommand (int netcode, int pnum, uint8_t **stream) if (netcode == DEM_CONVNULL) { player->ConversationFaceTalker = false; - player->ConversationNPC = NULL; - player->ConversationPC = NULL; + player->ConversationNPC = nullptr; + player->ConversationPC = nullptr; player->ConversationNPCAngle = 0.; } } diff --git a/src/p_doors.cpp b/src/p_doors.cpp index da7d1336e0..ec38df3262 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -147,7 +147,7 @@ void DDoor::Tick () { case doorRaise: case doorClose: - m_Sector->ceilingdata = NULL; //jff 2/22/98 + m_Sector->ceilingdata = nullptr; //jff 2/22/98 Destroy (); // unlink and free break; @@ -198,7 +198,7 @@ void DDoor::Tick () case doorCloseWaitOpen: case doorOpen: - m_Sector->ceilingdata = NULL; //jff 2/22/98 + m_Sector->ceilingdata = nullptr; //jff 2/22/98 Destroy (); // unlink and free break; @@ -593,7 +593,7 @@ void DAnimatedDoor::Tick () switch (m_Status) { case Dead: - m_Sector->ceilingdata = NULL; + m_Sector->ceilingdata = nullptr; Destroy (); break; @@ -608,7 +608,7 @@ void DAnimatedDoor::Tick () if (m_Delay == 0) { - m_Sector->ceilingdata = NULL; + m_Sector->ceilingdata = nullptr; Destroy (); break; } @@ -647,7 +647,7 @@ void DAnimatedDoor::Tick () { // IF DOOR IS DONE CLOSING... m_Sector->MoveCeiling (2048., m_BotDist, -1); - m_Sector->ceilingdata = NULL; + m_Sector->ceilingdata = nullptr; Destroy (); // Unset blocking flags on lines that didn't start with them. Since the // ceiling is down now, we shouldn't need this flag anymore to keep things diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 54a383073c..50e4d2140e 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1336,7 +1336,7 @@ int P_LookForTID (AActor *actor, INTBOOL allaround, FLookExParams *params) if (actor->LastLookActor != NULL && actor->LastLookActor->tid != actor->TIDtoHate) { - actor->LastLookActor = NULL; + actor->LastLookActor = nullptr; } FActorIterator iterator (actor->TIDtoHate, actor->LastLookActor); @@ -1401,12 +1401,12 @@ int P_LookForTID (AActor *actor, INTBOOL allaround, FLookExParams *params) if (!actor->IsFriend(actor->lastenemy)) { actor->target = actor->lastenemy; - actor->lastenemy = NULL; + actor->lastenemy = nullptr; return true; } else { - actor->lastenemy = NULL; + actor->lastenemy = nullptr; } } } @@ -1540,12 +1540,12 @@ int P_LookForEnemies (AActor *actor, INTBOOL allaround, FLookExParams *params) if (!actor->IsFriend(actor->lastenemy)) { actor->target = actor->lastenemy; - actor->lastenemy = NULL; + actor->lastenemy = nullptr; return true; } else { - actor->lastenemy = NULL; + actor->lastenemy = nullptr; } } } @@ -1674,12 +1674,12 @@ int P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params) if (!actor->IsFriend(actor->lastenemy)) { actor->target = actor->lastenemy; - actor->lastenemy = NULL; + actor->lastenemy = nullptr; return true; } else { - actor->lastenemy = NULL; + actor->lastenemy = nullptr; } } } @@ -1839,7 +1839,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Look) if (self->target == self->goal) { if (self->reactiontime > level.maptime) - self->target = NULL; + self->target = nullptr; } else if (self->SeeSound) { @@ -1926,7 +1926,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LookEx) if (maxheardist && dist > maxheardist) { targ = NULL; - self->LastHeard = NULL; + self->LastHeard = nullptr; } } } @@ -1985,7 +1985,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LookEx) // [KS] The target can become ourselves in rare circumstances (like // if we committed suicide), so if that's the case, just ignore it. - if (self->target == self) self->target = NULL; + if (self->target == self) self->target = nullptr; if (self->target != NULL) { @@ -2021,7 +2021,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LookEx) if (self->target == self->goal) { if (self->reactiontime > level.maptime) - self->target = NULL; + self->target = nullptr; } else if (self->SeeSound && !(flags & LOF_NOSEESOUND)) { @@ -2063,7 +2063,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LookEx) DEFINE_ACTION_FUNCTION(AActor, A_ClearLastHeard) { PARAM_SELF_PROLOGUE(AActor); - self->LastHeard = NULL; + self->LastHeard = nullptr; return 0; } @@ -2225,7 +2225,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi actor->target->renderflags & RF_INVISIBLE && actor->target != actor->goal) { - actor->target = NULL; + actor->target = nullptr; } // modify target threshold @@ -2274,7 +2274,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi // [RH] If the target is dead or a friend (and not a goal), stop chasing it. if (actor->target && actor->target != actor->goal && (actor->target->health <= 0 || actor->IsFriend(actor->target))) - actor->target = NULL; + actor->target = nullptr; // [RH] Friendly monsters will consider chasing whoever hurts a player if they // don't already have a target. @@ -2398,7 +2398,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi actor->reactiontime = actor->GetDefault()->reactiontime; actor->Angles.Yaw = lastgoalang; // Look in direction of last goal } - if (actor->target == actor->goal) actor->target = NULL; + if (actor->target == actor->goal) actor->target = nullptr; actor->flags |= MF_JUSTATTACKED; if (newgoal != NULL && delay != 0) { @@ -2692,8 +2692,8 @@ bool P_CheckForResurrection(AActor *self, bool usevilestates) { // If this is a friendly Arch-Vile (which is turning the resurrected monster into its friend) // and the Arch-Vile is currently targetting the resurrected monster the target must be cleared. - if (self->lastenemy == temp) self->lastenemy = NULL; - if (self->lastenemy == corpsehit) self->lastenemy = NULL; + if (self->lastenemy == temp) self->lastenemy = nullptr; + if (self->lastenemy == corpsehit) self->lastenemy = nullptr; if (temp == self->target) temp = NULL; } self->target = temp; diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 4067071aef..e36a1aca2a 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -181,7 +181,7 @@ void DFloor::Tick () } } - m_Sector->floordata = NULL; //jff 2/22/98 + m_Sector->floordata = nullptr; //jff 2/22/98 StopInterpolation(); //jff 2/26/98 implement stair retrigger lockout while still building @@ -561,7 +561,7 @@ bool EV_FloorCrushStop (int tag, line_t *line) { SN_StopSequence (sec, CHAN_FLOOR); sec->floordata->Destroy (); - sec->floordata = NULL; + sec->floordata = nullptr; } } return true; @@ -900,12 +900,12 @@ void DElevator::OnDestroy() if (m_Interp_Ceiling != NULL) { m_Interp_Ceiling->DelRef(); - m_Interp_Ceiling = NULL; + m_Interp_Ceiling = nullptr; } if (m_Interp_Floor != NULL) { m_Interp_Floor->DelRef(); - m_Interp_Floor = NULL; + m_Interp_Floor = nullptr; } Super::OnDestroy(); } @@ -964,8 +964,8 @@ void DElevator::Tick () // make floor stop sound SN_StopSequence (m_Sector, CHAN_FLOOR); - m_Sector->floordata = NULL; //jff 2/22/98 - m_Sector->ceilingdata = NULL; //jff 2/22/98 + m_Sector->floordata = nullptr; //jff 2/22/98 + m_Sector->ceilingdata = nullptr; //jff 2/22/98 Destroy (); // remove elevator from actives } } @@ -1225,11 +1225,11 @@ void DWaggleBase::DoWaggle (bool ceiling) P_ChangeSector (m_Sector, true, dist, ceiling, false); if (ceiling) { - m_Sector->ceilingdata = NULL; + m_Sector->ceilingdata = nullptr; } else { - m_Sector->floordata = NULL; + m_Sector->floordata = nullptr; } Destroy (); return; diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index b775eb3024..ec2854c6a9 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -580,8 +580,8 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags, FName MeansOf if (players[i].Bot != NULL && this == players[i].Bot->enemy) { if (players[i].Bot->dest == players[i].Bot->enemy) - players[i].Bot->dest = NULL; - players[i].Bot->enemy = NULL; + players[i].Bot->dest = nullptr; + players[i].Bot->enemy = nullptr; } } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 7b8f56847a..8e48d765f6 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -1620,7 +1620,7 @@ FUNC(LS_Thing_Hate) if (arg2 != 0) { hater->TIDtoHate = arg1; - hater->LastLookActor = NULL; + hater->LastLookActor = nullptr; // If the TID to hate is 0, then don't forget the target and // lastenemy fields. @@ -1628,11 +1628,11 @@ FUNC(LS_Thing_Hate) { if (hater->target != NULL && hater->target->tid != arg1) { - hater->target = NULL; + hater->target = nullptr; } if (hater->lastenemy != NULL && hater->lastenemy->tid != arg1) { - hater->lastenemy = NULL; + hater->lastenemy = nullptr; } } } @@ -1826,7 +1826,7 @@ FUNC(LS_Thing_SetGoal) { // Targeting a goal already? -> don't target it anymore. // A_Look will set it to the goal, presuming no real targets // come into view by then. - self->target = NULL; + self->target = nullptr; } self->goal = goal; if (arg3 == 0) diff --git a/src/p_map.cpp b/src/p_map.cpp index 3b819c69ab..0b75a44115 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2336,7 +2336,7 @@ bool P_TryMove(AActor *thing, const DVector2 &pos, && bglobal.IsDangerous(tm.sector)) { thing->player->Bot->prev = thing->player->Bot->dest; - thing->player->Bot->dest = NULL; + thing->player->Bot->dest = nullptr; thing->Vel.X = thing->Vel.Y = 0; thing->SetZ(oldz); thing->flags6 &= ~MF6_INTRYMOVE; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 4bb60567ad..3aeed82fff 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1713,7 +1713,7 @@ bool P_SeekerMissile (AActor *actor, double thresh, double turnMax, bool precise } if (!(target->flags & MF_SHOOTABLE)) { // Target died - actor->tracer = NULL; + actor->tracer = nullptr; return false; } if (speed == 0) @@ -5057,14 +5057,14 @@ AActor *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags) p->fixedlightlevel = -1; p->viewheight = p->DefaultViewHeight(); p->inconsistant = 0; - p->attacker = NULL; + p->attacker = nullptr; p->spreecount = 0; p->multicount = 0; p->lastkilltime = 0; p->BlendR = p->BlendG = p->BlendB = p->BlendA = 0.f; p->Uncrouch(); p->MinPitch = p->MaxPitch = 0.; // will be filled in by PostBeginPlay()/netcode - p->MUSINFOactor = NULL; + p->MUSINFOactor = nullptr; p->MUSINFOtics = -1; p->Vel.Zero(); // killough 10/98: initialize bobbing to 0. @@ -5160,7 +5160,7 @@ AActor *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags) TThinkerIterator it; while ((th = it.Next())) { - if (th->LastHeard == oldactor) th->LastHeard = NULL; + if (th->LastHeard == oldactor) th->LastHeard = nullptr; } for(auto &sec : level.sectors) { @@ -7137,8 +7137,8 @@ void AActor::Revive() if (SpawnFlags & MTF_FRIENDLY) flags |= MF_FRIENDLY; DamageType = info->DamageType; health = SpawnHealth(); - target = NULL; - lastenemy = NULL; + target = nullptr; + lastenemy = nullptr; // [RH] If it's a monster, it gets to count as another kill if (CountsAsKill()) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index ddc7515427..4c37e48eaa 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -977,7 +977,7 @@ void P_SetupPortals() if (s.mType == PORTS_STACKEDSECTORTHING && s.mSkybox) { s.mDisplacement = s.mSkybox->Pos() - s.mSkybox->target->Pos(); - s.mSkybox = NULL; + s.mSkybox = nullptr; } } } diff --git a/src/r_data/r_interpolate.cpp b/src/r_data/r_interpolate.cpp index e23c012c6f..70cf093931 100644 --- a/src/r_data/r_interpolate.cpp +++ b/src/r_data/r_interpolate.cpp @@ -222,7 +222,7 @@ void FInterpolator::AddInterpolation(DInterpolation *interp) { interp->Next = Head; if (Head != NULL) Head->Prev = interp; - interp->Prev = NULL; + interp->Prev = nullptr; Head = interp; count++; } @@ -238,15 +238,15 @@ void FInterpolator::RemoveInterpolation(DInterpolation *interp) if (Head == interp) { Head = interp->Next; - if (Head != NULL) Head->Prev = NULL; + if (Head != nullptr) Head->Prev = nullptr; } else { if (interp->Prev != NULL) interp->Prev->Next = interp->Next; if (interp->Next != NULL) interp->Next->Prev = interp->Prev; } - interp->Next = NULL; - interp->Prev = NULL; + interp->Next = nullptr; + interp->Prev = nullptr; count--; } @@ -302,11 +302,11 @@ void FInterpolator::RestoreInterpolations() void FInterpolator::ClearInterpolations() { DInterpolation *probe = Head; - Head = NULL; - while (probe != NULL) + Head = nullptr; + while (probe != nullptr) { DInterpolation *next = probe->Next; - probe->Next = probe->Prev = NULL; + probe->Next = probe->Prev = nullptr; probe->Destroy(); probe = next; } @@ -327,8 +327,8 @@ void FInterpolator::ClearInterpolations() DInterpolation::DInterpolation() { - Next = NULL; - Prev = NULL; + Next = nullptr; + Prev = nullptr; refcount = 0; } diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index 9887328e66..f9c9f50a90 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -307,7 +307,7 @@ IMPLEMENT_POINTERS_END DSeqNode::DSeqNode () : m_SequenceChoices(0) { - m_Next = m_Prev = m_ChildSeqNode = m_ParentSeqNode = NULL; + m_Next = m_Prev = m_ChildSeqNode = m_ParentSeqNode = nullptr; } void DSeqNode::Serialize(FSerializer &arc) @@ -395,8 +395,8 @@ void DSeqNode::OnDestroy() if (m_ParentSeqNode != NULL && m_ParentSeqNode->m_ChildSeqNode == this) { m_ParentSeqNode->m_SequencePtr++; - m_ParentSeqNode->m_ChildSeqNode = NULL; - m_ParentSeqNode = NULL; + m_ParentSeqNode->m_ChildSeqNode = nullptr; + m_ParentSeqNode = nullptr; } if (SequenceListHead == this) { @@ -821,7 +821,7 @@ DSeqNode::DSeqNode (int sequence, int modenum) m_Prev = NULL; } GC::WriteBarrier(this); - m_ParentSeqNode = m_ChildSeqNode = NULL; + m_ParentSeqNode = m_ChildSeqNode = nullptr; } void DSeqNode::ActivateSequence (int sequence)