Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2002:
[Freeciv-Dev] Re: Compaq Tru64 Unix Alpha platform - Building freeciv
Home

[Freeciv-Dev] Re: Compaq Tru64 Unix Alpha platform - Building freeciv

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Compaq Tru64 Unix Alpha platform - Building freeciv
From: Davide Pagnin <nightmare@xxxxxxxxxx>
Date: Sun, 19 May 2002 01:43:54 +0200

        Hi All!

I've reviewed the patch for 64 bit platforms, made by Raimar, after
I've pointed out the warning that a compilation raise under those
type of machines.

The attached patch, is Raimar patch, with the addition of a missed
conversion from XtPointer(punit->id) to INT_TO_XTPOINTER(punit->id)
which where at line 2125, in the file client/gui-xaw/citydlg.c

The other attachment is the warning report on my machine, with all 
the problems related to assert() and isspace() like functions.

I've read that Raimar does compile with an alpha but didn't run
into those warning, perhaps we have different environment?

Mine environment:
uname -svrm
OSF1 V5.1 1885 alpha

Freeciv Required Packages installed from the Open Source
Software Collection for Compaq Tru64 UNIX V5.1 and V5.1A:
http://www.tru64unix.compaq.com/demos/ossc-v51a/html/shwindex.htm

autoconf-2.13-4
automake-1.4-4
gettext-0.10.35-4
gmake-3.79.1-4
glib-1.2.10-4
gtk+-1.2.10-4
imlib-16bit-1.9.10-4
readline-4.1-4
xpm-3.4k-4
Xaw3d-1.3-4

For build properly, requires --disable-nls.
(Installed gettext is only 0.10.35)

gcc -v
Reading specs from
/usr/local/lib/gcc-lib/alphaev56-dec-osf5.1/3.0.3/specs
Configured with: ../gcc-3.0.3/configure 
Thread model: single
gcc version 3.0.3

I've tried to build with the /bin/cc, the bundled compiler from Compaq,
but very uncommon warning and errors come out the glib includes, and
other also some errors, within the macro preprocessor, so I had been
forced to compile with gcc.

I hope this infos can be useful, and I vote to have the 64bit patch,
included as soon as possible in the CVS.
I also hope to possibly fix the issues on assert and char subscripts.

        Ciao, Davide

P.S. Without --disable-nls, the configure scripts fails, is not
possible,
now that we use autogen.sh, to properly probe gettext and via a test
have the --disable-nls switch added if the system doesn't provide the
necessary gettext >= 0.10.38?
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/agents/cma_core.c 
freeciv-1.12.2/client/agents/cma_core.c
--- freeciv.orig/client/agents/cma_core.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/agents/cma_core.c     Sun May 19 01:01:53 2002
@@ -1821,13 +1821,13 @@
   struct agent self;
 
   freelog(LOG_DEBUG, "sizeof(struct cma_result)=%d",
-         sizeof(struct cma_result));
+         (unsigned int) sizeof(struct cma_result));
   freelog(LOG_DEBUG, "sizeof(struct cma_parameter)=%d",
-         sizeof(struct cma_parameter));
+         (unsigned int) sizeof(struct cma_parameter));
   freelog(LOG_DEBUG, "sizeof(struct combination)=%d",
-         sizeof(struct combination));
-  freelog(LOG_DEBUG, "sizeof(cache2)=%d", sizeof(cache2));
-  freelog(LOG_DEBUG, "sizeof(cache3)=%d", sizeof(cache3));
+         (unsigned int) sizeof(struct combination));
+  freelog(LOG_DEBUG, "sizeof(cache2)=%d", (unsigned int) sizeof(cache2));
+  freelog(LOG_DEBUG, "sizeof(cache3)=%d", (unsigned int) sizeof(cache3));
 
   /* reset cache counters */
   cache1.hits = 0;
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/attribute.c 
freeciv-1.12.2/client/attribute.c
--- freeciv.orig/client/attribute.c     Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/attribute.c   Sun May 19 01:01:53 2002
@@ -75,7 +75,8 @@
   int preamble_length, header_length, body_length, total_length, i,
       current_body_offset, entries = hash_num_entries(hash);
   size_t key_size = sizeof(struct attr_key);
-  char *result, *body;
+  void *result;
+  char *body;
   int *value_lengths, *header, *preamble;
 
   value_lengths = fc_malloc(sizeof(int) * entries);
