diff -Nurd -X freeciv.current/diff_ignore work.clean/common/map.h work.adjust/common/map.h --- work.clean/common/map.h Sun Aug 26 11:28:17 2001 +++ work.adjust/common/map.h Mon Sep 3 00:13:36 2001 @@ -191,6 +191,7 @@ void initialize_move_costs(void); void reset_move_costs(int x, int y); +#if 0 #define map_adjust_x(X) \ ((X) < 0 \ ? ((X) % map.xsize != 0 ? (X) % map.xsize + map.xsize : 0) \ @@ -200,6 +201,10 @@ #define map_adjust_y(Y) \ (((Y)<0) ? 0 : (((Y)>=map.ysize) ? map.ysize-1 : (Y))) +#else +int map_adjust_x(int X); +int map_adjust_y(int Y); +#endif #define map_inx(x,y) \ ((x)+(y)*map.xsize) @@ -569,5 +574,7 @@ #define MAP_DEFAULT_GENERATOR 1 #define MAP_MIN_GENERATOR 1 #define MAP_MAX_GENERATOR 4 + +#include "map_inline.h" #endif /* FC__MAP_H */ diff -Nurd -X freeciv.current/diff_ignore work.clean/common/map_inline.h work.adjust/common/map_inline.h --- work.clean/common/map_inline.h Thu Jan 1 01:00:00 1970 +++ work.adjust/common/map_inline.h Mon Sep 3 00:12:14 2001 @@ -0,0 +1,12 @@ + +extern inline int map_adjust_x(int X) +{ + return ((X) < 0 + ? ((X) % map.xsize != 0 ? (X) % map.xsize + map.xsize : 0) + : ((X) >= map.xsize ? (X) % map.xsize : (X))); +} + +extern inline int map_adjust_y(int Y) +{ + return (((Y) < 0) ? 0 : (((Y) >= map.ysize) ? map.ysize - 1 : (Y))); +}