Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] (PR#13607) gui-xaw: compile-fixes
Home

[Freeciv-Dev] (PR#13607) gui-xaw: compile-fixes

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13607) gui-xaw: compile-fixes
From: "Egor Vyscrebentsov" <evyscr@xxxxxxxxx>
Date: Fri, 12 Aug 2005 11:09:28 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Good daytime!

Yet another compile fix for CVS HEAD gui-xaw.

Thanks, evyscr
Index: client/gui-xaw/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/cityrep.c,v
retrieving revision 1.64
diff -u -r1.64 cityrep.c
--- client/gui-xaw/cityrep.c    4 Aug 2005 17:45:25 -0000       1.64
+++ client/gui-xaw/cityrep.c    12 Aug 2005 17:45:45 -0000
@@ -318,13 +318,12 @@
 {
   XawListReturnStruct *ret=XawListShowCurrent(city_list);
   struct city *pcity;
-  struct city_production production;
 
   if(ret->list_index!=XAW_LIST_NONE && 
      (pcity=cities_in_list[ret->list_index])) {
-    cid cids[U_LAST + B_LAST];
-    struct item items[U_LAST + B_LAST];
-    int cids_used = 0;
+    struct city_production targets[MAX_NUM_PRODUCTION_TARGETS];
+    struct item items[MAX_NUM_PRODUCTION_TARGETS];
+    int targets_used = 0;
     size_t i;
 
     XtSetSensitive(city_change_command, TRUE);
@@ -339,35 +338,33 @@
                                        city_change_command,
                                        NULL);
 
-    impr_type_iterate(i) {
-      if (can_build_improvement(pcity, i)) {
-       production.is_unit = false;
-       production.value = i;
-       cids[cids_used] = cid_encode(production);
-       cids_used++;
+    impr_type_iterate(impr) {
+      if (can_build_improvement(pcity, impr)) {
+       targets[targets_used].is_unit = false;
+       targets[targets_used].value = impr;
+       targets_used++;
       }
     } impr_type_iterate_end;
 
-    unit_type_iterate(i) {
-      if (can_build_unit(pcity, i)) {
-       production.is_unit = true;
-       production.value = i->index;
-       cids[cids_used] = cid_encode(production);
-       cids_used++;
+    unit_type_iterate(punittype) {
+      if (can_build_unit(pcity, punittype)) {
+       targets[targets_used].is_unit = true;
+       targets[targets_used].value = punittype->index;
+       targets_used++;
       }
     } unit_type_iterate_end;
 
-    name_and_sort_items(cids, cids_used, items, TRUE, NULL);
+    name_and_sort_items(targets, targets_used, items, TRUE, NULL);
     
-    for (i = 0; i < cids_used; i++) {
+    for (i = 0; i < targets_used; i++) {
       Widget entry =
          XtVaCreateManagedWidget(items[i].descr, smeBSBObjectClass,
                                  city_popupmenu, NULL);
       XtAddCallback(entry, XtNcallback, city_change_callback,
-                   INT_TO_XTPOINTER(items[i].cid));
+                   INT_TO_XTPOINTER(cid_encode(items[i].item)));
     }
 
-    if (cids_used == 0)
+    if (targets_used == 0)
       XtSetSensitive(city_change_command, FALSE);
   } else {
     XtSetSensitive(city_change_command, FALSE);
@@ -1064,8 +1061,8 @@
       return;
     }
 
-  client_change_all(state->fr_cids[state->fr_index],
-                   state->to_cids[state->to_index]);
+  client_change_all(cid_decode(state->fr_cids[state->fr_index]),
+                   cid_decode(state->to_cids[state->to_index]));
 
   XtDestroyWidget (state->w.shell);
 }
@@ -1079,23 +1076,23 @@
                                            XtPointer call_data)
 {
   struct chgall_data *state = (struct chgall_data *) client_data;
-  cid cids[U_LAST + B_LAST];
-  struct item items[U_LAST + B_LAST];
+  struct city_production targets[MAX_NUM_PRODUCTION_TARGETS];
+  struct item items[MAX_NUM_PRODUCTION_TARGETS];
   int i;
 
-  state->fr_count = collect_currently_building_targets(cids);
-  name_and_sort_items(cids, state->fr_count, items, FALSE, NULL);
+  state->fr_count = collect_currently_building_targets(targets);
+  name_and_sort_items(targets, state->fr_count, items, false, NULL);
   for (i = 0; i < state->fr_count; i++) {
     state->fr_list[i] = mystrdup(items[i].descr);
-    state->fr_cids[i] = items[i].cid;
+    state->fr_cids[i] = cid_encode(items[i].item);
   }
   XawListChange(state->w.fr, state->fr_list, state->fr_count, 0, FALSE);
 
-  state->to_count = collect_buildable_targets(cids);
-  name_and_sort_items(cids, state->to_count, items, TRUE, NULL);
+  state->to_count = collect_buildable_targets(targets);
+  name_and_sort_items(targets, state->to_count, items, TRUE, NULL);
   for (i = 0; i < state->to_count; i++) {
     state->to_list[i] = mystrdup(items[i].descr);
-    state->to_cids[i] = items[i].cid;
+    state->to_cids[i] = cid_encode(items[i].item);
   }
   XawListChange(state->w.to, state->to_list, state->to_count, 0, FALSE);
 
Index: client/gui-xaw/menu.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.c,v
retrieving revision 1.84
diff -u -r1.84 menu.c
--- client/gui-xaw/menu.c       1 Aug 2005 22:38:25 -0000       1.84
+++ client/gui-xaw/menu.c       12 Aug 2005 17:45:46 -0000
@@ -110,8 +110,7 @@
     { { N_("Message Options"), 0      },      "", MENU_GAME_MSG_OPTIONS, 0 },
     { { N_("Save Settings"), 0        },      "", MENU_GAME_SAVE_SETTINGS, 0 },
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
-    { { N_("Server Opt initial"), 0   },      "", MENU_GAME_SERVER_OPTIONS1, 0 
},
-    { { N_("Server Opt ongoing"), 0   },      "", MENU_GAME_SERVER_OPTIONS2, 0 
},
+    { { N_("Server Options"), 0       },      "", MENU_GAME_SERVER_OPTIONS, 0 
},
     { { 0                             },      "", MENU_SEPARATOR_LINE, 0 },
     { { N_("Export Log"), 0           },      "", MENU_GAME_OUTPUT_LOG, 0 },
     { { N_("Clear Log"), 0            },      "", MENU_GAME_CLEAR_OUTPUT, 0 },
@@ -277,8 +276,7 @@
     menu_entry_sensitive(MENU_GAME, MENU_GAME_OPTIONS, 0);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_MSG_OPTIONS, 0);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_SAVE_SETTINGS, 0);
-    menu_entry_sensitive(MENU_GAME, MENU_GAME_SERVER_OPTIONS1, 1);
-    menu_entry_sensitive(MENU_GAME, MENU_GAME_SERVER_OPTIONS2, 1);
+    menu_entry_sensitive(MENU_GAME, MENU_GAME_SERVER_OPTIONS, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_OUTPUT_LOG, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_CLEAR_OUTPUT, 1);
   }
@@ -353,8 +351,7 @@
     menu_entry_sensitive(MENU_GAME, MENU_GAME_OPTIONS, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_MSG_OPTIONS, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_SAVE_SETTINGS, 1);
-    menu_entry_sensitive(MENU_GAME, MENU_GAME_SERVER_OPTIONS1, 1);
-    menu_entry_sensitive(MENU_GAME, MENU_GAME_SERVER_OPTIONS2, 1);
+    menu_entry_sensitive(MENU_GAME, MENU_GAME_SERVER_OPTIONS, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_OUTPUT_LOG, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_CLEAR_OUTPUT, 1);
     menu_entry_sensitive(MENU_GAME, MENU_GAME_DISCONNECT, 1);
@@ -515,11 +512,8 @@
   case MENU_GAME_SAVE_SETTINGS:
     save_options();
     break;
-  case MENU_GAME_SERVER_OPTIONS1:
-    send_report_request(REPORT_SERVER_OPTIONS1);
-    break;
-  case MENU_GAME_SERVER_OPTIONS2:
-    send_report_request(REPORT_SERVER_OPTIONS2);
+  case MENU_GAME_SERVER_OPTIONS:
+    popup_settable_options_dialog();
     break;
   case MENU_GAME_OUTPUT_LOG:
     log_output_window();
Index: client/gui-xaw/menu.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/menu.h,v
retrieving revision 1.20
diff -u -r1.20 menu.h
--- client/gui-xaw/menu.h       25 Aug 2004 18:12:20 -0000      1.20
+++ client/gui-xaw/menu.h       12 Aug 2005 17:45:46 -0000
@@ -36,8 +36,7 @@
   MENU_GAME_OPTIONS,
   MENU_GAME_MSG_OPTIONS,
   MENU_GAME_SAVE_SETTINGS,
-  MENU_GAME_SERVER_OPTIONS1,
-  MENU_GAME_SERVER_OPTIONS2,
+  MENU_GAME_SERVER_OPTIONS,
   MENU_GAME_OUTPUT_LOG,
   MENU_GAME_CLEAR_OUTPUT,
   MENU_GAME_DISCONNECT,

[Prev in Thread] Current Thread [Next in Thread]