Martin Buchholz <martin(a)xemacs.org> writes:
Y> Mea culpa. I naively believed existing code did the right
Y> thing. But it did not. This means even with non MULE
Y> latin-1 environment, case-fold-search hasn't been working
Y> for bytes > 127. Here's the fix.
The ChangeLog entry and the fix use different types.
Oops. Thanks.
Y> 2000-11-16 Yoshiki Hayashi <yoshiki(a)xemacs.org>
Y> * buffer.h (IN_TRT_TABLE_DOMAIN): Cast to unsigned int.
Y> -#define IN_TRT_TABLE_DOMAIN(c) (((EMACS_UINT) (c)) <= 255)
Y> +#define IN_TRT_TABLE_DOMAIN(c) (((unsigned char) (c)) <= 255)
I don't understand TRT_TABLEs, but this must be wrong.
(((unsigned char) (c)) <= 255)
is always true.
The original code of TRT_TABLE_OF was:
INLINE Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c);
INLINE Emchar
TRT_TABLE_OF (Lisp_Object trt, Emchar c)
{
return IN_TRT_TABLE_DOMAIN (c) ? TRT_TABLE_CHAR_1 (trt, c) : c;
}
This code was intended to translate character only in ASCII
and Latin-1 range. Now I changed TRT_TABLE, that check
becomes unnecessary for MULE. But I doubted
IN_TRT_TABLE_DOMAIN doing the right thing, so I added assert
to see whether it is right or not without MULE. Now I know
it was wrong, we can fix XEmacs 21.1 as well. My intention
was not to trigger assert so if you are saying I should just
remove the call to assert, you're right.
2000-11-16 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* buffer.h (TRT_TABLE_OF): Remove assert.
(IN_TRT_TABLE_DOMAIN): Removed.
Index: buffer.h
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/buffer.h,v
retrieving revision 1.13.2.25
diff -u -r1.13.2.25 buffer.h
--- buffer.h 2000/11/15 10:39:42 1.13.2.25
+++ buffer.h 2000/11/16 09:48:05
@@ -1702,15 +1702,11 @@
}
#define SET_TRT_TABLE_CHAR_1(table, ch1, ch2) \
Fput_char_table (make_char (ch1), make_char (ch2), table);
-#define IN_TRT_TABLE_DOMAIN(c) (((EMACS_UINT) (c)) <= 255)
INLINE_HEADER Emchar TRT_TABLE_OF (Lisp_Object trt, Emchar c);
INLINE_HEADER Emchar
TRT_TABLE_OF (Lisp_Object trt, Emchar c)
{
-#ifndef MULE
- assert (IN_TRT_TABLE_DOMAIN (c));
-#endif
return TRT_TABLE_CHAR_1 (trt, c);
}
--
Yoshiki Hayashi