diff options
author | Eli Zaretskii <eliz@gnu.org> | 2010-09-23 10:32:38 -0400 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2010-09-23 10:32:38 -0400 |
commit | 579c18d04a042e78bc85c1aef081e612acd6e757 (patch) | |
tree | 4e164342527219189d0d515bf3895e4cc3c8cd1d /src/character.c | |
parent | 141624691330c7622d9a31d53ec919dee8e97473 (diff) | |
download | emacs-579c18d04a042e78bc85c1aef081e612acd6e757.tar.gz |
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.
Diffstat (limited to 'src/character.c')
-rw-r--r-- | src/character.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/character.c b/src/character.c index 90f6be10067..d80f8139486 100644 --- a/src/character.c +++ b/src/character.c @@ -378,11 +378,12 @@ usage: (char-width CHAR) */) 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 @@ c_string_width (const unsigned char *str, int len, int precision, int *nchars, i 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 @@ strwidth (const unsigned char *str, int len) 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 @@ EMACS_INT 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 (); |