diff options
| author | Richard M. Stallman | 1998-03-21 07:06:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-21 07:06:14 +0000 |
| commit | fc932ac6c7b54ac6f79222a2548707a97d3a44f4 (patch) | |
| tree | 88f9f2ff546b9d84c11515967b4bb5cc3c16d080 /src/coding.c | |
| parent | e7654b4a743e7c54c08629ee336e10a5f1089da6 (diff) | |
| download | emacs-fc932ac6c7b54ac6f79222a2548707a97d3a44f4.tar.gz emacs-fc932ac6c7b54ac6f79222a2548707a97d3a44f4.zip | |
Use STRING_BYTES and SET_STRING_BYTES.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/coding.c b/src/coding.c index 0f6fc3dd985..5e4c0b9afdd 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -4283,7 +4283,8 @@ code_convert_string (str, coding, encodep, nocopy) | |||
| 4283 | { | 4283 | { |
| 4284 | int len; | 4284 | int len; |
| 4285 | char *buf; | 4285 | char *buf; |
| 4286 | int from = 0, to = XSTRING (str)->size, to_byte = XSTRING (str)->size_byte; | 4286 | int from = 0, to = XSTRING (str)->size; |
| 4287 | int to_byte = STRING_BYTES (XSTRING (str)); | ||
| 4287 | struct gcpro gcpro1; | 4288 | struct gcpro gcpro1; |
| 4288 | Lisp_Object saved_coding_symbol = Qnil; | 4289 | Lisp_Object saved_coding_symbol = Qnil; |
| 4289 | int result; | 4290 | int result; |
| @@ -4359,7 +4360,7 @@ code_convert_string (str, coding, encodep, nocopy) | |||
| 4359 | len = encoding_buffer_size (coding, to_byte - from); | 4360 | len = encoding_buffer_size (coding, to_byte - from); |
| 4360 | else | 4361 | else |
| 4361 | len = decoding_buffer_size (coding, to_byte - from); | 4362 | len = decoding_buffer_size (coding, to_byte - from); |
| 4362 | len += from + XSTRING (str)->size_byte - to_byte; | 4363 | len += from + STRING_BYTES (XSTRING (str)) - to_byte; |
| 4363 | GCPRO1 (str); | 4364 | GCPRO1 (str); |
| 4364 | buf = get_conversion_buffer (len); | 4365 | buf = get_conversion_buffer (len); |
| 4365 | UNGCPRO; | 4366 | UNGCPRO; |
| @@ -4381,9 +4382,9 @@ code_convert_string (str, coding, encodep, nocopy) | |||
| 4381 | } | 4382 | } |
| 4382 | 4383 | ||
| 4383 | bcopy (XSTRING (str)->data + to_byte, buf + from + coding->produced, | 4384 | bcopy (XSTRING (str)->data + to_byte, buf + from + coding->produced, |
| 4384 | XSTRING (str)->size_byte - to_byte); | 4385 | STRING_BYTES (XSTRING (str)) - to_byte); |
| 4385 | 4386 | ||
| 4386 | len = from + XSTRING (str)->size_byte - to_byte; | 4387 | len = from + STRING_BYTES (XSTRING (str)) - to_byte; |
| 4387 | if (encodep) | 4388 | if (encodep) |
| 4388 | str = make_unibyte_string (buf, len + coding->produced); | 4389 | str = make_unibyte_string (buf, len + coding->produced); |
| 4389 | else | 4390 | else |
| @@ -4565,7 +4566,7 @@ highest priority.") | |||
| 4565 | CHECK_STRING (string, 0); | 4566 | CHECK_STRING (string, 0); |
| 4566 | 4567 | ||
| 4567 | return detect_coding_system (XSTRING (string)->data, | 4568 | return detect_coding_system (XSTRING (string)->data, |
| 4568 | XSTRING (string)->size_byte, | 4569 | STRING_BYTES (XSTRING (string)), |
| 4569 | !NILP (highest)); | 4570 | !NILP (highest)); |
| 4570 | } | 4571 | } |
| 4571 | 4572 | ||