aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorEli Zaretskii2010-09-22 12:03:34 -0400
committerEli Zaretskii2010-09-22 12:03:34 -0400
commit413d18e73de161f0618926ef73d170a7ef5c7a2f (patch)
tree874e4eac4e7b0843c67ad0969d5c945cb8c8639c /src/editfns.c
parent7390c1cdc8f29150299000e566de15e8e2432efa (diff)
downloademacs-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/editfns.c')
-rw-r--r--src/editfns.c30
1 files changed, 17 insertions, 13 deletions
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
96static int tm_diff (struct tm *, struct tm *); 96static int tm_diff (struct tm *, struct tm *);
97static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *); 97static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
98 EMACS_INT *, Lisp_Object, EMACS_INT *);
98static void update_buffer_properties (int, int); 99static void update_buffer_properties (int, int);
99static Lisp_Object region_limit (int); 100static Lisp_Object region_limit (int);
100static size_t emacs_memftimeu (char *, size_t, const char *, 101static 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
517static void 518static void
518find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end) 519find_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.
631If POS is nil, the value of point is used for POS. */) 634If 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.
644If POS is nil, the value of point is used for POS. */) 647If 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.
655If POS is nil, the value of point is used for POS. */) 658If 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
670is before LIMIT, then LIMIT will be returned instead. */) 673is 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
685is after LIMIT, then LIMIT will be returned instead. */) 688is 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
2345Lisp_Object 2348Lisp_Object
2346make_buffer_string (int start, int end, int props) 2349make_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
2369Lisp_Object 2372Lisp_Object
2370make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props) 2373make_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,
2439use `buffer-substring-no-properties' instead. */) 2443use `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;
2455they can be in either order. */) 2459they 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);