Merge: Codechange: Use null pointer literal instead of the NULL macro

This commit is contained in:
Jonathan G Rennison
2019-04-11 18:14:13 +01:00
585 changed files with 6604 additions and 6604 deletions

View File

@@ -269,7 +269,7 @@ private:
{
const TraceRestrictProgram *prog = GetExistingTraceRestrictProgram(tile, TrackdirToTrack(trackdir));
TraceRestrictProgramActionsUsedFlags flags_to_check = TRPAUF_PF;
if (is_res_through != NULL) {
if (is_res_through != nullptr) {
*is_res_through = false;
flags_to_check |= TRPAUF_RESERVE_THROUGH;
}
@@ -278,7 +278,7 @@ private:
}
if (prog && prog->actions_used_flags & flags_to_check) {
prog->Execute(Yapf().GetVehicle(), TraceRestrictProgramInput(tile, trackdir, &TraceRestrictPreviousSignalCallback, &n), out);
if (out.flags & TRPRF_RESERVE_THROUGH && is_res_through != NULL) {
if (out.flags & TRPRF_RESERVE_THROUGH && is_res_through != nullptr) {
*is_res_through = true;
}
if (out.flags & TRPRF_DENY) {
@@ -378,7 +378,7 @@ public:
if (ShouldCheckTraceRestrict(n, tile)) {
TraceRestrictProgramResult out;
if (ExecuteTraceRestrict(n, tile, trackdir, cost, out, NULL)) {
if (ExecuteTraceRestrict(n, tile, trackdir, cost, out, nullptr)) {
return -1;
}
}
@@ -396,7 +396,7 @@ public:
{
int cost = 0;
const Train *v = Yapf().GetVehicle();
assert(v != NULL);
assert(v != nullptr);
assert(v->type == VEH_TRAIN);
assert(v->gcache.cached_total_length != 0);
int missing_platform_length = CeilDiv(v->gcache.cached_total_length, TILE_SIZE) - platform_length;
@@ -430,7 +430,7 @@ public:
CPerfStart perf_cost(&Yapf().m_perf_cost);
/* Does the node have some parent node? */
bool has_parent = (n.m_parent != NULL);
bool has_parent = (n.m_parent != nullptr);
/* Do we already have a cached segment? */
CachedData &segment = *n.m_segment;
@@ -764,7 +764,7 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
/* Station platform-length penalty. */
if ((end_segment_reason & ESRB_STATION) != ESRB_NONE) {
const BaseStation *st = BaseStation::GetByTile(n.GetLastTile());
assert(st != NULL);
assert(st != nullptr);
uint platform_length = st->GetPlatformLength(n.GetLastTile(), ReverseDiagDir(TrackdirToExitdir(n.GetLastTrackdir())));
/* Reduce the extra cost caused by passing-station penalty (each station receives it in the segment cost). */
extra_cost -= Yapf().PfGetSettings().rail_station_penalty * platform_length;
@@ -782,7 +782,7 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
inline bool CanUseGlobalCache(Node &n) const
{
return !m_disable_cache
&& (n.m_parent != NULL)
&& (n.m_parent != nullptr)
&& (n.m_parent->m_num_signals_passed >= m_sig_look_ahead_costs.Size());
}