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

On 01/08/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote:
>
>  I get a lot of warnings like $subject.

 Patch


 - ML

diff -Nurd -X.diff_ignore freeciv/common/government.c freeciv/common/government.c
--- freeciv/common/government.c	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/government.c	2007-08-01 20:11:59.000000000 +0300
@@ -67,7 +67,7 @@
 /**************************************************************************
   Return the number of governments.
 **************************************************************************/
-const int government_count(void)
+int government_count(void)
 {
   return game.control.government_count;
 }
@@ -78,7 +78,7 @@
   Currently same as government_number(), paired with government_count()
   indicates use as an array index.
 **************************************************************************/
-const int government_index(const struct government *pgovern)
+int government_index(const struct government *pgovern)
 {
   assert(pgovern);
   return pgovern - governments;
@@ -87,7 +87,7 @@
 /**************************************************************************
   Return the government index.
 **************************************************************************/
-const int government_number(const struct government *pgovern)
+int government_number(const struct government *pgovern)
 {
   assert(pgovern);
   return pgovern->item_number;
diff -Nurd -X.diff_ignore freeciv/common/government.h freeciv/common/government.h
--- freeciv/common/government.h	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/government.h	2007-08-01 20:11:02.000000000 +0300
@@ -59,9 +59,9 @@
 
 
 /* General government accessor functions. */
-const int government_count(void);
-const int government_index(const struct government *pgovern);
-const int government_number(const struct government *pgovern);
+int government_count(void);
+int government_index(const struct government *pgovern);
+int government_number(const struct government *pgovern);
 
 struct government *government_by_number(const int gov);
 struct government *government_of_player(const struct player *pplayer);
diff -Nurd -X.diff_ignore freeciv/common/nation.c freeciv/common/nation.c
--- freeciv/common/nation.c	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/nation.c	2007-08-01 20:12:51.000000000 +0300
@@ -295,7 +295,7 @@
 /**************************************************************************
   Return the nation index.
 **************************************************************************/
-const Nation_type_id nation_number(const struct nation_type *pnation)
+Nation_type_id nation_number(const struct nation_type *pnation)
 {
   assert(pnation);
   return pnation->item_number;
@@ -307,7 +307,7 @@
   Currently same as nation_number(), paired with nation_count()
   indicates use as an array index.
 **************************************************************************/
-const Nation_type_id nation_index(const struct nation_type *pnation)
+Nation_type_id nation_index(const struct nation_type *pnation)
 {
   assert(pnation);
   return pnation - nations;
@@ -316,7 +316,7 @@
 /****************************************************************************
   Return the number of nations.
 ****************************************************************************/
-const Nation_type_id nation_count(void)
+Nation_type_id nation_count(void)
 {
   return game.control.nation_count;
 }
@@ -493,7 +493,7 @@
 /****************************************************************************
   Return the number of nation groups.
 ****************************************************************************/
-const int nation_group_count(void)
+int nation_group_count(void)
 {
   return num_nation_groups;
 }
@@ -501,7 +501,7 @@
 /**************************************************************************
   Return the nation group index.
 **************************************************************************/
-const int nation_group_index(const struct nation_group *pgroup)
+int nation_group_index(const struct nation_group *pgroup)
 {
   assert(pgroup);
   return pgroup - nation_groups;
@@ -510,7 +510,7 @@
 /**************************************************************************
   Return the nation group index.
 **************************************************************************/
-const int nation_group_number(const struct nation_group *pgroup)
+int nation_group_number(const struct nation_group *pgroup)
 {
   assert(pgroup);
   return pgroup->item_number;
diff -Nurd -X.diff_ignore freeciv/common/nation.h freeciv/common/nation.h
--- freeciv/common/nation.h	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/nation.h	2007-08-01 20:09:57.000000000 +0300
@@ -109,9 +109,9 @@
 };
 
 /* General nation accessor functions. */
-const Nation_type_id nation_count(void);
-const Nation_type_id nation_index(const struct nation_type *pnation);
-const Nation_type_id nation_number(const struct nation_type *pnation);
+Nation_type_id nation_count(void);
+Nation_type_id nation_index(const struct nation_type *pnation);
+Nation_type_id nation_number(const struct nation_type *pnation);
 
 struct nation_type *nation_by_number(const Nation_type_id nation);
 struct nation_type *nation_of_player(const struct player *pplayer);
@@ -145,9 +145,9 @@
 			      const char *name);
 
 /* General nation group accessor routines */
-const int nation_group_count(void);
-const int nation_group_index(const struct nation_group *pgroup);
-const int nation_group_number(const struct nation_group *pgroup);
+int nation_group_count(void);
+int nation_group_index(const struct nation_group *pgroup);
+int nation_group_number(const struct nation_group *pgroup);
 
 struct nation_group *nation_group_by_number(int id);
 struct nation_group *find_nation_group_by_rule_name(const char *name);
diff -Nurd -X.diff_ignore freeciv/common/player.c freeciv/common/player.c
--- freeciv/common/player.c	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/player.c	2007-08-01 20:13:35.000000000 +0300
@@ -257,7 +257,7 @@
 /**************************************************************************
   Return the number of players.
 **************************************************************************/
-const int player_count(void)
+int player_count(void)
 {
   return game.info.nplayers;
 }
@@ -268,7 +268,7 @@
   Currently same as player_number(), paired with player_count()
   indicates use as an array index.
 **************************************************************************/
-const int player_index(const struct player *pplayer)
+int player_index(const struct player *pplayer)
 {
   assert(pplayer);
   return pplayer - game.players;
@@ -277,7 +277,7 @@
 /**************************************************************************
   Return the player index.
 **************************************************************************/
-const int player_number(const struct player *pplayer)
+int player_number(const struct player *pplayer)
 {
   assert(pplayer);
   return pplayer->player_no;
diff -Nurd -X.diff_ignore freeciv/common/player.h freeciv/common/player.h
--- freeciv/common/player.h	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/player.h	2007-08-01 20:10:24.000000000 +0300
@@ -202,9 +202,9 @@
 };
 
 /* General player accessor functions. */
-const int player_count(void);
-const int player_index(const struct player *pplayer);
-const int player_number(const struct player *pplayer);
+int player_count(void);
+int player_index(const struct player *pplayer);
+int player_number(const struct player *pplayer);
 
 struct player *player_by_number(const int player_id);
 struct player *valid_player_by_number(const int player_id);
diff -Nurd -X.diff_ignore freeciv/common/team.c freeciv/common/team.c
--- freeciv/common/team.c	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/team.c	2007-08-01 20:14:09.000000000 +0300
@@ -72,7 +72,7 @@
 /**************************************************************************
   Return the number of teams.
 **************************************************************************/
-const int team_count(void)
+int team_count(void)
 {
   return game.info.num_teams;
 }
@@ -83,7 +83,7 @@
   Currently same as team_number(), paired with team_count()
   indicates use as an array index.
 ****************************************************************************/
-const Team_type_id team_index(const struct team *pteam)
+Team_type_id team_index(const struct team *pteam)
 {
   assert(pteam);
   return pteam - teams;
@@ -92,7 +92,7 @@
 /****************************************************************************
   Return the team index.
 ****************************************************************************/
-const Team_type_id team_number(const struct team *pteam)
+Team_type_id team_number(const struct team *pteam)
 {
   assert(pteam);
   return pteam->item_number;
diff -Nurd -X.diff_ignore freeciv/common/team.h freeciv/common/team.h
--- freeciv/common/team.h	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/team.h	2007-08-01 20:10:42.000000000 +0300
@@ -28,9 +28,9 @@
 };
 
 /* General team accessor functions. */
-const Team_type_id team_count(void);
-const Team_type_id team_index(const struct team *pteam);
-const Team_type_id team_number(const struct team *pteam);
+Team_type_id team_count(void);
+Team_type_id team_index(const struct team *pteam);
+Team_type_id team_number(const struct team *pteam);
 
 struct team *team_by_number(const Team_type_id id);
 struct team *find_team_by_rule_name(const char *team_name);
diff -Nurd -X.diff_ignore freeciv/common/terrain.c freeciv/common/terrain.c
--- freeciv/common/terrain.c	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/terrain.c	2007-08-01 20:15:21.000000000 +0300
@@ -102,7 +102,7 @@
 /**************************************************************************
   Return the number of terrains.
 **************************************************************************/
-const Terrain_type_id terrain_count(void)
+Terrain_type_id terrain_count(void)
 {
   return game.control.terrain_count;
 }
@@ -110,7 +110,7 @@
 /**************************************************************************
   Return the terrain identifier.
 **************************************************************************/
-const char terrain_identifier(const struct terrain *pterrain)
+char terrain_identifier(const struct terrain *pterrain)
 {
   assert(pterrain);
   return pterrain->identifier;
@@ -122,7 +122,7 @@
   Currently same as terrain_number(), paired with terrain_count()
   indicates use as an array index.
 **************************************************************************/
-const Terrain_type_id terrain_index(const struct terrain *pterrain)
+Terrain_type_id terrain_index(const struct terrain *pterrain)
 {
   assert(pterrain);
   return pterrain - civ_terrains;
@@ -131,7 +131,7 @@
 /**************************************************************************
   Return the terrain index.
 **************************************************************************/
-const Terrain_type_id terrain_number(const struct terrain *pterrain)
+Terrain_type_id terrain_number(const struct terrain *pterrain)
 {
   assert(pterrain);
   return pterrain->item_number;
@@ -274,7 +274,7 @@
 /**************************************************************************
   Return the resource count.
 **************************************************************************/
-const Resource_type_id resource_count(void)
+Resource_type_id resource_count(void)
 {
   return game.control.resource_count;
 }
@@ -285,7 +285,7 @@
   Currently same as resource_number(), paired with resource_count()
   indicates use as an array index.
 **************************************************************************/
-const Resource_type_id resource_index(const struct resource *presource)
+Resource_type_id resource_index(const struct resource *presource)
 {
   assert(presource);
   return presource - civ_resources;
@@ -294,7 +294,7 @@
 /**************************************************************************
   Return the resource index.
 **************************************************************************/
-const Resource_type_id resource_number(const struct resource *presource)
+Resource_type_id resource_number(const struct resource *presource)
 {
   assert(presource);
   return presource->item_number;
diff -Nurd -X.diff_ignore freeciv/common/terrain.h freeciv/common/terrain.h
--- freeciv/common/terrain.h	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/terrain.h	2007-08-01 20:09:32.000000000 +0300
@@ -206,9 +206,9 @@
 };
 
 /* General terrain accessor functions. */
-const Terrain_type_id terrain_count(void);
-const Terrain_type_id terrain_index(const struct terrain *pterrain);
-const Terrain_type_id terrain_number(const struct terrain *pterrain);
+Terrain_type_id terrain_count(void);
+Terrain_type_id terrain_index(const struct terrain *pterrain);
+Terrain_type_id terrain_number(const struct terrain *pterrain);
 
 struct terrain *terrain_by_number(const Terrain_type_id type);
 
@@ -216,7 +216,7 @@
 struct terrain *find_terrain_by_rule_name(const char *name);
 struct terrain *find_terrain_by_translated_name(const char *name);
 
-const char terrain_identifier(const struct terrain *pterrain);
+char terrain_identifier(const struct terrain *pterrain);
 const char *terrain_rule_name(const struct terrain *pterrain);
 const char *terrain_name_translation(struct terrain *pterrain);
 
@@ -249,9 +249,9 @@
 				     enum mapgen_terrain_property prop);
 
 /* General resource accessor functions. */
-const Resource_type_id resource_count(void);
-const Resource_type_id resource_index(const struct resource *presource);
-const Resource_type_id resource_number(const struct resource *presource);
+Resource_type_id resource_count(void);
+Resource_type_id resource_index(const struct resource *presource);
+Resource_type_id resource_number(const struct resource *presource);
 
 struct resource *resource_by_number(const Resource_type_id id);
 struct resource *find_resource_by_rule_name(const char *name);
diff -Nurd -X.diff_ignore freeciv/common/unittype.c freeciv/common/unittype.c
--- freeciv/common/unittype.c	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/unittype.c	2007-08-01 20:16:09.000000000 +0300
@@ -89,7 +89,7 @@
 /**************************************************************************
   Return the number of unit types.
 **************************************************************************/
-const Unit_type_id utype_count(void)
+Unit_type_id utype_count(void)
 {
   return game.control.num_unit_types;
 }
@@ -100,7 +100,7 @@
   Currently same as utype_number(), paired with utype_count()
   indicates use as an array index.
 **************************************************************************/
-const Unit_type_id utype_index(const struct unit_type *punittype)
+Unit_type_id utype_index(const struct unit_type *punittype)
 {
   assert(punittype);
   return punittype - unit_types;
@@ -109,7 +109,7 @@
 /**************************************************************************
   Return the unit type index.
 **************************************************************************/
-const Unit_type_id utype_number(const struct unit_type *punittype)
+Unit_type_id utype_number(const struct unit_type *punittype)
 {
   assert(punittype);
   return punittype->index;
@@ -901,7 +901,7 @@
 /**************************************************************************
   Return the unit_class count.
 **************************************************************************/
-const Unit_Class_id uclass_count(void)
+Unit_Class_id uclass_count(void)
 {
   return game.control.num_unit_classes;
 }
@@ -912,7 +912,7 @@
   Currently same as uclass_number(), paired with uclass_count()
   indicates use as an array index.
 **************************************************************************/
-const Unit_Class_id uclass_index(const struct unit_class *pclass)
+Unit_Class_id uclass_index(const struct unit_class *pclass)
 {
   assert(pclass);
   return pclass - unit_classes;
@@ -921,7 +921,7 @@
 /**************************************************************************
   Return the unit_class index.
 **************************************************************************/
-const Unit_Class_id uclass_number(const struct unit_class *pclass)
+Unit_Class_id uclass_number(const struct unit_class *pclass)
 {
   assert(pclass);
   return pclass->item_number;
diff -Nurd -X.diff_ignore freeciv/common/unittype.h freeciv/common/unittype.h
--- freeciv/common/unittype.h	2007-08-01 17:17:24.000000000 +0300
+++ freeciv/common/unittype.h	2007-08-01 20:08:41.000000000 +0300
@@ -225,9 +225,9 @@
 			     && (utype_by_number((ut)->index) == (ut))))
 
 /* General unit and unit type (matched) routines */
-const Unit_type_id utype_count(void);
-const Unit_type_id utype_index(const struct unit_type *punittype);
-const Unit_type_id utype_number(const struct unit_type *punittype);
+Unit_type_id utype_count(void);
+Unit_type_id utype_index(const struct unit_type *punittype);
+Unit_type_id utype_number(const struct unit_type *punittype);
 
 struct unit_type *unit_type(const struct unit *punit);
 struct unit_type *utype_by_number(const Unit_type_id id);
@@ -268,9 +268,9 @@
 const char *role_units_translations(int flag);
 
 /* General unit class routines */
-const Unit_Class_id uclass_count(void);
-const Unit_Class_id uclass_index(const struct unit_class *pclass);
-const Unit_Class_id uclass_number(const struct unit_class *pclass);
+Unit_Class_id uclass_count(void);
+Unit_Class_id uclass_index(const struct unit_class *pclass);
+Unit_Class_id uclass_number(const struct unit_class *pclass);
 
 struct unit_class *unit_class(const struct unit *punit);
 struct unit_class *utype_class(const struct unit_type *punittype);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to