Codechange: Replace all usages of alloca/AllocaM with more modern/less discouraged alternatives

This commit is contained in:
Charles Pigott
2021-05-01 21:06:17 +01:00
committed by PeterN
parent b19f42ecd9
commit b282664242
18 changed files with 135 additions and 122 deletions

View File

@@ -264,7 +264,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
wp->UpdateVirtCoord();
const StationSpec *spec = StationClass::Get(spec_class)->GetSpec(spec_index);
byte *layout_ptr = AllocaM(byte, count);
byte *layout_ptr = new byte[count];
if (spec == nullptr) {
/* The layout must be 0 for the 'normal' waypoints by design. */
memset(layout_ptr, 0, count);
@@ -291,6 +291,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
YapfNotifyTrackLayoutChange(tile, AxisToTrack(axis));
}
DirtyCompanyInfrastructureWindows(wp->owner);
delete[] layout_ptr;
}
return cost;