summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-12 19:57:41 +0000
committerludde <ludde@openttd.org>2005-07-12 19:57:41 +0000
commitdc9b51f110a8046718ba68b8db170bcbb147d337 (patch)
treedf7884807d619d145487f0cd9dcdf5c280421d1b
parent9a1b3fc181996ab5f85596356d29e986de7287c4 (diff)
downloadopenttd-dc9b51f110a8046718ba68b8db170bcbb147d337.tar.xz
(svn r2552) - Fix: [map] Fix so the code compiles correctly and doesn't crash on MSVC6 in optimization mode.
-rw-r--r--map.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/map.c b/map.c
index 66ac9dacb..edcd7e721 100644
--- a/map.c
+++ b/map.c
@@ -25,11 +25,11 @@ void InitMap(uint log_x, uint log_y)
DEBUG(map, 1)("Allocating map of size %dx%d", log_x, log_y);
- // XXX - MSVC6 volatile workaround
- *(volatile uint*)&_map_log_x = log_x;
- *(volatile uint*)&_map_log_y = log_y;
+ _map_log_x = log_x;
+ _map_log_y = log_y;
- map_size = MapSize();
+ // XXX - MSVC6 workaround
+ map_size = 1 << (log_x + log_y);
_map_type_and_height =
realloc(_map_type_and_height, map_size * sizeof(_map_type_and_height[0]));