diff options
author | peter1138 <peter1138@openttd.org> | 2008-06-03 12:11:16 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-06-03 12:11:16 +0000 |
commit | 1b7fcf0171ab4bc39b6cbb6b144ab7433f72ce1e (patch) | |
tree | 9ab27007bb5b8cb71e9c95adfefc283a973fc144 /src | |
parent | d67416088e6f55c2a835eed7fbe3fe61a5edd201 (diff) | |
download | openttd-1b7fcf0171ab4bc39b6cbb6b144ab7433f72ce1e.tar.xz |
(svn r13374) -Fix (r13364): Some common compilers do not yet support 9 year old specifications.
Diffstat (limited to 'src')
-rw-r--r-- | src/newgrf.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index dc72f2a5c..15fee8335 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2916,7 +2916,6 @@ static bool IsValidGroupID(uint16 groupid, const char *function) return true; } - static void VehicleMapSpriteGroup(byte *buf, byte feature, uint8 idcount) { static EngineID *last_engines; @@ -2943,7 +2942,7 @@ static void VehicleMapSpriteGroup(byte *buf, byte feature, uint8 idcount) } } - EngineID engines[idcount]; + EngineID *engines = (EngineID*)alloca(idcount * sizeof(*engines)); for (uint i = 0; i < idcount; i++) { engines[i] = GetNewEngine(_cur_grffile, (VehicleType)feature, grf_load_byte(&buf))->index; if (!wagover) last_engines[i] = engines[i]; @@ -2993,7 +2992,7 @@ static void VehicleMapSpriteGroup(byte *buf, byte feature, uint8 idcount) static void CanalMapSpriteGroup(byte *buf, uint8 idcount) { - CanalFeature cfs[idcount]; + CanalFeature *cfs = (CanalFeature*)alloca(idcount * sizeof(*cfs)); for (uint i = 0; i < idcount; i++) { cfs[i] = (CanalFeature)grf_load_byte(&buf); } @@ -3019,7 +3018,7 @@ static void CanalMapSpriteGroup(byte *buf, uint8 idcount) static void StationMapSpriteGroup(byte *buf, uint8 idcount) { - uint8 stations[idcount]; + uint8 *stations = (uint8*)alloca(idcount * sizeof(*stations)); for (uint i = 0; i < idcount; i++) { stations[i] = grf_load_byte(&buf); } @@ -3066,7 +3065,7 @@ static void StationMapSpriteGroup(byte *buf, uint8 idcount) static void TownHouseMapSpriteGroup(byte *buf, uint8 idcount) { - uint8 houses[idcount]; + uint8 *houses = (uint8*)alloca(idcount * sizeof(*houses)); for (uint i = 0; i < idcount; i++) { houses[i] = grf_load_byte(&buf); } @@ -3092,7 +3091,7 @@ static void TownHouseMapSpriteGroup(byte *buf, uint8 idcount) static void IndustryMapSpriteGroup(byte *buf, uint8 idcount) { - uint8 industries[idcount]; + uint8 *industries = (uint8*)alloca(idcount * sizeof(*industries)); for (uint i = 0; i < idcount; i++) { industries[i] = grf_load_byte(&buf); } @@ -3118,7 +3117,7 @@ static void IndustryMapSpriteGroup(byte *buf, uint8 idcount) static void IndustrytileMapSpriteGroup(byte *buf, uint8 idcount) { - uint8 indtiles[idcount]; + uint8 *indtiles = (uint8*)alloca(idcount * sizeof(*indtiles)); for (uint i = 0; i < idcount; i++) { indtiles[i] = grf_load_byte(&buf); } @@ -3144,7 +3143,7 @@ static void IndustrytileMapSpriteGroup(byte *buf, uint8 idcount) static void CargoMapSpriteGroup(byte *buf, uint8 idcount) { - CargoID cargos[idcount]; + CargoID *cargos = (CargoID*)alloca(idcount * sizeof(*cargos)); for (uint i = 0; i < idcount; i++) { cargos[i] = grf_load_byte(&buf); } |