changeset 110480:5290c80fda43

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.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 22 Sep 2010 12:03:34 -0400
parents 437c7aaf08fd
children c845917f5ca3
files src/ChangeLog src/alloc.c src/editfns.c src/insdel.c src/keyboard.c src/lisp.h src/minibuf.c
diffstat 7 files changed, 61 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/ChangeLog	Wed Sep 22 12:03:34 2010 -0400
@@ -1,3 +1,29 @@
+2010-09-22  Eli Zaretskii  <eliz@gnu.org>
+
+	* 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.
+
 2010-09-22  Chong Yidong  <cyd@stupidchicken.com>
 
 	* xml.c: Switch to GNU indentation.
--- a/src/alloc.c	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/alloc.c	Wed Sep 22 12:03:34 2010 -0400
@@ -1908,7 +1908,8 @@
    S->data if it was initially non-null.  */
 
 void
-allocate_string_data (struct Lisp_String *s, int nchars, int nbytes)
+allocate_string_data (struct Lisp_String *s,
+		      EMACS_INT nchars, EMACS_INT nbytes)
 {
   struct sdata *data, *old_data;
   struct sblock *b;
@@ -2412,7 +2413,7 @@
    occupying LENGTH bytes.  */
 
 Lisp_Object
-make_uninit_string (int length)
+make_uninit_string (EMACS_INT length)
 {
   Lisp_Object val;
 
@@ -2428,7 +2429,7 @@
    which occupy NBYTES bytes.  */
 
 Lisp_Object
-make_uninit_multibyte_string (int nchars, int nbytes)
+make_uninit_multibyte_string (EMACS_INT nchars, EMACS_INT nbytes)
 {
   Lisp_Object string;
   struct Lisp_String *s;
--- a/src/editfns.c	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/editfns.c	Wed Sep 22 12:03:34 2010 -0400
@@ -94,7 +94,8 @@
 #endif
 
 static int tm_diff (struct tm *, struct tm *);
-static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *);
+static void find_field (Lisp_Object, Lisp_Object, Lisp_Object,
+			EMACS_INT *, Lisp_Object, EMACS_INT *);
 static void update_buffer_properties (int, int);
 static Lisp_Object region_limit (int);
 static size_t emacs_memftimeu (char *, size_t, const char *,
@@ -515,7 +516,9 @@
    is not stored.  */
 
 static void
-find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end)
+find_field (Lisp_Object pos, Lisp_Object merge_at_boundary,
+	    Lisp_Object beg_limit,
+	    EMACS_INT *beg, Lisp_Object end_limit, EMACS_INT *end)
 {
   /* Fields right before and after the point.  */
   Lisp_Object before_field, after_field;
@@ -631,7 +634,7 @@
 If POS is nil, the value of point is used for POS.  */)
   (Lisp_Object pos)
 {
-  int beg, end;
+  EMACS_INT beg, end;
   find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
   if (beg != end)
     del_range (beg, end);
@@ -644,7 +647,7 @@
 If POS is nil, the value of point is used for POS.  */)
   (Lisp_Object pos)
 {
-  int beg, end;
+  EMACS_INT beg, end;
   find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
   return make_buffer_string (beg, end, 1);
 }
@@ -655,7 +658,7 @@
 If POS is nil, the value of point is used for POS.  */)
   (Lisp_Object pos)
 {
-  int beg, end;
+  EMACS_INT beg, end;
   find_field (pos, Qnil, Qnil, &beg, Qnil, &end);
   return make_buffer_string (beg, end, 0);
 }
@@ -670,7 +673,7 @@
 is before LIMIT, then LIMIT will be returned instead.  */)
   (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
 {
-  int beg;
+  EMACS_INT beg;
   find_field (pos, escape_from_edge, limit, &beg, Qnil, 0);
   return make_number (beg);
 }
@@ -685,7 +688,7 @@
 is after LIMIT, then LIMIT will be returned instead.  */)
   (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit)
 {
-  int end;
+  EMACS_INT end;
   find_field (pos, escape_from_edge, Qnil, 0, limit, &end);
   return make_number (end);
 }
@@ -2343,10 +2346,10 @@
    buffer substrings.  */
 
 Lisp_Object
-make_buffer_string (int start, int end, int props)
+make_buffer_string (EMACS_INT start, EMACS_INT end, int props)
 {
-  int start_byte = CHAR_TO_BYTE (start);
-  int end_byte = CHAR_TO_BYTE (end);
+  EMACS_INT start_byte = CHAR_TO_BYTE (start);
+  EMACS_INT end_byte = CHAR_TO_BYTE (end);
 
   return make_buffer_string_both (start, start_byte, end, end_byte, props);
 }
@@ -2367,7 +2370,8 @@
    buffer substrings.  */
 
 Lisp_Object
