aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2008-07-24 20:27:57 +0000
committerStefan Monnier2008-07-24 20:27:57 +0000
commit6449674edfbc2e10da852da5d4cc253ce7cf91f4 (patch)
tree4e966c1e67326e5e92507bce375b9cd43449bc34 /src
parentdbc812e07b362411b2219a29ef288740ad826677 (diff)
downloademacs-6449674edfbc2e10da852da5d4cc253ce7cf91f4.tar.gz
emacs-6449674edfbc2e10da852da5d4cc253ce7cf91f4.zip
(struct lisp_parse_state, char_quoted, inc_bytepos)
(dec_bytepos, find_defun_start): Use EMACS_INT for buffer positions.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/syntax.c47
2 files changed, 25 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 61975a25e1a..d85f4d6ee18 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12008-07-24 Stefan Monnier <monnier@iro.umontreal.ca> 12008-07-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * syntax.c (struct lisp_parse_state, char_quoted, inc_bytepos)
4 (dec_bytepos, find_defun_start): Use EMACS_INT for buffer positions.
5
3 * puresize.h (PURESIZE_CHECKING_RATIO): New macro. 6 * puresize.h (PURESIZE_CHECKING_RATIO): New macro.
4 (PURESIZE): Use it. 7 (PURESIZE): Use it.
5 8
diff --git a/src/syntax.c b/src/syntax.c
index 87cf2da2e39..eae8f360fef 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -65,18 +65,20 @@ int open_paren_in_column_0_is_defun_start;
65 65
66struct lisp_parse_state 66struct lisp_parse_state
67 { 67 {
68 int depth; /* Depth at end of parsing. */ 68 int depth; /* Depth at end of parsing. */
69 int instring; /* -1 if not within string, else desired terminator. */ 69 int instring; /* -1 if not within string, else desired terminator. */
70 int incomment; /* -1 if in unnestable comment else comment nesting */ 70 int incomment; /* -1 if in unnestable comment else comment nesting */
71 int comstyle; /* comment style a=0, or b=1, or ST_COMMENT_STYLE. */ 71 int comstyle; /* comment style a=0, or b=1, or ST_COMMENT_STYLE. */
72 int quoted; /* Nonzero if just after an escape char at end of parsing */ 72 int quoted; /* Nonzero if just after an escape char at end of parsing */
73 int thislevelstart; /* Char number of most recent start-of-expression at current level */ 73 int mindepth; /* Minimum depth seen while scanning. */
74 int prevlevelstart; /* Char number of start of containing expression */ 74 /* Char number of most recent start-of-expression at current level */
75 int location; /* Char number at which parsing stopped. */ 75 EMACS_INT thislevelstart;
76 int mindepth; /* Minimum depth seen while scanning. */ 76 /* Char number of start of containing expression */
77 int comstr_start; /* Position just after last comment/string starter. */ 77 EMACS_INT prevlevelstart;
78 Lisp_Object levelstarts; /* Char numbers of starts-of-expression 78 EMACS_INT location; /* Char number at which parsing stopped. */
79 of levels (starting from outermost). */ 79 EMACS_INT comstr_start; /* Position of last comment/string starter. */
80 Lisp_Object levelstarts; /* Char numbers of starts-of-expression
81 of levels (starting from outermost). */
80 }; 82 };
81 83
82/* These variables are a cache for finding the start of a defun. 84/* These variables are a cache for finding the start of a defun.
@@ -95,10 +97,6 @@ static EMACS_INT find_start_begv;
95static int find_start_modiff; 97static int find_start_modiff;
96 98
97 99
98static int find_defun_start P_ ((EMACS_INT, EMACS_INT));
99static int back_comment P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int, int,
100 EMACS_INT *, EMACS_INT *));
101static int char_quoted P_ ((int, int));
102static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int)); 100static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int));
103static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object)); 101static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object));
104static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int)); 102static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int));
@@ -290,13 +288,12 @@ update_syntax_table (charpos, count, init, object)
290 or after. On return global syntax data is good for lookup at CHARPOS. */ 288 or after. On return global syntax data is good for lookup at CHARPOS. */
291 289
292static int 290static int
293char_quoted (charpos, bytepos) 291char_quoted (EMACS_INT charpos, EMACS_INT bytepos)
294 register int charpos, bytepos;
295{ 292{
296 register enum syntaxcode code; 293 register enum syntaxcode code;
297 register int beg = BEGV; 294 register EMACS_INT beg = BEGV;
298 register int quoted = 0; 295 register int quoted = 0;
299 int orig = charpos; 296 EMACS_INT orig = charpos;
300 297
301 while (charpos > beg) 298 while (charpos > beg)
302 { 299 {
@@ -319,9 +316,9 @@ char_quoted (charpos, bytepos)
319/* Return the bytepos one character after BYTEPOS. 316/* Return the bytepos one character after BYTEPOS.
320 We assume that BYTEPOS is not at the end of the buffer. */ 317 We assume that BYTEPOS is not at the end of the buffer. */
321 318
322INLINE int 319INLINE EMACS_INT
323inc_bytepos (bytepos) 320inc_bytepos (bytepos)
324 int bytepos; 321 EMACS_INT bytepos;
325{ 322{
326 if (NILP (current_buffer->enable_multibyte_characters)) 323 if (NILP (current_buffer->enable_multibyte_characters))
327 return bytepos + 1; 324 return bytepos + 1;
@@ -333,9 +330,9 @@ inc_bytepos (bytepos)
333/* Return the bytepos one character before BYTEPOS. 330/* Return the bytepos one character before BYTEPOS.
334 We assume that BYTEPOS is not at the start of the buffer. */ 331 We assume that BYTEPOS is not at the start of the buffer. */
335 332
336INLINE int 333INLINE EMACS_INT
337dec_bytepos (bytepos) 334dec_bytepos (bytepos)
338 int bytepos; 335 EMACS_INT bytepos;
339{ 336{
340 if (NILP (current_buffer->enable_multibyte_characters)) 337 if (NILP (current_buffer->enable_multibyte_characters))
341 return bytepos - 1; 338 return bytepos - 1;
@@ -358,7 +355,7 @@ dec_bytepos (bytepos)
358 valid on return from the subroutine, so the caller should explicitly 355 valid on return from the subroutine, so the caller should explicitly
359 update the global data. */ 356 update the global data. */
360 357
361static int 358static EMACS_INT
362find_defun_start (pos, pos_byte) 359find_defun_start (pos, pos_byte)
363 EMACS_INT pos, pos_byte; 360 EMACS_INT pos, pos_byte;
364{ 361{