1. xemacs
  2. XEmacs

Commits

Stephen Turnbull  committed 427a72c

Eliminate several compiler (clang) warnings.

  • Participants
  • Parent commits a9fd35f
  • Branches default

Comments (0)

Files changed (9)

File src/ChangeLog

View file
+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:

File src/alloc.c

View file
   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

File src/bytecode.c

View file
 
   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

File src/data.c

View file
  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
  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

File src/dired.c

View file
 
   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
     {
   
   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),
 			 modestring,
 			 gid,
 			 make_unsigned_integer (s.st_ino),
-			 make_unsigned_integer (s.st_dev)));
+			 make_unsigned_integer ((EMACS_UINT) s.st_dev)));
 }
 
 

File src/editfns.c

View file
   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;
 
       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;
 	}

File src/glyphs.c

View file
 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)) ||
   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));
 }

File src/lread.c

View file
         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
     }

File src/sysdep.c

View file
 #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 */