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/ship_cmd.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 93019020a..08b07a07d 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -145,7 +145,7 @@ static const Depot *FindClosestShipDepot(const Vehicle *v, uint max_distance) { /* Find the closest depot */ const Depot *depot; - const Depot *best_depot = NULL; + const Depot *best_depot = nullptr; /* If we don't have a maximum distance, i.e. distance = 0, * we want to find any depot so the best distance of no * depot must be more than any correct distance. On the @@ -184,7 +184,7 @@ static void CheckIfShipNeedsService(Vehicle *v) const Depot *depot = FindClosestShipDepot(v, max_distance); - if (depot == NULL) { + if (depot == nullptr) { if (v->current_order.IsType(OT_GOTO_DEPOT)) { v->current_order.MakeDummy(); SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, WID_VV_START_STOP); @@ -333,7 +333,7 @@ void Ship::UpdateDeltaXY() */ static Vehicle *EnsureNoVisibleShipProc(Vehicle *v, void *data) { - return v->type == VEH_SHIP && (v->vehstatus & VS_HIDDEN) == 0 ? v : NULL; + return v->type == VEH_SHIP && (v->vehstatus & VS_HIDDEN) == 0 ? v : nullptr; } static bool CheckShipLeaveDepot(Ship *v) @@ -352,7 +352,7 @@ static bool CheckShipLeaveDepot(Ship *v) /* Don't leave depot if another vehicle is already entering/leaving */ /* This helps avoid CPU load if many ships are set to start at the same time */ - if (HasVehicleOnPos(v->tile, NULL, &EnsureNoVisibleShipProc)) return true; + if (HasVehicleOnPos(v->tile, nullptr, &EnsureNoVisibleShipProc)) return true; TileIndex tile = v->tile; Axis axis = GetShipDepotAxis(tile); @@ -869,10 +869,10 @@ bool Ship::FindClosestDepot(TileIndex *location, DestinationID *destination, boo { const Depot *depot = FindClosestShipDepot(this, 0); - if (depot == NULL) return false; + if (depot == nullptr) return false; - if (location != NULL) *location = depot->xy; - if (destination != NULL) *destination = depot->index; + if (location != nullptr) *location = depot->xy; + if (destination != nullptr) *destination = depot->index; return true; } |