* coding.c (coding_set_destination): Use BEG_BYTE rather than hardcoding 1.
(detect_coding_system): * lisp.h (detect_coding_system, chars_in_text, multibyte_chars_in_text) (string_char_to_byte, string_byte_to_char, insert_from_gap): * insdel.c (insert_from_gap): * fns.c (string_char_byte_cache_charpos, string_char_byte_cache_bytepos) (string_char_to_byte, string_byte_to_char, string_make_multibyte) (string_to_multibyte): * character.c (chars_in_text, multibyte_chars_in_text): * fileio.c (Finsert_file_contents): Use EMACS_INT for buffer positions.
This commit is contained in:
parent
8b8bf8e68f
commit
13818c3078
7 changed files with 48 additions and 36 deletions
|
@ -999,7 +999,7 @@ coding_set_destination (coding)
|
|||
{
|
||||
if (coding->src_pos < 0)
|
||||
{
|
||||
coding->destination = BEG_ADDR + coding->dst_pos_byte - 1;
|
||||
coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE;
|
||||
coding->dst_bytes = (GAP_END_ADDR
|
||||
- (coding->src_bytes - coding->consumed)
|
||||
- coding->destination);
|
||||
|
@ -1009,7 +1009,7 @@ coding_set_destination (coding)
|
|||
/* We are sure that coding->dst_pos_byte is before the gap
|
||||
of the buffer. */
|
||||
coding->destination = (BUF_BEG_ADDR (XBUFFER (coding->dst_object))
|
||||
+ coding->dst_pos_byte - 1);
|
||||
+ coding->dst_pos_byte - BEG_BYTE);
|
||||
coding->dst_bytes = (BUF_GAP_END_ADDR (XBUFFER (coding->dst_object))
|
||||
- coding->destination);
|
||||
}
|
||||
|
@ -7329,7 +7329,8 @@ Lisp_Object
|
|||
detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
|
||||
coding_system)
|
||||
const unsigned char *src;
|
||||
int src_chars, src_bytes, highest;
|
||||
EMACS_INT src_chars, src_bytes;
|
||||
int highest;
|
||||
int multibytep;
|
||||
Lisp_Object coding_system;
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue