diff options
| author | Stefan Monnier | 2008-07-24 20:27:57 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-07-24 20:27:57 +0000 |
| commit | 6449674edfbc2e10da852da5d4cc253ce7cf91f4 (patch) | |
| tree | 4e966c1e67326e5e92507bce375b9cd43449bc34 | |
| parent | dbc812e07b362411b2219a29ef288740ad826677 (diff) | |
| download | emacs-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.
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/syntax.c | 47 |
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 @@ | |||
| 1 | 2008-07-24 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2008-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 | ||
| 66 | struct lisp_parse_state | 66 | struct 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; | |||
| 95 | static int find_start_modiff; | 97 | static int find_start_modiff; |
| 96 | 98 | ||
| 97 | 99 | ||
| 98 | static int find_defun_start P_ ((EMACS_INT, EMACS_INT)); | ||
| 99 | static int back_comment P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int, int, | ||
| 100 | EMACS_INT *, EMACS_INT *)); | ||
| 101 | static int char_quoted P_ ((int, int)); | ||
| 102 | static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int)); | 100 | static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int)); |
| 103 | static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object)); | 101 | static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object)); |
| 104 | static Lisp_Object scan_lists P_ ((EMACS_INT, EMACS_INT, EMACS_INT, int)); | 102 | static 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 | ||
| 292 | static int | 290 | static int |
| 293 | char_quoted (charpos, bytepos) | 291 | char_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 | ||
| 322 | INLINE int | 319 | INLINE EMACS_INT |
| 323 | inc_bytepos (bytepos) | 320 | inc_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 | ||
| 336 | INLINE int | 333 | INLINE EMACS_INT |
| 337 | dec_bytepos (bytepos) | 334 | dec_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 | ||
| 361 | static int | 358 | static EMACS_INT |
| 362 | find_defun_start (pos, pos_byte) | 359 | find_defun_start (pos, pos_byte) |
| 363 | EMACS_INT pos, pos_byte; | 360 | EMACS_INT pos, pos_byte; |
| 364 | { | 361 | { |