comparison 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
comparison
equal deleted inserted replaced
91806:6c0a55931b1c 91807:507bcfb4342c
997 { 997 {
998 if (BUFFERP (coding->dst_object)) 998 if (BUFFERP (coding->dst_object))
999 { 999 {
1000 if (coding->src_pos < 0) 1000 if (coding->src_pos < 0)
1001 { 1001 {
1002 coding->destination = BEG_ADDR + coding->dst_pos_byte - 1; 1002 coding->destination = BEG_ADDR + coding->dst_pos_byte - BEG_BYTE;
1003 coding->dst_bytes = (GAP_END_ADDR 1003 coding->dst_bytes = (GAP_END_ADDR
1004 - (coding->src_bytes - coding->consumed) 1004 - (coding->src_bytes - coding->consumed)
1005 - coding->destination); 1005 - coding->destination);
1006 } 1006 }
1007 else 1007 else
1008 { 1008 {
1009 /* We are sure that coding->dst_pos_byte is before the gap 1009 /* We are sure that coding->dst_pos_byte is before the gap
1010 of the buffer. */ 1010 of the buffer. */
1011 coding->destination = (BUF_BEG_ADDR (XBUFFER (coding->dst_object)) 1011 coding->destination = (BUF_BEG_ADDR (XBUFFER (coding->dst_object))
1012 + coding->dst_pos_byte - 1); 1012 + coding->dst_pos_byte - BEG_BYTE);
1013 coding->dst_bytes = (BUF_GAP_END_ADDR (XBUFFER (coding->dst_object)) 1013 coding->dst_bytes = (BUF_GAP_END_ADDR (XBUFFER (coding->dst_object))
1014 - coding->destination); 1014 - coding->destination);
1015 } 1015 }
1016 } 1016 }
1017 else 1017 else
7327 7327
7328 Lisp_Object 7328 Lisp_Object
7329 detect_coding_system (src, src_chars, src_bytes, highest, multibytep, 7329 detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
7330 coding_system) 7330 coding_system)
7331 const unsigned char *src; 7331 const unsigned char *src;
7332 int src_chars, src_bytes, highest; 7332 EMACS_INT src_chars, src_bytes;
7333 int highest;
7333 int multibytep; 7334 int multibytep;
7334 Lisp_Object coding_system; 7335 Lisp_Object coding_system;
7335 { 7336 {
7336 const unsigned char *src_end = src + src_bytes; 7337 const unsigned char *src_end = src + src_bytes;
7337 Lisp_Object attrs, eol_type; 7338 Lisp_Object attrs, eol_type;