@@ -115,7 +116,7 @@
   /*
    * Step 5: fill out the header
    */
-  header = (int *)(result + preamble_length);
+  header = (int *)(ADD_TO_POINTER(result, preamble_length));
   current_body_offset = 0;
 
   for (i = 0; i < entries; i++) {
@@ -134,7 +135,7 @@
   /*
    * Step 6: fill out the body.
    */
-  body = result + preamble_length + header_length;
+  body = ADD_TO_POINTER(result, preamble_length + header_length);
   for (i = 0; i < entries; i++) {
     const void *pkey = hash_key_by_number(hash, i);
     const void *pvalue = hash_value_by_number(hash, i);
@@ -158,7 +159,7 @@
 /****************************************************************************
 ...
 *****************************************************************************/
-static void unserialize_hash(struct hash_table *hash, char *data,
+static void unserialize_hash(struct hash_table *hash, void *data,
                             size_t data_length)
 {
   int *preamble, *header;
@@ -172,12 +173,12 @@
   assert(preamble[1] == data_length);
 
   freelog(LOG_DEBUG, "try to unserialized %d entries from %d bytes",
-         entries, data_length);
+         entries, (unsigned int) data_length);
   preamble_length = 2 * sizeof(int);
   header_length = entries * sizeof(int) * 4;
 
-  header = (int *)(data + preamble_length);
-  body = data + preamble_length + header_length;
+  header = (int *)(ADD_TO_POINTER(data, preamble_length));
+  body = ADD_TO_POINTER(data, preamble_length + header_length);
 
   for (i = 0; i < entries; i++) {
     void *pkey = fc_malloc(header[0]);
@@ -244,7 +245,8 @@
   void *pvalue = NULL;
 
   freelog(ATTRIBUTE_LOG_LEVEL, "attribute_set(key=%d, id=%d, x=%d, y=%d, "
-         "data_length=%d, data=%p)", key, id, x, y, data_length, data);
+         "data_length=%d, data=%p)", key, id, x, y,
+         (unsigned int) data_length, data);
 
   assert(attribute_hash != NULL);
 
@@ -285,8 +287,8 @@
   int length;
 
   freelog(ATTRIBUTE_LOG_LEVEL, "attribute_get(key=%d, id=%d, x=%d, y=%d, "
-         "max_data_length=%d, data=%p)", key, id, x, y, max_data_length,
-         data);
+         "max_data_length=%d, data=%p)", key, id, x, y,
+         (unsigned int) max_data_length, data);
 
   assert(attribute_hash != NULL);
 
@@ -313,7 +315,7 @@
           "\"attribute_block_\" may alleviate the problem (though you will " 
           "lose some non-critical client data). If you still encounter this, "
           "submit a bug report to <freeciv-dev@xxxxxxxxxxx>", 
-          max_data_length, length);
+          (unsigned int) max_data_length, length);
 
     exit(EXIT_FAILURE);
   }
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/civclient.c 
freeciv-1.12.2/client/civclient.c
--- freeciv.orig/client/civclient.c     Fri May 17 16:07:53 2002
+++ freeciv-1.12.2/client/civclient.c   Sun May 19 01:01:53 2002
@@ -222,7 +222,7 @@
 /**************************************************************************
 ...
 **************************************************************************/
