Merge: Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
@@ -34,7 +34,7 @@ void GroundVehicle<T, Type>::PowerChanged()
|
||||
|
||||
this->CalculatePower(total_power, max_te, false);
|
||||
|
||||
for (const T *u = v; u != NULL; u = u->Next()) {
|
||||
for (const T *u = v; u != nullptr; u = u->Next()) {
|
||||
number_of_parts++;
|
||||
|
||||
/* Get minimum max speed for this track. */
|
||||
@@ -78,7 +78,7 @@ void GroundVehicle<T, Type>::CalculatePower(uint32& total_power, uint32& max_te,
|
||||
|
||||
const T *v = T::From(this);
|
||||
|
||||
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);
|
||||
|
||||
if (breakdowns && u->breakdown_ctr == 1 && u->breakdown_type == BREAKDOWN_LOW_POWER) {
|
||||
@@ -105,7 +105,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. */
|
||||
@@ -278,7 +278,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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user