(svn r13456) -Codechange: use AllocaM() macro instead of alloca() at most places

This commit is contained in:
smatz
2008-06-10 21:59:22 +00:00
parent 0e78f51801
commit 506cde94b6
6 changed files with 15 additions and 12 deletions

View File

@@ -194,7 +194,7 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
uint num_vehicles = 1 + CountArticulatedParts(p1, false);
/* Allow for the front and the articulated parts, plus one to "terminate" the list. */
Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * (num_vehicles + 1));
Vehicle **vl = AllocaM(Vehicle*, num_vehicles + 1);
memset(vl, 0, sizeof(*vl) * (num_vehicles + 1));
if (!Vehicle::AllocateList(vl, num_vehicles)) {