Mercurial > emacs
comparison src/character.h @ 95856:f13a77e0e34f
* character.h (CHAR_TO_BYTE_SAFE): New macro.
* character.c (Fmultibyte_char_to_unibyte): Obey the docstring.
* regex.c (RE_CHAR_TO_UNIBYTE): Use the new macro.
(WEAK_ALIAS): Simplify.
* syntax.c (skip_chars): Don't mark non-byte chars in the fastmap
when searching a unibyte buffer.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 12 Jun 2008 20:25:47 +0000 |
parents | abcb40dd43a2 |
children | d719efd8c628 |
comparison
equal
deleted
inserted
replaced
95855:5bef95d2d506 | 95856:f13a77e0e34f |
---|---|
65 /* Return the raw 8-bit byte for character C. */ | 65 /* Return the raw 8-bit byte for character C. */ |
66 #define CHAR_TO_BYTE8(c) \ | 66 #define CHAR_TO_BYTE8(c) \ |
67 (CHAR_BYTE8_P (c) \ | 67 (CHAR_BYTE8_P (c) \ |
68 ? (c) - 0x3FFF00 \ | 68 ? (c) - 0x3FFF00 \ |
69 : multibyte_char_to_unibyte (c, Qnil)) | 69 : multibyte_char_to_unibyte (c, Qnil)) |
70 | |
71 /* Return the raw 8-bit byte for character C, | |
72 or -1 if C doesn't correspond to a byte. */ | |
73 #define CHAR_TO_BYTE_SAFE(c) \ | |
74 (CHAR_BYTE8_P (c) \ | |
75 ? (c) - 0x3FFF00 \ | |
76 : multibyte_char_to_unibyte_safe (c, Qnil)) | |
70 | 77 |
71 /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character | 78 /* Nonzero iff BYTE is the 1st byte of a multibyte form of a character |
72 that corresponds to a raw 8-bit byte. */ | 79 that corresponds to a raw 8-bit byte. */ |
73 #define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1) | 80 #define CHAR_BYTE8_HEAD_P(byte) ((byte) == 0xC0 || (byte) == 0xC1) |
74 | 81 |