changeset 110552:66f6be9b4d43

Fix int/EMACS_INT use in ccl.c, cmds.c, data.c, dispnew.c. keyboard.c (make_lispy_position): Use EMACS_INT for buffer positions. xdisp.c (redisplay_internal, try_window_id) (set_cursor_from_row, find_first_unchanged_at_end_row): Use EMACS_INT for buffer positions. dispextern.h (set_cursor_from_row, mode_line_string) (marginal_area_string): Adjust prototypes. dispnew.c (increment_matrix_positions) (increment_row_positions, copy_glyph_row_contents) (mode_line_string, marginal_area_string): Use EMACS_INT for buffer positions. dispextern.h (mode_line_string, marginal_area_string) (increment_matrix_positions, increment_row_positions): Adjust prototypes. data.c (Faref, Faset): Use EMACS_INT for string length and positions. cmds.c (internal_self_insert): Use EMACS_INT for the count of characters to insert. ccl.c (Fccl_execute_on_string): Use EMACS_INT for string position and size.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 24 Sep 2010 13:48:10 -0400
parents f28cc7ff91f9
children eb608280bd3b
files src/ChangeLog src/ccl.c src/cmds.c src/data.c src/dispextern.h src/dispnew.c src/keyboard.c src/xdisp.c
diffstat 8 files changed, 76 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/ChangeLog	Fri Sep 24 13:48:10 2010 -0400
@@ -1,5 +1,33 @@
 2010-09-24  Eli Zaretskii  <eliz@gnu.org>
 
