diff options
| author | Eli Zaretskii | 2010-09-23 10:32:38 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2010-09-23 10:32:38 -0400 |
| commit | 579c18d04a042e78bc85c1aef081e612acd6e757 (patch) | |
| tree | 4e164342527219189d0d515bf3895e4cc3c8cd1d /src | |
| parent | 141624691330c7622d9a31d53ec919dee8e97473 (diff) | |
| download | emacs-579c18d04a042e78bc85c1aef081e612acd6e757.tar.gz emacs-579c18d04a042e78bc85c1aef081e612acd6e757.zip | |
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')
| -rw-r--r-- | src/ChangeLog | 40 | ||||
| -rw-r--r-- | src/character.c | 28 | ||||
| -rw-r--r-- | src/character.h | 8 | ||||
| -rw-r--r-- | src/composite.c | 32 | ||||
| -rw-r--r-- | src/composite.h | 11 | ||||
| -rw-r--r-- | src/editfns.c | 9 | ||||
| -rw-r--r-- | src/intervals.c | 3 | ||||
| -rw-r--r-- | src/intervals.h | 2 | ||||
| -rw-r--r-- | src/lisp.h | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 30 |
10 files changed, 103 insertions, 62 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 04f35d36ecf..f532a6c19f4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,17 +1,44 @@ | |||
| 1 | 2010-09-23 Eli Zaretskii <eliz@gnu.org> | 1 | 2010-09-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * font.c (font_intern_prop): Use EMACS_INT for string length | 3 | * xdisp.c (check_point_in_composition, reconsider_clip_changes): |
| 4 | variables. | 4 | Use EMACS_INT for buffer position variables and arguments. |
| 5 | |||
| 6 | * composite.c (get_composition_id, find_composition) | ||
| 7 | (run_composition_function, compose_text) | ||
| 8 | (composition_gstring_width, autocmp_chars) | ||
| 9 | (composition_update_it, Ffind_composition_internal): Use EMACS_INT | ||
| 10 | for buffer positions and string length variables and arguments. | ||
| 11 | |||
| 12 | * composite.h (get_composition_id, find_composition, compose_text) | ||
| 13 | (composition_gstring_width): Adjust prototypes. | ||
| 14 | |||
| 15 | * editfns.c (Fformat): Use EMACS_INT for string size variables. | ||
| 16 | |||
| 17 | * xdisp.c (store_mode_line_noprop, display_mode_element): Use | ||
| 18 | EMACS_INT for string positions. | ||
| 19 | |||
| 20 | * intervals.c (get_property_and_range): Use EMACS_INT for buffer | ||
| 21 | position arguments. | ||
| 22 | |||
| 23 | * intervals.h (get_property_and_range): Adjust prototype. | ||
| 5 | 24 | ||
| 6 | * character.c (parse_str_as_multibyte, str_as_multibyte) | 25 | * character.c (parse_str_as_multibyte, str_as_multibyte) |
| 7 | (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte) | 26 | (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte) |
| 8 | (string_count_byte8, string_escape_byte8): Use EMACS_INT for | 27 | (string_count_byte8, string_escape_byte8, c_string_width) |
| 9 | string length arguments, variables, and return values. | 28 | (strwidth, lisp_string_width, multibyte_chars_in_text): Use |
| 29 | EMACS_INT for string length variables and arguments. | ||
| 10 | 30 | ||
| 11 | * character.h (parse_str_as_multibyte, str_as_multibyte) | 31 | * character.h (parse_str_as_multibyte, str_as_multibyte) |
| 12 | (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte): Adjust | 32 | (parse_str_to_multibyte, str_to_multibyte, str_as_unibyte) |
| 33 | (c_string_width, strwidth, lisp_string_width): Adjust | ||
| 13 | prototypes. | 34 | prototypes. |
| 14 | 35 | ||
| 36 | * font.c (font_intern_prop): Use EMACS_INT for string length | ||
| 37 | variables. | ||
| 38 | |||
| 39 | * font.c (font_intern_prop): Use EMACS_INT for string length | ||
| 40 | variables. | ||
| 41 | |||
| 15 | * fns.c (Fstring_as_multibyte): Use EMACS_INT for string length | 42 | * fns.c (Fstring_as_multibyte): Use EMACS_INT for string length |
| 16 | variables. | 43 | variables. |
| 17 | 44 | ||
| @@ -33,7 +60,8 @@ | |||
| 33 | 60 | ||
| 34 | * lisp.h (make_string, make_unibyte_string, make_multibyte_string) | 61 | * lisp.h (make_string, make_unibyte_string, make_multibyte_string) |
| 35 | (make_string_from_bytes, make_specified_string_string) | 62 | (make_string_from_bytes, make_specified_string_string) |
| 36 | (make_pure_string, string_bytes): Adjust prototypes. | 63 | (make_pure_string, string_bytes, check_point_in_composition): |
| 64 | Adjust prototypes. | ||
| 37 | 65 | ||
| 38 | 2010-09-22 Eli Zaretskii <eliz@gnu.org> | 66 | 2010-09-22 Eli Zaretskii <eliz@gnu.org> |
| 39 | 67 | ||
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) */) | |||
| 378 | characters and bytes of the substring in *NCHARS and *NBYTES | 378 | characters and bytes of the substring in *NCHARS and *NBYTES |
| 379 | respectively. */ | 379 | respectively. */ |
| 380 | 380 | ||
| 381 | int | 381 | EMACS_INT |
| 382 | c_string_width (const unsigned char *str, int len, int precision, int *nchars, int *nbytes) | 382 | c_string_width (const unsigned char *str, EMACS_INT len, int precision, |
| 383 | EMACS_INT *nchars, EMACS_INT *nbytes) | ||
| 383 | { | 384 | { |
| 384 | int i = 0, i_byte = 0; | 385 | EMACS_INT i = 0, i_byte = 0; |
| 385 | int width = 0; | 386 | EMACS_INT width = 0; |
| 386 | struct Lisp_Char_Table *dp = buffer_display_table (); | 387 | struct Lisp_Char_Table *dp = buffer_display_table (); |
| 387 | 388 | ||
| 388 | while (i_byte < len) | 389 | while (i_byte < len) |
| @@ -429,8 +430,8 @@ c_string_width (const unsigned char *str, int len, int precision, int *nchars, i | |||
| 429 | current buffer. The width is measured by how many columns it | 430 | current buffer. The width is measured by how many columns it |
| 430 | occupies on the screen. */ | 431 | occupies on the screen. */ |
| 431 | 432 | ||
| 432 | int | 433 | EMACS_INT |
| 433 | strwidth (const unsigned char *str, int len) | 434 | strwidth (const unsigned char *str, EMACS_INT len) |
| 434 | { | 435 | { |
| 435 | return c_string_width (str, len, -1, NULL, NULL); | 436 | return c_string_width (str, len, -1, NULL, NULL); |
| 436 | } | 437 | } |
| @@ -442,17 +443,18 @@ strwidth (const unsigned char *str, int len) | |||
| 442 | PRECISION, and set number of characters and bytes of the substring | 443 | PRECISION, and set number of characters and bytes of the substring |
| 443 | in *NCHARS and *NBYTES respectively. */ | 444 | in *NCHARS and *NBYTES respectively. */ |
| 444 | 445 | ||
| 445 | int | 446 | EMACS_INT |
| 446 | lisp_string_width (Lisp_Object string, int precision, int *nchars, int *nbytes) | 447 | lisp_string_width (Lisp_Object string, int precision, |
| 448 | EMACS_INT *nchars, EMACS_INT *nbytes) | ||
| 447 | { | 449 | { |
| 448 | int len = SCHARS (string); | 450 | EMACS_INT len = SCHARS (string); |
| 449 | /* This set multibyte to 0 even if STRING is multibyte when it | 451 | /* This set multibyte to 0 even if STRING is multibyte when it |
| 450 | contains only ascii and eight-bit-graphic, but that's | 452 | contains only ascii and eight-bit-graphic, but that's |
| 451 | intentional. */ | 453 | intentional. */ |
| 452 | int multibyte = len < SBYTES (string); | 454 | int multibyte = len < SBYTES (string); |
| 453 | unsigned char *str = SDATA (string); | 455 | unsigned char *str = SDATA (string); |
| 454 | int i = 0, i_byte = 0; | 456 | EMACS_INT i = 0, i_byte = 0; |
| 455 | int width = 0; | 457 | EMACS_INT width = 0; |
| 456 | struct Lisp_Char_Table *dp = buffer_display_table (); | 458 | struct Lisp_Char_Table *dp = buffer_display_table (); |
| 457 | 459 | ||
| 458 | while (i < len) | 460 | while (i < len) |
| @@ -570,11 +572,11 @@ EMACS_INT | |||
| 570 | multibyte_chars_in_text (const unsigned char *ptr, EMACS_INT nbytes) | 572 | multibyte_chars_in_text (const unsigned char *ptr, EMACS_INT nbytes) |
| 571 | { | 573 | { |
| 572 | const unsigned char *endp = ptr + nbytes; | 574 | const unsigned char *endp = ptr + nbytes; |
| 573 | int chars = 0; | 575 | EMACS_INT chars = 0; |
| 574 | 576 | ||
| 575 | while (ptr < endp) | 577 | while (ptr < endp) |
| 576 | { | 578 | { |
| 577 | int len = MULTIBYTE_LENGTH (ptr, endp); | 579 | EMACS_INT len = MULTIBYTE_LENGTH (ptr, endp); |
| 578 | 580 | ||
| 579 | if (len == 0) | 581 | if (len == 0) |
| 580 | abort (); | 582 | abort (); |
diff --git a/src/character.h b/src/character.h index cbc4d6b3121..aea1a47a1f6 100644 --- a/src/character.h +++ b/src/character.h | |||
| @@ -612,9 +612,11 @@ extern EMACS_INT str_to_multibyte (unsigned char *, EMACS_INT, EMACS_INT); | |||
| 612 | extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT); | 612 | extern EMACS_INT str_as_unibyte (unsigned char *, EMACS_INT); |
| 613 | extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, | 613 | extern EMACS_INT str_to_unibyte (const unsigned char *, unsigned char *, |
| 614 | EMACS_INT, int); | 614 | EMACS_INT, int); |
| 615 | extern int strwidth (const unsigned char *, int); | 615 | extern EMACS_INT strwidth (const unsigned char *, EMACS_INT); |
| 616 | extern int c_string_width (const unsigned char *, int, int, int *, int *); | 616 | extern EMACS_INT c_string_width (const unsigned char *, EMACS_INT, int, |
| 617 | extern int lisp_string_width (Lisp_Object, int, int *, int *); | 617 | EMACS_INT *, EMACS_INT *); |
| 618 | extern EMACS_INT lisp_string_width (Lisp_Object, int, | ||
| 619 | EMACS_INT *, EMACS_INT *); | ||
| 618 | 620 | ||
| 619 | extern Lisp_Object Vprintable_chars; | 621 | extern Lisp_Object Vprintable_chars; |
| 620 | 622 | ||
diff --git a/src/composite.c b/src/composite.c index bc5a67ef6e2..8849f5274b0 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -180,7 +180,8 @@ Lisp_Object composition_temp; | |||
| 180 | If the composition is invalid, return -1. */ | 180 | If the composition is invalid, return -1. */ |
| 181 | 181 | ||
| 182 | int | 182 | int |
| 183 | get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp_Object string) | 183 | get_composition_id (EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT nchars, |
| 184 | Lisp_Object prop, Lisp_Object string) | ||
| 184 | { | 185 | { |
| 185 | Lisp_Object id, length, components, key, *key_contents; | 186 | Lisp_Object id, length, components, key, *key_contents; |
| 186 | int glyph_len; | 187 | int glyph_len; |
| @@ -188,7 +189,8 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 188 | int hash_index; | 189 | int hash_index; |
| 189 | unsigned hash_code; | 190 | unsigned hash_code; |
| 190 | struct composition *cmp; | 191 | struct composition *cmp; |
| 191 | int i, ch; | 192 | EMACS_INT i; |
| 193 | int ch; | ||
| 192 | 194 | ||
| 193 | /* PROP should be | 195 | /* PROP should be |
| 194 | Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC) | 196 | Form-A: ((LENGTH . COMPONENTS) . MODIFICATION-FUNC) |
| @@ -290,7 +292,7 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 290 | && VECTORP (AREF (components, 0))) | 292 | && VECTORP (AREF (components, 0))) |
| 291 | { | 293 | { |
| 292 | /* COMPONENTS is a glyph-string. */ | 294 | /* COMPONENTS is a glyph-string. */ |
| 293 | int len = ASIZE (key); | 295 | EMACS_UINT len = ASIZE (key); |
| 294 | 296 | ||
| 295 | for (i = 1; i < len; i++) | 297 | for (i = 1; i < len; i++) |
| 296 | if (! VECTORP (AREF (key, i))) | 298 | if (! VECTORP (AREF (key, i))) |
| @@ -298,7 +300,7 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 298 | } | 300 | } |
| 299 | else if (VECTORP (components) || CONSP (components)) | 301 | else if (VECTORP (components) || CONSP (components)) |
| 300 | { | 302 | { |
| 301 | int len = XVECTOR (key)->size; | 303 | EMACS_UINT len = XVECTOR (key)->size; |
| 302 | 304 | ||
| 303 | /* The number of elements should be odd. */ | 305 | /* The number of elements should be odd. */ |
| 304 | if ((len % 2) == 0) | 306 | if ((len % 2) == 0) |
| @@ -427,7 +429,9 @@ get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp | |||
| 427 | This doesn't check the validity of composition. */ | 429 | This doesn't check the validity of composition. */ |
| 428 | 430 | ||
| 429 | int | 431 | int |
| 430 | find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *prop, Lisp_Object object) | 432 | find_composition (EMACS_INT pos, EMACS_INT limit, |
| 433 | EMACS_INT *start, EMACS_INT *end, | ||
| 434 | Lisp_Object *prop, Lisp_Object object) | ||
| 431 | { | 435 | { |
| 432 | Lisp_Object val; | 436 | Lisp_Object val; |
| 433 | 437 | ||
| @@ -465,7 +469,7 @@ find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Obj | |||
| 465 | FROM and TO with property PROP. */ | 469 | FROM and TO with property PROP. */ |
| 466 | 470 | ||
| 467 | static void | 471 | static void |
| 468 | run_composition_function (int from, int to, Lisp_Object prop) | 472 | run_composition_function (EMACS_INT from, EMACS_INT to, Lisp_Object prop) |
| 469 | { | 473 | { |
| 470 | Lisp_Object func; | 474 | Lisp_Object func; |
| 471 | EMACS_INT start, end; | 475 | EMACS_INT start, end; |
| @@ -628,7 +632,8 @@ make_composition_value_copy (Lisp_Object list) | |||
| 628 | indices START and END in STRING. */ | 632 | indices START and END in STRING. */ |
| 629 | 633 | ||
| 630 | void | 634 | void |
| 631 | compose_text (int start, int end, Lisp_Object components, Lisp_Object modification_func, Lisp_Object string) | 635 | compose_text (EMACS_INT start, EMACS_INT end, Lisp_Object components, |
| 636 | Lisp_Object modification_func, Lisp_Object string) | ||
| 632 | { | 637 | { |
| 633 | Lisp_Object prop; | 638 | Lisp_Object prop; |
| 634 | 639 | ||
| @@ -735,7 +740,8 @@ composition_gstring_p (Lisp_Object gstring) | |||
| 735 | } | 740 | } |
| 736 | 741 | ||
| 737 | int | 742 | int |
| 738 | composition_gstring_width (Lisp_Object gstring, int from, int to, struct font_metrics *metrics) | 743 | composition_gstring_width (Lisp_Object gstring, EMACS_INT from, EMACS_INT to, |
| 744 | struct font_metrics *metrics) | ||
| 739 | { | 745 | { |
| 740 | Lisp_Object *glyph; | 746 | Lisp_Object *glyph; |
| 741 | int width = 0; | 747 | int width = 0; |
| @@ -907,7 +913,7 @@ autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT | |||
| 907 | EMACS_INT to; | 913 | EMACS_INT to; |
| 908 | EMACS_INT pt = PT, pt_byte = PT_BYTE; | 914 | EMACS_INT pt = PT, pt_byte = PT_BYTE; |
| 909 | Lisp_Object re, font_object, lgstring; | 915 | Lisp_Object re, font_object, lgstring; |
| 910 | int len; | 916 | EMACS_INT len; |
| 911 | 917 | ||
| 912 | record_unwind_save_match_data (); | 918 | record_unwind_save_match_data (); |
| 913 | re = AREF (rule, 0); | 919 | re = AREF (rule, 0); |
| @@ -1397,7 +1403,7 @@ composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_I | |||
| 1397 | /* automatic composition */ | 1403 | /* automatic composition */ |
| 1398 | Lisp_Object gstring = composition_gstring_from_id (cmp_it->id); | 1404 | Lisp_Object gstring = composition_gstring_from_id (cmp_it->id); |
| 1399 | Lisp_Object glyph; | 1405 | Lisp_Object glyph; |
| 1400 | int from, to; | 1406 | EMACS_INT from; |
| 1401 | 1407 | ||
| 1402 | if (cmp_it->nglyphs == 0) | 1408 | if (cmp_it->nglyphs == 0) |
| 1403 | { | 1409 | { |
| @@ -1879,9 +1885,9 @@ See `find-composition' for more details. */) | |||
| 1879 | id = COMPOSITION_ID (prop); | 1885 | id = COMPOSITION_ID (prop); |
| 1880 | else | 1886 | else |
| 1881 | { | 1887 | { |
| 1882 | int start_byte = (NILP (string) | 1888 | EMACS_INT start_byte = (NILP (string) |
| 1883 | ? CHAR_TO_BYTE (start) | 1889 | ? CHAR_TO_BYTE (start) |
| 1884 | : string_char_to_byte (string, start)); | 1890 | : string_char_to_byte (string, start)); |
| 1885 | id = get_composition_id (start, start_byte, end - start, prop, string); | 1891 | id = get_composition_id (start, start_byte, end - start, prop, string); |
| 1886 | } | 1892 | } |
| 1887 | 1893 | ||
diff --git a/src/composite.h b/src/composite.h index 554ab554115..157d90caf05 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -212,15 +212,16 @@ extern Lisp_Object Vauto_composition_function; | |||
| 212 | extern Lisp_Object Qauto_composition_function; | 212 | extern Lisp_Object Qauto_composition_function; |
| 213 | extern Lisp_Object Vcomposition_function_table; | 213 | extern Lisp_Object Vcomposition_function_table; |
| 214 | 214 | ||
| 215 | extern int get_composition_id (int, int, int, Lisp_Object, Lisp_Object); | 215 | extern int get_composition_id (EMACS_INT, EMACS_INT, EMACS_INT, |
| 216 | extern int find_composition (int, int, EMACS_INT *, EMACS_INT *, Lisp_Object *, | 216 | Lisp_Object, Lisp_Object); |
| 217 | Lisp_Object); | 217 | extern int find_composition (EMACS_INT, EMACS_INT, EMACS_INT *, EMACS_INT *, |
| 218 | Lisp_Object *, Lisp_Object); | ||
| 218 | extern void update_compositions (EMACS_INT, EMACS_INT, int); | 219 | extern void update_compositions (EMACS_INT, EMACS_INT, int); |
| 219 | extern void make_composition_value_copy (Lisp_Object); | 220 | extern void make_composition_value_copy (Lisp_Object); |
| 220 | extern void compose_region (int, int, Lisp_Object, Lisp_Object, | 221 | extern void compose_region (int, int, Lisp_Object, Lisp_Object, |
| 221 | Lisp_Object); | 222 | Lisp_Object); |
| 222 | extern void syms_of_composite (void); | 223 | extern void syms_of_composite (void); |
| 223 | extern void compose_text (int, int, Lisp_Object, Lisp_Object, | 224 | extern void compose_text (EMACS_INT, EMACS_INT, Lisp_Object, Lisp_Object, |
| 224 | Lisp_Object); | 225 | Lisp_Object); |
| 225 | 226 | ||
| 226 | /* Macros for lispy glyph-string. This is completely different from | 227 | /* Macros for lispy glyph-string. This is completely different from |
| @@ -306,7 +307,7 @@ struct font_metrics; | |||
| 306 | extern Lisp_Object composition_gstring_put_cache (Lisp_Object, int); | 307 | extern Lisp_Object composition_gstring_put_cache (Lisp_Object, int); |
| 307 | extern Lisp_Object composition_gstring_from_id (int); | 308 | extern Lisp_Object composition_gstring_from_id (int); |
| 308 | extern int composition_gstring_p (Lisp_Object); | 309 | extern int composition_gstring_p (Lisp_Object); |
| 309 | extern int composition_gstring_width (Lisp_Object, int, int, | 310 | extern int composition_gstring_width (Lisp_Object, EMACS_INT, EMACS_INT, |
| 310 | struct font_metrics *); | 311 | struct font_metrics *); |
| 311 | 312 | ||
| 312 | extern void composition_compute_stop_pos (struct composition_it *, | 313 | extern void composition_compute_stop_pos (struct composition_it *, |
diff --git a/src/editfns.c b/src/editfns.c index 8822dec5101..33bd793a17d 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3609,7 +3609,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3609 | if (*format++ == '%') | 3609 | if (*format++ == '%') |
| 3610 | { | 3610 | { |
| 3611 | int thissize = 0; | 3611 | int thissize = 0; |
| 3612 | int actual_width = 0; | 3612 | EMACS_INT actual_width = 0; |
| 3613 | unsigned char *this_format_start = format - 1; | 3613 | unsigned char *this_format_start = format - 1; |
| 3614 | int field_width = 0; | 3614 | int field_width = 0; |
| 3615 | 3615 | ||
| @@ -3851,8 +3851,8 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3851 | /* handle case (precision[n] >= 0) */ | 3851 | /* handle case (precision[n] >= 0) */ |
| 3852 | 3852 | ||
| 3853 | int width, padding; | 3853 | int width, padding; |
| 3854 | int nbytes, start, end; | 3854 | EMACS_INT nbytes, start, end; |
| 3855 | int nchars_string; | 3855 | EMACS_INT nchars_string; |
| 3856 | 3856 | ||
| 3857 | /* lisp_string_width ignores a precision of 0, but GNU | 3857 | /* lisp_string_width ignores a precision of 0, but GNU |
| 3858 | libc functions print 0 characters when the precision | 3858 | libc functions print 0 characters when the precision |
| @@ -3863,7 +3863,8 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3863 | if (precision[n] == 0) | 3863 | if (precision[n] == 0) |
| 3864 | width = nchars_string = nbytes = 0; | 3864 | width = nchars_string = nbytes = 0; |
| 3865 | else if (precision[n] > 0) | 3865 | else if (precision[n] > 0) |
| 3866 | width = lisp_string_width (args[n], precision[n], &nchars_string, &nbytes); | 3866 | width = lisp_string_width (args[n], precision[n], |
| 3867 | &nchars_string, &nbytes); | ||
| 3867 | else | 3868 | else |
| 3868 | { /* no precision spec given for this argument */ | 3869 | { /* no precision spec given for this argument */ |
| 3869 | width = lisp_string_width (args[n], -1, NULL, NULL); | 3870 | width = lisp_string_width (args[n], -1, NULL, NULL); |
diff --git a/src/intervals.c b/src/intervals.c index 86cbe1effcc..4d7d92fb70a 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -2246,7 +2246,8 @@ move_if_not_intangible (int position) | |||
| 2246 | nil means the current buffer. */ | 2246 | nil means the current buffer. */ |
| 2247 | 2247 | ||
| 2248 | int | 2248 | int |
| 2249 | get_property_and_range (int pos, Lisp_Object prop, Lisp_Object *val, EMACS_INT *start, EMACS_INT *end, Lisp_Object object) | 2249 | get_property_and_range (EMACS_INT pos, Lisp_Object prop, Lisp_Object *val, |
| 2250 | EMACS_INT *start, EMACS_INT *end, Lisp_Object object) | ||
| 2250 | { | 2251 | { |
| 2251 | INTERVAL i, prev, next; | 2252 | INTERVAL i, prev, next; |
| 2252 | 2253 | ||
diff --git a/src/intervals.h b/src/intervals.h index 612c1a99848..3430804660b 100644 --- a/src/intervals.h +++ b/src/intervals.h | |||
| @@ -276,7 +276,7 @@ extern int compare_string_intervals (Lisp_Object, Lisp_Object); | |||
| 276 | extern Lisp_Object textget (Lisp_Object, Lisp_Object); | 276 | extern Lisp_Object textget (Lisp_Object, Lisp_Object); |
| 277 | extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, int); | 277 | extern Lisp_Object lookup_char_property (Lisp_Object, Lisp_Object, int); |
| 278 | extern void move_if_not_intangible (int); | 278 | extern void move_if_not_intangible (int); |
| 279 | extern int get_property_and_range (int, Lisp_Object, Lisp_Object *, | 279 | extern int get_property_and_range (EMACS_INT, Lisp_Object, Lisp_Object *, |
| 280 | EMACS_INT *, EMACS_INT *, Lisp_Object); | 280 | EMACS_INT *, EMACS_INT *, Lisp_Object); |
| 281 | extern Lisp_Object get_local_map (int, struct buffer *, Lisp_Object); | 281 | extern Lisp_Object get_local_map (int, struct buffer *, Lisp_Object); |
| 282 | extern INTERVAL update_interval (INTERVAL, int); | 282 | extern INTERVAL update_interval (INTERVAL, int); |
diff --git a/src/lisp.h b/src/lisp.h index f36d1836110..3633b3bc855 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2673,7 +2673,7 @@ extern void update_echo_area (void); | |||
| 2673 | extern void truncate_echo_area (int); | 2673 | extern void truncate_echo_area (int); |
| 2674 | extern void redisplay (void); | 2674 | extern void redisplay (void); |
| 2675 | extern int check_point_in_composition | 2675 | extern int check_point_in_composition |
| 2676 | (struct buffer *, int, struct buffer *, int); | 2676 | (struct buffer *, EMACS_INT, struct buffer *, EMACS_INT); |
| 2677 | extern void redisplay_preserve_echo_area (int); | 2677 | extern void redisplay_preserve_echo_area (int); |
| 2678 | extern void prepare_menu_bars (void); | 2678 | extern void prepare_menu_bars (void); |
| 2679 | 2679 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index be6ff1254eb..d55e736f162 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9628,7 +9628,7 @@ static int | |||
| 9628 | store_mode_line_noprop (const unsigned char *str, int field_width, int precision) | 9628 | store_mode_line_noprop (const unsigned char *str, int field_width, int precision) |
| 9629 | { | 9629 | { |
| 9630 | int n = 0; | 9630 | int n = 0; |
| 9631 | int dummy, nbytes; | 9631 | EMACS_INT dummy, nbytes; |
| 9632 | 9632 | ||
| 9633 | /* Copy at most PRECISION chars from STR. */ | 9633 | /* Copy at most PRECISION chars from STR. */ |
| 9634 | nbytes = strlen (str); | 9634 | nbytes = strlen (str); |
| @@ -11378,8 +11378,8 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) | |||
| 11378 | position. BUF and PT are the current point buffer and position. */ | 11378 | position. BUF and PT are the current point buffer and position. */ |
| 11379 | 11379 | ||
| 11380 | int | 11380 | int |
| 11381 | check_point_in_composition (struct buffer *prev_buf, int prev_pt, | 11381 | check_point_in_composition (struct buffer *prev_buf, EMACS_INT prev_pt, |
| 11382 | struct buffer *buf, int pt) | 11382 | struct buffer *buf, EMACS_INT pt) |
| 11383 | { | 11383 | { |
| 11384 | EMACS_INT start, end; | 11384 | EMACS_INT start, end; |
| 11385 | Lisp_Object prop; | 11385 | Lisp_Object prop; |
| @@ -11432,7 +11432,7 @@ reconsider_clip_changes (struct window *w, struct buffer *b) | |||
| 11432 | if (!b->clip_changed | 11432 | if (!b->clip_changed |
| 11433 | && BUFFERP (w->buffer) && !NILP (w->window_end_valid)) | 11433 | && BUFFERP (w->buffer) && !NILP (w->window_end_valid)) |
| 11434 | { | 11434 | { |
| 11435 | int pt; | 11435 | EMACS_INT pt; |
| 11436 | 11436 | ||
| 11437 | if (w == XWINDOW (selected_window)) | 11437 | if (w == XWINDOW (selected_window)) |
| 11438 | pt = BUF_PT (current_buffer); | 11438 | pt = BUF_PT (current_buffer); |
| @@ -18377,7 +18377,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18377 | { | 18377 | { |
| 18378 | /* A string: output it and check for %-constructs within it. */ | 18378 | /* A string: output it and check for %-constructs within it. */ |
| 18379 | unsigned char c; | 18379 | unsigned char c; |
| 18380 | int offset = 0; | 18380 | EMACS_INT offset = 0; |
| 18381 | 18381 | ||
| 18382 | if (SCHARS (elt) > 0 | 18382 | if (SCHARS (elt) > 0 |
| 18383 | && (!NILP (props) || risky)) | 18383 | && (!NILP (props) || risky)) |
| @@ -18474,7 +18474,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18474 | && (mode_line_target != MODE_LINE_DISPLAY | 18474 | && (mode_line_target != MODE_LINE_DISPLAY |
| 18475 | || it->current_x < it->last_visible_x)) | 18475 | || it->current_x < it->last_visible_x)) |
| 18476 | { | 18476 | { |
| 18477 | int last_offset = offset; | 18477 | EMACS_INT last_offset = offset; |
| 18478 | 18478 | ||
| 18479 | /* Advance to end of string or next format specifier. */ | 18479 | /* Advance to end of string or next format specifier. */ |
| 18480 | while ((c = SREF (elt, offset++)) != '\0' && c != '%') | 18480 | while ((c = SREF (elt, offset++)) != '\0' && c != '%') |
| @@ -18482,7 +18482,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18482 | 18482 | ||
| 18483 | if (offset - 1 != last_offset) | 18483 | if (offset - 1 != last_offset) |
| 18484 | { | 18484 | { |
| 18485 | int nchars, nbytes; | 18485 | EMACS_INT nchars, nbytes; |
| 18486 | 18486 | ||
| 18487 | /* Output to end of string or up to '%'. Field width | 18487 | /* Output to end of string or up to '%'. Field width |
| 18488 | is length of string. Don't output more than | 18488 | is length of string. Don't output more than |
| @@ -18501,11 +18501,11 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18501 | break; | 18501 | break; |
| 18502 | case MODE_LINE_STRING: | 18502 | case MODE_LINE_STRING: |
| 18503 | { | 18503 | { |
| 18504 | int bytepos = last_offset; | 18504 | EMACS_INT bytepos = last_offset; |
| 18505 | int charpos = string_byte_to_char (elt, bytepos); | 18505 | EMACS_INT charpos = string_byte_to_char (elt, bytepos); |
| 18506 | int endpos = (precision <= 0 | 18506 | EMACS_INT endpos = (precision <= 0 |
| 18507 | ? string_byte_to_char (elt, offset) | 18507 | ? string_byte_to_char (elt, offset) |
| 18508 | : charpos + nchars); | 18508 | : charpos + nchars); |
| 18509 | 18509 | ||
| 18510 | n += store_mode_line_string (NULL, | 18510 | n += store_mode_line_string (NULL, |
| 18511 | Fsubstring (elt, make_number (charpos), | 18511 | Fsubstring (elt, make_number (charpos), |
| @@ -18515,8 +18515,8 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18515 | break; | 18515 | break; |
| 18516 | case MODE_LINE_DISPLAY: | 18516 | case MODE_LINE_DISPLAY: |
| 18517 | { | 18517 | { |
| 18518 | int bytepos = last_offset; | 18518 | EMACS_INT bytepos = last_offset; |
| 18519 | int charpos = string_byte_to_char (elt, bytepos); | 18519 | EMACS_INT charpos = string_byte_to_char (elt, bytepos); |
| 18520 | 18520 | ||
| 18521 | if (precision <= 0) | 18521 | if (precision <= 0) |
| 18522 | nchars = string_byte_to_char (elt, offset) - charpos; | 18522 | nchars = string_byte_to_char (elt, offset) - charpos; |
| @@ -18529,7 +18529,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18529 | } | 18529 | } |
| 18530 | else /* c == '%' */ | 18530 | else /* c == '%' */ |
| 18531 | { | 18531 | { |
| 18532 | int percent_position = offset; | 18532 | EMACS_INT percent_position = offset; |
| 18533 | 18533 | ||
| 18534 | /* Get the specified minimum width. Zero means | 18534 | /* Get the specified minimum width. Zero means |
| 18535 | don't pad. */ | 18535 | don't pad. */ |