Mercurial > emacs
diff src/fns.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 | b3e6289494fb |
| children | e54658ddb618 |
line wrap: on
line diff
--- a/src/fns.c Tue Feb 12 21:29:33 2008 +0000 +++ b/src/fns.c Tue Feb 12 21:35:15 2008 +0000 @@ -786,8 +786,8 @@ } static Lisp_Object string_char_byte_cache_string; -static int string_char_byte_cache_charpos; -static int string_char_byte_cache_bytepos; +static EMACS_INT string_char_byte_cache_charpos; +static EMACS_INT string_char_byte_cache_bytepos; void clear_string_char_byte_cache () @@ -795,16 +795,16 @@ string_char_byte_cache_string = Qnil; } -/* Return the character index corresponding to CHAR_INDEX in STRING. */ - -int +/* Return the byte index corresponding to CHAR_INDEX in STRING. */ + +EMACS_INT string_char_to_byte (string, char_index) Lisp_Object string; - int char_index; + EMACS_INT char_index; { - int i_byte; - int best_below, best_below_byte; - int best_above, best_above_byte; + EMACS_INT i_byte; + EMACS_INT best_below, best_below_byte; + EMACS_INT best_above, best_above_byte; best_below = best_below_byte = 0; best_above = SCHARS (string); @@ -859,14 +859,14 @@ /* Return the character index corresponding to BYTE_INDEX in STRING. */ -int +EMACS_INT string_byte_to_char (string, byte_index) Lisp_Object string; - int byte_index; + EMACS_INT byte_index; { - int i, i_byte; - int best_below, best_below_byte; - int best_above, best_above_byte; + EMACS_INT i, i_byte; + EMACS_INT best_below, best_below_byte; + EMACS_INT best_above, best_above_byte; best_below = best_below_byte = 0; best_above = SCHARS (string); @@ -930,7 +930,7 @@ Lisp_Object string; { unsigned char *buf; - int nbytes; + EMACS_INT nbytes; Lisp_Object ret; USE_SAFE_ALLOCA; @@ -964,7 +964,7 @@ Lisp_Object string; { unsigned char *buf; - int nbytes; + EMACS_INT nbytes; Lisp_Object ret; USE_SAFE_ALLOCA;
