User: ben
Date: 05/09/27 07:29:51
Modified: xemacs/src ChangeLog text.c event-Xt.c lisp.h number-gmp.c
number-gmp.h
Log:
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'.
Revision Changes Path
1.860 +13 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.859
retrieving revision 1.860
diff -u -p -r1.859 -r1.860
--- ChangeLog 2005/09/26 08:41:49 1.859
+++ ChangeLog 2005/09/27 05:29:41 1.860
@@ -1,3 +1,16 @@
+2005-09-27 Ben Wing <ben(a)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(a)xemacs.org>
* specifier.c:
1.26 +2 -2 XEmacs/xemacs/src/text.c
Index: text.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- text.c 2005/04/09 10:02:12 1.25
+++ text.c 2005/09/27 05:29:44 1.26
@@ -1686,7 +1686,7 @@ wcscmp_ascii (const wchar_t *s1, const A
{
while (*s1 && *s2)
{
- if (*s1 != *s2)
+ if (*s1 != (wchar_t) *s2)
break;
s1++, s2++;
}
@@ -1809,7 +1809,7 @@ do \
\
if (dstp + len <= dstend) \
{ \
- set_itext_ichar_fmt (dstp, ch, dstfmt, dstobj); \
+ (void) set_itext_ichar_fmt (dstp, ch, dstfmt, dstobj); \
dstp += len; \
} \
else \
1.87 +5 -4 XEmacs/xemacs/src/event-Xt.c
Index: event-Xt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -p -r1.86 -r1.87
--- event-Xt.c 2005/07/03 21:48:00 1.86
+++ event-Xt.c 2005/09/27 05:29:44 1.87
@@ -1314,7 +1314,8 @@ x_event_to_emacs_event (XEvent *x_event,
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 @@ Information is displayed on stderr. Cur
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) {
1.131 +8 -4 XEmacs/xemacs/src/lisp.h
Index: lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -p -r1.130 -r1.131
--- lisp.h 2005/07/17 20:08:48 1.130
+++ lisp.h 2005/09/27 05:29:45 1.131
@@ -506,7 +506,7 @@ typedef EMACS_INT Memxpos;
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 @@ MODULE_API void assert_failed (const Asc
((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
1.5 +2 -2 XEmacs/xemacs/src/number-gmp.c
Index: number-gmp.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/number-gmp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- number-gmp.c 2004/11/04 23:06:45 1.4
+++ number-gmp.c 2005/09/27 05:29:45 1.5
@@ -66,8 +66,8 @@ bigfloat_to_string(mpf_t f, int base)
/* 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';
1.4 +8 -0 XEmacs/xemacs/src/number-gmp.h
Index: number-gmp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/number-gmp.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- number-gmp.h 2005/02/03 16:14:07 1.3
+++ number-gmp.h 2005/09/27 05:29:45 1.4
@@ -35,7 +35,15 @@ Boston, MA 02111-1307, USA. */
#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;