NOTE: This patch has been committed.
src/ChangeLog addition:
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'.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/number-gmp.h src/number-gmp.c src/lisp.h src/event-Xt.c src/text.c
Tue Sep 27 00:27:29 CDT 2005
Index: src/text.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/text.c,v
retrieving revision 1.25
diff -u -p -r1.25 text.c
--- src/text.c 2005/04/09 10:02:12 1.25
+++ src/text.c 2005/09/27 05:27:54
@@ -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 \
Index: src/event-Xt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v
retrieving revision 1.86
diff -u -p -r1.86 event-Xt.c
--- src/event-Xt.c 2005/07/03 21:48:00 1.86
+++ src/event-Xt.c 2005/09/27 05:27:57
@@ -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) {
Index: src/lisp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.130
diff -u -p -r1.130 lisp.h
--- src/lisp.h 2005/07/17 20:08:48 1.130
+++ src/lisp.h 2005/09/27 05:28:00
@@ -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
Index: src/number-gmp.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/number-gmp.c,v
retrieving revision 1.4
diff -u -p -r1.4 number-gmp.c
--- src/number-gmp.c 2004/11/04 23:06:45 1.4
+++ src/number-gmp.c 2005/09/27 05:28:01
@@ -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';
Index: src/number-gmp.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/number-gmp.h,v
retrieving revision 1.3
diff -u -p -r1.3 number-gmp.h
--- src/number-gmp.h 2005/02/03 16:14:07 1.3
+++ src/number-gmp.h 2005/09/27 05:28:03
@@ -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;