Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#6830) remove map_adjust_x/map_adjust_y
Home

[Freeciv-Dev] (PR#6830) remove map_adjust_x/map_adjust_y

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6830) remove map_adjust_x/map_adjust_y
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Nov 2003 22:07:14 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6830 >

This clever little patch removes map_adjust_x and map_adjust_y.  They 
are currently unused, have been for a while, and should remain so.

All old callers now use normalize_map_pos, nearest_real_pos, or 
map_distance_vector instead.

jason

? genlist_safe_unlink.diff
Index: common/map.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/map.h,v
retrieving revision 1.161
diff -u -r1.161 map.h
--- common/map.h        2003/10/27 14:25:24     1.161
+++ common/map.h        2003/11/11 06:05:33
@@ -228,16 +228,6 @@
 #define CHECK_INDEX(index) ((void)0)
 #endif
 
-#define map_adjust_x(X)            \
-  ((X) < 0                         \
-   ? ((X) % map.xsize != 0 ? (X) % map.xsize + map.xsize : 0) \
-   : ((X) >= map.xsize             \
-      ? (X) % map.xsize            \
-      : (X)))
-
-#define map_adjust_y(Y) \
-  (((Y)<0) ? 0 : (((Y)>=map.ysize) ? map.ysize-1 : (Y)))
-
 /* Obscure math.  See explanation in doc/HACKING. */
 #define native_to_map_pos(pmap_x, pmap_y, nat_x, nat_y)                     \
   (topo_has_flag(TF_ISO)                                                    \

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6830) remove map_adjust_x/map_adjust_y, Jason Short <=