aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/ChangeLog26
-rw-r--r--src/alloc.c7
-rw-r--r--src/editfns.c30
-rw-r--r--src/insdel.c4
-rw-r--r--src/keyboard.c5
-rw-r--r--src/lisp.h11
-rw-r--r--src/minibuf.c6
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 @@
12010-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
12010-09-22 Chong Yidong <cyd@stupidchicken.com> 272010-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
1910void 1910void
1911allocate_string_data (struct Lisp_String *s, int nchars, int nbytes) 1911allocate_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
2414Lisp_Object 2415Lisp_Object
2415make_uninit_string (int length) 2416make_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
2430Lisp_Object 2431Lisp_Object
2431make_uninit_multibyte_string (int nchars, int nbytes) 2432make_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
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);
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 */
2694extern void check_pure_size (void); 2694extern void check_pure_size (void);
2695extern void allocate_string_data (struct Lisp_String *, int, int); 2695extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
2696extern void reset_malloc_hooks (void); 2696extern void reset_malloc_hooks (void);
2697extern void uninterrupt_malloc (void); 2697extern void uninterrupt_malloc (void);
2698extern void malloc_warning (const char *); 2698extern void malloc_warning (const char *);
@@ -2722,8 +2722,8 @@ extern Lisp_Object make_string (const char *, int);
2722extern Lisp_Object make_unibyte_string (const char *, int); 2722extern Lisp_Object make_unibyte_string (const char *, int);
2723extern Lisp_Object make_multibyte_string (const char *, int, int); 2723extern Lisp_Object make_multibyte_string (const char *, int, int);
2724extern Lisp_Object make_event_array (int, Lisp_Object *); 2724extern Lisp_Object make_event_array (int, Lisp_Object *);
2725extern Lisp_Object make_uninit_string (int); 2725extern Lisp_Object make_uninit_string (EMACS_INT);
2726extern Lisp_Object make_uninit_multibyte_string (int, int); 2726extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT);
2727extern Lisp_Object make_string_from_bytes (const char *, int, int); 2727extern Lisp_Object make_string_from_bytes (const char *, int, int);
2728extern Lisp_Object make_specified_string (const char *, int, int, int); 2728extern Lisp_Object make_specified_string (const char *, int, int, int);
2729EXFUN (Fpurecopy, 1); 2729EXFUN (Fpurecopy, 1);
@@ -2991,8 +2991,9 @@ EXFUN (Fuser_login_name, 1);
2991EXFUN (Fsystem_name, 0); 2991EXFUN (Fsystem_name, 0);
2992EXFUN (Fcurrent_time, 0); 2992EXFUN (Fcurrent_time, 0);
2993extern int clip_to_bounds (int, int, int); 2993extern int clip_to_bounds (int, int, int);
2994extern Lisp_Object make_buffer_string (int, int, int); 2994extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
2995extern Lisp_Object make_buffer_string_both (int, int, int, int, int); 2995extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
2996 EMACS_INT, int);
2996extern void init_editfns (void); 2997extern void init_editfns (void);
2997extern void syms_of_editfns (void); 2998extern void syms_of_editfns (void);
2998EXFUN (Fconstrain_to_field, 5); 2999EXFUN (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,
370If the current buffer is not a minibuffer, return its entire contents. */) 370If 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,
380If the current buffer is not a minibuffer, return its entire contents. */) 380If 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.
391If the current buffer is not a minibuffer, return its entire contents. */) 391If 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);