changeset 110551:f28cc7ff91f9

Fix int/EMACS_INT use in casefiddle.c and syntax.c. syntax.c (scan_words, update_syntax_table) (prev_char_comend_first, back_comment, skip_chars) (skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use EMACS_INT for buffer and string positions. syntax.h (scan_words, update_syntax_table): Adjust prototypes. casefiddle.c (operate_on_word): Use EMACS_INT for buffer positions.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 24 Sep 2010 11:24:47 -0400
parents d33e6623664c
children 66f6be9b4d43
files src/ChangeLog src/casefiddle.c src/syntax.c src/syntax.h
diffstat 4 files changed, 53 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Sep 24 17:20:58 2010 +0200
+++ b/src/ChangeLog	Fri Sep 24 11:24:47 2010 -0400
@@ -1,3 +1,15 @@
+2010-09-24  Eli Zaretskii  <eliz@gnu.org>
+
+	* syntax.c (scan_words, update_syntax_table)
+	(prev_char_comend_first, back_comment, skip_chars)
+	(skip_syntaxes, Fforward_comment, Fbackward_prefix_chars): Use
+	EMACS_INT for buffer and string positions.
+
+	* syntax.h (scan_words, update_syntax_table): Adjust prototypes.
+
+	* casefiddle.c (operate_on_word): Use EMACS_INT for buffer
+	positions.
+
 2010-09-24  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* scroll.c (calculate_scrolling, line_ins_del)
@@ -21,6 +33,14 @@
 
 2010-09-24  Eli Zaretskii  <eliz@gnu.org>
 
+	* syntax.c (scan_words, update_syntax_table)
+	(prev_char_comend_first, back_comment, skip_chars): 
+
+	* syntax.h (scan_words): Adjust prototype.
+
+	* casefiddle.c (operate_on_word): Use EMACS_INT for buffer
+	positions.
+
 	* callproc.c (Fcall_process): Use EMACS_INT for count of
 	characters read from the subprocess.
 
--- a/src/casefiddle.c	Fri Sep 24 17:20:58 2010 +0200
+++ b/src/casefiddle.c	Fri Sep 24 11:24:47 2010 -0400
@@ -352,8 +352,8 @@
 operate_on_word (Lisp_Object arg, EMACS_INT *newpoint)
 {
   Lisp_Object val;
-  int farend;
-  int iarg;
+  EMACS_INT farend;
+  EMACS_INT iarg;
 
   CHECK_NUMBER (arg);
   iarg = XINT (arg);
--- a/src/syntax.c	Fri Sep 24 17:20:58 2010 +0200
+++ b/src/syntax.c	Fri Sep 24 11:24:47 2010 -0400
@@ -185,7 +185,8 @@
    start/end of OBJECT.  */
 
 void
-update_syntax_table (int charpos, int count, int init, Lisp_Object object)
+update_syntax_table (EMACS_INT charpos, int count, int init,
+		     Lisp_Object object)
 {
   Lisp_Object tmp_table;
   int cnt = 0, invalidate = 1;
@@ -475,7 +476,7 @@
 /* Return the SYNTAX_COMEND_FIRST of the character before POS, POS_BYTE.  */
 
 static int
-prev_char_comend_first (int pos, int pos_byte)
+prev_char_comend_first (EMACS_INT pos, EMACS_INT pos_byte)
 {
   int c, val;
 
@@ -557,8 +558,8 @@
      that determines quote parity to the comment-end.  */
   while (from != stop)
     {
-      int temp_byte, prev_syntax;
-      int com2start, com2end;
+      EMACS_INT temp_byte;
+      int prev_syntax, com2start, com2end;
       int comstart;
 
       /* Move back and examine a character.  */
@@ -595,7 +596,8 @@
 	 have %..\n and %{..}%.  */
       if (from > stop && (com2end || comstart))
 	{
-	  int next = from, next_byte = from_byte, next_c, next_syntax;
+	  EMACS_INT next = from, next_byte = from_byte;
+	  int next_c, next_syntax;
 	  DEC_BOTH (next, next_byte);
 	  UPDATE_SYNTAX_TABLE_BACKWARD (next);
 	  next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte);
@@ -1242,12 +1244,12 @@
    If that many words cannot be found before the end of the buffer, return 0.
    COUNT negative means scan backward and stop at word beginning.  */
 
-int
-scan_words (register int from, register int count)
+EMACS_INT
+scan_words (register EMACS_INT from, register EMACS_INT count)
 {
-  register int beg = BEGV;
-  register int end = ZV;
-  register int from_byte = CHAR_TO_BYTE (from);
+  register EMACS_INT beg = BEGV;
+  register EMACS_INT end = ZV;
+  register EMACS_INT from_byte = CHAR_TO_BYTE (from);
   register enum syntaxcode code;
   int ch0, ch1;
   Lisp_Object func, script, pos;
@@ -1455,14 +1457,14 @@
   int *char_ranges;
   int n_char_ranges = 0;
   int negate = 0;
-  register int i, i_byte;
+  register EMACS_INT i, i_byte;
   /* Set to 1 if the current buffer is multibyte and the region
      contains non-ASCII chars.  */
   int multibyte;
   /* Set to 1 if STRING is multibyte and it contains non-ASCII
      chars.  */
   int string_multibyte;
-  int size_byte;
+  EMACS_INT size_byte;
   const unsigned char *str;
   int len;
   Lisp_Object iso_classes;
@@ -1774,9 +1776,9 @@
     }
 
   {
-    int start_point = PT;
-    int pos = PT;
-    int pos_byte = PT_BYTE;
+    EMACS_INT start_point = PT;
+    EMACS_INT pos = PT;
+    EMACS_INT pos_byte = PT_BYTE;
     unsigned char *p = PT_ADDR, *endp, *stop;
 
     if (forwardp)
@@ -1946,9 +1948,9 @@
   register unsigned int c;
   unsigned char fastmap[0400];
   int negate = 0;
-  register int i, i_byte;
+  register EMACS_INT i, i_byte;
   int multibyte;
-  int size_byte;
+  EMACS_INT size_byte;
   unsigned char *str;
 
   CHECK_STRING (string);
@@ -2001,9 +2003,9 @@
       fastmap[i] ^= 1;
 
   {
-    int start_point = PT;
-    int pos = PT;
-    int pos_byte = PT_BYTE;
+    EMACS_INT start_point = PT;
+    EMACS_INT pos = PT;
+    EMACS_INT pos_byte = PT_BYTE;
     unsigned char *p = PT_ADDR, *endp, *stop;
 
     if (forwardp)
@@ -2394,7 +2396,8 @@
 	  if (code == Scomment_fence)
 	    {
 	      /* Skip until first preceding unquoted comment_fence.  */
-	      int found = 0, ini = from, ini_byte = from_byte;
+	      int found = 0;
+	      EMACS_INT ini = from, ini_byte = from_byte;
 
 	      while (1)
 		{
@@ -2910,11 +2913,11 @@
 This includes chars with "quote" or "prefix" syntax (' or p).  */)
   (void)
 {
-  int beg = BEGV;
-  int opoint = PT;
-  int opoint_byte = PT_BYTE;
-  int pos = PT;
-  int pos_byte = PT_BYTE;
+  EMACS_INT beg = BEGV;
+  EMACS_INT opoint = PT;
+  EMACS_INT opoint_byte = PT_BYTE;
+  EMACS_INT pos = PT;
+  EMACS_INT pos_byte = PT_BYTE;
   int c;
 
   if (pos <= beg)
--- a/src/syntax.h	Fri Sep 24 17:20:58 2010 +0200
+++ b/src/syntax.h	Fri Sep 24 11:24:47 2010 -0400
@@ -19,7 +19,7 @@
 
 
 extern Lisp_Object Qsyntax_table_p;
-extern void update_syntax_table (int, int, int, Lisp_Object);
+extern void update_syntax_table (EMACS_INT, int, int, Lisp_Object);
 
 /* The standard syntax table is stored where it will automatically
    be used in all new buffers.  */
@@ -301,7 +301,7 @@
 extern int parse_sexp_lookup_properties;
 extern INTERVAL interval_of (int, Lisp_Object);
 
-extern int scan_words (int, int);
+extern EMACS_INT scan_words (EMACS_INT, EMACS_INT);
 
 /* arch-tag: 28833cca-cd73-4741-8c85-a3111166a0e0
    (do not change this comment) */