Mercurial > emacs
diff src/charset.h @ 28138:d2e19a90c9ef
* regex.c: Declare a new type `re_char' used throughout the code for the
string char type. It's `const unsigned char' to match the rest of Emacs.
Consistently make sure all pointers to strings use it and make sure all
pointers into the pattern use `unsigned char'.
(re_match_2_internal): Use `PREFETCH+STRING_CHAR' instead of
GET_CHAR_AFTER_2.
Also merge wordbound and notwordbound to reduce code duplication.
* charset.h (GET_CHAR_AFTER_2): Remove.
(GET_CHAR_BEFORE_2): Use unsigned chars, like everywhere else.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 14 Mar 2000 00:27:57 +0000 |
parents | 85c7cda1975f |
children | 975fe3d8922e |
line wrap: on
line diff
--- a/src/charset.h Mon Mar 13 23:33:46 2000 +0000 +++ b/src/charset.h Tue Mar 14 00:27:57 2000 +0000 @@ -577,26 +577,15 @@ ? 1 \ : multibyte_form_length (str, len)) -/* Set C a (possibly multibyte) character at P. P points into a - string which is the virtual concatenation of STR1 (which ends at - END1) or STR2 (which ends at END2). */ - -#define GET_CHAR_AFTER_2(c, p, str1, end1, str2, end2) \ - do { \ - const char *dtemp = (p) == (end1) ? (str2) : (p); \ - const char *dlimit = ((p) >= (str1) && (p) < (end1)) ? (end1) : (end2); \ - c = STRING_CHAR (dtemp, dlimit - dtemp); \ - } while (0) - /* Set C a (possibly multibyte) character before P. P points into a string which is the virtual concatenation of STR1 (which ends at END1) or STR2 (which ends at END2). */ #define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \ do { \ - const char *dtemp = (p); \ - const char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \ - while (dtemp-- > dlimit && (unsigned char) *dtemp >= 0xA0); \ + const unsigned char *dtemp = (p); \ + const unsigned char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \ + while (dtemp-- > dlimit && *dtemp >= 0xA0); \ c = STRING_CHAR (dtemp, p - dtemp); \ } while (0)