Codechange: Use null pointer literal instead of the NULL macro

This commit is contained in:
Henry Wilson
2019-04-10 22:07:06 +01:00
committed by Michael Lutz
parent 3b4f224c0b
commit 7c8e7c6b6e
463 changed files with 5674 additions and 5674 deletions

View File

@@ -30,7 +30,7 @@ void GroundVehicle<T, Type>::PowerChanged()
uint32 number_of_parts = 0;
uint16 max_track_speed = v->GetDisplayMaxSpeed();
for (const T *u = v; u != NULL; u = u->Next()) {
for (const T *u = v; u != nullptr; u = u->Next()) {
uint32 current_power = u->GetPower() + u->GetPoweredPartPower(u);
total_power += current_power;
@@ -83,7 +83,7 @@ void GroundVehicle<T, Type>::CargoChanged()
assert(this->First() == this);
uint32 weight = 0;
for (T *u = T::From(this); u != NULL; u = u->Next()) {
for (T *u = T::From(this); u != nullptr; u = u->Next()) {
uint32 current_weight = u->GetWeight();
weight += current_weight;
/* Slope steepness is in percent, result in N. */
@@ -198,7 +198,7 @@ bool GroundVehicle<T, Type>::IsChainInDepot() const
if (!IsDepotTypeTile(v->tile, (TransportType)Type) || v->cur_speed != 0) return false;
/* Check whether the rest is also already trying to enter the depot. */
for (; v != NULL; v = v->Next()) {
for (; v != nullptr; v = v->Next()) {
if (!v->T::IsInDepot() || v->tile != this->tile) return false;
}