[P21.5] Quiet gcc on 64-bit systems

Marcus Crestani crestani at informatik.uni-tuebingen.de
Wed Aug 15 04:11:08 EDT 2007


PATCH 21.5

Gcc issues a couple of warnings on 64-bit systems due to pointer
conversion.  This patch fixes it.

I'll commit Friday if nobody objects.


src/ChangeLog addition:

2007-08-15  Marcus Crestani  <crestani at xemacs.org>

	* input-method-xlib.c (EmacsFreeXIMStyles):
	* lisp.h:
	* process-unix.c (connect_to_file_descriptor):
	* process-unix.c (create_bidirectional_pipe):
	* process-unix.c (unix_create_process):
	* process-unix.c (unix_open_network_stream):
	* process-unix.c (unix_open_multicast_group): Convert pointers to
	EMACS_INTs instead of ints.
	* vdb.c (Ftest_vdb): Print adresses as pointers.


linux64-xemacs-21.5 source patch:
Diff command:   cvs -q diff -u
Files affected: src/vdb.c
===================================================================
RCS src/process-unix.c
===================================================================
RCS src/lisp.h
===================================================================
RCS src/input-method-xlib.c
===================================================================
RCS

Index: src/input-method-xlib.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/input-method-xlib.c,v
retrieving revision 1.22
diff -u -r1.22 input-method-xlib.c
--- src/input-method-xlib.c	19 Jun 2006 18:19:37 -0000	1.22
+++ src/input-method-xlib.c	15 Aug 2007 08:01:13 -0000
@@ -713,7 +713,7 @@
 
   if (converter_data)
     {
-      Boolean free_p    = (Boolean) (int) converter_data;
+      Boolean free_p    = (Boolean) (EMACS_INT) converter_data;
       XIMStyles *styles = (XIMStyles *) toVal->addr;
       if (free_p)
         XFree ( styles->supported_styles );
Index: src/lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.146
diff -u -r1.146 lisp.h
--- src/lisp.h	4 Aug 2007 20:00:23 -0000	1.146
+++ src/lisp.h	15 Aug 2007 08:01:13 -0000
@@ -1331,7 +1331,7 @@
 
 /* This is shared by process.h, events.h and others in future.
    See events.h for description */
-typedef unsigned int USID;
+typedef unsigned EMACS_INT USID;
 typedef int face_index;
 typedef int glyph_index;
 typedef struct lstream Lstream; /* lstream.h */
Index: src/process-unix.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/process-unix.c,v
retrieving revision 1.59
diff -u -r1.59 process-unix.c
--- src/process-unix.c	22 Jun 2007 17:50:42 -0000	1.59
+++ src/process-unix.c	15 Aug 2007 08:01:13 -0000
@@ -174,7 +174,7 @@
 {
   /* This function can GC */
   Lisp_Object proc;
-  int inch;
+  EMACS_INT inch;
 
   CHECK_STRING (name);
   CHECK_INT (infd);
@@ -424,8 +424,8 @@
 }
 
 static int
-create_bidirectional_pipe (int *inchannel, int *outchannel,
-			   volatile int *forkin, volatile int *forkout)
+create_bidirectional_pipe (EMACS_INT *inchannel, EMACS_INT *outchannel,
+			   volatile EMACS_INT *forkin, volatile EMACS_INT *forkout)
 {
   int sv[2];
 
@@ -1055,13 +1055,13 @@
 		     int separate_err)
 {
   int pid;
-  int inchannel  = -1;
-  int outchannel = -1;
-  int errchannel = -1;
+  EMACS_INT inchannel  = -1;
+  EMACS_INT outchannel = -1;
+  EMACS_INT errchannel = -1;
   /* Use volatile to protect variables from being clobbered by longjmp.  */
-  volatile int forkin   = -1;
-  volatile int forkout  = -1;
-  volatile int forkerr  = -1;
+  volatile EMACS_INT forkin   = -1;
+  volatile EMACS_INT forkout  = -1;
+  volatile EMACS_INT forkerr  = -1;
   volatile int pty_flag = 0;
 
   if (!NILP (Vprocess_connection_type))
@@ -1884,8 +1884,8 @@
 			  Lisp_Object service, Lisp_Object protocol,
 			  void **vinfd, void **voutfd)
 {
-  int inch;
-  int outch;
+  EMACS_INT inch;
+  EMACS_INT outch;
   volatile int s = -1;
   volatile int port;
   volatile int retry = 0;
@@ -2162,7 +2162,7 @@
   struct ip_mreq imr;
   struct sockaddr_in sa;
   struct protoent *udp;
-  int ws, rs;
+  EMACS_INT ws, rs;
   int theport;
   unsigned char thettl;
   int one = 1; /* For REUSEADDR */
Index: src/vdb.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/vdb.c,v
retrieving revision 1.2
diff -u -r1.2 vdb.c
--- src/vdb.c	26 Mar 2006 14:05:30 -0000	1.2
+++ src/vdb.c	15 Aug 2007 08:01:13 -0000
@@ -90,9 +90,8 @@
      protection of PROT_READ|PROT_WRITE. */
   p = (Rawbyte *) mc_alloc (mc_get_page_size());
   set_lheader_implementation ((struct lrecord_header *) p, &lrecord_cons);
-  fprintf (stderr, "Allocate p: [%x ... %x], length %d\n", 
-	   (int) p, (int) (p + mc_get_page_size ()), 
-	   (int) mc_get_page_size ());
+  fprintf (stderr, "Allocate p: [%p ... %p], length %d\n", 
+	   p, p + mc_get_page_size (), (int) mc_get_page_size ());
 
   /* Test read. */
   fprintf (stderr, "Attempt to read p[666]... ");
@@ -126,11 +125,11 @@
   vdb_unprotect (p, mc_get_page_size ());
   for (count = Dynarr_length (page_fault_table); count; count--)
     if (Dynarr_at (page_fault_table, count - 1) == &p[666])
-      fprintf (stderr, "VALID page fault at %x\n",
-	       (int) Dynarr_at (page_fault_table, count - 1));
+      fprintf (stderr, "VALID page fault at %p\n",
+	       Dynarr_at (page_fault_table, count - 1));
     else
-      fprintf (stderr, "WRONG page fault at %x\n",
-	       (int) Dynarr_at (page_fault_table, count - 1));
+      fprintf (stderr, "WRONG page fault at %p\n",
+	       Dynarr_at (page_fault_table, count - 1));
   Dynarr_free (page_fault_table);
   mc_free (p);
   return Qnil;

-- 
Marcus



More information about the XEmacs-Patches mailing list