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
}
else
{
- /* Could be the end of the bracket expression. If it's
- not (i.e., when the bracket expression is `[]' so
- far), the ']' character bit gets set way below. */
- if (c == ']' && p != p1 + 1)
- break;
+ /* Could be the end of the bracket expression. If it's
+ not (i.e., when the bracket expression is `[]' so
+ far), the ']' character bit gets set way below. */
+ if (c == ']' && p != p1 + 1)
+ break;
}
/* If C indicates start of multibyte char, get the
else if (!escaped_char &&
syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
- { /* Leave room for the null. */
+ {
+ /* Leave room for the null. */
char str[CHAR_CLASS_MAX_LENGTH + 1];
PATFETCH (c);
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++])
/* Update STARTPOS to the next character boundary. */
if (multibyte)
{
- const unsigned char *p = POS_ADDR_VSTRING (startpos);
- const unsigned char *pend = STOP_ADDR_VSTRING (startpos);
+ const unsigned char *p
+ = (const unsigned char *) POS_ADDR_VSTRING (startpos);
+ const unsigned char *pend
+ = (const unsigned char *) STOP_ADDR_VSTRING (startpos);
int len = MULTIBYTE_FORM_LENGTH (p, pend - p);
range -= len;
}
else
{
- range--;
- startpos++;
- }
+ range--;
+ startpos++;
+ }
}
else
{
/* Update STARTPOS to the previous character boundary. */
if (multibyte)
{
- const unsigned char *p = POS_ADDR_VSTRING (startpos);
+ const unsigned char *p
+ = (const unsigned char *) POS_ADDR_VSTRING (startpos);
int len = 0;
/* Find the head of multibyte form. */
do
{
PREFETCH ();
- if ((unsigned char) translate[(unsigned char) *d++]
+ if ((unsigned char) RE_TRANSLATE (translate, (unsigned char) *d++)
!= (unsigned char) *p++)
goto fail;
}
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;