-void handle_packet_input(char *packet, int type)
+void handle_packet_input(void *packet, int type)
 {
   switch(type) {
   case PACKET_JOIN_GAME_REPLY:
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/civclient.h 
freeciv-1.12.2/client/civclient.h
--- freeciv.orig/client/civclient.h     Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/civclient.h   Sun May 19 01:01:53 2002
@@ -16,7 +16,7 @@
 #include "packets.h"           /* enum report_type */
 #include "game.h"              /* enum client_states */
 
-void handle_packet_input(char *packet, int type);
+void handle_packet_input(void *packet, int type);
 
 void send_unit_info(struct unit *punit);
 void send_move_unit(struct unit *punit);
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/climisc.c 
freeciv-1.12.2/client/climisc.c
--- freeciv.orig/client/climisc.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/climisc.c     Sun May 19 01:01:53 2002
@@ -93,7 +93,7 @@
   recyc_ptr = recyc_conts.ptr;
   recyc_ptr[recyc_conts.n-1] = cont;
   freelog(LOG_DEBUG, "clicont: recycling %d (max %d recyc %d)",
-         cont, max_cont_used, recyc_conts.n);
+         cont, max_cont_used, (unsigned int)recyc_conts.n);
 }
 
 /**************************************************************************
@@ -112,7 +112,7 @@
     update_island_impr_effect(max_cont_used-1, max_cont_used);
   }
   freelog(LOG_DEBUG, "clicont: new %d (max %d, recyc %d)",
-         ret, max_cont_used, recyc_conts.n);
+         ret, max_cont_used, (unsigned int)recyc_conts.n);
   return ret;
 }
 
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/clinet.c 
freeciv-1.12.2/client/clinet.c
--- freeciv.orig/client/clinet.c        Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/clinet.c      Sun May 19 01:01:53 2002
@@ -319,7 +319,7 @@
   if (read_from_connection(&aconnection, FALSE) >= 0) {
     enum packet_type type;
     bool result;
-    char *packet;
+    void *packet;
 
     while (TRUE) {
       packet = get_packet_from_connection(&aconnection, &type, &result);
@@ -357,7 +357,7 @@
     if (read_from_connection(&aconnection, TRUE) >= 0) {
       enum packet_type type;
       bool result;
-      char *packet;
+      void *packet;
 
       while (TRUE) {
        packet = get_packet_from_connection(&aconnection, &type, &result);
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/citydlg.c 
freeciv-1.12.2/client/gui-xaw/citydlg.c
--- freeciv.orig/client/gui-xaw/citydlg.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/citydlg.c     Sun May 19 01:04:23 2002
@@ -1784,8 +1784,8 @@
     xaw_expose_now(pixcomm);
 
     XtRemoveAllCallbacks(pixcomm, XtNcallback);
-    XtAddCallback(pixcomm, XtNcallback, 
-                 support_units_callback, (XtPointer)punit->id);
+    XtAddCallback(pixcomm, XtNcallback,
+                 support_units_callback, INT_TO_XTPOINTER(punit->id));
     XtSetSensitive(pixcomm, TRUE);
   }
 
@@ -1845,7 +1845,7 @@
 
     XtRemoveAllCallbacks(pixcomm, XtNcallback);
     XtAddCallback(pixcomm, XtNcallback, 
-                 present_units_callback, (XtPointer)punit->id);
+                 present_units_callback, INT_TO_XTPOINTER(punit->id));
     XtSetSensitive(pixcomm, TRUE);
   }
 
@@ -2122,7 +2122,7 @@
                    unit_types[ut1].name, unit_types[ut2].name,
                    value, game.player_ptr->economic.gold);
         popup_message_dialog(toplevel, "upgradedialog", buf,
-                             unitupgrade_callback_yes, (XtPointer)(punit->id), 
0,
+                             unitupgrade_callback_yes, 
INT_TO_XTPOINTER(punit->id), 0,
                              unitupgrade_callback_no, 0, 0,
                              NULL);
       } else {
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/cityrep.c 
freeciv-1.12.2/client/gui-xaw/cityrep.c
--- freeciv.orig/client/gui-xaw/cityrep.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/cityrep.c     Sun May 19 01:01:54 2002
@@ -346,7 +346,7 @@
          XtVaCreateManagedWidget(items[i].descr, smeBSBObjectClass,
                                  city_popupmenu, NULL);
       XtAddCallback(entry, XtNcallback, city_change_callback,
-                   (XtPointer) (items[i].cid));
+                   INT_TO_XTPOINTER(items[i].cid));
     }
 
     if (cids_used == 0)
@@ -373,7 +373,7 @@
   if(ret->list_index!=XAW_LIST_NONE && 
      (pcity=cities_in_list[ret->list_index])) {
     struct packet_city_request packet;
-    cid my_cid = (cid) client_data;
+    cid my_cid = (cid) XTPOINTER_TO_INT(client_data);
     Boolean unit;
     int build_nr;
       
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/dialogs.c 
freeciv-1.12.2/client/gui-xaw/dialogs.c
--- freeciv.orig/client/gui-xaw/dialogs.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/dialogs.c     Sun May 19 01:01:54 2002
@@ -1330,7 +1330,8 @@
                                     XtNfromVert, prev,
                                     XtNlabel, (XtArgVal)governments[i].name,
                                     NULL);
-    XtAddCallback(button, XtNcallback, government_callback, (XtPointer)i);
+    XtAddCallback(button, XtNcallback, government_callback,
+                 INT_TO_XTPOINTER(i));
     XtSetSensitive(button, can_change ? TRUE : FALSE);
     prev = button;
   }
@@ -1391,9 +1392,8 @@
   if (client_data) {
     struct unit *punit = find_unit_by_id (unit_to_use_to_pillage);
     if (punit) {
-      request_new_unit_activity_targeted (punit,
-                                         ACTIVITY_PILLAGE,
-                                         (int)client_data);
+      request_new_unit_activity_targeted(punit, ACTIVITY_PILLAGE,
+                                        XTPOINTER_TO_INT(client_data));
     }
   }
 
@@ -1431,7 +1431,8 @@
                               XtNlabel,
                                 (XtArgVal)(map_get_infrastructure_text (what)),
                               NULL);
-    XtAddCallback (button, XtNcallback, pillage_callback, (XtPointer)what);
+    XtAddCallback(button, XtNcallback, pillage_callback,
+                 INT_TO_XTPOINTER(what));
     prev = button;
     may_pillage &= (~(what | map_get_infrastructure_prerequisite (what)));
   }
@@ -1452,7 +1453,7 @@
                                   XtPointer call_data)
 {
   struct unit *punit;
-  int activity = (int)client_data;
+  int activity = XTPOINTER_TO_INT(client_data);
 
   if (!is_showing_unit_connect_dialog) {
     destroy_message_dialog(w);
@@ -1512,8 +1513,8 @@
                               XtNlabel,
                                 (XtArgVal)(get_activity_text (activity)),
                               NULL);
-    XtAddCallback (button, XtNcallback, unit_connect_callback, 
-                  (XtPointer)activity);
+    XtAddCallback(button, XtNcallback, unit_connect_callback,
+                 INT_TO_XTPOINTER(activity));
     prev = button;
   }
   button =
@@ -2077,8 +2078,8 @@
 
 
   for(i=0; i<game.playable_nation_count; i++) {
-    XtAddCallback(races_toggles[i], XtNcallback, 
-                 races_toggles_callback, (XtPointer)i);
+    XtAddCallback(races_toggles[i], XtNcallback,
+                 races_toggles_callback, INT_TO_XTPOINTER(i));
   }
 
 
@@ -2166,17 +2167,13 @@
 void races_toggles_callback(Widget w, XtPointer client_data, 
                            XtPointer call_data)
 {
-  int index, race;
+  int index = XTPOINTER_TO_INT(client_data);
+  int race = races_toggles_to_nations[index];
   int j;
   int leader_count;
-  char **leaders;
+  char **leaders = get_nation_leader_names(race, &leader_count);
   Widget entry;
 
-  index = (int)client_data;
-  race = races_toggles_to_nations[index];
-
-  leaders = get_nation_leader_names(race, &leader_count);
-
   if(races_leader_pick_popupmenu)
     XtDestroyWidget(races_leader_pick_popupmenu);
 
@@ -2192,10 +2189,8 @@
                              smeBSBObjectClass,
                              races_leader_pick_popupmenu,
                              NULL);
-    XtAddCallback(entry,
-                 XtNcallback,
-                 races_leader_pick_callback,
-                 (XtPointer)((MAX_NUM_NATIONS * race) + j));
+    XtAddCallback(entry, XtNcallback, races_leader_pick_callback,
+                 INT_TO_XTPOINTER(MAX_NUM_NATIONS * race + j));
   }
 
   races_leader_set_values(race, myrand(leader_count));
@@ -2212,10 +2207,8 @@
 void races_leader_pick_callback(Widget w, XtPointer client_data,
                                XtPointer call_data)
 {
-  int race, lead;
-
-  race = ((int)client_data) / MAX_NUM_NATIONS;
-  lead = ((int)client_data) - (MAX_NUM_NATIONS * race);
+  int race = XTPOINTER_TO_INT(client_data) / MAX_NUM_NATIONS;
+  int lead = XTPOINTER_TO_INT(client_data) - (MAX_NUM_NATIONS * race);
 
   races_leader_set_values(race, lead);
 }
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/diplodlg.c 
freeciv-1.12.2/client/gui-xaw/diplodlg.c
--- freeciv.orig/client/gui-xaw/diplodlg.c      Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/diplodlg.c    Sun May 19 01:01:54 2002
@@ -246,8 +246,9 @@
       Widget entry=
        XtVaCreateManagedWidget(advances[i].name, smeBSBObjectClass, 
                                popupmenu, NULL);
-      XtAddCallback(entry, XtNcallback, diplomacy_dialog_tech_callback, 
-                   (XtPointer)(plr0->player_no*10000+plr1->player_no*100+i)); 
+      XtAddCallback(entry, XtNcallback, diplomacy_dialog_tech_callback,
+                   INT_TO_XTPOINTER(plr0->player_no * 10000 +
+                                    plr1->player_no * 100 + i));
       flag=1;
     }
   }
@@ -285,10 +286,10 @@
     Widget entry=
       XtVaCreateManagedWidget(city_list_ptrs[j]->name, smeBSBObjectClass, 
                              popupmenu, NULL);
-    XtAddCallback(entry, XtNcallback, diplomacy_dialog_city_callback, 
-                 (XtPointer)(city_list_ptrs[j]->id*1024
-                             + plr0->player_no*32
-                             + plr1->player_no));
+    XtAddCallback(entry, XtNcallback, diplomacy_dialog_city_callback,
+                 INT_TO_XTPOINTER(city_list_ptrs[j]->id * 1024
+                                  + plr0->player_no * 32
+                                  + plr1->player_no));
   }
   free(city_list_ptrs);
   return i;
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/gui_main.c 
freeciv-1.12.2/client/gui-xaw/gui_main.c
--- freeciv.orig/client/gui-xaw/gui_main.c      Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/gui_main.c    Sun May 19 01:01:54 2002
@@ -405,7 +405,7 @@
     XtVaSetValues(econ_label[i], XtNbitmap,
                  get_citizen_pixmap(i<5?1:2), NULL);
     XtAddCallback(econ_label[i], XtNcallback, taxrates_callback,
-                 (XtPointer)i);  
+                 INT_TO_XTPOINTER(i));
   }
                
   XtAddCallback(map_horizontal_scrollbar, XtNjumpProc, 
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/gui_stuff.h 
freeciv-1.12.2/client/gui-xaw/gui_stuff.h
--- freeciv.orig/client/gui-xaw/gui_stuff.h     Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/gui_stuff.h   Sun May 19 01:01:54 2002
@@ -38,4 +38,7 @@
 #define I_S(w)  xaw_intl_string(w)
 #define I_SW(w) xaw_intl_string_width(w)
 
+#define INT_TO_XTPOINTER(m_i)  ((XtPointer)((long)(m_i)))
+#define XTPOINTER_TO_INT(m_p)  ((int)((long)(m_p)))
+
 #endif  /* FC__GUI_STUFF_H */
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/helpdlg.c 
freeciv-1.12.2/client/gui-xaw/helpdlg.c
--- freeciv.orig/client/gui-xaw/helpdlg.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/helpdlg.c     Sun May 19 01:01:54 2002
@@ -298,7 +298,8 @@
                              NULL);
   }
 
