Mercurial > emacs
diff src/character.c @ 110504:0fdd992ff057
Fix more uses of int instead of EMACS_INT.
xdisp.c (check_point_in_composition, reconsider_clip_changes):
Use EMACS_INT for buffer position variables and arguments.
composite.c (get_composition_id, find_composition)
(run_composition_function, compose_text)
(composition_gstring_width, autocmp_chars)
(composition_update_it, Ffind_composition_internal): Use EMACS_INT
for buffer positions and string length variables and arguments.
composite.h (get_composition_id, find_composition, compose_text)
(composition_gstring_width): Adjust prototypes.
editfns.c (Fformat): Use EMACS_INT for string size variables.
xdisp.c (store_mode_line_noprop, display_mode_element): Use
EMACS_INT for string positions.
intervals.c (get_property_and_range): Use EMACS_INT for buffer
position arguments.
intervals.h (get_property_and_range): Adjust prototype.
character.c (parse_str_as_multibyte, str_as_multibyte)
(parse_str_to_multibyte, str_to_multibyte, str_as_unibyte)
(string_count_byte8, string_escape_byte8, c_string_width)
(strwidth, lisp_string_width, multibyte_chars_in_text): Use
EMACS_INT for string length variables and arguments.
(string_escape_byte8): Protect against too long strings.
character.h (parse_str_as_multibyte, str_as_multibyte)
(parse_str_to_multibyte, str_to_multibyte, str_as_unibyte)
(c_string_width, strwidth, lisp_string_width): Adjust
prototypes.
lisp.h (check_point_in_composition): Adjust prototype.
| author | Eli Zaretskii <eliz@gnu.org> |
|---|---|
| date | Thu, 23 Sep 2010 10:32:38 -0400 |
| parents | fda36a325177 |
| children | 515d80e174ba |
line wrap: on
line diff
--- a/src/character.c Thu Sep 23 08:09:12 2010 -0400 +++ b/src/character.c Thu Sep 23 10:32:38 2010 -0400 @@ -378,11 +378,12 @@ characters and bytes of the substring in *NCHARS and *NBYTES respectively. */ -int -c_string_width (const unsigned char *str, int len, int precision, int *nchars, int *nbytes) +EMACS_INT +c_string_width (const unsigned char *str, EMACS_INT len, int precision, + EMACS_INT *nchars, EMACS_INT *nbytes) { - int i = 0, i_byte = 0; - int width = 0; + EMACS_INT i = 0, i_byte = 0; + EMACS_INT width = 0; struct Lisp_Char_Table *dp = buffer_display_table (); while (i_byte < len) @@ -429,8 +430,8 @@ current buffer. The width is measured by how many columns it occupies on the screen. */ -int -strwidth (const unsigned char *str, int len) +EMACS_INT +strwidth (const unsigned char *str, EMACS_INT len) { return c_string_width (str, len, -1, NULL, NULL); } @@ -442,17 +443,18 @@ PRECISION, and set number of characters and bytes of the substring in *NCHARS and *NBYTES respectively. */ -int -lisp_string_width (Lisp_Object string, int precision, int *nchars, int *nbytes) +EMACS_INT +lisp_string_width (Lisp_Object string, int precision, + EMACS_INT *nchars, EMACS_INT *nbytes) { - int len = SCHARS (string); + EMACS_INT len = SCHARS (string); /* This set multibyte to 0 even if STRING is multibyte when it contains only ascii and eight-bit-graphic, but that's intentional. */ int multibyte = len < SBYTES (string); unsigned char *str = SDATA (string); - int i = 0, i_byte = 0; - int width = 0; + EMACS_INT i = 0, i_byte = 0; + EMACS_INT width = 0; struct Lisp_Char_Table *dp = buffer_display_table (); while (i < len) @@ -570,11 +572,11 @@ multibyte_chars_in_text (const unsigned char *ptr, EMACS_INT nbytes) { const unsigned char *endp = ptr + nbytes; - int chars = 0; + EMACS_INT chars = 0; while (ptr < endp) { - int len = MULTIBYTE_LENGTH (ptr, endp); + EMACS_INT len = MULTIBYTE_LENGTH (ptr, endp); if (len == 0) abort ();
