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 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):
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. */
#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
(_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))
\f
/* Define the actual buffer data structures. */
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)
{
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)
{
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;
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))
} 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) \
/* 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) \
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 \
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 \
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++; \
} \
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 \
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++; \
} \
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)
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);
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);
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))
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))
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
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
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));
}
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])
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)
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
{
int c;
str = (char *) SDATA (errstring);
- c = STRING_CHAR (str, 0);
+ c = STRING_CHAR (str);
Faset (errstring, make_number (0), make_number (DOWNCASE (c)));
}
{
if (STRING_MULTIBYTE (seq))
{
- c = STRING_CHAR (SDATA (seq) + ibyte,
- SBYTES (seq) - ibyte);
+ c = STRING_CHAR (SDATA (seq) + ibyte);
cbytes = CHAR_BYTES (c);
}
else
{
if (STRING_MULTIBYTE (seq))
{
- c = STRING_CHAR (SDATA (seq) + ibyte,
- SBYTES (seq) - ibyte);
+ c = STRING_CHAR (SDATA (seq) + ibyte);
cbytes = CHAR_BYTES (c);
}
else
{
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)
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)
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)
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];
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 \
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;
/* 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;
}
/* 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;
}
}
buf[i++] = c;
}
- return STRING_CHAR (buf, i);
+ return STRING_CHAR (buf);
}
/* Unread the character C in the way appropriate for the stream READCHARFUN.
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);
}
}
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;
}
/* 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;
}
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
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));
# 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)
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 \
{ \
# 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; \
# 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) \
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)
{
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;
{
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;
}
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;
{
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;
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)
{
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
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);
}
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;
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. */
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
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))
{
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;
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;
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)
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;
while (! (CHAR_HEAD_P (*charstart)))
charstart--;
- ch = STRING_CHAR (charstart, ptr - charstart + 1);
+ ch = STRING_CHAR (charstart);
if (char_base != (ch & ~0x3F))
ch = -1;
}
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;
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 unsigned char *class_beg = str + i_byte + 1;
const unsigned char *class_end = class_beg;
break;
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;
}
/* Treat `-' as range character only if another character
/* Get the end of the range. */
leading_code2 = str[i_byte];
- c2 = STRING_CHAR_AND_LENGTH (str + i_byte,
- size_byte - i_byte, len);
+ c2 = STRING_CHAR_AND_LENGTH (str + i_byte, len);
i_byte += len;
if (c2 == '\\'
&& i_byte < size_byte)
{
leading_code2 = str[i_byte];
- c2 =STRING_CHAR_AND_LENGTH (str + i_byte, size_byte-i_byte, len);
+ c2 =STRING_CHAR_AND_LENGTH (str + i_byte, len);
i_byte += len;
}
p = GAP_END_ADDR;
stop = endp;
}
- c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
+ c = STRING_CHAR_AND_LENGTH (p, nbytes);
if (! NILP (iso_classes) && in_classes (c, iso_classes))
{
if (negate)
}
prev_p = p;
while (--p >= stop && ! CHAR_HEAD_P (*p));
- c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
+ c = STRING_CHAR (p);
if (! NILP (iso_classes) && in_classes (c, iso_classes))
{
p = GAP_END_ADDR;
stop = endp;
}
- c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes);
+ c = STRING_CHAR_AND_LENGTH (p, nbytes);
if (! fastmap[(int) SYNTAX (c)])
break;
p += nbytes, pos++, pos_byte += nbytes;
UPDATE_SYNTAX_TABLE_BACKWARD (pos - 1);
prev_p = p;
while (--p >= stop && ! CHAR_HEAD_P (*p));
- c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH);
+ c = STRING_CHAR (p);
if (! fastmap[(int) SYNTAX (c)])
break;
pos--, pos_byte -= prev_p - p;
static int display_echo_area_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
static int resize_mini_window_1 P_ ((EMACS_INT, Lisp_Object, EMACS_INT, EMACS_INT));
static Lisp_Object unwind_redisplay P_ ((Lisp_Object));
-static int string_char_and_length P_ ((const unsigned char *, int, int *));
+static int string_char_and_length P_ ((const unsigned char *, int *));
static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object,
struct text_pos));
static int compute_window_start_on_continuation_line P_ ((struct window *));
character. */
static INLINE int
-string_char_and_length (str, maxlen, len)
+string_char_and_length (str, len)
const unsigned char *str;
- int maxlen, *len;
+ int *len;
{
int c;
- c = STRING_CHAR_AND_LENGTH (str, maxlen, *len);
+ c = STRING_CHAR_AND_LENGTH (str, *len);
if (!CHAR_VALID_P (c, 1))
/* We may not change the length here because other places in Emacs
don't use this function, i.e. they silently accept invalid
while (nchars--)
{
- string_char_and_length (p, rest, &len);
+ string_char_and_length (p, &len);
p += len, rest -= len;
xassert (rest >= 0);
CHARPOS (pos) += 1;
SET_TEXT_POS (pos, 0, 0);
while (charpos--)
{
- string_char_and_length (s, rest, &len);
+ string_char_and_length (s, &len);
s += len, rest -= len;
xassert (rest >= 0);
CHARPOS (pos) += 1;
for (nchars = 0; rest > 0; ++nchars)
{
- string_char_and_length (p, rest, &len);
+ string_char_and_length (p, &len);
rest -= len, p += len;
}
}
int c, len;
struct face *face = FACE_FROM_ID (it->f, face_id);
- c = string_char_and_length (p, rest, &len);
+ c = string_char_and_length (p, &len);
face_id = FACE_FOR_CHAR (it->f, face, c, CHARPOS (pos), it->string);
}
}
pos_byte = IT_STRING_BYTEPOS (*it);
string = it->string;
s = SDATA (string) + pos_byte;
- it->c = STRING_CHAR (s, 0);
+ it->c = STRING_CHAR (s);
}
else
{
int remaining = SBYTES (it->string) - IT_STRING_BYTEPOS (*it);
const unsigned char *s = (SDATA (it->string)
+ IT_STRING_BYTEPOS (*it));
- it->c = string_char_and_length (s, remaining, &it->len);
+ it->c = string_char_and_length (s, &it->len);
}
else
{
int maxlen = SBYTES (it->string) - IT_STRING_BYTEPOS (*it);
const unsigned char *s = (SDATA (it->string)
+ IT_STRING_BYTEPOS (*it));
- it->c = string_char_and_length (s, maxlen, &it->len);
+ it->c = string_char_and_length (s, &it->len);
}
else
{
performance problem because there is no noticeable performance
difference between Emacs running in unibyte or multibyte mode. */
int maxlen = strlen (it->s) - IT_BYTEPOS (*it);
- it->c = string_char_and_length (it->s + IT_BYTEPOS (*it),
- maxlen, &it->len);
+ it->c = string_char_and_length (it->s + IT_BYTEPOS (*it), &it->len);
}
else
it->c = it->s[IT_BYTEPOS (*it)], it->len = 1;
/* Get the next character, maybe multibyte. */
p = BYTE_POS_ADDR (IT_BYTEPOS (*it));
if (it->multibyte_p && !ASCII_BYTE_P (*p))
- it->c = STRING_CHAR_AND_LENGTH (p, 0, it->len);
+ it->c = STRING_CHAR_AND_LENGTH (p, it->len);
else
it->c = *p, it->len = 1;
for the *Message* buffer. */
for (i = 0; i < nbytes; i += char_bytes)
{
- c = string_char_and_length (m + i, nbytes - i, &char_bytes);
+ c = string_char_and_length (m + i, &char_bytes);
work[0] = (ASCII_CHAR_P (c)
? c
: multibyte_char_to_unibyte (c, Qnil));
/* Convert a multibyte string to single-byte. */
for (i = 0; i < nbytes; i += n)
{
- c = string_char_and_length (s + i, nbytes - i, &n);
+ c = string_char_and_length (s + i, &n);
work[0] = (ASCII_CHAR_P (c)
? c
: multibyte_char_to_unibyte (c, Qnil));
/* Get the next character. */
if (multibyte_p)
- it.c = string_char_and_length (p, arrow_len, &it.len);
+ it.c = string_char_and_length (p, &it.len);
else
it.c = *p, it.len = 1;
p += it.len;
{
int maxlen = ((IT_BYTEPOS (*it) >= GPT ? ZV : GPT)
- IT_BYTEPOS (*it));
- it2.c = STRING_CHAR_AND_LENGTH (p, maxlen, it2.len);
+ it2.c = STRING_CHAR_AND_LENGTH (p, it2.len);
}
else
it2.c = *p, it2.len = 1;
if (nchars == nbytes)
c = copy_bufptr[i], len = 1;
else
- c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
- nbytes - i, len);
+ c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, len);
inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
? ASCII_KEYSTROKE_EVENT
: MULTIBYTE_CHAR_KEYSTROKE_EVENT);