summaryrefslogtreecommitdiff
path: root/src/train.h
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/train.h
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/train.h')
-rw-r--r--src/train.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/train.h b/src/train.h
index 5958cde1a..3bbb6cafb 100644
--- a/src/train.h
+++ b/src/train.h
@@ -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.