comparison src/charset.h @ 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 695cf19ef79e
children a8fa7c632ee4
comparison
equal deleted inserted replaced
54702:1ee1cc05559b 54703:42c61598ee66
214 ((MIN_CHARSET_PRIVATE_DIMENSION2 - 0xE0) << 14) 214 ((MIN_CHARSET_PRIVATE_DIMENSION2 - 0xE0) << 14)
215 /* Maximum character code currently used plus 1. */ 215 /* Maximum character code currently used plus 1. */
216 #define MAX_CHAR (0x1F << 14) 216 #define MAX_CHAR (0x1F << 14)
217 217
218 /* 1 if C is a single byte character, else 0. */ 218 /* 1 if C is a single byte character, else 0. */
219 #define SINGLE_BYTE_CHAR_P(c) ((unsigned) (c) < 0x100) 219 #define SINGLE_BYTE_CHAR_P(c) (((unsigned)(c) & 0xFF) == (c))
220 220
221 /* 1 if BYTE is an ASCII character in itself, in multibyte mode. */ 221 /* 1 if BYTE is an ASCII character in itself, in multibyte mode. */
222 #define ASCII_BYTE_P(byte) ((byte) < 0x80) 222 #define ASCII_BYTE_P(byte) ((byte) < 0x80)
223 223
224 /* A char-table containing information on each character set. 224 /* A char-table containing information on each character set.
533 advance. Returns the length of the multi-byte form. If C is an 533 advance. Returns the length of the multi-byte form. If C is an
534 invalid character code, signal an error. */ 534 invalid character code, signal an error. */
535 535
536 #define CHAR_STRING(c, str) \ 536 #define CHAR_STRING(c, str) \
537 (SINGLE_BYTE_CHAR_P (c) \ 537 (SINGLE_BYTE_CHAR_P (c) \
538 ? ((ASCII_BYTE_P (c) || c >= 0xA0) \ 538 ? ((ASCII_BYTE_P (c) || c >= 0xA0) \
539 ? (*(str) = (unsigned char)(c), 1) \ 539 ? (*(str) = (unsigned char)(c), 1) \
540 : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \ 540 : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
541 : char_to_string (c, (unsigned char *) str)) 541 : char_to_string (c, (unsigned char *) str))
542 542
543 /* Like CHAR_STRING but don't signal an error if C is invalid. 543 /* Like CHAR_STRING but don't signal an error if C is invalid.