diff options
author | smatz <smatz@openttd.org> | 2008-06-10 21:59:22 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-06-10 21:59:22 +0000 |
commit | 506cde94b66dc639f5f550849f9d8b9942832c4c (patch) | |
tree | 1e9c70ae3dc2bbcd2c970580934f71f53844a48a /src/train_cmd.cpp | |
parent | 0e78f51801fd7c4af6113976d69cd7582a11a3e7 (diff) | |
download | openttd-506cde94b66dc639f5f550849f9d8b9942832c4c.tar.xz |
(svn r13456) -Codechange: use AllocaM() macro instead of alloca() at most places
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 8de0bb797..acf7f7c53 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -549,7 +549,7 @@ static CommandCost CmdBuildRailWagon(EngineID engine, TileIndex tile, uint32 fla if (!IsCompatibleRail(rvi->railtype, GetRailType(tile))) return CMD_ERROR; /* Allow for the wagon 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)) @@ -716,7 +716,7 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 if (!HasPowerOnRail(rvi->railtype, GetRailType(tile))) return CMD_ERROR; /* Allow for the dual-heads 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)) { |