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

@@ -118,7 +118,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
int GetDisplaySpeed() const { return this->gcache.last_speed; }
int GetDisplayMaxSpeed() const { return this->vcache.cached_max_speed; }
Money GetRunningCost() const;
int GetDisplayImageWidth(Point *offset = NULL) const;
int GetDisplayImageWidth(Point *offset = nullptr) const;
bool IsInDepot() const { return this->track == TRACK_BIT_DEPOT; }
bool Tick();
void OnNewDay();
@@ -146,7 +146,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
inline Train *GetNextUnit() const
{
Train *v = this->GetNextVehicle();
if (v != NULL && v->IsRearDualheaded()) v = v->GetNextVehicle();
if (v != nullptr && v->IsRearDualheaded()) v = v->GetNextVehicle();
return v;
}
@@ -158,7 +158,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
inline Train *GetPrevUnit()
{
Train *v = this->GetPrevVehicle();
if (v != NULL && v->IsRearDualheaded()) v = v->GetPrevVehicle();
if (v != nullptr && v->IsRearDualheaded()) v = v->GetPrevVehicle();
return v;
}
@@ -173,7 +173,7 @@ struct Train FINAL : public GroundVehicle<Train, VEH_TRAIN> {
* longer than the part after the center. This means we have to round up the
* length of the next vehicle but may not round the length of the current
* vehicle. */
return this->gcache.cached_veh_length / 2 + (this->Next() != NULL ? this->Next()->gcache.cached_veh_length + 1 : 0) / 2;
return this->gcache.cached_veh_length / 2 + (this->Next() != nullptr ? this->Next()->gcache.cached_veh_length + 1 : 0) / 2;
}
protected: // These functions should not be called outside acceleration code.