disp = dp ? DISP_CHAR_VECTOR (dp, c) : Qnil;
if (VECTORP (disp))
- width = ASIZE (disp);
+ width = sanitize_char_width (ASIZE (disp));
else
width = CHAR_WIDTH (c);
{
val = DISP_CHAR_VECTOR (dp, c);
if (VECTORP (val))
- thiswidth = ASIZE (val);
+ thiswidth = sanitize_char_width (ASIZE (val));
else
thiswidth = CHAR_WIDTH (c);
}
{
EMACS_INT chars, bytes, thiswidth;
Lisp_Object val;
- int cmp_id;
+ ptrdiff_t cmp_id;
EMACS_INT ignore, end;
if (find_composition (i, -1, &ignore, &end, &val, string)
{
val = DISP_CHAR_VECTOR (dp, c);
if (VECTORP (val))
- thiswidth = ASIZE (val);
+ thiswidth = sanitize_char_width (ASIZE (val));
else
thiswidth = CHAR_WIDTH (c);
}
}
/* Arrange unibyte text at STR of NBYTES bytes as a multibyte text.
- It actually converts only such 8-bit characters that don't contruct
+ It actually converts only such 8-bit characters that don't construct
a multibyte sequence to multibyte forms of Latin-1 characters. If
NCHARS is nonzero, set *NCHARS to the number of characters in the
text. It is assured that we can use LEN bytes at STR as a work
}
/* Parse unibyte string at STR of LEN bytes, and return the number of
- bytes it may ocupy when converted to multibyte string by
+ bytes it may occupy when converted to multibyte string by
`str_to_multibyte'. */
EMACS_INT
Lisp_Object str;
USE_SAFE_ALLOCA;
- SAFE_ALLOCA (buf, unsigned char *, MAX_MULTIBYTE_LENGTH * n);
+ SAFE_NALLOCA (buf, MAX_MULTIBYTE_LENGTH, n);
p = buf;
for (i = 0; i < n; i++)
non-nil, is an index of a target character in the string.
If the current buffer (or STRING) is multibyte, and the target
-character is not ASCII nor 8-bit character, an error is signalled. */)
+character is not ASCII nor 8-bit character, an error is signaled. */)
(Lisp_Object position, Lisp_Object string)
{
int c;