aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorEli Zaretskii2010-09-24 11:24:47 -0400
committerEli Zaretskii2010-09-24 11:24:47 -0400
commit4f3a2f8d41f3a1e2be27921e8271c5fdb78e6d98 (patch)
tree9afa3e5cda7d3f8505ca39f25d5004797b78c6f2 /src/syntax.c
parentf0812d352e22fb610d5002a50827278fd271938c (diff)
downloademacs-4f3a2f8d41f3a1e2be27921e8271c5fdb78e6d98.tar.gz
emacs-4f3a2f8d41f3a1e2be27921e8271c5fdb78e6d98.zip
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.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 5f836b0e8cf..2f4f5236a40 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -185,7 +185,8 @@ INTERVAL interval_of (int, Lisp_Object);
185 start/end of OBJECT. */ 185 start/end of OBJECT. */
186 186
187void 187void
188update_syntax_table (int charpos, int count, int init, Lisp_Object object) 188update_syntax_table (EMACS_INT charpos, int count, int init,
189 Lisp_Object object)
189{ 190{
190 Lisp_Object tmp_table; 191 Lisp_Object tmp_table;
191 int cnt = 0, invalidate = 1; 192 int cnt = 0, invalidate = 1;
@@ -475,7 +476,7 @@ find_defun_start (EMACS_INT pos, EMACS_INT pos_byte)
475/* Return the SYNTAX_COMEND_FIRST of the character before POS, POS_BYTE. */ 476/* Return the SYNTAX_COMEND_FIRST of the character before POS, POS_BYTE. */
476 477
477static int 478static int
478prev_char_comend_first (int pos, int pos_byte) 479prev_char_comend_first (EMACS_INT pos, EMACS_INT pos_byte)
479{ 480{
480 int c, val; 481 int c, val;
481 482
@@ -557,8 +558,8 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
557 that determines quote parity to the comment-end. */ 558 that determines quote parity to the comment-end. */
558 while (from != stop) 559 while (from != stop)
559 { 560 {
560 int temp_byte, prev_syntax; 561 EMACS_INT temp_byte;
561 int com2start, com2end; 562 int prev_syntax, com2start, com2end;
562 int comstart; 563 int comstart;
563 564
564 /* Move back and examine a character. */ 565 /* Move back and examine a character. */
@@ -595,7 +596,8 @@ back_comment (EMACS_INT from, EMACS_INT from_byte, EMACS_INT stop, int comnested
595 have %..\n and %{..}%. */ 596 have %..\n and %{..}%. */
596 if (from > stop && (com2end || comstart)) 597 if (from > stop && (com2end || comstart))
597 { 598 {
598 int next = from, next_byte = from_byte, next_c, next_syntax; 599 EMACS_INT next = from, next_byte = from_byte;
600 int next_c, next_syntax;
599 DEC_BOTH (next, next_byte); 601 DEC_BOTH (next, next_byte);
600 UPDATE_SYNTAX_TABLE_BACKWARD (next); 602 UPDATE_SYNTAX_TABLE_BACKWARD (next);
601 next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte); 603 next_c = FETCH_CHAR_AS_MULTIBYTE (next_byte);
@@ -1242,12 +1244,12 @@ Lisp_Object Vfind_word_boundary_function_table;
1242 If that many words cannot be found before the end of the buffer, return 0. 1244 If that many words cannot be found before the end of the buffer, return 0.
1243 COUNT negative means scan backward and stop at word beginning. */ 1245 COUNT negative means scan backward and stop at word beginning. */
1244 1246
1245int 1247EMACS_INT
1246scan_words (register int from, register int count) 1248scan_words (register EMACS_INT from, register EMACS_INT count)
1247{ 1249{
1248 register int beg = BEGV; 1250 register EMACS_INT beg = BEGV;
1249 register int end = ZV; 1251 register EMACS_INT end = ZV;
1250 register int from_byte = CHAR_TO_BYTE (from); 1252 register EMACS_INT from_byte = CHAR_TO_BYTE (from);
1251 register enum syntaxcode code; 1253 register enum syntaxcode code;
1252 int ch0, ch1; 1254 int ch0, ch1;
1253 Lisp_Object func, script, pos; 1255 Lisp_Object func, script, pos;
@@ -1455,14 +1457,14 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
1455 int *char_ranges; 1457 int *char_ranges;
1456 int n_char_ranges = 0; 1458 int n_char_ranges = 0;
1457 int negate = 0; 1459 int negate = 0;
1458 register int i, i_byte; 1460 register EMACS_INT i, i_byte;
1459 /* Set to 1 if the current buffer is multibyte and the region 1461 /* Set to 1 if the current buffer is multibyte and the region
1460 contains non-ASCII chars. */ 1462 contains non-ASCII chars. */
1461 int multibyte; 1463 int multibyte;
1462 /* Set to 1 if STRING is multibyte and it contains non-ASCII 1464 /* Set to 1 if STRING is multibyte and it contains non-ASCII
1463 chars. */ 1465 chars. */
1464 int string_multibyte; 1466 int string_multibyte;
1465 int size_byte; 1467 EMACS_INT size_byte;
1466 const unsigned char *str; 1468 const unsigned char *str;
1467 int len; 1469 int len;
1468 Lisp_Object iso_classes; 1470 Lisp_Object iso_classes;
@@ -1774,9 +1776,9 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
1774 } 1776 }
1775 1777
1776 { 1778 {
1777 int start_point = PT; 1779 EMACS_INT start_point = PT;
1778 int pos = PT; 1780 EMACS_INT pos = PT;
1779 int pos_byte = PT_BYTE; 1781 EMACS_INT pos_byte = PT_BYTE;
1780 unsigned char *p = PT_ADDR, *endp, *stop; 1782 unsigned char *p = PT_ADDR, *endp, *stop;
1781 1783
1782 if (forwardp) 1784 if (forwardp)
@@ -1946,9 +1948,9 @@ skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim)
1946 register unsigned int c; 1948 register unsigned int c;
1947 unsigned char fastmap[0400]; 1949 unsigned char fastmap[0400];
1948 int negate = 0; 1950 int negate = 0;
1949 register int i, i_byte; 1951 register EMACS_INT i, i_byte;
1950 int multibyte; 1952 int multibyte;
1951 int size_byte; 1953 EMACS_INT size_byte;
1952 unsigned char *str; 1954 unsigned char *str;
1953 1955
1954 CHECK_STRING (string); 1956 CHECK_STRING (string);
@@ -2001,9 +2003,9 @@ skip_syntaxes (int forwardp, Lisp_Object string, Lisp_Object lim)
2001 fastmap[i] ^= 1; 2003 fastmap[i] ^= 1;
2002 2004
2003 { 2005 {
2004 int start_point = PT; 2006 EMACS_INT start_point = PT;
2005 int pos = PT; 2007 EMACS_INT pos = PT;
2006 int pos_byte = PT_BYTE; 2008 EMACS_INT pos_byte = PT_BYTE;
2007 unsigned char *p = PT_ADDR, *endp, *stop; 2009 unsigned char *p = PT_ADDR, *endp, *stop;
2008 2010
2009 if (forwardp) 2011 if (forwardp)
@@ -2394,7 +2396,8 @@ between them, return t; otherwise return nil. */)
2394 if (code == Scomment_fence) 2396 if (code == Scomment_fence)
2395 { 2397 {
2396 /* Skip until first preceding unquoted comment_fence. */ 2398 /* Skip until first preceding unquoted comment_fence. */
2397 int found = 0, ini = from, ini_byte = from_byte; 2399 int found = 0;
2400 EMACS_INT ini = from, ini_byte = from_byte;
2398 2401
2399 while (1) 2402 while (1)
2400 { 2403 {
@@ -2910,11 +2913,11 @@ DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars,
2910This includes chars with "quote" or "prefix" syntax (' or p). */) 2913This includes chars with "quote" or "prefix" syntax (' or p). */)
2911 (void) 2914 (void)
2912{ 2915{
2913 int beg = BEGV; 2916 EMACS_INT beg = BEGV;
2914 int opoint = PT; 2917 EMACS_INT opoint = PT;
2915 int opoint_byte = PT_BYTE; 2918 EMACS_INT opoint_byte = PT_BYTE;
2916 int pos = PT; 2919 EMACS_INT pos = PT;
2917 int pos_byte = PT_BYTE; 2920 EMACS_INT pos_byte = PT_BYTE;
2918 int c; 2921 int c;
2919 2922
2920 if (pos <= beg) 2923 if (pos <= beg)