changeset 5762:427a72c6ee17

Eliminate several compiler (clang) warnings.
author Stephen J. Turnbull <stephen@xemacs.org>
date Sun, 15 Sep 2013 23:47:37 +0900
parents a9fd35f939a5
children 23dc211f4d2f
files src/ChangeLog src/alloc.c src/bytecode.c src/data.c src/dired.c src/editfns.c src/glyphs.c src/lread.c src/sysdep.c
diffstat 9 files changed, 56 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/ChangeLog	Sun Sep 15 23:47:37 2013 +0900
@@ -1,3 +1,27 @@
+2013-09-09  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* alloc.c (free_normal_lisp_object):
+	Mark unused argument.
+
+	* bytecode.c (bytecode_negate): 
+	* data.c (Fsub1):
+	Shut up compiler warnings about always true comparisons.
+
+	* dired.c (Ffile_attributes):
+	Shut up compiler warnings about signedness in comparison.
+
+	* editfns.c (Fencode_time):
+	Fix addition of int to string to shut up compiler.  Still broken?
+
+	* glyphs.c (check_valid_xbm_inline):
+	Shut up compiler warnings about unused variable and signedness.
+
+	* lread.c (unreadchar):
+	Shut up compiler warning about unused format argument.
+
+	* sysdep.c (child_setup_tty):
+	Shut up compiler warning about empty if body.
+
 2013-08-05  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* data.c:
--- a/src/alloc.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/alloc.c	Sun Sep 15 23:47:37 2013 +0900
@@ -832,23 +832,25 @@
   zero_sized_lisp_object (obj, lisp_object_size (obj));
 }
 
+#ifdef NEW_GC
+void
+free_normal_lisp_object (Lisp_Object UNUSED(obj))
+{
+  /* Manual frees are not allowed with asynchronous finalization */
+  return;
+}
+#else
 void
 free_normal_lisp_object (Lisp_Object obj)
 {
-#ifndef NEW_GC
   const struct lrecord_implementation *imp =
     XRECORD_LHEADER_IMPLEMENTATION (obj);
-#endif /* not NEW_GC */
-
-#ifdef NEW_GC
-  /* Manual frees are not allowed with asynchronous finalization */
-  return;
-#else
+
   assert (!imp->frob_block_p);
   assert (!imp->size_in_bytes_method);
   old_free_lcrecord (obj);
+}
 #endif
-}
 
 #ifndef NEW_GC
 int
--- a/src/bytecode.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/bytecode.c	Sun Sep 15 23:47:37 2013 +0900
@@ -239,8 +239,8 @@
 
   if (FIXNUMP    (obj)) return make_integer (- XFIXNUM (obj));
   if (FLOATP  (obj)) return make_float (- XFLOAT_DATA (obj));
-  if (CHARP   (obj)) return make_integer (- ((int) XCHAR (obj)));
-  if (MARKERP (obj)) return make_integer (- ((int) marker_position (obj)));
+  if (CHARP   (obj)) return make_integer (- ((EMACS_INT) XCHAR (obj)));
+  if (MARKERP (obj)) return make_integer (- marker_position (obj));
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (obj)) BIGNUM_ARITH_RETURN (obj, neg);
 #endif
--- a/src/data.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/data.c	Sun Sep 15 23:47:37 2013 +0900
@@ -2477,7 +2477,7 @@
  retry:
 
   if (FIXNUMP    (number)) return make_integer (XFIXNUM (number) + 1);
-  if (CHARP   (number)) return make_integer (XCHAR (number) + 1);
+  if (CHARP   (number)) return make_integer ((EMACS_INT) XCHAR (number) + 1);
   if (MARKERP (number)) return make_integer (marker_position (number) + 1);
   if (FLOATP  (number)) return make_float (XFLOAT_DATA (number) + 1.0);
 #ifdef HAVE_BIGNUM
@@ -2521,7 +2521,7 @@
  retry:
 
   if (FIXNUMP    (number)) return make_integer (XFIXNUM (number) - 1);
-  if (CHARP   (number)) return make_integer (XCHAR (number) - 1);
+  if (CHARP   (number)) return make_integer ((EMACS_INT) XCHAR (number) - 1);
   if (MARKERP (number)) return make_integer (marker_position (number) - 1);
   if (FLOATP  (number)) return make_float (XFLOAT_DATA (number) - 1.0);
 #ifdef HAVE_BIGNUM
