Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11604) Sprinkling some more consts
Home

[Freeciv-Dev] (PR#11604) Sprinkling some more consts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11604) Sprinkling some more consts
From: "Frédéric Brière" <fbriere@xxxxxxxxxxx>
Date: Sun, 19 Dec 2004 04:50:22 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11604 >

This patch adds some consts here and there in various client/*.[ch]
functions.


-- 
             Frédéric Brière    <*>    fbriere@xxxxxxxxxxx

 =>  <fbriere@xxxxxxxxxx> IS NO MORE:  <http://www.abacomsucks.com>  <=

Index: client/climisc.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v
retrieving revision 1.146
diff -u -r1.146 climisc.c
--- client/climisc.c    12 Dec 2004 03:44:47 -0000      1.146
+++ client/climisc.c    19 Dec 2004 11:34:53 -0000
@@ -975,7 +975,7 @@
   distance Parameter sq_dist may be NULL. Returns NULL only if no city is
   known. Favors punit owner's cities over other cities if equally distant.
 **************************************************************************/
-struct city *get_nearest_city(struct unit *punit, int *sq_dist)
+struct city *get_nearest_city(const struct unit *punit, int *sq_dist)
 {
   struct city *pcity_near;
   int pcity_near_dist;
Index: client/climisc.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.h,v
retrieving revision 1.52
diff -u -r1.52 climisc.h
--- client/climisc.h    12 Dec 2004 03:44:47 -0000      1.52
+++ client/climisc.h    19 Dec 2004 11:34:53 -0000
@@ -116,7 +120,7 @@
 void reports_thaw(void);
 void reports_force_thaw(void);
 
-struct city *get_nearest_city(struct unit *punit, int *sq_dist);
+struct city *get_nearest_city(const struct unit *punit, int *sq_dist);
 
 void cityrep_buy(struct city *pcity);
 void common_taxrates_callback(int i);
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.166
diff -u -r1.166 mapview_common.c
--- client/mapview_common.c     16 Dec 2004 18:59:28 -0000      1.166
+++ client/mapview_common.c     19 Dec 2004 11:34:53 -0000
@@ -869,7 +869,7 @@
   Draw the given unit onto the canvas store at the given location.  The
   area of drawing is UNIT_TILE_HEIGHT x UNIT_TILE_WIDTH.
 **************************************************************************/
-void put_unit(struct unit *punit,
+void put_unit(const struct unit *punit,
              struct canvas *pcanvas, int canvas_x, int canvas_y)
 {
   struct drawn_sprite drawn_sprites[40];
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.83
diff -u -r1.83 mapview_common.h
--- client/mapview_common.h     16 Dec 2004 18:59:28 -0000      1.83
+++ client/mapview_common.h     19 Dec 2004 11:34:54 -0000
@@ -159,7 +159,7 @@
 bool tile_visible_mapcanvas(struct tile *ptile);
 bool tile_visible_and_not_on_border_mapcanvas(struct tile *ptile);
 
-void put_unit(struct unit *punit,
+void put_unit(const struct unit *punit,
              struct canvas *pcanvas, int canvas_x, int canvas_y);
 void put_city(struct city *pcity,
              struct canvas *pcanvas, int canvas_x, int canvas_y);
Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.221
diff -u -r1.221 tilespec.c
--- client/tilespec.c   17 Dec 2004 09:13:54 -0000      1.221
+++ client/tilespec.c   19 Dec 2004 11:42:21 -0000
@@ -1845,7 +1845,7 @@
 /**********************************************************************
  ...
 ***********************************************************************/
-static struct Sprite *get_unit_nation_flag_sprite(struct unit *punit)
+static struct Sprite *get_unit_nation_flag_sprite(const struct unit *punit)
 {
   return get_nation_by_plr(unit_owner(punit))->flag_sprite;
 }
@@ -1957,7 +1957,7 @@
   Fill in the sprite array for the unit
 ***********************************************************************/
 static int fill_unit_sprite_array(struct drawn_sprite *sprs,
-                                 struct unit *punit,
+                                 const struct unit *punit,
                                  bool stack, bool backdrop)
 {
   struct drawn_sprite *save_sprs = sprs;
@@ -2636,7 +2636,7 @@
   is done differently.
 ****************************************************************************/
 int fill_sprite_array(struct drawn_sprite *sprs, struct tile *ptile,
-                     struct unit *punit, struct city *pcity,
+                     const struct unit *punit, struct city *pcity,
                      bool citymode)
 {
   Terrain_type_id ttype, ttype_near[8];
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.94
diff -u -r1.94 tilespec.h
--- client/tilespec.h   17 Dec 2004 09:13:54 -0000      1.94
+++ client/tilespec.h   19 Dec 2004 11:42:21 -0000
@@ -80,7 +80,7 @@
 /* Gfx support */
 
 int fill_sprite_array(struct drawn_sprite *sprs, struct tile *ptile,
-                     struct unit *punit, struct city *pcity,
+                     const struct unit *punit, struct city *pcity,
                      bool citymode);
 
 enum color_std player_color(const struct player *pplayer);
Index: client/mapctrl_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapctrl_common.c,v
retrieving revision 1.43
diff -u -r1.43 mapctrl_common.c
--- client/mapctrl_common.c     22 Nov 2004 19:31:30 -0000      1.43
+++ client/mapctrl_common.c     19 Dec 2004 12:14:31 -0000
@@ -709,7 +709,7 @@
 /****************************************************************************
   Fill and sort the list of units on the tile.
 ****************************************************************************/
-void fill_tile_unit_list(struct tile *ptile, struct unit **unit_list)
+void fill_tile_unit_list(const struct tile *ptile, struct unit **unit_list)
 {
   int i = 0;
 
Index: client/mapctrl_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapctrl_common.h,v
retrieving revision 1.19
diff -u -r1.19 mapctrl_common.h
--- client/mapctrl_common.h     29 Sep 2004 02:24:19 -0000      1.19
+++ client/mapctrl_common.h     19 Dec 2004 12:14:31 -0000
@@ -60,7 +60,7 @@
 bool get_chance_to_win(int *att_chance, int *def_chance,
                       struct tile *ptile);
 
-void fill_tile_unit_list(struct tile *ptile, struct unit **unit_list);
+void fill_tile_unit_list(const struct tile *ptile, struct unit **unit_list);
 
 extern struct city *city_workers_display;
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11604) Sprinkling some more consts, Frédéric Brière <=