-  XtAddCallback(l, XtNcallback, help_tree_node_callback, (XtPointer)tech);
+  XtAddCallback(l, XtNcallback, help_tree_node_callback,
+               INT_TO_XTPOINTER(tech));
 
   XtVaSetValues(l, XtVaTypedArg, XtNbackground, 
                XtRString, bg, strlen(bg)+1, NULL);
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/mapctrl.c 
freeciv-1.12.2/client/gui-xaw/mapctrl.c
--- freeciv.orig/client/gui-xaw/mapctrl.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/mapctrl.c     Sun May 19 01:01:54 2002
@@ -91,9 +91,9 @@
 void popup_newcity_dialog(struct unit *punit, char *suggestname)
 {
   input_dialog_create(toplevel, "shellnewcityname",
-    _("What should we call our new city?"), suggestname,
-    name_new_city_callback, (XtPointer)punit->id,
-    name_new_city_callback, (XtPointer)0);
+                     _("What should we call our new city?"), suggestname,
+                     name_new_city_callback, INT_TO_XTPOINTER(punit->id),
+                     name_new_city_callback, INT_TO_XTPOINTER(0));
 }
 
 /**************************************************************************
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/mapview.c 
freeciv-1.12.2/client/gui-xaw/mapview.c
--- freeciv.orig/client/gui-xaw/mapview.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/mapview.c     Sun May 19 01:01:54 2002
@@ -1172,7 +1172,7 @@
 void scrollbar_scroll_callback(Widget w, XtPointer client_data,
                             XtPointer position_val)
 {
-  int position = (int) position_val, is_real;
+  int position = XTPOINTER_TO_INT(position_val), is_real;
 
 
   if(get_client_state()!=CLIENT_GAME_RUNNING_STATE)
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/ratesdlg.c 
freeciv-1.12.2/client/gui-xaw/ratesdlg.c
--- freeciv.orig/client/gui-xaw/ratesdlg.c      Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/ratesdlg.c    Sun May 19 01:01:54 2002
@@ -362,8 +362,7 @@
 void rates_scroll_scroll_callback(Widget w, XtPointer client_data,
                                  XtPointer position_val)
 {
-  int pos=(int)position_val;
-  int val;
+  int val, pos = XTPOINTER_TO_INT(position_val);
   
   if(w==rates_tax_scroll) {
     if(pos<0)
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/client/gui-xaw/repodlgs.c 
freeciv-1.12.2/client/gui-xaw/repodlgs.c
--- freeciv.orig/client/gui-xaw/repodlgs.c      Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/client/gui-xaw/repodlgs.c    Sun May 19 01:01:54 2002
@@ -1015,9 +1015,8 @@
 
     popup_message_dialog(toplevel, "upgradedialog", buf,
                         upgrade_callback_yes,
-                        (XtPointer)(activeunits_type[ret->list_index]), 0,
-                        upgrade_callback_no, 0, 0,
-                        NULL);
+                        INT_TO_XTPOINTER(activeunits_type[ret->list_index]),
+                        0, upgrade_callback_no, 0, 0, NULL);
   }
 }
 
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/common/astring.h 
freeciv-1.12.2/common/astring.h
--- freeciv.orig/common/astring.h       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/common/astring.h     Sun May 19 01:01:55 2002
@@ -20,6 +20,7 @@
 #define FC__ASTRING_H
 
 #include <stddef.h>            /* size_t */
