Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2005:
[Freeciv-Dev] (PR#12463) Couple of const leftovers
Home

[Freeciv-Dev] (PR#12463) Couple of const leftovers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12463) Couple of const leftovers
From: "Frédéric Brière" <fbriere@xxxxxxxxxxx>
Date: Tue, 8 Mar 2005 13:38:22 -0800
Reply-to: bugs@xxxxxxxxxxx

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

Here's a couple of const patches that I forgot to send with the others
a few months ago.


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

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

Index: common/game.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.c,v
retrieving revision 1.198
diff -u -r1.198 game.c
--- common/game.c       4 Mar 2005 18:48:07 -0000       1.198
+++ common/game.c       8 Mar 2005 20:24:06 -0000
@@ -67,7 +67,7 @@
 /**************************************************************************
 Count the # of thousand citizen in a civilisation.
 **************************************************************************/
-int civ_population(struct player *pplayer)
+int civ_population(const struct player *pplayer)
 {
   int ppl=0;
   city_list_iterate(pplayer->cities, pcity)
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.176
diff -u -r1.176 game.h
--- common/game.h       6 Mar 2005 17:35:36 -0000       1.176
+++ common/game.h       8 Mar 2005 20:24:06 -0000
@@ -277,7 +277,7 @@
 int game_next_year(int);
 void game_advance_year(void);
 
-int civ_population(struct player *pplayer);
+int civ_population(const struct player *pplayer);
 struct city *game_find_city_by_name(const char *name);
 
 struct unit *find_unit_by_id(int id);
Index: common/improvement.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/improvement.c,v
retrieving revision 1.51
diff -u -r1.51 improvement.c
--- common/improvement.c        21 Dec 2004 04:18:54 -0000      1.51
+++ common/improvement.c        8 Mar 2005 20:32:50 -0000
@@ -280,7 +280,8 @@
    Whether player can build given building somewhere, ignoring whether it
    is obsolete.
 **************************************************************************/
-bool can_player_build_improvement_direct(struct player *p, Impr_Type_id id)
+bool can_player_build_improvement_direct(const struct player *p,
+                                        Impr_Type_id id)
 {
   struct impr_type *impr;
   bool space_part = FALSE;
@@ -337,7 +338,7 @@
   returns TRUE if building is available with current tech OR will be
   available with future tech.  Returns FALSE if building is obsolete.
 **************************************************************************/
-bool can_player_build_improvement(struct player *p, Impr_Type_id id)
+bool can_player_build_improvement(const struct player *p, Impr_Type_id id)
 {
   if (!can_player_build_improvement_direct(p, id)) {
     return FALSE;
@@ -353,7 +354,8 @@
   returns TRUE if building is available with current tech OR will be
   available with future tech.  Returns FALSE if building is obsolete.
 **************************************************************************/
-bool can_player_eventually_build_improvement(struct player *p, Impr_Type_id id)
+bool can_player_eventually_build_improvement(const struct player *p,
+                                            Impr_Type_id id)
 {
   if (!improvement_exists(id)) {
     return FALSE;
Index: common/improvement.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/improvement.h,v
retrieving revision 1.38
diff -u -r1.38 improvement.h
--- common/improvement.h        21 Dec 2004 04:18:54 -0000      1.38
+++ common/improvement.h        8 Mar 2005 20:32:50 -0000
@@ -113,9 +113,10 @@
 Impr_Type_id find_improvement_by_name_orig(const char *s);
 
 /* player related improvement and unit functions */
-bool can_player_build_improvement_direct(struct player *p, Impr_Type_id id);
-bool can_player_build_improvement(struct player *p, Impr_Type_id id);
-bool can_player_eventually_build_improvement(struct player *p,
+bool can_player_build_improvement_direct(const struct player *p,
+                                        Impr_Type_id id);
+bool can_player_build_improvement(const struct player *p, Impr_Type_id id);
+bool can_player_eventually_build_improvement(const struct player *p,
                                             Impr_Type_id id);
 
 /* Iterates over all improvements. Creates a new variable names m_i
Index: common/spaceship.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/spaceship.c,v
retrieving revision 1.4
diff -u -r1.4 spaceship.c
--- common/spaceship.c  4 Apr 2003 15:47:49 -0000       1.4
+++ common/spaceship.c  8 Mar 2005 20:21:42 -0000
@@ -113,7 +113,7 @@
 /**********************************************************************
 Count the number of structurals placed; that is, in ship->structure[]
 **********************************************************************/
-int num_spaceship_structurals_placed(struct player_spaceship *ship)
+int num_spaceship_structurals_placed(const struct player_spaceship *ship)
 {
   int i, num = 0;
   for(i=0; i<NUM_SS_STRUCTURALS; i++) {
Index: common/spaceship.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/spaceship.h,v
retrieving revision 1.4
diff -u -r1.4 spaceship.h
--- common/spaceship.h  12 Apr 2002 13:50:56 -0000      1.4
+++ common/spaceship.h  8 Mar 2005 20:21:42 -0000
@@ -114,6 +114,6 @@
 extern const struct sship_part_info modules_info[NUM_SS_MODULES];
 
 void spaceship_init(struct player_spaceship *ship);
-int num_spaceship_structurals_placed(struct player_spaceship *ship);
+int num_spaceship_structurals_placed(const struct player_spaceship *ship);
 
 #endif /* FC__SPACESHIP_H */

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12463) Couple of const leftovers, Frédéric Brière <=