diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-04-10 22:07:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-10 23:22:20 +0200 |
commit | 7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch) | |
tree | 99f134b7e66367cf11e10bc5061896eab4a3264f /src/ground_vehicle.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/ground_vehicle.cpp')
-rw-r--r-- | src/ground_vehicle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ground_vehicle.cpp b/src/ground_vehicle.cpp index 6fd8d7710..b94fb0e7b 100644 --- a/src/ground_vehicle.cpp +++ b/src/ground_vehicle.cpp @@ -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; } |