Mercurial > hg > octave-nkf > gnulib-hg
changeset 963:ed0235161e4b
(TRANSLATE, re_search_2, re_match_2_internal,bcmp_translate):
Use RE_TRANSLATE instead of accessing translate array directly.
author | Richard Stallman <rms@gnu.org> |
---|---|
date | Fri, 04 Jul 1997 20:46:22 +0000 |
parents | 1bd42c6bc7a3 |
children | 22c9a7229cef |
files | regex.c |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/regex.c +++ b/regex.c @@ -1540,7 +1540,7 @@ when we use a character as a subscript we must make it unsigned. */ #ifndef TRANSLATE #define TRANSLATE(d) \ - (translate ? (unsigned char) translate[(unsigned char) (d)] : (d)) + (translate ? (unsigned char) RE_TRANSLATE (translate, (unsigned char) (d)) : (d)) #endif @@ -3810,7 +3810,7 @@ if (translate) while (range > lim && !fastmap[(unsigned char) - translate[(unsigned char) *d++]]) + RE_TRANSLATE (translate, (unsigned char) *d++)]) range--; else while (range > lim && !fastmap[(unsigned char) *d++]) @@ -4500,7 +4500,7 @@ do { PREFETCH (); - if ((unsigned char) translate[(unsigned char) *d++] + if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d++) != (unsigned char) *p++) goto fail; } @@ -5895,7 +5895,8 @@ register unsigned char *p1 = s1, *p2 = s2; while (len) { - if (translate[*p1++] != translate[*p2++]) return 1; + if (RE_TRANSLATE (translate, *p1++) != RE_TRANSLATE (translate, *p2++)) + return 1; len--; } return 0;