Mercurial > emacs
diff src/coding.c @ 91807:507bcfb4342c
* 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.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 12 Feb 2008 21:35:15 +0000 |
parents | 0a283ea23533 |
children | 7bed61cbed0c |
line wrap: on
line diff
--- a/src/coding.c Tue Feb 12 21:29:33 2008 +0000 +++ b/src/coding.c Tue Feb 12 21:35:15 2008 +0000 @@ -999,7 +999,7 @@ { 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 @@ /* 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 @@ 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; {