Author: cazfi
Date: Thu Nov 19 18:00:06 2015
New Revision: 30689

URL: http://svn.gna.org/viewcvs/freeciv?rev=30689&view=rev
Log:
Fixed fair generator gcc-4.2 warnings.

See bug #24088

Modified:
    trunk/server/generator/mapgen.c

Modified: trunk/server/generator/mapgen.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/generator/mapgen.c?rev=30689&r1=30688&r2=30689&view=diff
==============================================================================
--- trunk/server/generator/mapgen.c     (original)
+++ trunk/server/generator/mapgen.c     Thu Nov 19 18:00:06 2015
@@ -3463,7 +3463,7 @@
   int players_per_island = 1;
   int teams_num = 0, team_players_num = 0, single_players_num = 0;
   int i, iter = CLIP(1, 100000 / map_num_tiles(), 10);
-  bool done;
+  bool done = FALSE;
 
   teams_iterate(pteam) {
     i = player_list_size(team_members(pteam));
@@ -3585,9 +3585,10 @@
   log_debug("playermass=%d, islandmass1=%d, islandmass2=%d, islandmass3=%d",
             playermass, islandmass1, islandmass2, islandmass3);
 
+  pmap = fair_map_new();
+
   while (--iter >= 0) {
     done = TRUE;
-    pmap = fair_map_new();
 
     whole_map_iterate(ptile) {
       struct fair_tile *pftile = pmap + tile_index(ptile);
@@ -3749,6 +3750,7 @@
     }
 
     fair_map_destroy(pmap);
+    pmap = fair_map_new();
 
     /* Decrease land mass, for better chances. */
     islandmass1 = (islandmass1 * 99) / 100;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to