Author: cazfi
Date: Fri Aug 28 22:03:53 2015
New Revision: 29713

URL: http://svn.gna.org/viewcvs/freeciv?rev=29713&view=rev
Log:
Fixed -Wshadow warnings from xaw-client specific code.

See patch #6297

Modified:
    branches/S2_6/client/gui-xaw/citydlg.c
    branches/S2_6/client/gui-xaw/cityrep.c
    branches/S2_6/client/gui-xaw/cma_fe.c
    branches/S2_6/client/gui-xaw/dialogs.c
    branches/S2_6/client/gui-xaw/finddlg.c
    branches/S2_6/client/gui-xaw/gotodlg.c
    branches/S2_6/client/gui-xaw/mapview.c
    branches/S2_6/client/gui-xaw/wldlg.c
    branches/S2_6/client/gui-xaw/xaw_actions.c
    branches/S2_6/client/gui-xaw/xaw_actions.h

Modified: branches/S2_6/client/gui-xaw/citydlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/citydlg.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/citydlg.c      (original)
+++ branches/S2_6/client/gui-xaw/citydlg.c      Fri Aug 28 22:03:53 2015
@@ -1591,14 +1591,14 @@
 *****************************************************************/
 void city_dialog_update_citizens(struct city_dialog *pdialog)
 {
-  enum citizen_category citizens[MAX_CITY_SIZE];
+  enum citizen_category categories[MAX_CITY_SIZE];
   int i;
   struct city *pcity=pdialog->pcity;
-  int num_citizens = get_city_citizen_types(pcity, FEELING_FINAL, citizens);
+  int num_citizens = get_city_citizen_types(pcity, FEELING_FINAL, categories);
 
   for (i = 0; i < num_citizens && i < pdialog->num_citizens_shown; i++) {
     xaw_set_bitmap(pdialog->citizen_labels[i],
-                  get_citizen_pixmap(citizens[i], i, pcity));
+                  get_citizen_pixmap(categories[i], i, pcity));
 
     /* HACK: set sensitivity/callbacks on the widget */
     XtRemoveAllCallbacks(pdialog->citizen_labels[i], XtNcallback);
@@ -1834,7 +1834,7 @@
 {
   char buf[512];
   String now;
-  
+
   fc_snprintf(buf, sizeof(buf), _("%s - %s citizens  Governor: %s"),
              city_name(pdialog->pcity),
              population_to_text(city_population(pdialog->pcity)),

Modified: branches/S2_6/client/gui-xaw/cityrep.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/cityrep.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/cityrep.c      (original)
+++ branches/S2_6/client/gui-xaw/cityrep.c      Fri Aug 28 22:03:53 2015
@@ -813,12 +813,11 @@
 /**************************************************************************
 ...
 **************************************************************************/
-
-static void popup_chgall_dialog (Widget parent)
+static void popup_chgall_dialog(Widget parent)
 {
   struct chgall_data *state;
   Widget shell;
-  Widget main_form;
+  Widget chgall_main;
   Widget fr_viewport;
   Widget to_viewport;
   Position x, y;
@@ -859,7 +858,7 @@
   XtAddCallback (state->w.shell, XtNdestroyCallback,
                 chgall_shell_destroy, state);
 
-  main_form =
+  chgall_main =
     XtVaCreateManagedWidget
     (
      "chgallform",
@@ -873,7 +872,7 @@
     (
      "chgallfrviewport",
      viewportWidgetClass,
-     main_form,
+     chgall_main,
      NULL
     );
 
@@ -891,7 +890,7 @@
     (
      "chgalltoviewport",
      viewportWidgetClass,
-     main_form,
+     chgall_main,
      NULL
     );
 
@@ -909,7 +908,7 @@
     (
      "chgallchangecommand",
      commandWidgetClass,
-     main_form,
+     chgall_main,
      NULL
     ));
 
@@ -918,7 +917,7 @@
     (
      "chgallrefreshcommand",
      commandWidgetClass,
-     main_form,
+     chgall_main,
      NULL
     ));
 
@@ -927,7 +926,7 @@
     (
      "chgallcancelcommand",
      commandWidgetClass,
-     main_form,
+     chgall_main,
      NULL
     ));
 

Modified: branches/S2_6/client/gui-xaw/cma_fe.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/cma_fe.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/cma_fe.c       (original)
+++ branches/S2_6/client/gui-xaw/cma_fe.c       Fri Aug 28 22:03:53 2015
@@ -188,14 +188,14 @@
 
   /* Create scrollbars in the minimal surplus column. */
   prev = surplus_header;
-  output_type_iterate(i) {
-    surplus_slider[i] = 
+  output_type_iterate(o) {
+    surplus_slider[o] =
       XtVaCreateManagedWidget("cmapresetscroll",
-                                  scrollbarWidgetClass, form,
-                                  XtNfromHoriz, stat_surplus_label[i],
-                                  XtNfromVert, prev,
-                                  NULL);
-    prev = stat_surplus_label[i];
+                              scrollbarWidgetClass, form,
+                              XtNfromHoriz, stat_surplus_label[o],
+                              XtNfromVert, prev,
+                              NULL);
+    prev = stat_surplus_label[o];
   } output_type_iterate_end;
 
   celebrate_toggle = 
@@ -307,10 +307,10 @@
   XtAddCallback(close_button, XtNcallback,
                 close_callback, NULL);
 
-  output_type_iterate(i) {
-    XtAddCallback(surplus_slider[i], XtNscrollProc,
+  output_type_iterate(o) {
+    XtAddCallback(surplus_slider[o], XtNscrollProc,
                   sliders_scroll_callback, NULL);
-    XtAddCallback(surplus_slider[i], XtNjumpProc,
+    XtAddCallback(surplus_slider[o], XtNjumpProc,
                   sliders_jump_callback, NULL);
   } output_type_iterate_end;
 
@@ -324,8 +324,8 @@
   /* Update dialog with CMA parameters from city.  */
   cmafec_get_fe_parameter(current_city, &parameter);
 
-  output_type_iterate(i) {
-    minimal_surplus[i] = parameter.minimal_surplus[i];
+  output_type_iterate(o) {
+    minimal_surplus[o] = parameter.minimal_surplus[o];
   } output_type_iterate_end;
 
   XtVaSetValues(celebrate_toggle, 
@@ -338,8 +338,8 @@
     factors[O_LAST] = 1;
   }
 
-  output_type_iterate(i) {
-    factors[i] = parameter.factor[i];
+  output_type_iterate(o) {
+    factors[o] = parameter.factor[o];
   } output_type_iterate_end;
 
   set_slider_values();
@@ -351,9 +351,9 @@
   XtVaSetValues(result_label, XtNwidth, 360, NULL);
   XtVaSetValues(result_label, XtNheight, 110, NULL);
 
-  output_type_iterate(i) {
-    XtVaSetValues(stat_surplus_label[i], XtNwidth, 90, NULL);
-    XtVaSetValues(stat_factor_label[i], XtNwidth, 90, NULL);
+  output_type_iterate(o) {
+    XtVaSetValues(stat_surplus_label[o], XtNwidth, 90, NULL);
+    XtVaSetValues(stat_factor_label[o], XtNwidth, 90, NULL);
   } output_type_iterate_end;
   /* FIXME! Now we assume that output_type_iterate ends with O_LAST. */
   XtVaSetValues(stat_factor_label[O_LAST], XtNwidth, 90, NULL);
@@ -549,9 +549,9 @@
 {
   int i;
   
-  output_type_iterate(i) {
-    XawScrollbarSetThumb(surplus_slider[i],
-                     (((20 + minimal_surplus[i])))*1/41.0f, 1/41.0f);
+  output_type_iterate(o) {
+    XawScrollbarSetThumb(surplus_slider[o],
+                         (((20 + minimal_surplus[o])))*1/41.0f, 1/41.0f);
   } output_type_iterate_end;
 
   for (i = 0; i < (O_LAST + 1); i++) { 
@@ -576,17 +576,17 @@
 
   result = cm_result_new(current_city);
 
-  output_type_iterate(i) {
-    if (w == surplus_slider[i]) {
+  output_type_iterate(o) {
+    if (w == surplus_slider[o]) {
       if (pos > 0 ) {
-        minimal_surplus[i]++;
-        if (minimal_surplus[i] == 21) {
-          minimal_surplus[i]--;
+        minimal_surplus[o]++;
+        if (minimal_surplus[o] == 21) {
+          minimal_surplus[o]--;
         }
       } else {
-        minimal_surplus[i]--;
-        if (minimal_surplus[i] == -21) {
-          minimal_surplus[i]++;
+        minimal_surplus[o]--;
+        if (minimal_surplus[o] == -21) {
+          minimal_surplus[o]++;
         }
       }
     }
@@ -610,9 +610,9 @@
 
   cmafec_get_fe_parameter(current_city, &parameter);
 
-  output_type_iterate(i) {
-    parameter.minimal_surplus[i] = minimal_surplus[i];
-    parameter.factor[i] = factors[i];
+  output_type_iterate(o) {
+    parameter.minimal_surplus[o] = minimal_surplus[o];
+    parameter.factor[o] = factors[o];
   } output_type_iterate_end;
 
   XtVaGetValues(celebrate_toggle, XtNstate, &parameter.require_happy, NULL);
@@ -658,10 +658,10 @@
 
   result = cm_result_new(current_city);
 
-  output_type_iterate(i) {
-    if (w == surplus_slider[i]) {
+  output_type_iterate(o) {
+    if (w == surplus_slider[o]) {
       /* convert from percent to [-20..20] */
-      minimal_surplus[i] = (int)(percent * 41) - 20;
+      minimal_surplus[o] = (int)(percent * 41) - 20;
     }
   } output_type_iterate_end;
 
@@ -674,9 +674,9 @@
 
   cmafec_get_fe_parameter(current_city, &parameter);
 
-  output_type_iterate(i) {
-    parameter.minimal_surplus[i] = minimal_surplus[i];
-    parameter.factor[i] = factors[i];
+  output_type_iterate(o) {
+    parameter.minimal_surplus[o] = minimal_surplus[o];
+    parameter.factor[o] = factors[o];
   } output_type_iterate_end;
 
   XtVaGetValues(celebrate_toggle, XtNstate, &parameter.require_happy, NULL);

Modified: branches/S2_6/client/gui-xaw/dialogs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/dialogs.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/dialogs.c      (original)
+++ branches/S2_6/client/gui-xaw/dialogs.c      Fri Aug 28 22:03:53 2015
@@ -331,7 +331,7 @@
                               const struct text_tag_list *tags,
                               struct tile *ptile)
 {
-  Widget notify_dialog_shell, notify_form, notify_command, notify_goto_command;
+  Widget notify_gdialog_shell, notify_form, notify_command, 
notify_goto_command;
   Widget notify_headline, notify_label;
   Dimension width, width2, width_1, width_2;
   
@@ -339,13 +339,13 @@
     popup_notify_dialog("Message:", headline, lines);
     return;
   }
-  notify_dialog_shell = XtCreatePopupShell("Message:",
-                                          transientShellWidgetClass,
-                                          toplevel, NULL, 0);
-
-  notify_form = XtVaCreateManagedWidget("notifyform", 
-                                        formWidgetClass, 
-                                        notify_dialog_shell, NULL);
+  notify_gdialog_shell = XtCreatePopupShell("Message:",
+                                            transientShellWidgetClass,
+                                            toplevel, NULL, 0);
+
+  notify_form = XtVaCreateManagedWidget("notifyform",
+                                        formWidgetClass, 
+                                        notify_gdialog_shell, NULL);
 
   notify_headline=XtVaCreateManagedWidget("notifyheadline", 
                          labelWidgetClass, notify_form, 
@@ -381,8 +381,8 @@
   XtAddCallback(notify_command, XtNcallback, notify_no_goto_command_callback, 
NULL);
   XtAddCallback(notify_goto_command, XtNcallback, 
notify_goto_command_callback, NULL);
   notify_goto_add_widget_tile(notify_goto_command, ptile);
-  xaw_set_relative_position(toplevel, notify_dialog_shell, 25, 5);
-  XtPopup(notify_dialog_shell, XtGrabNone);
+  xaw_set_relative_position(toplevel, notify_gdialog_shell, 25, 5);
+  XtPopup(notify_gdialog_shell, XtGrabNone);
   /*  XtSetSensitive(toplevel, FALSE); */
 }
 

Modified: branches/S2_6/client/gui-xaw/finddlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/finddlg.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/finddlg.c      (original)
+++ branches/S2_6/client/gui-xaw/finddlg.c      Fri Aug 28 22:03:53 2015
@@ -150,7 +150,7 @@
 /**************************************************************************
 ...
 **************************************************************************/
-void update_find_dialog(Widget find_list)
+void update_find_dialog(Widget search_list)
 {
   int j = 0;
 
@@ -167,9 +167,9 @@
     } city_list_iterate_end;
   } players_iterate_end;
   
-  if(ncities_total) {
+  if (ncities_total) {
     qsort(city_name_ptrs, ncities_total, sizeof(char *), compare_strings_ptrs);
-    XawListChange(find_list, city_name_ptrs, ncities_total, 0, True);
+    XawListChange(search_list, city_name_ptrs, ncities_total, 0, True);
   }
 }
 
@@ -197,8 +197,8 @@
 {
   struct city *pcity;
   XawListReturnStruct *ret;
-  
-  ret=XawListShowCurrent(find_list);
+
+  ret = XawListShowCurrent(find_list);
 
   if (ret->list_index != XAW_LIST_NONE) {
     if ((pcity = game_city_by_name(ret->string))) {

Modified: branches/S2_6/client/gui-xaw/gotodlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/gotodlg.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/gotodlg.c      (original)
+++ branches/S2_6/client/gui-xaw/gotodlg.c      Fri Aug 28 22:03:53 2015
@@ -207,7 +207,7 @@
 /**************************************************************************
 ...
 **************************************************************************/
-void update_goto_dialog(Widget goto_list)
+void update_goto_dialog(Widget goto_cities)
 {
   int j = 0;
   Boolean all_cities;
@@ -220,7 +220,7 @@
 
   cleanup_goto_list();
 
-  if(all_cities) {
+  if (all_cities) {
     ncities_total = 0;
     players_iterate(pplayer) {
       ncities_total += city_list_size(pplayer->cities);
@@ -229,7 +229,7 @@
     ncities_total = city_list_size(client.conn.playing->cities);
   }
 
-  city_name_ptrs=fc_malloc(ncities_total*sizeof(char*));
+  city_name_ptrs = fc_malloc(ncities_total*sizeof(char*));
   
   players_iterate(pplayer) {
     if (!all_cities && pplayer != client.conn.playing) {
@@ -246,9 +246,9 @@
     } city_list_iterate_end;
   } players_iterate_end;
 
-  if(ncities_total) {
+  if (ncities_total) {
     qsort(city_name_ptrs, ncities_total, sizeof(char *), compare_strings_ptrs);
-    XawListChange(goto_list, city_name_ptrs, ncities_total, 0, True);
+    XawListChange(goto_cities, city_name_ptrs, ncities_total, 0, True);
   }
 }
 
@@ -269,12 +269,15 @@
 void goto_list_callback(Widget w, XtPointer client_data, XtPointer call_data)
 {
   XawListReturnStruct *ret;
-  ret=XawListShowCurrent(goto_list);
-  
+
+  ret = XawListShowCurrent(goto_list);
+
   if (ret->list_index != XAW_LIST_NONE) {
     struct city *pdestcity;
+
     if ((pdestcity = get_selected_city())) {
       bool can_airlift = FALSE;
+
       unit_list_iterate(get_units_in_focus(), punit) {
         if (unit_can_airlift_to(punit, pdestcity)) {
          can_airlift = TRUE;

Modified: branches/S2_6/client/gui-xaw/mapview.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/mapview.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/mapview.c      (original)
+++ branches/S2_6/client/gui-xaw/mapview.c      Fri Aug 28 22:03:53 2015
@@ -690,22 +690,22 @@
 Draw at x = left of string, y = top of string.
 **************************************************************************/
 static void draw_shadowed_string(struct canvas *pcanvas,
-                                XFontSet fontset, GC font_gc,
-                                struct color *foreground,
-                                struct color *shadow,
-                                int x, int y, const char *string)
+                                 XFontSet fontset, GC fgc,
+                                 struct color *foreground,
+                                 struct color *shadow,
+                                 int x, int y, const char *string)
 {
   size_t len = strlen(string);
 
   y -= XExtentsOfFontSet(fontset)->max_logical_extent.y;
 
-  XSetForeground(display, font_gc, shadow->color.pixel);
-  XmbDrawString(display, pcanvas->pixmap, fontset, font_gc,
-      x + 1, y + 1, string, len);
-
-  XSetForeground(display, font_gc, foreground->color.pixel);
-  XmbDrawString(display, pcanvas->pixmap, fontset, font_gc,
-      x, y, string, len);
+  XSetForeground(display, fgc, shadow->color.pixel);
+  XmbDrawString(display, pcanvas->pixmap, fontset, fgc,
+                x + 1, y + 1, string, len);
+
+  XSetForeground(display, fgc, foreground->color.pixel);
+  XmbDrawString(display, pcanvas->pixmap, fontset, fgc,
+                x, y, string, len);
 }
 
 static XFontSet *fonts[FONT_COUNT] = {&main_font_set, &prod_font_set};

Modified: branches/S2_6/client/gui-xaw/wldlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/wldlg.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/wldlg.c        (original)
+++ branches/S2_6/client/gui-xaw/wldlg.c        Fri Aug 28 22:03:53 2015
@@ -801,10 +801,10 @@
 
 *****************************************************************/
 void insert_into_worklist(struct worklist_dialog *pdialog,
-                         int before, cid cid)
+                          int before, cid id)
 {
   int i, first_free;
-  struct universal target = cid_decode(cid);
+  struct universal target = cid_decode(id);
 
   /* If this worklist is a city worklist, double check that the city
      really can (eventually) build the target.  We've made sure that
@@ -847,7 +847,7 @@
   pdialog->worklist_ids[first_free] = WORKLIST_END;
   pdialog->worklist_names_ptrs[first_free] = NULL;
 
-  pdialog->worklist_ids[before] = cid;
+  pdialog->worklist_ids[before] = id;
   
   worklist_id_to_name(pdialog->worklist_names[before],
                      target, pdialog->pcity);
@@ -1136,9 +1136,10 @@
   pdialog=(struct worklist_dialog *)client_data;
 
   ret = XawListShowCurrent(pdialog->worklist);
-  if(ret->list_index!=XAW_LIST_NONE) {
-    cid cid = pdialog->worklist_ids[ret->list_index];
-    production = cid_decode(cid);
+  if (ret->list_index != XAW_LIST_NONE) {
+    cid id = pdialog->worklist_ids[ret->list_index];
+
+    production = cid_decode(id);
   } else {
     production.kind = VUT_NONE;
     production.value.building = NULL;

Modified: branches/S2_6/client/gui-xaw/xaw_actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/xaw_actions.c?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/xaw_actions.c  (original)
+++ branches/S2_6/client/gui-xaw/xaw_actions.c  Fri Aug 28 22:03:53 2015
@@ -1045,7 +1045,7 @@
 
/*******************************************************************************
  Initialize our Actions!!
 
*******************************************************************************/
-void InitializeActions (XtAppContext app_context)
-{
-  XtAppAddActions(app_context, Actions, XtNumber(Actions));
-}
+void InitializeActions(XtAppContext context)
+{
+  XtAppAddActions(context, Actions, XtNumber(Actions));
+}

Modified: branches/S2_6/client/gui-xaw/xaw_actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-xaw/xaw_actions.h?rev=29713&r1=29712&r2=29713&view=diff
==============================================================================
--- branches/S2_6/client/gui-xaw/xaw_actions.h  (original)
+++ branches/S2_6/client/gui-xaw/xaw_actions.h  Fri Aug 28 22:03:53 2015
@@ -16,7 +16,7 @@
 #include <X11/Intrinsic.h>
 
 
-extern void InitializeActions (XtAppContext app_context);
+extern void InitializeActions(XtAppContext context);
 
 
 #endif  /* FC__XAW_ACTIONS_H */


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

Reply via email to