diff options
| author | Eli Zaretskii | 2010-09-22 12:03:34 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2010-09-22 12:03:34 -0400 |
| commit | 413d18e73de161f0618926ef73d170a7ef5c7a2f (patch) | |
| tree | 874e4eac4e7b0843c67ad0969d5c945cb8c8639c /src | |
| parent | 7390c1cdc8f29150299000e566de15e8e2432efa (diff) | |
| download | emacs-413d18e73de161f0618926ef73d170a7ef5c7a2f.tar.gz emacs-413d18e73de161f0618926ef73d170a7ef5c7a2f.zip | |
Fix some uses of int instead of EMACS_INT.
minibuf.c (Fminibuffer_contents)
(Fminibuffer_contents_no_properties)
(Fminibuffer_completion_contents): Use EMACS_INT for minibuffer
positions.
keyboard.c (command_loop_1): Use EMACS_INT to compare point with
mark.
alloc.c (make_uninit_string, make_uninit_multibyte_string)
(allocate_string_data): Accept EMACS_INT for string length.
editfns.c (Ffield_string, Ffield_string_no_properties)
(make_buffer_string, make_buffer_string_both, Fbuffer_substring)
(Fbuffer_substring_no_properties, find_field, Fdelete_field)
(Ffield_string, Ffield_string_no_properties, Ffield_beginning)
(Ffield_end): Use EMACS_INT for buffer positions.
insdel.c (prepare_to_modify_buffer): Use EMACS_INT to compare
point with mark.
lisp.h (allocate_string_data, make_uninit_string)
(make_uninit_multibyte_string, make_buffer_string)
(make_buffer_string_both): Adjust prototypes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 26 | ||||
| -rw-r--r-- | src/alloc.c | 7 | ||||
| -rw-r--r-- | src/editfns.c | 30 | ||||
| -rw-r--r-- | src/insdel.c | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 5 | ||||
| -rw-r--r-- | src/lisp.h | 11 | ||||
| -rw-r--r-- | src/minibuf.c | 6 |
7 files changed, 61 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4b3e76f851d..6bb13eaa088 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2010-09-22 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * minibuf.c (Fminibuffer_contents) | ||
| 4 | (Fminibuffer_contents_no_properties) | ||
| 5 | (Fminibuffer_completion_contents): Use EMACS_INT for minibuffer | ||
| 6 | positions. | ||
| 7 | |||
| 8 | * keyboard.c (command_loop_1): Use EMACS_INT to compare point with | ||
| 9 | mark. | ||
| 10 | |||
| 11 | * alloc.c (make_uninit_string, make_uninit_multibyte_string) | ||
| 12 | (allocate_string_data): Accept EMACS_INT for string length. | ||
| 13 | |||
| 14 | * editfns.c (Ffield_string, Ffield_string_no_properties) | ||
| 15 | (make_buffer_string, make_buffer_string_both, Fbuffer_substring) | ||
| 16 | (Fbuffer_substring_no_properties, find_field, Fdelete_field) | ||
| 17 | (Ffield_string, Ffield_string_no_properties, Ffield_beginning) | ||
| 18 | (Ffield_end): Use EMACS_INT for buffer positions. | ||
| 19 | |||
| 20 | * insdel.c (prepare_to_modify_buffer): Use EMACS_INT to compare | ||
| 21 | point with mark. | ||
| 22 | |||
| 23 | * lisp.h (allocate_string_data, make_uninit_string) | ||
| 24 | (make_uninit_multibyte_string, make_buffer_string) | ||
| 25 | (make_buffer_string_both): Adjust prototypes. | ||
| 26 | |||
| 1 | 2010-09-22 Chong Yidong <cyd@stupidchicken.com> | 27 | 2010-09-22 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 28 | ||
| 3 | * xml.c: Switch to GNU indentation. | 29 | * xml.c: Switch to GNU indentation. |
diff --git a/src/alloc.c b/src/alloc.c index 1f615a7d505..60b8016fb88 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1908,7 +1908,8 @@ allocate_string (void) | |||
| 1908 | S->data if it was initially non-null. */ | 1908 | S->data if it was initially non-null. */ |
| 1909 | 1909 | ||
| 1910 | void | 1910 | void |
| 1911 | allocate_string_data (struct Lisp_String *s, int nchars, int nbytes) | 1911 | allocate_string_data (struct Lisp_String *s, |
| 1912 | EMACS_INT nchars, EMACS_INT nbytes) | ||
| 1912 | { | 1913 | { |
| 1913 | struct sdata *data, *old_data; | 1914 | struct sdata *data, *old_data; |
| 1914 | struct sblock *b; | 1915 | struct sblock *b; |
| @@ -2412,7 +2413,7 @@ build_string (const char *str) | |||
| 2412 | occupying LENGTH bytes. */ | 2413 | occupying LENGTH bytes. */ |
| 2413 | 2414 | ||
| 2414 | Lisp_Object | 2415 | Lisp_Object |
| 2415 | make_uninit_string (int length) | 2416 | make_uninit_string (EMACS_INT length) |
| 2416 | { | 2417 | { |
| 2417 | Lisp_Object val; | 2418 | Lisp_Object val; |
| 2418 | 2419 | ||
| @@ -2428,7 +2429,7 @@ make_uninit_string (int length) | |||
| 2428 | which occupy NBYTES bytes. */ | 2429 | which occupy NBYTES bytes. */ |
| 2429 | 2430 | ||
| 2430 | Lisp_Object | 2431 | Lisp_Object |
| 2431 | make_uninit_multibyte_string (int nchars, int nbytes) | 2432 | make_uninit_multibyte_string (EMACS_INT nchars, EMACS_INT nbytes) |
| 2432 | { | 2433 | { |
| 2433 | Lisp_Object string; | 2434 | Lisp_Object string; |
| 2434 | struct Lisp_String *s; | 2435 | struct Lisp_String *s; |
diff --git a/src/editfns.c b/src/editfns.c index add2f37109b..e78f301e433 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -94,7 +94,8 @@ extern Lisp_Object w32_get_internal_run_time (void); | |||
| 94 | #endif | 94 | #endif |
| 95 | 95 | ||
| 96 | static int tm_diff (struct tm *, struct tm *); | 96 | static int tm_diff (struct tm *, struct tm *); |
| 97 | static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *); | 97 | static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, |
| 98 | EMACS_INT *, Lisp_Object, EMACS_INT *); | ||
| 98 | static void update_buffer_properties (int, int); | 99 | static void update_buffer_properties (int, int); |
| 99 | static Lisp_Object region_limit (int); | 100 | static Lisp_Object region_limit (int); |
| 100 | static size_t emacs_memftimeu (char *, size_t, const char *, | 101 | static size_t emacs_memftimeu (char *, size_t, const char *, |
| @@ -515,7 +516,9 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o | |||
| 515 | is not stored. */ | 516 | is not stored. */ |
| 516 | 517 | ||
| 517 | static void | 518 | static void |
| 518 | find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end) | 519 | find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, |
| 520 | Lisp_Object beg_limit, | ||
| 521 | EMACS_INT *beg, Lisp_Object end_limit, EMACS_INT *end) | ||
| 519 | { | 522 | { |
| 520 | /* Fields right before and after the point. */ | 523 | /* Fields right before and after the point. */ |
| 521 | Lisp_Object before_field, after_field; | 524 | Lisp_Object before_field, after_field; |
| @@ -631,7 +634,7 @@ A field is a region of text with the same `field' property. | |||
| 631 | If POS is nil, the value of point is used for POS. */) | 634 | If POS is nil, the value of point is used for POS. */) |
| 632 | (Lisp_Object pos) | 635 | (Lisp_Object pos) |
| 633 | { | 636 | { |
| 634 | int beg, end; | 637 | EMACS_INT beg, end; |
| 635 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); | 638 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); |
| 636 | if (beg != end) | 639 | if (beg != end) |
| 637 | del_range (beg, end); | 640 | del_range (beg, end); |
| @@ -644,7 +647,7 @@ A field is a region of text with the same `field' property. | |||
| 644 | If POS is nil, the value of point is used for POS. */) | 647 | If POS is nil, the value of point is used for POS. */) |
| 645 | (Lisp_Object pos) | 648 | (Lisp_Object pos) |
| 646 | { | 649 | { |
| 647 | int beg, end; | 650 | EMACS_INT beg, end; |
| 648 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); | 651 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); |
| 649 | return make_buffer_string (beg, end, 1); | 652 | return make_buffer_string (beg, end, 1); |
| 650 | } | 653 | } |
| @@ -655,7 +658,7 @@ A field is a region of text with the same `field' property. | |||
| 655 | If POS is nil, the value of point is used for POS. */) | 658 | If POS is nil, the value of point is used for POS. */) |
| 656 | (Lisp_Object pos) | 659 | (Lisp_Object pos) |
| 657 | { | 660 | { |
| 658 | int beg, end; | 661 | EMACS_INT beg, end; |
| 659 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); | 662 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); |
| 660 | return make_buffer_string (beg, end, 0); | 663 | return make_buffer_string (beg, end, 0); |
| 661 | } | 664 | } |
| @@ -670,7 +673,7 @@ If LIMIT is non-nil, it is a buffer position; if the beginning of the field | |||
| 670 | is before LIMIT, then LIMIT will be returned instead. */) | 673 | is before LIMIT, then LIMIT will be returned instead. */) |
| 671 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) | 674 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) |
| 672 | { | 675 | { |
| 673 | int beg; | 676 | EMACS_INT beg; |
| 674 | find_field (pos, escape_from_edge, limit, &beg, Qnil, 0); | 677 | find_field (pos, escape_from_edge, limit, &beg, Qnil, 0); |
| 675 | return make_number (beg); | 678 | return make_number (beg); |
| 676 | } | 679 | } |
| @@ -685,7 +688,7 @@ If LIMIT is non-nil, it is a buffer position; if the end of the field | |||
| 685 | is after LIMIT, then LIMIT will be returned instead. */) | 688 | is after LIMIT, then LIMIT will be returned instead. */) |
| 686 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) | 689 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) |
| 687 | { | 690 | { |
| 688 | int end; | 691 | EMACS_INT end; |
| 689 | find_field (pos, escape_from_edge, Qnil, 0, limit, &end); | 692 | find_field (pos, escape_from_edge, Qnil, 0, limit, &end); |
| 690 | return make_number (end); | 693 | return make_number (end); |
| 691 | } | 694 | } |
| @@ -2343,10 +2346,10 @@ from adjoining text, if those properties are sticky. */) | |||
| 2343 | buffer substrings. */ | 2346 | buffer substrings. */ |
| 2344 | 2347 | ||
| 2345 | Lisp_Object | 2348 | Lisp_Object |
| 2346 | make_buffer_string (int start, int end, int props) | 2349 | make_buffer_string (EMACS_INT start, EMACS_INT end, int props) |
| 2347 | { | 2350 | { |
| 2348 | int start_byte = CHAR_TO_BYTE (start); | 2351 | EMACS_INT start_byte = CHAR_TO_BYTE (start); |
| 2349 | int end_byte = CHAR_TO_BYTE (end); | 2352 | EMACS_INT end_byte = CHAR_TO_BYTE (end); |
| 2350 | 2353 | ||
| 2351 | return make_buffer_string_both (start, start_byte, end, end_byte, props); | 2354 | return make_buffer_string_both (start, start_byte, end, end_byte, props); |
| 2352 | } | 2355 | } |
| @@ -2367,7 +2370,8 @@ make_buffer_string (int start, int end, int props) | |||
| 2367 | buffer substrings. */ | 2370 | buffer substrings. */ |
| 2368 | 2371 | ||
| 2369 | Lisp_Object | 2372 | Lisp_Object |
| 2370 | make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props) | 2373 | make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte, |
| 2374 | EMACS_INT end, EMACS_INT end_byte, int props) | ||
| 2371 | { | 2375 | { |
| 2372 | Lisp_Object result, tem, tem1; | 2376 | Lisp_Object result, tem, tem1; |
| 2373 | 2377 | ||
| @@ -2439,7 +2443,7 @@ into the result string; if you don't want the text properties, | |||
| 2439 | use `buffer-substring-no-properties' instead. */) | 2443 | use `buffer-substring-no-properties' instead. */) |
| 2440 | (Lisp_Object start, Lisp_Object end) | 2444 | (Lisp_Object start, Lisp_Object end) |
| 2441 | { | 2445 | { |
| 2442 | register int b, e; | 2446 | register EMACS_INT b, e; |
| 2443 | 2447 | ||
| 2444 | validate_region (&start, &end); | 2448 | validate_region (&start, &end); |
| 2445 | b = XINT (start); | 2449 | b = XINT (start); |
| @@ -2455,7 +2459,7 @@ The two arguments START and END are character positions; | |||
| 2455 | they can be in either order. */) | 2459 | they can be in either order. */) |
| 2456 | (Lisp_Object start, Lisp_Object end) | 2460 | (Lisp_Object start, Lisp_Object end) |
| 2457 | { | 2461 | { |
| 2458 | register int b, e; | 2462 | register EMACS_INT b, e; |
| 2459 | 2463 | ||
| 2460 | validate_region (&start, &end); | 2464 | validate_region (&start, &end); |
| 2461 | b = XINT (start); | 2465 | b = XINT (start); |
diff --git a/src/insdel.c b/src/insdel.c index 2ccc0b8eaac..fb26fe77ac2 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -2057,8 +2057,8 @@ prepare_to_modify_buffer (EMACS_INT start, EMACS_INT end, | |||
| 2057 | : (!NILP (Vselect_active_regions) | 2057 | : (!NILP (Vselect_active_regions) |
| 2058 | && !NILP (Vtransient_mark_mode)))) | 2058 | && !NILP (Vtransient_mark_mode)))) |
| 2059 | { | 2059 | { |
| 2060 | int b = XINT (Fmarker_position (current_buffer->mark)); | 2060 | EMACS_INT b = XINT (Fmarker_position (current_buffer->mark)); |
| 2061 | int e = XINT (make_number (PT)); | 2061 | EMACS_INT e = PT; |
| 2062 | if (b < e) | 2062 | if (b < e) |
| 2063 | Vsaved_region_selection = make_buffer_string (b, e, 0); | 2063 | Vsaved_region_selection = make_buffer_string (b, e, 0); |
| 2064 | else if (b > e) | 2064 | else if (b > e) |
diff --git a/src/keyboard.c b/src/keyboard.c index eed031a3c2e..4785036eda8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1811,8 +1811,9 @@ command_loop_1 (void) | |||
| 1811 | && !NILP (Vtransient_mark_mode))) | 1811 | && !NILP (Vtransient_mark_mode))) |
| 1812 | && !EQ (Vthis_command, Qhandle_switch_frame)) | 1812 | && !EQ (Vthis_command, Qhandle_switch_frame)) |
| 1813 | { | 1813 | { |
| 1814 | int beg = XINT (Fmarker_position (current_buffer->mark)); | 1814 | EMACS_INT beg = |
| 1815 | int end = XINT (make_number (PT)); | 1815 | XINT (Fmarker_position (current_buffer->mark)); |
| 1816 | EMACS_INT end = PT; | ||
| 1816 | if (beg < end) | 1817 | if (beg < end) |
| 1817 | call2 (Qx_set_selection, QPRIMARY, | 1818 | call2 (Qx_set_selection, QPRIMARY, |
| 1818 | make_buffer_string (beg, end, 0)); | 1819 | make_buffer_string (beg, end, 0)); |
diff --git a/src/lisp.h b/src/lisp.h index 781261d9779..02cae0004f1 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2692,7 +2692,7 @@ extern void memory_warnings (POINTER_TYPE *, void (*warnfun) (const char *)); | |||
| 2692 | 2692 | ||
| 2693 | /* Defined in alloc.c */ | 2693 | /* Defined in alloc.c */ |
| 2694 | extern void check_pure_size (void); | 2694 | extern void check_pure_size (void); |
| 2695 | extern void allocate_string_data (struct Lisp_String *, int, int); | 2695 | extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); |
| 2696 | extern void reset_malloc_hooks (void); | 2696 | extern void reset_malloc_hooks (void); |
| 2697 | extern void uninterrupt_malloc (void); | 2697 | extern void uninterrupt_malloc (void); |
| 2698 | extern void malloc_warning (const char *); | 2698 | extern void malloc_warning (const char *); |
| @@ -2722,8 +2722,8 @@ extern Lisp_Object make_string (const char *, int); | |||
| 2722 | extern Lisp_Object make_unibyte_string (const char *, int); | 2722 | extern Lisp_Object make_unibyte_string (const char *, int); |
| 2723 | extern Lisp_Object make_multibyte_string (const char *, int, int); | 2723 | extern Lisp_Object make_multibyte_string (const char *, int, int); |
| 2724 | extern Lisp_Object make_event_array (int, Lisp_Object *); | 2724 | extern Lisp_Object make_event_array (int, Lisp_Object *); |
| 2725 | extern Lisp_Object make_uninit_string (int); | 2725 | extern Lisp_Object make_uninit_string (EMACS_INT); |
| 2726 | extern Lisp_Object make_uninit_multibyte_string (int, int); | 2726 | extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT); |
| 2727 | extern Lisp_Object make_string_from_bytes (const char *, int, int); | 2727 | extern Lisp_Object make_string_from_bytes (const char *, int, int); |
| 2728 | extern Lisp_Object make_specified_string (const char *, int, int, int); | 2728 | extern Lisp_Object make_specified_string (const char *, int, int, int); |
| 2729 | EXFUN (Fpurecopy, 1); | 2729 | EXFUN (Fpurecopy, 1); |
| @@ -2991,8 +2991,9 @@ EXFUN (Fuser_login_name, 1); | |||
| 2991 | EXFUN (Fsystem_name, 0); | 2991 | EXFUN (Fsystem_name, 0); |
| 2992 | EXFUN (Fcurrent_time, 0); | 2992 | EXFUN (Fcurrent_time, 0); |
| 2993 | extern int clip_to_bounds (int, int, int); | 2993 | extern int clip_to_bounds (int, int, int); |
| 2994 | extern Lisp_Object make_buffer_string (int, int, int); | 2994 | extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int); |
| 2995 | extern Lisp_Object make_buffer_string_both (int, int, int, int, int); | 2995 | extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT, |
| 2996 | EMACS_INT, int); | ||
| 2996 | extern void init_editfns (void); | 2997 | extern void init_editfns (void); |
| 2997 | extern void syms_of_editfns (void); | 2998 | extern void syms_of_editfns (void); |
| 2998 | EXFUN (Fconstrain_to_field, 5); | 2999 | EXFUN (Fconstrain_to_field, 5); |
diff --git a/src/minibuf.c b/src/minibuf.c index 009d94c36a8..2b21fa6a06f 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -370,7 +370,7 @@ DEFUN ("minibuffer-contents", Fminibuffer_contents, | |||
| 370 | If the current buffer is not a minibuffer, return its entire contents. */) | 370 | If the current buffer is not a minibuffer, return its entire contents. */) |
| 371 | (void) | 371 | (void) |
| 372 | { | 372 | { |
| 373 | int prompt_end = XINT (Fminibuffer_prompt_end ()); | 373 | EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ()); |
| 374 | return make_buffer_string (prompt_end, ZV, 1); | 374 | return make_buffer_string (prompt_end, ZV, 1); |
| 375 | } | 375 | } |
| 376 | 376 | ||
| @@ -380,7 +380,7 @@ DEFUN ("minibuffer-contents-no-properties", Fminibuffer_contents_no_properties, | |||
| 380 | If the current buffer is not a minibuffer, return its entire contents. */) | 380 | If the current buffer is not a minibuffer, return its entire contents. */) |
| 381 | (void) | 381 | (void) |
| 382 | { | 382 | { |
| 383 | int prompt_end = XINT (Fminibuffer_prompt_end ()); | 383 | EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ()); |
| 384 | return make_buffer_string (prompt_end, ZV, 0); | 384 | return make_buffer_string (prompt_end, ZV, 0); |
| 385 | } | 385 | } |
| 386 | 386 | ||
| @@ -391,7 +391,7 @@ That is what completion commands operate on. | |||
| 391 | If the current buffer is not a minibuffer, return its entire contents. */) | 391 | If the current buffer is not a minibuffer, return its entire contents. */) |
| 392 | (void) | 392 | (void) |
| 393 | { | 393 | { |
| 394 | int prompt_end = XINT (Fminibuffer_prompt_end ()); | 394 | EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ()); |
| 395 | if (PT < prompt_end) | 395 | if (PT < prompt_end) |
| 396 | error ("Cannot do completion in the prompt"); | 396 | error ("Cannot do completion in the prompt"); |
| 397 | return make_buffer_string (prompt_end, PT, 1); | 397 | return make_buffer_string (prompt_end, PT, 1); |