Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] (PR#6866) Remove unused variables, remove trailing commas
Home

[Freeciv-Dev] (PR#6866) Remove unused variables, remove trailing commas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#6866) Remove unused variables, remove trailing commas
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Fri, 14 Nov 2003 15:34:24 -0800
Reply-to: rt@xxxxxxxxxxx

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


While I'm sure that the removal of the variables doesn't change the
semantics I'm not sure that the current semantics are correct. So
please check.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  "With a PC, I always felt limited by the software available.
   On Unix, I am limited by my knowledge."
    -- Peter J. Schoenster <pschon@xxxxxxxxxxxxxxxxx>

Index: ai/advdiplomacy.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.c,v
retrieving revision 1.9
diff -u -u -r1.9 advdiplomacy.c
--- ai/advdiplomacy.c   2003/11/13 19:41:09     1.9
+++ ai/advdiplomacy.c   2003/11/14 23:29:43
@@ -156,17 +156,12 @@
 {
   int worth = 0; /* worth for pplayer of what aplayer gives */
   bool give = (pplayer == pclause->from);
-  int receiver, giver;
+  int giver;
   struct ai_dip_intel *adip = &ai->diplomacy.player_intel[aplayer->player_no];
 
   diplomacy_verbose = verbose;
 
   giver = pclause->from->player_no;
-  if (give) {
-    receiver = aplayer->player_no;
-  } else {
-    receiver = pplayer->player_no;
-  }
 
   switch (pclause->type) {
   case CLAUSE_ADVANCE:
Index: ai/advmilitary.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advmilitary.c,v
retrieving revision 1.154
diff -u -u -r1.154 advmilitary.c
--- ai/advmilitary.c    2003/09/23 18:43:23     1.154
+++ ai/advmilitary.c    2003/11/14 23:29:44
@@ -930,7 +930,6 @@
   int bx = 0, by = 0;
   /* Type of the boat (real or a future one) */
   Unit_Type_id boattype = U_LAST;
-  int boatspeed;
   bool go_by_boat;
   /* Is the defender veteran? */
   bool def_vet;
@@ -968,7 +967,6 @@
       boattype = get_role_unit(L_FERRYBOAT, 0);
     }
   }
-  boatspeed = unit_types[boattype].move_rate;
 
   best_choice.want = find_something_to_kill(pplayer, myunit, &x, &y);
 
Index: ai/aiunit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v
retrieving revision 1.301
diff -u -u -r1.301 aiunit.c
--- ai/aiunit.c 2003/11/13 19:41:09     1.301
+++ ai/aiunit.c 2003/11/14 23:29:46
@@ -106,13 +106,11 @@
 {
   struct city *most_needed;
   int comparison;
-  struct city *least_needed;
   struct unit *transported;
 
   do {
     most_needed = NULL;
     comparison = 0;
-    least_needed = NULL;
     transported = NULL;
 
     city_list_iterate(pplayer->cities, pcity) {
Index: common/packets.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.h,v
retrieving revision 1.159
diff -u -u -r1.159 packets.h
--- common/packets.h    2003/11/13 19:41:09     1.159
+++ common/packets.h    2003/11/14 23:29:48
@@ -167,7 +167,7 @@
   AUTH_LOGIN_FIRST,   /* request a password for a returning user */
   AUTH_NEWUSER_FIRST, /* request a password for a new user */
   AUTH_LOGIN_RETRY,   /* inform the client to try a different password */
-  AUTH_NEWUSER_RETRY, /* inform the client to try a different [new] password */
+  AUTH_NEWUSER_RETRY  /* inform the client to try a different [new] password */
 };
 
 /*********************************************************
Index: common/unit.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unit.c,v
retrieving revision 1.187
diff -u -u -r1.187 unit.c
--- common/unit.c       2003/10/29 08:00:39     1.187
+++ common/unit.c       2003/11/14 23:29:49
@@ -576,7 +576,6 @@
 **************************************************************************/
 bool can_unit_paradrop(struct unit *punit)
 {
-  struct city *pcity;
   struct unit_type *utype;
   struct tile *ptile;
 
@@ -595,7 +594,7 @@
   if (tile_has_special(ptile, S_AIRBASE))
     return TRUE;
 
-  if(!(pcity = map_get_city(punit->x, punit->y)))
+  if(!map_get_city(punit->x, punit->y))
     return FALSE;
 
   return TRUE;
Index: common/aicore/path_finding.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/path_finding.h,v
retrieving revision 1.5
diff -u -u -r1.5 path_finding.h
--- common/aicore/path_finding.h        2003/09/25 16:58:00     1.5
+++ common/aicore/path_finding.h        2003/11/14 23:29:50
@@ -264,7 +264,7 @@
 
   /* Assumes that the unit is never lucky in the random rulings and so
    * yields the worst travel time. */
-  TM_WORST_TIME,
+  TM_WORST_TIME
 };
 
 /* Full specification of a position and time to reach it. */
Index: server/airgoto.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/airgoto.c,v
retrieving revision 1.4
diff -u -u -r1.4 airgoto.c
--- server/airgoto.c    2003/02/21 13:23:09     1.4
+++ server/airgoto.c    2003/11/14 23:29:51
@@ -160,7 +160,6 @@
                                        int moves_per_turn, 
                                        int max_moves)
 {
-  struct city *pcity;
   struct tile *ptile;
 
   refuels.list_size = 1;
@@ -170,7 +169,7 @@
 
   whole_map_iterate(x, y) {
     ptile = map_get_tile(x, y);
-    if ((pcity = is_allied_city_tile(ptile, pplayer)) != NULL
+    if (is_allied_city_tile(ptile, pplayer)
        && !is_non_allied_unit_tile(ptile, pplayer) ) {
       add_refuel_point(x, y, FUEL_CITY, 
                        MAP_MAX_HEIGHT + MAP_MAX_WIDTH, 0, FALSE);
Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.240
diff -u -u -r1.240 citytools.c
--- server/citytools.c  2003/11/07 09:45:03     1.240
+++ server/citytools.c  2003/11/14 23:29:52
@@ -1077,19 +1077,14 @@
   int o, x, y;
   struct player *pplayer = city_owner(pcity);
   struct tile *ptile = map_get_tile(pcity->x, pcity->y);
-  bool effect_update, had_palace = pcity->improvements[B_PALACE] != I_NONE;
+  bool had_palace = pcity->improvements[B_PALACE] != I_NONE;
   char *city_name = mystrdup(pcity->name);
 
   gamelog(GAMELOG_LOSEC, _("%s lose %s (%i,%i)"),
          get_nation_name_plural(pplayer->nation), pcity->name, pcity->x,
          pcity->y);
 
-  /* Explicitly remove all improvements, to properly remove any global effects
-     and to handle the preservation of "destroyed" effects. */
-  effect_update=FALSE;
-
   built_impr_iterate(pcity, i) {
-    effect_update = TRUE;
     city_remove_improvement(pcity, i);
   } built_impr_iterate_end;
 
Index: server/ruleset.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/ruleset.c,v
retrieving revision 1.155
diff -u -u -r1.155 ruleset.c
--- server/ruleset.c    2003/10/02 17:54:58     1.155
+++ server/ruleset.c    2003/11/14 23:29:53
@@ -496,10 +496,9 @@
   struct advance *a;
   int num_techs; /* number of techs in the ruleset (means without A_NONE)*/
   int i;
-  char *datafile_options;
   const char *filename = secfile_filename(file);
   
-  datafile_options = check_ruleset_capabilities(file, "+1.9", filename);
+  (void) check_ruleset_capabilities(file, "+1.9", filename);
   sec = secfile_get_secnames_prefix(file, "advance_", &num_techs);
 
   /* Initialize dummy tech A_NONE */
@@ -672,14 +671,12 @@
 **************************************************************************/
 static void load_ruleset_units(struct section_file *file)
 {
-  char *datafile_options;
   struct unit_type *u;
   int i, j, ival, nval;
   char *sval, **slist, **sec;
   const char *filename = secfile_filename(file);
 
-  datafile_options =
-    check_ruleset_capabilities(file, "+1.9", filename);
+  (void) check_ruleset_capabilities(file, "+1.9", filename);
 
   sec = secfile_get_secnames_prefix(file, "unit_", &nval);
 
@@ -988,7 +985,6 @@
 **************************************************************************/
 static void load_ruleset_buildings(struct section_file *file)
 {
-  char *datafile_options;
   char **sec, *item, **list;
   int i, j, k, nval, count;
   bool problem;
@@ -996,7 +992,7 @@
   struct impr_effect *e;
   const char *filename = secfile_filename(file);
 
-  datafile_options = check_ruleset_capabilities(file, "+1.10.1", filename);
+  (void) check_ruleset_capabilities(file, "+1.10.1", filename);
 
   sec = secfile_get_secnames_prefix(file, "building_", &nval);
 
@@ -1359,15 +1355,13 @@
 **************************************************************************/
 static void load_ruleset_terrain(struct section_file *file)
 {
-  char *datafile_options;
   int nval;
   char **sec;
   int i, j;
   struct tile_type *t;
   const char *filename = secfile_filename(file);
 
-  datafile_options =
-    check_ruleset_capabilities(file, "+1.9", filename);
+  (void) check_ruleset_capabilities(file, "+1.9", filename);
 
   /* options */
 
@@ -1552,14 +1546,12 @@
 **************************************************************************/
 static void load_ruleset_governments(struct section_file *file)
 {
-  char *datafile_options;
   int i, j, nval;
   char *c;
   char **sec, **slist;
   const char *filename = secfile_filename(file);
 
-  datafile_options =
-    check_ruleset_capabilities(file, "+1.9", filename);
+  (void) check_ruleset_capabilities(file, "+1.9", filename);
 
   sec = secfile_get_secnames_prefix(file, "government_", &nval);
 
@@ -2060,7 +2052,7 @@
 **************************************************************************/
 static void load_ruleset_nations(struct section_file *file)
 {
-  char *datafile_options, *bad_leader, *g;
+  char *bad_leader, *g;
   struct nation_type *pl;
   struct government *gov;
   int dim, val, i, j, k, nval;
@@ -2068,7 +2060,7 @@
   char **techs, **leaders, **sec, **civilwar_nations;
   const char *filename = secfile_filename(file);
 
-  datafile_options = check_ruleset_capabilities(file, "+1.9", filename);
+  (void) check_ruleset_capabilities(file, "+1.9", filename);
 
   sec = secfile_get_secnames_prefix(file, "nation", &nval);
 
@@ -2338,12 +2330,11 @@
 **************************************************************************/
 static void load_ruleset_cities(struct section_file *file)
 {
-  char *datafile_options;
   char **styles, *replacement;
   int i, nval;
   const char *filename = secfile_filename(file);
 
-  datafile_options = check_ruleset_capabilities(file, "+1.9", filename);
+  (void) check_ruleset_capabilities(file, "+1.9", filename);
 
   /* City Parameters */
 
@@ -2393,13 +2384,12 @@
 static void load_ruleset_game()
 {
   struct section_file file;
-  char *datafile_options;
   char *sval;
   const char *filename;
 
   openload_ruleset_file(&file, "game");
   filename = secfile_filename(&file);
-  datafile_options = check_ruleset_capabilities(&file, "+1.11.1", filename);
+  (void) check_ruleset_capabilities(&file, "+1.11.1", filename);
   (void) section_file_lookup(&file, "datafile.description");   /* unused */
 
   game.rgame.min_city_center_food =

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#6866) Remove unused variables, remove trailing commas, Raimar Falke <=