-make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props)
+make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte,
+			 EMACS_INT end, EMACS_INT end_byte, int props)
 {
   Lisp_Object result, tem, tem1;
 
@@ -2439,7 +2443,7 @@
 use `buffer-substring-no-properties' instead.  */)
   (Lisp_Object start, Lisp_Object end)
 {
-  register int b, e;
+  register EMACS_INT b, e;
 
   validate_region (&start, &end);
   b = XINT (start);
@@ -2455,7 +2459,7 @@
 they can be in either order.  */)
   (Lisp_Object start, Lisp_Object end)
 {
-  register int b, e;
+  register EMACS_INT b, e;
 
   validate_region (&start, &end);
   b = XINT (start);
--- a/src/insdel.c	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/insdel.c	Wed Sep 22 12:03:34 2010 -0400
@@ -2057,8 +2057,8 @@
 	  : (!NILP (Vselect_active_regions)
 	     && !NILP (Vtransient_mark_mode))))
     {
-      int b = XINT (Fmarker_position (current_buffer->mark));
-      int e = XINT (make_number (PT));
+      EMACS_INT b = XINT (Fmarker_position (current_buffer->mark));
+      EMACS_INT e = PT;
       if (b < e)
 	Vsaved_region_selection = make_buffer_string (b, e, 0);
       else if (b > e)
--- a/src/keyboard.c	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/keyboard.c	Wed Sep 22 12:03:34 2010 -0400
@@ -1811,8 +1811,9 @@
 			 && !NILP (Vtransient_mark_mode)))
 		  && !EQ (Vthis_command, Qhandle_switch_frame))
 		{
-		  int beg = XINT (Fmarker_position (current_buffer->mark));
-		  int end = XINT (make_number (PT));
+		  EMACS_INT beg =
+		    XINT (Fmarker_position (current_buffer->mark));
+		  EMACS_INT end = PT;
 		  if (beg < end)
 		    call2 (Qx_set_selection, QPRIMARY,
 			   make_buffer_string (beg, end, 0));
--- a/src/lisp.h	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/lisp.h	Wed Sep 22 12:03:34 2010 -0400
@@ -2692,7 +2692,7 @@
 
 /* Defined in alloc.c */
 extern void check_pure_size (void);
-extern void allocate_string_data (struct Lisp_String *, int, int);
+extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT);
 extern void reset_malloc_hooks (void);
 extern void uninterrupt_malloc (void);
 extern void malloc_warning (const char *);
@@ -2722,8 +2722,8 @@
 extern Lisp_Object make_unibyte_string (const char *, int);
 extern Lisp_Object make_multibyte_string (const char *, int, int);
 extern Lisp_Object make_event_array (int, Lisp_Object *);
-extern Lisp_Object make_uninit_string (int);
-extern Lisp_Object make_uninit_multibyte_string (int, int);
+extern Lisp_Object make_uninit_string (EMACS_INT);
+extern Lisp_Object make_uninit_multibyte_string (EMACS_INT, EMACS_INT);
 extern Lisp_Object make_string_from_bytes (const char *, int, int);
 extern Lisp_Object make_specified_string (const char *, int, int, int);
 EXFUN (Fpurecopy, 1);
@@ -2991,8 +2991,9 @@
 EXFUN (Fsystem_name, 0);
 EXFUN (Fcurrent_time, 0);
 extern int clip_to_bounds (int, int, int);
-extern Lisp_Object make_buffer_string (int, int, int);
-extern Lisp_Object make_buffer_string_both (int, int, int, int, int);
+extern Lisp_Object make_buffer_string (EMACS_INT, EMACS_INT, int);
+extern Lisp_Object make_buffer_string_both (EMACS_INT, EMACS_INT, EMACS_INT,
+					    EMACS_INT, int);
 extern void init_editfns (void);
 extern void syms_of_editfns (void);
 EXFUN (Fconstrain_to_field, 5);
--- a/src/minibuf.c	Wed Sep 22 13:34:37 2010 +0000
+++ b/src/minibuf.c	Wed Sep 22 12:03:34 2010 -0400
@@ -370,7 +370,7 @@
 If the current buffer is not a minibuffer, return its entire contents.  */)
   (void)
 {
-  int prompt_end = XINT (Fminibuffer_prompt_end ());
+  EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ());
   return make_buffer_string (prompt_end, ZV, 1);
 }
 
@@ -380,7 +380,7 @@
 If the current buffer is not a minibuffer, return its entire contents.  */)
   (void)
 {
-  int prompt_end = XINT (Fminibuffer_prompt_end ());
+  EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ());
   return make_buffer_string (prompt_end, ZV, 0);
 }
 
@@ -391,7 +391,7 @@
 If the current buffer is not a minibuffer, return its entire contents.  */)
   (void)
 {
-  int prompt_end = XINT (Fminibuffer_prompt_end ());
+  EMACS_INT prompt_end = XINT (Fminibuffer_prompt_end ());
   if (PT < prompt_end)
     error ("Cannot do completion in the prompt");
   return make_buffer_string (prompt_end, PT, 1);