diff options
| author | Stefan Monnier | 2008-02-12 21:35:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-02-12 21:35:15 +0000 |
| commit | 13818c30785d1253412c4e08c61417eb81a98c5b (patch) | |
| tree | f5fa90cff90bb458801514d30546ba9538d3af0a /src/coding.c | |
| parent | 8b8bf8e68f19cdbe07521fa2d3c563265b27bd94 (diff) | |
| download | emacs-13818c30785d1253412c4e08c61417eb81a98c5b.tar.gz emacs-13818c30785d1253412c4e08c61417eb81a98c5b.zip | |
* 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.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c index 93726169585..8bac5c5ae80 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -999,7 +999,7 @@ coding_set_destination (coding) | |||
| 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); |
| @@ -1009,7 +1009,7 @@ coding_set_destination (coding) | |||
| 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 | } |
| @@ -7329,7 +7329,8 @@ 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 | { |