+#include "shared.h"            /* ADD_TO_POINTER */
 
 struct astring {
   char *str;                   /* the string */
@@ -50,6 +51,6 @@
 
 /* Returns a pointer to the nth (0-based) element in the given athing. Does
    no boundary or pointer checking */
-#define ath_get(ath,n) ((char *)((ath)->ptr)+(ath)->size*(n))
+#define ath_get(ath,n) ADD_TO_POINTER((ath)->ptr, (ath)->size*(n))
 
 #endif  /* FC__ASTRING_H */
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/common/registry.c 
freeciv-1.12.2/common/registry.c
--- freeciv.orig/common/registry.c      Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/common/registry.c    Sun May 19 01:01:55 2002
@@ -444,7 +444,8 @@
                       base_name.n + 20 +  columns[columns_tab.n-1].n);
          my_snprintf(entry_name.str, entry_name.n_alloc, "%s%d.%s,%d",
                      base_name.str, table_lineno,
-                     columns[columns_tab.n-1].str, i-columns_tab.n+1);
+                     columns[columns_tab.n - 1].str,
+                     (int) (i - columns_tab.n + 1));
        }
        pentry = new_entry(sb, entry_name.str, tok);
        entry_list_insert_back(&psection->entries, pentry);
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/common/sbuffer.c 
freeciv-1.12.2/common/sbuffer.c
--- freeciv.orig/common/sbuffer.c       Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/common/sbuffer.c     Sun May 19 01:01:55 2002
@@ -34,13 +34,15 @@
 #include <string.h>
 
 #include "mem.h"
