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

Begasus wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=39947 >
> 
> Third (second one went to [EMAIL PROTECTED] as stated on the bugs site) try, 
> seems the previous one ended up in a fixed ticket (sorry for 
> that). This fix lets the build (sdl) compile completly (checked with the 
> trunk checkout r14131)

Here's 2 separate patches for the 2 types of fixes.

The "init" patch is rather ugly.  gcc-2.95 doesn't accept general c99 
initializers; by patching it this way we make it so that it is valid c99 
but still works in gcc 2.95.

-jason

Index: server/cityturn.c
===================================================================
--- server/cityturn.c	(revision 14131)
+++ server/cityturn.c	(working copy)
@@ -638,7 +638,7 @@
   if (valid_improvement(choice.value.building)) {
     struct universal target = {
       .kind = VUT_IMPROVEMENT,
-      .value.building = choice.value.building
+      .value = {.building = choice.value.building}
     };
 
     change_build_target(pplayer, pcity, target, E_IMP_AUTO);
@@ -651,7 +651,7 @@
 	&& !building_has_effect(pimprove, EFT_CAPITAL_CITY)) {
       struct universal target = {
         .kind = VUT_IMPROVEMENT,
-        .value.building = pimprove
+        .value = {.building = pimprove}
       };
 
       change_build_target(pplayer, pcity, target, E_IMP_AUTO);
Index: common/effects.c
===================================================================
--- common/effects.c	(revision 14131)
+++ common/effects.c	(working copy)
@@ -539,7 +539,7 @@
   struct universal source = {
     .kind = VUT_IMPROVEMENT,
     /* just to bamboozle the annoying compiler warning */
-    .value.building = improvement_by_number(improvement_number(pimprove))
+    .value = {.building = improvement_by_number(improvement_number(pimprove))}
   };
   struct effect_list *plist = get_req_source_effects(&source);
 
@@ -694,7 +694,7 @@
   struct effect_list *plist;
   struct universal source = {
     .kind = VUT_IMPROVEMENT,
-    .value.building = pimprove
+    .value = {.building = pimprove}
   };
 
   /* A capitalization production is never redundant. */
@@ -1011,7 +1011,7 @@
     struct impr_type *building = pcity->production.value.building;
     struct universal source = {
       .kind = VUT_IMPROVEMENT,
-      .value.building = building
+      .value = {.building = building}
     };
     struct effect_list *plist = get_req_source_effects(&source);
     int power = 0;
Index: ai/aicity.c
===================================================================
--- ai/aicity.c	(revision 14131)
+++ ai/aicity.c	(working copy)
@@ -793,7 +793,7 @@
   struct government *gov = government_of_player(pplayer);
   struct universal source = {
     .kind = VUT_IMPROVEMENT,
-    .value.building = pimprove
+    .value = {.building = pimprove}
   };
   const bool is_coinage = improvement_has_flag(pimprove, IF_GOLD);
 
Index: ai/aidata.c
===================================================================
--- ai/aidata.c	(revision 14131)
+++ ai/aidata.c	(working copy)
@@ -66,7 +66,7 @@
   improvement_iterate(pimprove) {
     struct universal source = {
       .kind = VUT_IMPROVEMENT,
-      .value.building = pimprove
+      .value = {.building = pimprove}
     };
 
     ai->impr_calc[improvement_index(pimprove)] = AI_IMPR_ESTIMATE;
Index: client/helpdata.c
===================================================================
--- client/helpdata.c	(revision 14131)
+++ client/helpdata.c	(working copy)
@@ -657,7 +657,7 @@
 {
   struct universal source = {
     .kind = VUT_IMPROVEMENT,
-    .value.building = pimprove
+    .value = {.building = pimprove}
   };
 
   assert(buf);
@@ -1084,7 +1084,7 @@
   struct advance *vap = valid_advance_by_number(i);
   struct universal source = {
     .kind = VUT_ADVANCE,
-    .value.advance = vap
+    .value = {.advance = vap}
   };
 
   assert(buf&&user_text);
@@ -1173,7 +1173,7 @@
 {
   struct universal source = {
     .kind = VUT_TERRAIN,
-    .value.terrain = pterrain
+    .value = {.terrain = pterrain}
   };
   buf[0] = '\0';
   
@@ -1229,7 +1229,7 @@
 {
   struct universal source = {
     .kind = VUT_GOVERNMENT,
-    .value.govern = gov
+    .value = {.govern = gov}
   };
 
   buf[0] = '\0';
Index: client/mapctrl_common.c
===================================================================
--- client/mapctrl_common.c	(revision 14131)
+++ client/mapctrl_common.c	(working copy)
@@ -60,7 +60,7 @@
 /* The mapcanvas clipboard */
 struct universal clipboard =
 { .kind = VUT_NONE,
-  .value.building = NULL
+  .value = {.building = NULL}
 };
 
 /* Goto with drag and drop. */
Index: client/climisc.c
===================================================================
--- client/climisc.c	(revision 14131)
+++ client/climisc.c	(working copy)
@@ -460,7 +460,7 @@
 {
   struct universal target = {
     .kind = VUT_UTYPE,
-    .value.utype = punittype};
+    .value = {.utype = punittype}};
 
   return cid_encode(target);
 }
@@ -472,7 +472,7 @@
 {
   struct universal target = {
     .kind = VUT_IMPROVEMENT,
-    .value.building = pimprove
+    .value = {.building = pimprove}
   };
 
   return cid_encode(target);
Index: server/savegame.c
===================================================================
--- server/savegame.c	(revision 14131)
+++ server/savegame.c	(working copy)
@@ -3000,9 +3000,10 @@
 
   i = -1;
   unit_list_iterate(plr->units, punit) {
-    i++;
     int activity;
 
+    i++;
+
     secfile_insert_int(file, punit->id, "player%d.u%d.id", plrno, i);
     secfile_insert_int(file, punit->tile->nat_x, "player%d.u%d.x", plrno, i);
     secfile_insert_int(file, punit->tile->nat_y, "player%d.u%d.y", plrno, i);
Index: client/tilespec.c
===================================================================
--- client/tilespec.c	(revision 14131)
+++ client/tilespec.c	(working copy)
@@ -4214,6 +4214,7 @@
   struct drawn_sprite *save_sprs = sprs;
   struct player *owner = NULL;
   struct base_type *pbase = NULL;
+  bool do_draw_unit, solid_bg;
 
   if (ptile != NULL) {
     pbase = tile_get_base(ptile);
@@ -4221,13 +4222,13 @@
 
   /* Unit drawing is disabled if the view options is turned off, but only
    * if we're drawing on the mapview. */
-  bool do_draw_unit = (punit && (draw_units || !ptile
-				 || (draw_focus_unit
-				     && unit_is_in_focus(punit))));
-  bool solid_bg = (solid_color_behind_units
-		   && (do_draw_unit
-		       || (pcity && draw_cities)
-		       || (ptile && !draw_terrain)));
+  do_draw_unit = (punit && (draw_units || !ptile
+			    || (draw_focus_unit
+				&& unit_is_in_focus(punit))));
+  solid_bg = (solid_color_behind_units
+	      && (do_draw_unit
+		  || (pcity && draw_cities)
+		  || (ptile && !draw_terrain)));
 
   if (citymode) {
     int count = 0, i, cx, cy;
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to