changeset 54703:42c61598ee66

(SINGLE_BYTE_CHAR_P): Fix macro to avoid warnings from GCC.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 04 Apr 2004 21:00:49 +0000
parents 1ee1cc05559b
children 3d13cea5e07a
files src/charset.h
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.h	Sun Apr 04 20:53:04 2004 +0000
+++ b/src/charset.h	Sun Apr 04 21:00:49 2004 +0000
@@ -216,7 +216,7 @@
 #define MAX_CHAR (0x1F << 14)
 
 /* 1 if C is a single byte character, else 0.  */
-#define SINGLE_BYTE_CHAR_P(c) ((unsigned) (c) < 0x100)
+#define SINGLE_BYTE_CHAR_P(c) (((unsigned)(c) & 0xFF) == (c))
 
 /* 1 if BYTE is an ASCII character in itself, in multibyte mode.  */
 #define ASCII_BYTE_P(byte) ((byte) < 0x80)
@@ -535,7 +535,7 @@
 
 #define CHAR_STRING(c, str)						  \
   (SINGLE_BYTE_CHAR_P (c)						  \
-   ? ((ASCII_BYTE_P (c) || c >= 0xA0)					  \
+   ? ((ASCII_BYTE_P (c) || c >= 0xA0)			  \
       ? (*(str) = (unsigned char)(c), 1)				  \
       : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
    : char_to_string (c, (unsigned char *) str))