Commit 62a6e103 authored by Andreas Schwab's avatar Andreas Schwab

* character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Remove

ignored second argument.  All callers changed.
* regex.c (STRING_CHAR, STRING_CHAR_AND_LENGTH, RE_STRING_CHAR)
(RE_STRING_CHAR_AND_LENGTH): Likewise.
* xdisp.c (string_char_and_length): Likewise.
parent c3b616a9
2009-11-21 Andreas Schwab <schwab@linux-m68k.org>
* character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Remove
ignored second argument. All callers changed.
* regex.c (STRING_CHAR, STRING_CHAR_AND_LENGTH, RE_STRING_CHAR)
(RE_STRING_CHAR_AND_LENGTH): Likewise.
* xdisp.c (string_char_and_length): Likewise.
2009-11-21 Dan Nicolaescu <dann@ics.uci.edu>
* xterm.c (x_new_font):
......
......@@ -2409,7 +2409,7 @@ current buffer is cleared. */)
p++, pos++;
else if (CHAR_BYTE8_HEAD_P (*p))
{
c = STRING_CHAR_AND_LENGTH (p, stop - pos, bytes);
c = STRING_CHAR_AND_LENGTH (p, bytes);
/* Delete all bytes for this 8-bit character but the
last one, and change the last one to the charcter
code. */
......
......@@ -330,7 +330,7 @@ extern unsigned char *_fetch_multibyte_char_p;
#define FETCH_MULTIBYTE_CHAR(pos) \
(_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \
+ (pos) + BEG_ADDR - BEG_BYTE), \
STRING_CHAR (_fetch_multibyte_char_p, 0))
STRING_CHAR (_fetch_multibyte_char_p))
/* Return character at position POS. If the current buffer is unibyte
and the character is not ASCII, make the returning character
......@@ -389,7 +389,7 @@ extern unsigned char *_fetch_multibyte_char_p;
(_fetch_multibyte_char_p \
= (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \
+ (pos) + BUF_BEG_ADDR (buf) - BEG_BYTE), \
STRING_CHAR (_fetch_multibyte_char_p, 0))
STRING_CHAR (_fetch_multibyte_char_p))
/* Define the actual buffer data structures. */
......
......@@ -133,7 +133,7 @@ casify_object (flag, obj)
bcopy (old_dst, dst, o - old_dst);
o = dst + (o - old_dst);
}
c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, 0, len);
c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i_byte, len);
if (inword && flag != CASE_CAPITALIZE_UP)
c = DOWNCASE (c);
else if (!UPPERCASEP (c)
......
......@@ -405,7 +405,7 @@ c_string_width (const unsigned char *str, int len, int precision, int *nchars, i
{
int bytes, thiswidth;
Lisp_Object val;
int c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
int c = STRING_CHAR_AND_LENGTH (str + i_byte, bytes);
if (dp)
{
......@@ -495,7 +495,7 @@ lisp_string_width (string, precision, nchars, nbytes)
int c;
if (multibyte)
c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
c = STRING_CHAR_AND_LENGTH (str + i_byte, bytes);
else
c = str[i_byte], bytes = 1;
chars = 1;
......@@ -1061,7 +1061,7 @@ character is not ASCII nor 8-bit character, an error is signalled. */)
if (! STRING_MULTIBYTE (string))
return make_number (*p);
}
c = STRING_CHAR (p, 0);
c = STRING_CHAR (p);
if (CHAR_BYTE8_P (c))
c = CHAR_TO_BYTE8 (c);
else if (! ASCII_CHAR_P (c))
......
......@@ -311,10 +311,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
} while (0)
/* Return the character code of character whose multibyte form is at
P. The argument LEN is ignored. It will be removed in the
future. */
P. */
#define STRING_CHAR(p, len) \
#define STRING_CHAR(p) \
(!((p)[0] & 0x80) \
? (p)[0] \
: ! ((p)[0] & 0x20) \
......@@ -329,10 +328,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Like STRING_CHAR, but set ACTUAL_LEN to the length of multibyte
form. The argument LEN is ignored. It will be removed in the
future. */
form. */
#define STRING_CHAR_AND_LENGTH(p, len, actual_len) \
#define STRING_CHAR_AND_LENGTH(p, actual_len) \
(!((p)[0] & 0x80) \
? ((actual_len) = 1, (p)[0]) \
: ! ((p)[0] & 0x20) \
......@@ -382,7 +380,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
int len; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, 0, len); \
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
} \
else \
......@@ -405,7 +403,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
int len; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, 0, len); \
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
} \
else \
......@@ -426,7 +424,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
unsigned char *ptr = &SDATA (STRING)[BYTEIDX]; \
int len; \
\
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, 0, len); \
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
CHARIDX++; \
} \
......@@ -445,7 +443,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
\
OUTPUT= STRING_CHAR_AND_LENGTH (ptr, 0, len); \
OUTPUT= STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
} \
else \
......@@ -465,7 +463,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
unsigned char *ptr = BYTE_POS_ADDR (BYTEIDX); \
int len; \
\
OUTPUT= STRING_CHAR_AND_LENGTH (ptr, 0, len); \
OUTPUT = STRING_CHAR_AND_LENGTH (ptr, len); \
BYTEIDX += len; \
CHARIDX++; \
} \
......
......@@ -1321,7 +1321,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string)
retry:
check_val = Qnil;
/* At first, check if POS is composable. */
c = STRING_CHAR (cur.p, 0);
c = STRING_CHAR (cur.p);
if (! CHAR_COMPOSABLE_P (c))
{
if (limit < 0)
......@@ -1347,7 +1347,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string)
fore_check_limit = cur.pos;
break;
}
c = STRING_CHAR (cur.p, 0);
c = STRING_CHAR (cur.p);
if (! CHAR_COMPOSABLE_P (c))
break;
val = CHAR_TABLE_REF (Vcomposition_function_table, c);
......@@ -1368,7 +1368,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string)
if (get_property_and_range (cur.pos, Qcomposition, &val, &b, &e, Qnil)
&& COMPOSITION_VALID_P (b, e, val))
break;
c = STRING_CHAR (cur.p, 0);
c = STRING_CHAR (cur.p);
if (! CHAR_COMPOSABLE_P (c))
break;
val = CHAR_TABLE_REF (Vcomposition_function_table, c);
......@@ -1391,7 +1391,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string)
if (NILP (check_val))
{
c = STRING_CHAR (cur.p, 0);
c = STRING_CHAR (cur.p);
check_val = CHAR_TABLE_REF (Vcomposition_function_table, c);
}
for (; CONSP (check_val); check_val = XCDR (check_val))
......
......@@ -2007,8 +2007,7 @@ or a byte-code object. IDX starts at 0. */)
return make_number ((unsigned char) SREF (array, idxval));
idxval_byte = string_char_to_byte (array, idxval);
c = STRING_CHAR (SDATA (array) + idxval_byte,
SBYTES (array) - idxval_byte);
c = STRING_CHAR (SDATA (array) + idxval_byte);
return make_number (c);
}
else if (BOOL_VECTOR_P (array))
......
......@@ -767,9 +767,8 @@ a new string, without any text properties, is returned. */)
if (multibyte)
{
int len;
int maxlen = SDATA (string) + SBYTES (string) - strp;
STRING_CHAR_AND_LENGTH (strp, maxlen, len);
STRING_CHAR_AND_LENGTH (strp, len);
if (len == 1)
*bufp = *strp;
else
......@@ -931,9 +930,8 @@ a new string, without any text properties, is returned. */)
else
{
int len;
int maxlen = SDATA (string) + SBYTES (string) - strp;
STRING_CHAR_AND_LENGTH (strp, maxlen, len);
STRING_CHAR_AND_LENGTH (strp, len);
if (len == 1)
*bufp = *strp;
else
......
......@@ -231,7 +231,7 @@ A multibyte character is handled correctly. */)
if (SCHARS (string))
{
if (STRING_MULTIBYTE (string))
XSETFASTINT (val, STRING_CHAR (SDATA (string), SBYTES (string)));
XSETFASTINT (val, STRING_CHAR (SDATA (string)));
else
XSETFASTINT (val, SREF (string, 0));
}
......@@ -2983,7 +2983,7 @@ check_translation (pos, pos_byte, end, val)
memcpy (newbuf, buf, sizeof (int) * buf_used);
buf = newbuf;
}
buf[buf_used++] = STRING_CHAR_AND_LENGTH (p, 0, len);
buf[buf_used++] = STRING_CHAR_AND_LENGTH (p, len);
pos_byte += len;
}
if (XINT (AREF (elt, i)) != buf[i])
......@@ -3052,7 +3052,7 @@ It returns the number of characters changed. */)
Lisp_Object val;
if (multibyte)
oc = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, len);
oc = STRING_CHAR_AND_LENGTH (p, len);
else
oc = *p, len = 1;
if (oc < size)
......@@ -3064,8 +3064,7 @@ It returns the number of characters changed. */)
if (string_multibyte)
{
str = tt + string_char_to_byte (table, oc);
nc = STRING_CHAR_AND_LENGTH (str, MAX_MULTIBYTE_LENGTH,
str_len);
nc = STRING_CHAR_AND_LENGTH (str, str_len);
}
else
{
......
......@@ -277,7 +277,7 @@ report_file_error (string, data)
int c;
str = (char *) SDATA (errstring);
c = STRING_CHAR (str, 0);
c = STRING_CHAR (str);
Faset (errstring, make_number (0), make_number (DOWNCASE (c)));
}
......
......@@ -1711,8 +1711,7 @@ to be sure of changing the value of `foo'. */)
{
if (STRING_MULTIBYTE (seq))
{
c = STRING_CHAR (SDATA (seq) + ibyte,
SBYTES (seq) - ibyte);
c = STRING_CHAR (SDATA (seq) + ibyte);
cbytes = CHAR_BYTES (c);
}
else
......@@ -1742,8 +1741,7 @@ to be sure of changing the value of `foo'. */)
{
if (STRING_MULTIBYTE (seq))
{
c = STRING_CHAR (SDATA (seq) + ibyte,
SBYTES (seq) - ibyte);
c = STRING_CHAR (SDATA (seq) + ibyte);
cbytes = CHAR_BYTES (c);
}
else
......@@ -3363,7 +3361,7 @@ base64_encode_1 (from, to, length, line_break, multibyte)
{
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
c = STRING_CHAR_AND_LENGTH (from + i, bytes);
if (CHAR_BYTE8_P (c))
c = CHAR_TO_BYTE8 (c);
else if (c >= 256)
......@@ -3403,7 +3401,7 @@ base64_encode_1 (from, to, length, line_break, multibyte)
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
c = STRING_CHAR_AND_LENGTH (from + i, bytes);
if (CHAR_BYTE8_P (c))
c = CHAR_TO_BYTE8 (c);
else if (c >= 256)
......@@ -3427,7 +3425,7 @@ base64_encode_1 (from, to, length, line_break, multibyte)
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (from + i, length - i, bytes);
c = STRING_CHAR_AND_LENGTH (from + i, bytes);
if (CHAR_BYTE8_P (c))
c = CHAR_TO_BYTE8 (c);
else if (c >= 256)
......
......@@ -3863,7 +3863,7 @@ font_at (c, pos, face, w, string)
EMACS_INT pos_byte = string_char_to_byte (string, pos);
str = SDATA (string) + pos_byte;
c = STRING_CHAR (str, 0);
c = STRING_CHAR (str);
}
else
c = SDATA (string)[pos];
......
......@@ -295,7 +295,7 @@ skip_invisible (pos, next_boundary_p, to, window)
int c; \
\
wide_column = 0; \
c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, bytes); \
c = STRING_CHAR_AND_LENGTH (p, bytes); \
if (BYTES_BY_CHAR_HEAD (*p) != bytes) \
width = bytes * 4; \
else \
......
......@@ -648,7 +648,7 @@ copy_text (const unsigned char *from_addr, unsigned char *to_addr,
while (bytes_left > 0)
{
int thislen, c;
c = STRING_CHAR_AND_LENGTH (from_addr, bytes_left, thislen);
c = STRING_CHAR_AND_LENGTH (from_addr, thislen);
if (! ASCII_CHAR_P (c))
c &= 0xFF;
*to_addr++ = c;
......
......@@ -303,7 +303,7 @@ readchar (readcharfun, multibyte)
/* Fetch the character code from the buffer. */
unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, pt_byte);
BUF_INC_POS (inbuffer, pt_byte);
c = STRING_CHAR (p, pt_byte - orig_pt_byte);
c = STRING_CHAR (p);
if (multibyte)
*multibyte = 1;
}
......@@ -332,7 +332,7 @@ readchar (readcharfun, multibyte)
/* Fetch the character code from the buffer. */
unsigned char *p = BUF_BYTE_ADDRESS (inbuffer, bytepos);
BUF_INC_POS (inbuffer, bytepos);
c = STRING_CHAR (p, bytepos - orig_bytepos);
c = STRING_CHAR (p);
if (multibyte)
*multibyte = 1;
}
......@@ -439,7 +439,7 @@ readchar (readcharfun, multibyte)
}
buf[i++] = c;
}
return STRING_CHAR (buf, i);
return STRING_CHAR (buf);
}
/* Unread the character C in the way appropriate for the stream READCHARFUN.
......
......@@ -401,7 +401,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte)
int len;
for (i = 0; i < size_byte; i += len)
{
int ch = STRING_CHAR_AND_LENGTH (ptr + i, size_byte - i, len);
int ch = STRING_CHAR_AND_LENGTH (ptr + i, len);
insert_char (ch);
}
}
......@@ -427,7 +427,7 @@ strout (ptr, size, size_byte, printcharfun, multibyte)
corresponding character code before handing it to
PRINTCHAR. */
int len;
int ch = STRING_CHAR_AND_LENGTH (ptr + i, size_byte - i, len);
int ch = STRING_CHAR_AND_LENGTH (ptr + i, len);
PRINTCHAR (ch);
i += len;
}
......@@ -519,8 +519,7 @@ print_string (string, printcharfun)
/* Here, we must convert each multi-byte form to the
corresponding character code before handing it to PRINTCHAR. */
int len;
int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i,
size_byte - i, len);
int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i, len);
PRINTCHAR (ch);
i += len;
}
......@@ -1645,8 +1644,7 @@ print_object (obj, printcharfun, escapeflag)
if (multibyte)
{
c = STRING_CHAR_AND_LENGTH (str + i_byte,
size_byte - i_byte, len);
c = STRING_CHAR_AND_LENGTH (str + i_byte, len);
i_byte += len;
}
else
......
......@@ -477,7 +477,7 @@ status_message (p)
if (! NILP (Vlocale_coding_system))
string = (code_convert_string_norecord
(string, Vlocale_coding_system, 0));
c1 = STRING_CHAR ((char *) SDATA (string), 0);
c1 = STRING_CHAR ((char *) SDATA (string));
c2 = DOWNCASE (c1);
if (c1 != c2)
Faset (string, make_number (0), make_number (c2));
......
......@@ -147,10 +147,10 @@
# define RE_MULTIBYTE_P(bufp) ((bufp)->multibyte)
# define RE_TARGET_MULTIBYTE_P(bufp) ((bufp)->target_multibyte)
# define RE_STRING_CHAR(p, s, multibyte) \
(multibyte ? (STRING_CHAR (p, s)) : (*(p)))
# define RE_STRING_CHAR_AND_LENGTH(p, s, len, multibyte) \
(multibyte ? (STRING_CHAR_AND_LENGTH (p, s, len)) : ((len) = 1, *(p)))
# define RE_STRING_CHAR(p, multibyte) \
(multibyte ? (STRING_CHAR (p)) : (*(p)))
# define RE_STRING_CHAR_AND_LENGTH(p, len, multibyte) \
(multibyte ? (STRING_CHAR_AND_LENGTH (p, len)) : ((len) = 1, *(p)))
# define RE_CHAR_TO_MULTIBYTE(c) UNIBYTE_TO_CHAR (c)
......@@ -166,7 +166,7 @@
re_char *dtemp = (p) == (str2) ? (end1) : (p); \
re_char *dlimit = ((p) > (str2) && (p) <= (end2)) ? (str2) : (str1); \
while (dtemp-- > dlimit && !CHAR_HEAD_P (*dtemp)); \
c = STRING_CHAR (dtemp, (p) - dtemp); \
c = STRING_CHAR (dtemp); \
} \
else \
{ \
......@@ -180,7 +180,7 @@
# define GET_CHAR_AFTER(c, p, len) \
do { \
if (target_multibyte) \
(c) = STRING_CHAR_AND_LENGTH (p, 0, len); \
(c) = STRING_CHAR_AND_LENGTH (p, len); \
else \
{ \
(c) = *p; \
......@@ -302,11 +302,11 @@ enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 };
# define SAME_CHARSET_P(c1, c2) (1)
# define MULTIBYTE_FORM_LENGTH(p, s) (1)
# define PREV_CHAR_BOUNDARY(p, limit) ((p)--)
# define STRING_CHAR(p, s) (*(p))
# define RE_STRING_CHAR(p, s, multibyte) STRING_CHAR ((p), (s))
# define STRING_CHAR(p) (*(p))
# define RE_STRING_CHAR(p, multibyte) STRING_CHAR (p)
# define CHAR_STRING(c, s) (*(s) = (c), 1)
# define STRING_CHAR_AND_LENGTH(p, s, actual_len) ((actual_len) = 1, *(p))
# define RE_STRING_CHAR_AND_LENGTH(p, s, len, multibyte) STRING_CHAR_AND_LENGTH ((p), (s), (len))
# define STRING_CHAR_AND_LENGTH(p, actual_len) ((actual_len) = 1, *(p))
# define RE_STRING_CHAR_AND_LENGTH(p, len, multibyte) STRING_CHAR_AND_LENGTH (p, len)
# define RE_CHAR_TO_MULTIBYTE(c) (c)
# define RE_CHAR_TO_UNIBYTE(c) (c)
# define GET_CHAR_BEFORE_2(c, p, str1, end1, str2, end2) \
......@@ -1757,7 +1757,7 @@ static int analyse_first _RE_ARGS ((re_char *p, re_char *pend,
do { \
int len; \
if (p == pend) return REG_EEND; \
c = RE_STRING_CHAR_AND_LENGTH (p, pend - p, len, multibyte); \
c = RE_STRING_CHAR_AND_LENGTH (p, len, multibyte); \
p += len; \
} while (0)
......@@ -4541,8 +4541,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
{
int buf_charlen;
buf_ch = STRING_CHAR_AND_LENGTH (d, range - lim,
buf_charlen);
buf_ch = STRING_CHAR_AND_LENGTH (d, buf_charlen);
buf_ch = RE_TRANSLATE (translate, buf_ch);
if (fastmap[CHAR_LEADING_CODE (buf_ch)])
break;
......@@ -4574,8 +4573,7 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
{
int buf_charlen;
buf_ch = STRING_CHAR_AND_LENGTH (d, range - lim,
buf_charlen);
buf_ch = STRING_CHAR_AND_LENGTH (d, buf_charlen);
if (fastmap[CHAR_LEADING_CODE (buf_ch)])
break;
range -= buf_charlen;
......@@ -4592,12 +4590,9 @@ re_search_2 (bufp, str1, size1, str2, size2, startpos, range, regs, stop)
}
else /* Searching backwards. */
{
int room = (startpos >= size1
? size2 + size1 - startpos
: size1 - startpos);
if (multibyte)
{
buf_ch = STRING_CHAR (d, room);
buf_ch = STRING_CHAR (d);
buf_ch = TRANSLATE (buf_ch);
if (! fastmap[CHAR_LEADING_CODE (buf_ch)])
goto advance;
......@@ -4888,11 +4883,11 @@ mutually_exclusive_p (bufp, p1, p2)
{
register re_wchar_t c
= (re_opcode_t) *p2 == endline ? '\n'
: RE_STRING_CHAR (p2 + 2, pend - p2 - 2, multibyte);
: RE_STRING_CHAR (p2 + 2, multibyte);
if ((re_opcode_t) *p1 == exactn)
{
if (c != RE_STRING_CHAR (p1 + 2, pend - p1 - 2, multibyte))
if (c != RE_STRING_CHAR (p1 + 2, multibyte))
{
DEBUG_PRINT3 (" '%c' != '%c' => fast loop.\n", c, p1[2]);
return 1;
......@@ -5543,13 +5538,13 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
PREFETCH ();
if (multibyte)
pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen);
pat_ch = STRING_CHAR_AND_LENGTH (p, pat_charlen);
else
{
pat_ch = RE_CHAR_TO_MULTIBYTE (*p);
pat_charlen = 1;
}
buf_ch = STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen);
buf_ch = STRING_CHAR_AND_LENGTH (d, buf_charlen);
if (TRANSLATE (buf_ch) != pat_ch)
{
......@@ -5571,7 +5566,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
PREFETCH ();
if (multibyte)
{
pat_ch = STRING_CHAR_AND_LENGTH (p, pend - p, pat_charlen);
pat_ch = STRING_CHAR_AND_LENGTH (p, pat_charlen);
pat_ch = RE_CHAR_TO_UNIBYTE (pat_ch);
}
else
......@@ -5611,7 +5606,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT1 ("EXECUTING anychar.\n");
PREFETCH ();
buf_ch = RE_STRING_CHAR_AND_LENGTH (d, dend - d, buf_charlen,
buf_ch = RE_STRING_CHAR_AND_LENGTH (d, buf_charlen,
target_multibyte);
buf_ch = TRANSLATE (buf_ch);
......@@ -5659,7 +5654,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
PREFETCH ();
c = RE_STRING_CHAR_AND_LENGTH (d, dend - d, len, target_multibyte);
c = RE_STRING_CHAR_AND_LENGTH (d, len, target_multibyte);
if (target_multibyte)
{
int c1;
......@@ -6257,7 +6252,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
UPDATE_SYNTAX_TABLE (charpos);
#endif
PREFETCH ();
c2 = RE_STRING_CHAR (d, dend - d, target_multibyte);
c2 = RE_STRING_CHAR (d, target_multibyte);
s2 = SYNTAX (c2);
/* Case 2: S2 is neither Sword nor Ssymbol. */
......@@ -6310,7 +6305,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
if (!AT_STRINGS_END (d))
{
PREFETCH_NOLIMIT ();
c2 = RE_STRING_CHAR (d, dend - d, target_multibyte);
c2 = RE_STRING_CHAR (d, target_multibyte);
#ifdef emacs
UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1);
#endif
......
......@@ -1387,7 +1387,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n,
base_pat++;
}
c = STRING_CHAR_AND_LENGTH (base_pat, len_byte, in_charlen);
c = STRING_CHAR_AND_LENGTH (base_pat, in_charlen);
if (NILP (trt))
{
......@@ -1527,7 +1527,6 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
EMACS_INT this_pos = pos;
EMACS_INT this_pos_byte = pos_byte;
int this_len = len;
int this_len_byte = len_byte;
unsigned char *p = pat;
if (pos + len > lim || pos_byte + len_byte > lim_byte)
goto stop;
......@@ -1537,16 +1536,14 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
int charlen, buf_charlen;
int pat_ch, buf_ch;
pat_ch = STRING_CHAR_AND_LENGTH (p, this_len_byte, charlen);
pat_ch = STRING_CHAR_AND_LENGTH (p, charlen);
buf_ch = STRING_CHAR_AND_LENGTH (BYTE_POS_ADDR (this_pos_byte),
ZV_BYTE - this_pos_byte,
buf_charlen);
TRANSLATE (buf_ch, trt, buf_ch);
if (buf_ch != pat_ch)
break;
this_len_byte -= charlen;
this_len--;
p += charlen;
......@@ -1615,7 +1612,6 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
EMACS_INT this_pos = pos - len;
EMACS_INT this_pos_byte;
int this_len = len;
int this_len_byte = len_byte;
unsigned char *p = pat;
if (this_pos < lim || (pos_byte - len_byte) < lim_byte)
......@@ -1628,16 +1624,14 @@ simple_search (n, pat, len, len_byte, trt, pos, pos_byte, lim, lim_byte)
int charlen, buf_charlen;
int pat_ch, buf_ch;
pat_ch = STRING_CHAR_AND_LENGTH (p, this_len_byte, charlen);
pat_ch = STRING_CHAR_AND_LENGTH (p, charlen);
buf_ch = STRING_CHAR_AND_LENGTH (BYTE_POS_ADDR (this_pos_byte),
ZV_BYTE - this_pos_byte,
buf_charlen);
TRANSLATE (buf_ch, trt, buf_ch);
if (buf_ch != pat_ch)
break;
this_len_byte -= charlen;
this_len--;
p += charlen;
this_pos_byte += buf_charlen;
......@@ -1841,7 +1835,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
while (! (CHAR_HEAD_P (*charstart)))
charstart--;
ch = STRING_CHAR (charstart, ptr - charstart + 1);
ch = STRING_CHAR (charstart);
if (char_base != (ch & ~0x3F))
ch = -1;
}
......
......@@ -911,8 +911,7 @@ text property. */)
if (*p)
{
int len;
int character = (STRING_CHAR_AND_LENGTH
(p, SBYTES (string) - 1, len));
int character = STRING_CHAR_AND_LENGTH (p, len);
XSETINT (match, character);
if (XFASTINT (match) == ' ')
match = Qnil;
......@@ -1588,12 +1587,12 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
unsigned char leading_code;
leading_code = str[i_byte];
c = STRING_CHAR_AND_LENGTH (str + i_byte, size_byte-i_byte, len);
c = STRING_CHAR_AND_LENGTH (str + i_byte, len);
i_byte += len;
if (handle_iso_classes && c == '['
&& i_byte < size_byte
&& STRING_CHAR (str + i_byte, size_byte - i_byte) == ':')
&& STRING_CHAR (str + i_byte) == ':')
{
const <