mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-21 13:10:37 -08:00
Use STRING_BYTES and SET_STRING_BYTES.
This commit is contained in:
parent
e7654b4a74
commit
fc932ac6c7
31 changed files with 210 additions and 201 deletions
11
src/coding.c
11
src/coding.c
|
|
@ -4283,7 +4283,8 @@ code_convert_string (str, coding, encodep, nocopy)
|
|||
{
|
||||
int len;
|
||||
char *buf;
|
||||
int from = 0, to = XSTRING (str)->size, to_byte = XSTRING (str)->size_byte;
|
||||
int from = 0, to = XSTRING (str)->size;
|
||||
int to_byte = STRING_BYTES (XSTRING (str));
|
||||
struct gcpro gcpro1;
|
||||
Lisp_Object saved_coding_symbol = Qnil;
|
||||
int result;
|
||||
|
|
@ -4359,7 +4360,7 @@ code_convert_string (str, coding, encodep, nocopy)
|
|||
len = encoding_buffer_size (coding, to_byte - from);
|
||||
else
|
||||
len = decoding_buffer_size (coding, to_byte - from);
|
||||
len += from + XSTRING (str)->size_byte - to_byte;
|
||||
len += from + STRING_BYTES (XSTRING (str)) - to_byte;
|
||||
GCPRO1 (str);
|
||||
buf = get_conversion_buffer (len);
|
||||
UNGCPRO;
|
||||
|
|
@ -4381,9 +4382,9 @@ code_convert_string (str, coding, encodep, nocopy)
|
|||
}
|
||||
|
||||
bcopy (XSTRING (str)->data + to_byte, buf + from + coding->produced,
|
||||
XSTRING (str)->size_byte - to_byte);
|
||||
STRING_BYTES (XSTRING (str)) - to_byte);
|
||||
|
||||
len = from + XSTRING (str)->size_byte - to_byte;
|
||||
len = from + STRING_BYTES (XSTRING (str)) - to_byte;
|
||||
if (encodep)
|
||||
str = make_unibyte_string (buf, len + coding->produced);
|
||||
else
|
||||
|
|
@ -4565,7 +4566,7 @@ highest priority.")
|
|||
CHECK_STRING (string, 0);
|
||||
|
||||
return detect_coding_system (XSTRING (string)->data,
|
||||
XSTRING (string)->size_byte,
|
||||
STRING_BYTES (XSTRING (string)),
|
||||
!NILP (highest));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue