changeset 2956:ee35a8fdcfcd

[xemacs-hg @ 2005-09-27 05:29:41 by ben] fix compilation warnings text.c, event-Xt.c, lisp.h, number-gmp.c, number-gmp.h: Fix compilation warnings. A couple of changes of new -> new_, 'foo -> `foo'.
author ben
date Tue, 27 Sep 2005 05:29:45 +0000
parents 4d269e525e21
children 5eb04c84c7ae
files src/ChangeLog src/event-Xt.c src/lisp.h src/number-gmp.c src/number-gmp.h src/text.c
diffstat 6 files changed, 38 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Sep 26 22:19:05 2005 +0000
+++ b/src/ChangeLog	Tue Sep 27 05:29:45 2005 +0000
@@ -1,3 +1,16 @@
+2005-09-27  Ben Wing  <ben@xemacs.org>
+
+	* text.c (wcscmp_ascii):
+	* text.c (COPY_TEXT_BETWEEN_FORMATS):
+	* event-Xt.c (x_event_to_emacs_event):
+	* event-Xt.c (ShellVisualPatch):
+	* lisp.h:
+	* lisp.h (assert_with_message):
+	* number-gmp.c (bigfloat_to_string):
+	* number-gmp.h:
+	Fix compilation warnings.  A couple of changes of new -> new_,
+	'foo -> `foo'.
+
 2005-09-26  Ben Wing  <ben@xemacs.org>
 
 	* specifier.c:
--- a/src/event-Xt.c	Mon Sep 26 22:19:05 2005 +0000
+++ b/src/event-Xt.c	Tue Sep 27 05:29:45 2005 +0000
@@ -1314,7 +1314,8 @@
 		      Ibyte *dataint;
 		      len = strlen (data);
 		      EXTERNAL_TO_C_STRING (data, dataint, Qfile_name);
-		      hurl = dnd_url_hexify_string (dataint, "file:");
+		      hurl = dnd_url_hexify_string (dataint,
+						    (const Ibyte *) "file:");
 		      l_item = build_intstring (hurl);
 		      l_dndlist = Fcons (l_item, l_dndlist);
 		      data += len + 1;
@@ -3144,14 +3145,14 @@
 
 static XtInitProc orig_shell_init_proc;
 
-static void ShellVisualPatch(Widget wanted, Widget new,
+static void ShellVisualPatch(Widget wanted, Widget new_,
 			     ArgList args, Cardinal *num_args)
 {
   Widget p;
-  ShellWidget w = (ShellWidget) new;
+  ShellWidget w = (ShellWidget) new_;
 
   /* first, call the original setup */
-  (*orig_shell_init_proc)(wanted, new, args, num_args);
+  (*orig_shell_init_proc)(wanted, new_, args, num_args);
 
   /* if the visual isn't explicitly set, grab it from the nearest shell ancestor */
   if (w->shell.visual == CopyFromParent) {
--- a/src/lisp.h	Mon Sep 26 22:19:05 2005 +0000
+++ b/src/lisp.h	Tue Sep 27 05:29:45 2005 +0000
@@ -506,7 +506,7 @@
    them to be classes and using operator overloading.  Unfortunately this
    is a huge pain in the ass because C++ doesn't strongly distinguish
    "bool" and "size_t" from int.  The problem is especially bad with "bool"
-   -- if you want to be able to say 'if (len--)' where len is e.g. a
+   -- if you want to be able to say `if (len--)' where len is e.g. a
    Bytecount, you need to declare a conversion operator to bool(); and
    since bool is just an alias for int, you suddenly get tons and tons of
    ambiguities, which need to be resolved by lots of laborious declarations
@@ -1049,11 +1049,15 @@
   ((x) ? (void) 0 : assert_failed (file, line, #x))
 #elif defined (DEBUG_XEMACS)
 # define assert(x) ((x) ? (void) 0 : (void) ABORT ())
-# define assert_with_message(x, msg) ((x) ? (void) 0 : (void) ABORT ())
+# define assert_with_message(x, msg) assert (x)
 # define assert_at_line(x, file, line) assert (x)
 #else
-# define assert(x) ((void) 0)
-# define assert_with_message(x, msg)
+/* This used to be ((void) (0)) but that triggers lots of unused variable
+   warnings.  It's pointless to force all that code to be rewritten, with
+   added ifdefs.  Any reasonable compiler will eliminate an expression with
+   no effects. */
+# define assert(x) ((void) (x))
+# define assert_with_message(x, msg) assert (x)
 # define assert_at_line(x, file, line) assert (x)
 #endif
 
--- a/src/number-gmp.c	Mon Sep 26 22:19:05 2005 +0000
+++ b/src/number-gmp.c	Tue Sep 27 05:29:45 2005 +0000
@@ -66,8 +66,8 @@
       /* Computerized scientific notation */
       /* We need room for a radix point, format identifier, and exponent */
       const int space = (expt < 0)
-        ? (int)(log (-expt) / log (base)) + 3
-        : (int)(log (expt) / log (base)) + 2;
+        ? (int)(log ((double) (-expt)) / log ((double) base)) + 3
+        : (int)(log ((double) expt) / log ((double) base)) + 2;
       XREALLOC_ARRAY (str, CIbyte, len + space);
       memmove (&str[neg + 2], &str[neg + 1], len - neg);
       str[len + 1] = 'l';
--- a/src/number-gmp.h	Mon Sep 26 22:19:05 2005 +0000
+++ b/src/number-gmp.h	Tue Sep 27 05:29:45 2005 +0000
@@ -35,7 +35,15 @@
 #undef __GNUC__
 #endif
 
+#ifdef _MSC_VER
+/* "unary minus operator applied to unsigned type, result still unsigned":
+   Occurs on line 1596 of gmp.h in version 4.1.4. */
+#pragma warning ( disable : 4146 )
+#endif
 #include <gmp.h>
+#ifdef _MSC_VER
+#pragma warning ( default : 4146 )
+#endif
 
 typedef mpz_t bignum;
 typedef mpq_t ratio;
--- a/src/text.c	Mon Sep 26 22:19:05 2005 +0000
+++ b/src/text.c	Tue Sep 27 05:29:45 2005 +0000
@@ -1686,7 +1686,7 @@
 {
   while (*s1 && *s2)
     {
-      if (*s1 != *s2)
+      if (*s1 != (wchar_t) *s2)
        break;
       s1++, s2++;
     }
@@ -1809,7 +1809,7 @@
 									 \
 	    if (dstp + len <= dstend)					 \
 	      {								 \
-		set_itext_ichar_fmt (dstp, ch, dstfmt, dstobj);	 \
+		(void) set_itext_ichar_fmt (dstp, ch, dstfmt, dstobj);	 \
 		dstp += len;						 \
 	      }								 \
 	    else							 \