Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3731) coordinate functions need int*, get short*
Home

[Freeciv-Dev] (PR#3731) coordinate functions need int*, get short*

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#3731) coordinate functions need int*, get short*
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 14 Mar 2003 18:22:51 -0800
Reply-to: rt@xxxxxxxxxxxxxx

All Freeciv coordinate functions take integers.  Those that take 
pointers take pointers to integers.

In the new PF code, there is code that passes pointers to short's 
instead - specifically to index_to_map_pos.  This is okay with the 
current macro implementation, but is no good with a function implementation.

Attached is the easy fix.  It is also possible to fix this using wrapper 
variables (but I'm not sure why you'd want to).

jason

Index: common/aicore/path_finding.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/path_finding.c,v
retrieving revision 1.1
diff -u -r1.1 path_finding.c
--- common/aicore/path_finding.c        2003/03/11 17:59:26     1.1
+++ common/aicore/path_finding.c        2003/03/15 02:17:53
@@ -98,7 +98,7 @@
  * (aka internal buffer); index is map_pos_to_index(x, y);
  */
 struct pf_map {
-  short x, y;                  /* The current position */
+  int x, y;                    /* The current position */
   index_t index;               /* Current offset into lattice */
   struct pf_parameter *params;  /* Initial parameters */
   struct pqueue *queue;         /* Queue of nodes we have reached but not 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#3731) coordinate functions need int*, get short*, Jason Short <=