summaryrefslogtreecommitdiff
path: root/src/vehiclelist.cpp
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/vehiclelist.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/vehiclelist.cpp')
-rw-r--r--src/vehiclelist.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp
index c98797573..acb848982 100644
--- a/src/vehiclelist.cpp
+++ b/src/vehiclelist.cpp
@@ -65,13 +65,13 @@ bool VehicleListIdentifier::UnpackIfValid(uint32 data)
* @param type Type of vehicle
* @param tile The tile the depot is located on
* @param engines Pointer to list to add vehicles to
- * @param wagons Pointer to list to add wagons to (can be NULL)
+ * @param wagons Pointer to list to add wagons to (can be nullptr)
* @param individual_wagons If true add every wagon to \a wagons which is not attached to an engine. If false only add the first wagon of every row.
*/
void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons)
{
engines->clear();
- if (wagons != NULL && wagons != engines) wagons->clear();
+ if (wagons != nullptr && wagons != engines) wagons->clear();
const Vehicle *v;
FOR_ALL_VEHICLES(v) {
@@ -84,7 +84,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
const Train *t = Train::From(v);
if (t->IsArticulatedPart() || t->IsRearDualheaded()) continue;
if (t->track != TRACK_BIT_DEPOT) continue;
- if (wagons != NULL && t->First()->IsFreeWagon()) {
+ if (wagons != nullptr && t->First()->IsFreeWagon()) {
if (individual_wagons || t->IsFreeWagon()) wagons->push_back(t);
continue;
}
@@ -104,7 +104,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
/* Ensure the lists are not wasting too much space. If the lists are fresh
* (i.e. built within a command) then this will actually do nothing. */
engines->shrink_to_fit();
- if (wagons != NULL && wagons != engines) wagons->shrink_to_fit();
+ if (wagons != nullptr && wagons != engines) wagons->shrink_to_fit();
}
/**
@@ -139,9 +139,9 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
case VL_SHARED_ORDERS:
/* Add all vehicles from this vehicle's shared order list */
v = Vehicle::GetIfValid(vli.index);
- if (v == NULL || v->type != vli.vtype || !v->IsPrimaryVehicle()) return false;
+ if (v == nullptr || v->type != vli.vtype || !v->IsPrimaryVehicle()) return false;
- for (; v != NULL; v = v->NextShared()) {
+ for (; v != nullptr; v = v->NextShared()) {
list->push_back(v);
}
break;