+#include "shared.h"
+
 #include "sbuffer.h"
 
 /* default buffer size: */
 #define SBUF_DEFAULT_SIZE (64*1024)
 
 struct sbuffer {
-  char *buffer;
+  void *buffer;
   int size;
   int offset;
 
@@ -72,12 +74,12 @@
 **************************************************************************/
 static void sbuf_expand(struct sbuffer *sb)
 {
-  char *prev_buffer;
+  void *prev_buffer;
 
   assert(sb && (sb->size>0));
   
   prev_buffer = sb->buffer;
-  sb->buffer = (char *)fc_malloc(sb->size);
+  sb->buffer = fc_malloc(sb->size);
 
   /* store pointer to previous buffer: */
   *(char **)(sb->buffer) = (char*)prev_buffer;
@@ -131,7 +133,7 @@
 **************************************************************************/
 void *sbuf_malloc(struct sbuffer *sb, size_t size)
 {
-  char *ret;
+  void *ret;
   
   assert(sb && sb->buffer && (sb->size>0) && (sb->offset>0));
   assert(size > 0 && size <= (sb->size-SBUF_ALIGN_SIZE));
@@ -145,7 +147,7 @@
     assert(size <= (sb->size - sb->offset));
   }
 
-  ret = sb->buffer + sb->offset;
+  ret = ADD_TO_POINTER(sb->buffer, sb->offset);
   sb->offset += size;
   return ret;
 }
@@ -155,7 +157,7 @@
 **************************************************************************/
 char *sbuf_strdup(struct sbuffer *sb, const char *str)
 {
-  int size = strlen(str)+1;
+  size_t size = strlen(str)+1;
   char *ret;
   
   assert(sb && sb->buffer && (sb->size>0) && (sb->offset>0));
@@ -166,7 +168,7 @@
     sbuf_expand(sb);
     assert(size <= (sb->size - sb->offset));
   }
-  ret = sb->buffer + sb->offset;
+  ret = ADD_TO_POINTER(sb->buffer, sb->offset);
   memcpy(ret, str, size);      /* includes null-terminator */
   sb->offset += size;
   return ret;
@@ -178,12 +180,10 @@
 **************************************************************************/
 void sbuf_free(struct sbuffer *sb)
 {
-  char *next;
-
   assert(sb && sb->buffer);
   
   do {
-    next = *(char **)sb->buffer;
+    void *next = *(char **)sb->buffer;
     free(sb->buffer);
     sb->buffer = next;
   } while(sb->buffer);
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/common/shared.h 
freeciv-1.12.2/common/shared.h
--- freeciv.orig/common/shared.h        Thu May 16 21:04:12 2002
+++ freeciv-1.12.2/common/shared.h      Sun May 19 01:01:55 2002
@@ -72,6 +72,7 @@
 #define MAX_UINT32 0xFFFFFFFF
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#define ADD_TO_POINTER(p, n) ((void *)((char *)(p)+(n)))
 
 char *create_centered_string(char *s);
 
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/server/sernet.c 
freeciv-1.12.2/server/sernet.c
--- freeciv.orig/server/sernet.c        Fri May 17 16:07:59 2002
+++ freeciv-1.12.2/server/sernet.c      Sun May 19 01:01:55 2002
@@ -543,7 +543,7 @@
        struct connection *pconn = &connections[i];
        if(pconn->used && FD_ISSET(pconn->sock, &readfs)) {
          if(read_socket_data(pconn->sock, pconn->buffer)>=0) {
-           char *packet;
+           void *packet;
            enum packet_type type;
            bool result;
 
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/server/srv_main.c 
freeciv-1.12.2/server/srv_main.c
--- freeciv.orig/server/srv_main.c      Fri May 17 16:07:59 2002
+++ freeciv-1.12.2/server/srv_main.c    Sun May 19 01:01:55 2002
@@ -601,7 +601,7 @@
 Returns 0 if connection should be closed (because the clients was
 rejected). Returns 1 else.
 **************************************************************************/
-bool handle_packet_input(struct connection *pconn, char *packet, int type)
+bool handle_packet_input(struct connection *pconn, void *packet, int type)
 {
   struct player *pplayer;
 
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/server/srv_main.h 
freeciv-1.12.2/server/srv_main.h
--- freeciv.orig/server/srv_main.h      Fri May 17 16:07:59 2002
+++ freeciv-1.12.2/server/srv_main.h    Sun May 19 01:01:55 2002
@@ -43,7 +43,7 @@
 void srv_init(void);
 void srv_main(void);
 
-bool handle_packet_input(struct connection *pconn, char *packet, int type);
+bool handle_packet_input(struct connection *pconn, void *packet, int type);
 void lost_connection_to_client(struct connection *pconn);
 void accept_new_player(char *name, struct connection *pconn);
 void start_game(void);
diff -urN -Xfreeciv.orig/diff_ignore freeciv.orig/server/stdinhand.c 
freeciv-1.12.2/server/stdinhand.c
--- freeciv.orig/server/stdinhand.c     Fri May 17 15:44:13 2002
+++ freeciv-1.12.2/server/stdinhand.c   Sun May 19 01:01:55 2002
@@ -3187,7 +3187,7 @@
     size_t synlen = strlen(syn);
     char prefix[40];
 
-    my_snprintf(prefix, sizeof(prefix), "%*s", synlen, " ");
+    my_snprintf(prefix, sizeof(prefix), "%*s", (int) synlen, " ");
     cmd_reply_prefix(help_cmd, caller, C_COMMENT, prefix,
                     "%s%s", syn, _(cmd->synopsis));
   }
Problems with assert:
ai/aiunit.c:1339: warning: cast from pointer to integer of different size
server/plrhand.c:189: warning: cast from pointer to integer of different size
client/packhand.c:1646: warning: cast from pointer to integer of different size
client/audio.c:216: warning: cast from pointer to integer of different size
client/audio.c:233: warning: cast from pointer to integer of different size

Problems with char subscript:
common/capability.c:44: warning: subscript has type `char'
common/capability.c:44: warning: subscript has type `char'
common/capability.c:75: warning: subscript has type `char'
common/capability.c:75: warning: subscript has type `char'
common/inputfile.c:341: warning: subscript has type `char'
common/inputfile.c:358: warning: subscript has type `char'
common/inputfile.c:646: warning: subscript has type `char'
common/inputfile.c:652: warning: subscript has type `char'
common/inputfile.c:655: warning: subscript has type `char'
common/inputfile.c:682: warning: subscript has type `char'
common/inputfile.c:709: warning: subscript has type `char'
common/inputfile.c:756: warning: subscript has type `char'
common/inputfile.c:762: warning: subscript has type `char'
common/inputfile.c:765: warning: subscript has type `char'
common/inputfile.c:769: warning: subscript has type `char'
common/inputfile.c:789: warning: subscript has type `char'
common/registry.c:613: warning: subscript has type `char'
common/registry.c:614: warning: subscript has type `char'
common/registry.c:619: warning: subscript has type `char'
common/shared.c:439: warning: subscript has type `char'
common/shared.c:476: warning: subscript has type `char'
common/shared.c:540: warning: subscript has type `char'
common/shared.c:550: warning: subscript has type `char'
server/stdinhand.c:1921: warning: subscript has type `char'
server/stdinhand.c:2054: warning: subscript has type `char'
server/stdinhand.c:2059: warning: subscript has type `char'
server/stdinhand.c:2099: warning: subscript has type `char'
server/stdinhand.c:2105: warning: subscript has type `char'
server/stdinhand.c:2379: warning: subscript has type `char'
server/stdinhand.c:2382: warning: subscript has type `char'
server/stdinhand.c:2542: warning: subscript has type `char'
server/stdinhand.c:2545: warning: subscript has type `char'
server/stdinhand.c:2648: warning: subscript has type `char'
server/stdinhand.c:2656: warning: subscript has type `char'
server/stdinhand.c:2664: warning: subscript has type `char'
server/stdinhand.c:2888: warning: subscript has type `char'
server/stdinhand.c:2899: warning: subscript has type `char'
server/stdinhand.c:2908: warning: subscript has type `char'
server/stdinhand.c:2932: warning: subscript has type `char'
server/stdinhand.c:2944: warning: subscript has type `char'
server/stdinhand.c:3680: warning: subscript has type `char'
server/stdinhand.c:3687: warning: subscript has type `char'
server/stdinhand.c:3692: warning: subscript has type `char'
server/stdinhand.c:3712: warning: subscript has type `char'
server/stdinhand.c:3741: warning: subscript has type `char'
client/clinet.c:498: warning: subscript has type `char'
client/options.c:313: warning: subscript has type `char'
client/tilespec.c:495: warning: subscript has type `char'
client/tilespec.c:496: warning: subscript has type `char'
client/tilespec.c:497: warning: subscript has type `char'
client/gui-gtk/dialogs.c:2242: warning: subscript has type `char'
client/gui-xaw:dialogs.c:2370: warning: subscript has type `char'

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