+	* keyboard.c (make_lispy_position): Use EMACS_INT for buffer
+	positions.
+
+	* xdisp.c (redisplay_internal, try_window_id)
+	(set_cursor_from_row, find_first_unchanged_at_end_row): Use
+	EMACS_INT for buffer positions.
+
+	* dispextern.h (set_cursor_from_row, mode_line_string)
+	(marginal_area_string): Adjust prototypes.
+
+	* dispnew.c (increment_matrix_positions)
+	(increment_row_positions, copy_glyph_row_contents)
+	(mode_line_string, marginal_area_string): Use EMACS_INT for buffer
+	positions.
+
+	* dispextern.h (mode_line_string, marginal_area_string)
+	(increment_matrix_positions, increment_row_positions): Adjust
+	prototypes.
+
+	* data.c (Faref, Faset): Use EMACS_INT for string length and
+	positions.
+
+	* cmds.c (internal_self_insert): Use EMACS_INT for the count of
+	characters to insert.
+
+	* ccl.c (Fccl_execute_on_string): Use EMACS_INT for string
+	position and size.
+
 	* syntax.c (scan_words, update_syntax_table)
 	(prev_char_comend_first, back_comment, skip_chars)
 	(skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use
--- a/src/ccl.c	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/ccl.c	Fri Sep 24 13:48:10 2010 -0400
@@ -2061,10 +2061,10 @@
   int i;
   int outbufsize;
   unsigned char *outbuf, *outp;
-  int str_chars, str_bytes;
+  EMACS_INT str_chars, str_bytes;
 #define CCL_EXECUTE_BUF_SIZE 1024
   int source[CCL_EXECUTE_BUF_SIZE], destination[CCL_EXECUTE_BUF_SIZE];
-  int consumed_chars, consumed_bytes, produced_chars;
+  EMACS_INT consumed_chars, consumed_bytes, produced_chars;
 
   if (setup_ccl_program (&ccl, ccl_prog) < 0)
     error ("Invalid CCL program");
@@ -2128,7 +2128,7 @@
 	      if (outp - outbuf + MAX_MULTIBYTE_LENGTH * ccl.produced
 		  > outbufsize)
 		{
-		  int offset = outp - outbuf;
+		  EMACS_INT offset = outp - outbuf;
 		  outbufsize += MAX_MULTIBYTE_LENGTH * ccl.produced;
 		  outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
 		  outp = outbuf + offset;
@@ -2140,7 +2140,7 @@
 	    {
 	      if (outp - outbuf + ccl.produced > outbufsize)
 		{
-		  int offset = outp - outbuf;
+		  EMACS_INT offset = outp - outbuf;
 		  outbufsize += ccl.produced;
 		  outbuf = (unsigned char *) xrealloc (outbuf, outbufsize);
 		  outp = outbuf + offset;
--- a/src/cmds.c	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/cmds.c	Fri Sep 24 13:48:10 2010 -0400
@@ -37,7 +37,7 @@
 /* A possible value for a buffer's overwrite-mode variable.  */
 Lisp_Object Qoverwrite_mode_binary;
 
-static int internal_self_insert (int, int);
+static int internal_self_insert (int, EMACS_INT);
 
 DEFUN ("forward-point", Fforward_point, Sforward_point, 1, 1, 0,
        doc: /* Return buffer position N characters after (before if N negative) point.  */)
@@ -304,7 +304,7 @@
   {
     int character = translate_char (Vtranslation_table_for_input,
 				    (int) XINT (last_command_event));
-    int val = internal_self_insert (character, (int) XFASTINT (n));
+    int val = internal_self_insert (character, XFASTINT (n));
     if (val == 2)
       nonundocount = 0;
     frame_make_pointer_invisible ();
@@ -323,7 +323,7 @@
 static Lisp_Object Qpost_self_insert_hook, Vpost_self_insert_hook;
 
 static int
-internal_self_insert (int c, int n)
+internal_self_insert (int c, EMACS_INT n)
 {
   int hairy = 0;
   Lisp_Object tem;
--- a/src/data.c	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/data.c	Fri Sep 24 13:48:10 2010 -0400
@@ -2082,13 +2082,14 @@
 or a byte-code object.  IDX starts at 0.  */)
   (register Lisp_Object array, Lisp_Object idx)
 {
-  register int idxval;
+  register EMACS_INT idxval;
 
   CHECK_NUMBER (idx);
   idxval = XINT (idx);
   if (STRINGP (array))
     {
-      int c, idxval_byte;
+      int c;
+      EMACS_INT idxval_byte;
 
       if (idxval < 0 || idxval >= SCHARS (array))
 	args_out_of_range (array, idx);
@@ -2136,7 +2137,7 @@
 bool-vector.  IDX starts at 0.  */)
   (register Lisp_Object array, Lisp_Object idx, Lisp_Object newelt)
 {
-  register int idxval;
+  register EMACS_INT idxval;
 
   CHECK_NUMBER (idx);
   idxval = XINT (idx);
@@ -2171,7 +2172,7 @@
     }
   else if (STRING_MULTIBYTE (array))
     {
-      int idxval_byte, prev_bytes, new_bytes, nbytes;
+      EMACS_INT idxval_byte, prev_bytes, new_bytes, nbytes;
       unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1;
 
       if (idxval < 0 || idxval >= SCHARS (array))
@@ -2187,7 +2188,7 @@
       if (prev_bytes != new_bytes)
 	{
 	  /* We must relocate the string data.  */
-	  int nchars = SCHARS (array);
+	  EMACS_INT nchars = SCHARS (array);
 	  unsigned char *str;
 	  USE_SAFE_ALLOCA;
 
--- a/src/dispextern.h	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/dispextern.h	Fri Sep 24 13:48:10 2010 -0400
@@ -2929,7 +2929,8 @@
 void mark_window_display_accurate (Lisp_Object, int);
 void redisplay_preserve_echo_area (int);
 int set_cursor_from_row (struct window *, struct glyph_row *,
-                         struct glyph_matrix *, int, int, int, int);
+                         struct glyph_matrix *, EMACS_INT, EMACS_INT,
+			 int, int);
 void init_iterator (struct it *, struct window *, EMACS_INT,
                     EMACS_INT, struct glyph_row *, enum face_id);
 void init_iterator_to_row_start (struct it *, struct window *,
@@ -3209,11 +3210,11 @@
                                             Lisp_Object *,
                                             int *, int *, int *, int *);
 extern Lisp_Object mode_line_string (struct window *, enum window_part,
-                                     int *, int *, int *,
+                                     int *, int *, EMACS_INT *,
                                      Lisp_Object *,
                                      int *, int *, int *, int *);
 extern Lisp_Object marginal_area_string (struct window *, enum window_part,
-                                         int *, int *, int *,
+                                         int *, int *, EMACS_INT *,
                                          Lisp_Object *,
                                          int *, int *, int *, int *);
 extern void redraw_frame (struct frame *);
@@ -3236,9 +3237,9 @@
                          int, int, int);
 void rotate_matrix (struct glyph_matrix *, int, int, int);
 void increment_matrix_positions (struct glyph_matrix *,
-                                 int, int, int, int);
+                                 int, int, EMACS_INT, EMACS_INT);
 void blank_row (struct window *, struct glyph_row *, int);
-void increment_row_positions (struct glyph_row *, int, int);
+void increment_row_positions (struct glyph_row *, EMACS_INT, EMACS_INT);
 void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int);
 void clear_glyph_row (struct glyph_row *);
 void prepare_desired_row (struct glyph_row *);
--- a/src/dispnew.c	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/dispnew.c	Fri Sep 24 13:48:10 2010 -0400
@@ -849,7 +849,8 @@
    DELTA_BYTES.  */
 
 void
-increment_matrix_positions (struct glyph_matrix *matrix, int start, int end, int delta, int delta_bytes)
+increment_matrix_positions (struct glyph_matrix *matrix, int start, int end,
+			    EMACS_INT delta, EMACS_INT delta_bytes)
 {
   /* Check that START and END are reasonable values.  */
   xassert (start >= 0 && start <= matrix->nrows);
@@ -1088,7 +1089,8 @@
    ends.  */
 
 void
-increment_row_positions (struct glyph_row *row, int delta, int delta_bytes)
+increment_row_positions (struct glyph_row *row,
+			 EMACS_INT delta, EMACS_INT delta_bytes)
 {
   int area, i;
 
@@ -1200,7 +1202,8 @@
    positions in row TO by DELTA/ DELTA_BYTES.  */
 
 void
-copy_glyph_row_contents (struct glyph_row *to, struct glyph_row *from, int delta, int delta_bytes)
+copy_glyph_row_contents (struct glyph_row *to, struct glyph_row *from,
+			 EMACS_INT delta, EMACS_INT delta_bytes)
 {
   int area;
 
@@ -5498,7 +5501,9 @@
    *CHARPOS is set to the position in the string returned.  */
 
 Lisp_Object
-mode_line_string (struct window *w, enum window_part part, int *x, int *y, int *charpos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
+mode_line_string (struct window *w, enum window_part part,
+		  int *x, int *y, EMACS_INT *charpos, Lisp_Object *object,
+		  int *dx, int *dy, int *width, int *height)
 {
   struct glyph_row *row;
   struct glyph *glyph, *end;
@@ -5565,7 +5570,9 @@
    the string returned.  */
 
 Lisp_Object
-marginal_area_string (struct window *w, enum window_part part, int *x, int *y, int *charpos, Lisp_Object *object, int *dx, int *dy, int *width, int *height)
+marginal_area_string (struct window *w, enum window_part part,
+		      int *x, int *y, EMACS_INT *charpos, Lisp_Object *object,
+		      int *dx, int *dy, int *width, int *height)
 {
   struct glyph_row *row = w->current_matrix->rows;
   struct glyph *glyph, *end;
--- a/src/keyboard.c	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/keyboard.c	Fri Sep 24 13:48:10 2010 -0400
@@ -5281,7 +5281,8 @@
       /* It's a click in window window at frame coordinates (x,y)  */
       struct window *w = XWINDOW (window);
       Lisp_Object string_info = Qnil;
-      int textpos = -1, rx = -1, ry = -1;
+      EMACS_INT textpos = -1;
+      int rx = -1, ry = -1;
       int dx = -1, dy = -1;
       int width = -1, height = -1;
       Lisp_Object object = Qnil;
@@ -5300,7 +5301,7 @@
 	  /* Mode line or header line.  Look for a string under
 	     the mouse that may have a `local-map' property.  */
 	  Lisp_Object string;
-	  int charpos;
+	  EMACS_INT charpos;
 
 	  posn = part == ON_MODE_LINE ? Qmode_line : Qheader_line;
 	  rx = wx, ry = wy;
@@ -5324,7 +5325,7 @@
       else if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN)
 	{
 	  Lisp_Object string;
-	  int charpos;
+	  EMACS_INT charpos;
 
 	  posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin;
 	  rx = wx, ry = wy;
--- a/src/xdisp.c	Fri Sep 24 11:24:47 2010 -0400
+++ b/src/xdisp.c	Fri Sep 24 13:48:10 2010 -0400
@@ -11103,7 +11103,7 @@
 
 /* Delta in characters and bytes for try_window_id.  */
 
-int debug_delta, debug_delta_bytes;
+EMACS_INT debug_delta, debug_delta_bytes;
 
 /* Values of window_end_pos and window_end_vpos at the end of
    try_window_id.  */
@@ -11834,7 +11834,7 @@
   		{
  		  struct glyph_row *row
  		    = MATRIX_ROW (w->current_matrix, this_line_vpos + 1);
-  		  int delta, delta_bytes;
+  		  EMACS_INT delta, delta_bytes;
 
 		  /* We used to distinguish between two cases here,
 		     conditioned by Z - CHARPOS (tlendpos) == ZV, for
@@ -12463,7 +12463,8 @@
 
 int
 set_cursor_from_row (struct window *w, struct glyph_row *row,
-		     struct glyph_matrix *matrix, int delta, int delta_bytes,
+		     struct glyph_matrix *matrix,
+		     EMACS_INT delta, EMACS_INT delta_bytes,
 		     int dy, int dvpos)
 {
   struct glyph *glyph = row->glyphs[TEXT_AREA];
@@ -15056,7 +15057,7 @@
 
 static struct glyph_row *find_last_unchanged_at_beg_row (struct window *);
 static struct glyph_row *find_first_unchanged_at_end_row (struct window *,
-                                                          int *, int *);
+                                                          EMACS_INT *, EMACS_INT *);
 static struct glyph_row *
 find_last_row_displaying_text (struct glyph_matrix *, struct it *,
                                struct glyph_row *);
@@ -15151,7 +15152,8 @@
    changes.  */
 
 static struct glyph_row *
-find_first_unchanged_at_end_row (struct window *w, int *delta, int *delta_bytes)
+find_first_unchanged_at_end_row (struct window *w,
+				 EMACS_INT *delta, EMACS_INT *delta_bytes)
 {
   struct glyph_row *row;
   struct glyph_row *row_found = NULL;
@@ -15382,13 +15384,14 @@
   struct glyph_row *bottom_row;
   int bottom_vpos;
   struct it it;
-  int delta = 0, delta_bytes = 0, stop_pos, dvpos, dy;
+  EMACS_INT delta = 0, delta_bytes = 0, stop_pos;
+  int dvpos, dy;
   struct text_pos start_pos;
   struct run run;
   int first_unchanged_at_end_vpos = 0;
   struct glyph_row *last_text_row, *last_text_row_at_end;
   struct text_pos start;
-  int first_changed_charpos, last_changed_charpos;
+  EMACS_INT first_changed_charpos, last_changed_charpos;
 
 #if GLYPH_DEBUG
   if (inhibit_try_window_id)
@@ -15515,7 +15518,7 @@
 	  || (last_changed_charpos < CHARPOS (start) - 1
 	      && FETCH_BYTE (BYTEPOS (start) - 1) == '\n')))
     {
-      int Z_old, delta, Z_BYTE_old, delta_bytes;
+      EMACS_INT Z_old, delta, Z_BYTE_old, delta_bytes;
       struct glyph_row *r0;
 
       /* Compute how many chars/bytes have been added to or removed
@@ -24167,7 +24170,8 @@
   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
   Lisp_Object pointer = Qnil;
-  int charpos, dx, dy, width, height;
+  int dx, dy, width, height;
+  EMACS_INT charpos;
   Lisp_Object string, object = Qnil;
   Lisp_Object pos, help;