summaryrefslogtreecommitdiff
path: root/src/charset.h
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-03-14 00:27:57 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-03-14 00:27:57 +0000
commit66f0296e4897de71e31a1663d4b92d580476e2b2 (patch)
treeb9622b13082f428cb56d652782663157a69c3387 /src/charset.h
parenta735b7e1cff3f1a5bfa20b4388f5d3da41491a53 (diff)
downloademacs-66f0296e4897de71e31a1663d4b92d580476e2b2.tar.gz
emacs-66f0296e4897de71e31a1663d4b92d580476e2b2.tar.bz2
emacs-66f0296e4897de71e31a1663d4b92d580476e2b2.zip
* 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.
Diffstat (limited to 'src/charset.h')
-rw-r--r--src/charset.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/charset.h b/src/charset.h
index 6b2e25b89dd..3acc447c5f8 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -577,26 +577,15 @@ else
? 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)