Merge: Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
/* static */ char *ScriptRail::GetName(RailType rail_type)
|
||||
{
|
||||
if (!IsRailTypeAvailable(rail_type)) return NULL;
|
||||
if (!IsRailTypeAvailable(rail_type)) return nullptr;
|
||||
|
||||
return GetString(GetRailTypeInfo((::RailType)rail_type)->strings.menu_text);
|
||||
}
|
||||
@@ -185,7 +185,7 @@
|
||||
if (res != CALLBACK_FAILED) {
|
||||
int index = 0;
|
||||
const StationSpec *spec = StationClass::GetByGrf(file->grfid, res, &index);
|
||||
if (spec == NULL) {
|
||||
if (spec == nullptr) {
|
||||
DEBUG(grf, 1, "%s returned an invalid station ID for 'AI construction/purchase selection (18)' callback", file->filename);
|
||||
} else {
|
||||
/* We might have gotten an usable station spec. Try to build it, but if it fails we'll fall back to the original station. */
|
||||
@@ -487,10 +487,10 @@ static bool IsValidSignalType(int signal_type)
|
||||
|
||||
switch (build_type) {
|
||||
case BT_TRACK: return ::RailBuildCost((::RailType)railtype);
|
||||
case BT_SIGNAL: return ::GetPrice(PR_BUILD_SIGNALS, 1, NULL);
|
||||
case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_TRAIN, 1, NULL);
|
||||
case BT_STATION: return ::GetPrice(PR_BUILD_STATION_RAIL, 1, NULL) + ::GetPrice(PR_BUILD_STATION_RAIL_LENGTH, 1, NULL);
|
||||
case BT_WAYPOINT: return ::GetPrice(PR_BUILD_WAYPOINT_RAIL, 1, NULL);
|
||||
case BT_SIGNAL: return ::GetPrice(PR_BUILD_SIGNALS, 1, nullptr);
|
||||
case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_TRAIN, 1, nullptr);
|
||||
case BT_STATION: return ::GetPrice(PR_BUILD_STATION_RAIL, 1, nullptr) + ::GetPrice(PR_BUILD_STATION_RAIL_LENGTH, 1, nullptr);
|
||||
case BT_WAYPOINT: return ::GetPrice(PR_BUILD_WAYPOINT_RAIL, 1, nullptr);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user