? diff Index: client/climisc.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v retrieving revision 1.61 diff -r1.61 climisc.c 202,203c202 < if( !normalize_map_pos(&x, &y) ) < return; --- > CHECK_MAP_POS(x, y); 480c479,480 < assert(is_real_tile(x1, y1)); --- > CHECK_MAP_POS(x1, y1); > assert(map_get_tile(x1, y1)->known); Index: client/control.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/control.c,v retrieving revision 1.60 diff -r1.60 control.c 1036,1037d1035 < punit->x=-1; /* focus hack - if we're moving the unit in focus, it wont < * be redrawn on top of the city */ Index: client/goto.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v retrieving revision 1.26 diff -r1.26 goto.c 621,623c621 < /* Replace with check for is_normal_tile later */ < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); 800,802c798 < /* Replace with check for is_normal_tile later */ < assert(is_real_tile(dest_x, dest_y)); < normalize_map_pos(&dest_x, &dest_y); --- > CHECK_MAP_POS(dest_x, dest_y); Index: client/gui-gtk/mapview.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/mapview.c,v retrieving revision 1.101 diff -r1.101 mapview.c 2230,2232c2230 < /* Replace with check for is_normal_tile later */ < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); Index: client/gui-mui/graphics.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/graphics.c,v retrieving revision 1.15 diff -r1.15 graphics.c 1251,1252c1251,1252 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > Index: common/city.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/city.c,v retrieving revision 1.124 diff -r1.124 city.c 103c103 < assert(is_real_tile(map_x, map_y)); --- > CHECK_MAP_POS(map_x, map_y); 2062c2062 < assert(is_real_tile(map_x, map_y)); --- > CHECK_MAP_POS(map_x, map_y); Index: common/map.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.c,v retrieving revision 1.92 diff -r1.92 map.c 1012c1012 < assert(is_real_tile(x, y)); --- > CHECK_MAP_POS(x, y); 1050,1051c1050 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); 1138,1140c1137 < int is_real = normalize_map_pos(&x, &y); < < assert(is_real); --- > CHECK_MAP_POS(x, y); 1150,1153c1147,1149 < if (!normalize_map_pos(&x, &y)) < return -1; < else < return (map.tiles + x + y * map.xsize)->continent; --- > CHECK_MAP_POS(x, y); > > return (map.tiles + x + y * map.xsize)->continent; 1161,1162c1157,1158 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > 1172,1175c1168,1170 < if (!normalize_map_pos(&x, &y)) < return T_UNKNOWN; < else < return (map.tiles + x + y * map.xsize)->terrain; --- > CHECK_MAP_POS(x, y); > > return (map.tiles + x + y * map.xsize)->terrain; 1183,1186c1178,1180 < if (!normalize_map_pos(&x, &y)) < return S_NO_SPECIAL; < else < return (map.tiles + x + y * map.xsize)->special; --- > CHECK_MAP_POS(x, y); > > return (map.tiles + x + y * map.xsize)->special; 1194,1195c1188,1189 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > 1204,1205c1198 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); 1218,1219c1211,1212 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > 1231,1232c1224,1225 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > 1242,1243c1235,1236 < assert(is_real_tile(x, y)); < normalize_map_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > 1253,1256c1246,1248 < if (!normalize_map_pos(&x, &y)) < return TILE_UNKNOWN; < else < return (enum known_type) ((map.tiles + x + y * map.xsize)->known); --- > CHECK_MAP_POS(x, y); > > return (enum known_type) ((map.tiles + x + y * map.xsize)->known); 1265,1267c1257,1259 < assert(is_real_tile(x1, y1) && is_real_tile(x2, y2)); < normalize_map_pos(&x1, &y1); < normalize_map_pos(&x2, &y2); --- > CHECK_MAP_POS(x1, y1); > CHECK_MAP_POS(x2, y2); > 1342c1334 < assert(is_real_tile(x0, y0)); --- > CHECK_MAP_POS(x0, y0); 1413,1415c1405,1407 < assert(is_real_tile(start_x, start_y) && is_real_tile(end_x, end_y)); < normalize_map_pos(&start_x, &start_y); < normalize_map_pos(&end_x, &end_y); --- > CHECK_MAP_POS(start_x, start_y); > CHECK_MAP_POS(end_x, end_y); > Index: common/map.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/map.h,v retrieving revision 1.94 diff -r1.94 map.h 215a216,232 > /* > * Every map position which is passed to CHECK_MAP_POS should be real > * and normal(ized). This is currently always checked except of > * "--enable-debug=no" is passed to configure i.e. NDEBUG isn't > * defined. CHECK_MAP_POS may always omit the checks in the long > * run. Or may even be removed completely. > */ > #ifdef NDEBUG > #define CHECK_MAP_POS(x,y) do{}while(0) > #else > #define CHECK_MAP_POS(x,y) do{\ > int dx = x, dy = y; \ > assert(normalize_map_pos(&dx, &dy)); \ > assert(x == dx && y == dy); \ > } while(0) > #endif > Index: server/maphand.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/maphand.c,v retrieving revision 1.86 diff -r1.86 maphand.c 955,958c955,956 < if (!is_real_tile(x, y)) { < freelog(LOG_ERROR, "Trying to get nonexistant tile at %i,%i", x, y); < } < nearest_real_pos(&x, &y); --- > CHECK_MAP_POS(x, y); > Index: server/settlers.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/server/settlers.c,v retrieving revision 1.110 diff -r1.110 settlers.c 632,633c632,633 < if (!normalize_map_pos(&x, &y)) < return 0; --- > > CHECK_MAP_POS(x, y);