--- a/src/dired.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/dired.c	Sun Sep 15 23:47:37 2013 +0900
@@ -939,8 +939,8 @@
 
   if (NILP(id_format) || EQ (id_format, Qinteger))
     {
-      uidInfo = make_unsigned_integer (s.st_uid);
-      gidInfo = make_unsigned_integer (s.st_gid);
+      uidInfo = make_unsigned_integer ((EMACS_UINT) s.st_uid);
+      gidInfo = make_unsigned_integer ((EMACS_UINT) s.st_gid);
     }
   else
     {
@@ -957,7 +957,7 @@
   
   RETURN_UNGCPRO (listn (12,
 			 mode,
-			 make_unsigned_integer (s.st_nlink),
+			 make_unsigned_integer ((EMACS_UINT) s.st_nlink),
 			 uidInfo,
 			 gidInfo,
 			 make_time (s.st_atime),
@@ -967,7 +967,7 @@
 			 modestring,
 			 gid,
 			 make_unsigned_integer (s.st_ino),
-			 make_unsigned_integer (s.st_dev)));
+			 make_unsigned_integer ((EMACS_UINT) s.st_dev)));
 }
 
 
--- a/src/editfns.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/editfns.c	Sun Sep 15 23:47:37 2013 +0900
@@ -1168,7 +1168,7 @@
   CHECK_FIXNUM (*args); tm.tm_hour = XFIXNUM (*args++);	/* hour */
   CHECK_FIXNUM (*args); tm.tm_mday = XFIXNUM (*args++);	/* day */
   CHECK_FIXNUM (*args); tm.tm_mon  = XFIXNUM (*args++) - 1;	/* month */
-  CHECK_FIXNUM (*args); tm.tm_year = XFIXNUM (*args++) - 1900;/* year */
+  CHECK_FIXNUM (*args); tm.tm_year = XFIXNUM (*args++) - 1900;	/* year */
 
   tm.tm_isdst = -1;
 
@@ -1190,7 +1190,9 @@
       else if (FIXNUMP (zone))
 	{
 	  int abszone = abs (XFIXNUM (zone));
-	  sprintf (tzbuf, "XXX%s%d:%02d:%02d", "-" + (XFIXNUM (zone) < 0),
+	  /* #### I have no idea what this conforms to,
+	     but the compiler has stopped whining. */
+	  sprintf (tzbuf, "XXX%s%d:%02d:%02d", (XFIXNUM (zone) < 0) ? "-" : "+",
 		   abszone / (60*60), (abszone/60) % 60, abszone % 60);
 	  tzstring = tzbuf;
 	}
--- a/src/glyphs.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/glyphs.c	Sun Sep 15 23:47:37 2013 +0900
@@ -2637,8 +2637,8 @@
 static void
 check_valid_xbm_inline (Lisp_Object data)
 {
-  Lisp_Object width, height, bits, args[2];
-  unsigned long i_width, i_height;
+  Lisp_Object width, height, bits;
+  EMACS_INT i_width, i_height;
 
   if (!CONSP (data) ||
       !CONSP (XCDR (data)) ||
@@ -2658,9 +2658,9 @@
   if (!FIXNUMP (height) || XREALFIXNUM (height) < 0)
     invalid_argument ("Height must be a natural number", height);
 
-  i_width = (unsigned long) XREALFIXNUM (width);
-  i_height = (unsigned long) XREALFIXNUM (height);
-  if (i_width * i_height / 8UL > string_char_length (bits))
+  i_width = XREALFIXNUM (width);
+  i_height = XREALFIXNUM (height);
+  if (i_width * i_height / 8 > string_char_length (bits))
     invalid_argument ("data is too short for width and height",
 			 vector3 (width, height, bits));
 }
--- a/src/lread.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/lread.c	Sun Sep 15 23:47:37 2013 +0900
@@ -304,7 +304,7 @@
         if (testing_mule)
           fprintf (stderr,
                    (c >= 0x20 && c <= 0x7E) ? "UU%c" :
-                   ((c == '\n') ? "UU\\n\n" : "UU\\%o"), c);
+                   ((c == '\n') ? "UU\\n%c" : "UU\\%o"), c);
       }
 #endif
     }
--- a/src/sysdep.c	Sun Sep 08 21:48:09 2013 +0200
+++ b/src/sysdep.c	Sun Sep 15 23:47:37 2013 +0900
@@ -494,8 +494,10 @@
 #else
   /* <mdiers> What to do upon failure? Just ignoring rc is probably
      not acceptable, is it? */
-  if (cfsetispeed (&s.main, B9600) == -1) /* ignore */;
-  if (cfsetospeed (&s.main, B9600) == -1) /* ignore */;
+  if (cfsetispeed (&s.main, B9600) == -1)
+    ;				/* ignore */
+  if (cfsetospeed (&s.main, B9600) == -1)
+    ;				/* ignore */
 #endif /* defined (CBAUD) */
 
 #else /* not HAVE_TERMIO */