comparison src/regex.c @ 1497:0ad2242c43a4

[xemacs-hg @ 2003-05-22 10:18:55 by stephent] fix compiler warning <87brxvs2v8.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 22 May 2003 10:18:58 +0000
parents 0f42689481f0
children a8d8f419b459
comparison
equal deleted inserted replaced
1496:e7b471ce22c1 1497:0ad2242c43a4
6073 matchwordbound: 6073 matchwordbound:
6074 { 6074 {
6075 /* XEmacs change */ 6075 /* XEmacs change */
6076 /* Straightforward and (I hope) correct implementation. 6076 /* Straightforward and (I hope) correct implementation.
6077 Probably should be optimized by arranging to compute 6077 Probably should be optimized by arranging to compute
6078 pos only once. */ 6078 charpos only once. */
6079 /* emch1 is the character before d, syn1 is the syntax of 6079 /* emch1 is the character before d, syn1 is the syntax of
6080 emch1, emch2 is the character at d, and syn2 is the 6080 emch1, emch2 is the character at d, and syn2 is the
6081 syntax of emch2. */ 6081 syntax of emch2. */
6082 Ichar emch1, emch2; 6082 Ichar emch1, emch2;
6083 int syn1 = 0, 6083 int syn1 = 0,
6085 re_char *d_before, *d_after; 6085 re_char *d_before, *d_after;
6086 int result, 6086 int result,
6087 at_beg = AT_STRINGS_BEG (d), 6087 at_beg = AT_STRINGS_BEG (d),
6088 at_end = AT_STRINGS_END (d); 6088 at_end = AT_STRINGS_END (d);
6089 #ifdef emacs 6089 #ifdef emacs
6090 Charxpos pos; 6090 Charxpos charpos;
6091 #endif 6091 #endif
6092 6092
6093 if (at_beg && at_end) 6093 if (at_beg && at_end)
6094 { 6094 {
6095 result = 0; 6095 result = 0;
6100 { 6100 {
6101 d_before = POS_BEFORE_GAP_UNSAFE (d); 6101 d_before = POS_BEFORE_GAP_UNSAFE (d);
6102 DEC_IBYTEPTR_FMT (d_before, fmt); 6102 DEC_IBYTEPTR_FMT (d_before, fmt);
6103 emch1 = itext_ichar_fmt (d_before, fmt, lispobj); 6103 emch1 = itext_ichar_fmt (d_before, fmt, lispobj);
6104 #ifdef emacs 6104 #ifdef emacs
6105 pos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)) - 1; 6105 charpos = offset_to_charxpos (lispobj,
6106 PTR_TO_OFFSET (d)) - 1;
6106 BEGIN_REGEX_MALLOC_OK (); 6107 BEGIN_REGEX_MALLOC_OK ();
6107 UPDATE_SYNTAX_CACHE (scache, pos); 6108 UPDATE_SYNTAX_CACHE (scache, charpos);
6108 #endif 6109 #endif
6109 syn1 = SYNTAX_FROM_CACHE (scache, emch1); 6110 syn1 = SYNTAX_FROM_CACHE (scache, emch1);
6110 END_REGEX_MALLOC_OK (); 6111 END_REGEX_MALLOC_OK ();
6111 } 6112 }
6112 if (!at_end) 6113 if (!at_end)
6113 { 6114 {
6114 d_after = POS_AFTER_GAP_UNSAFE (d); 6115 d_after = POS_AFTER_GAP_UNSAFE (d);
6115 emch2 = itext_ichar_fmt (d_after, fmt, lispobj); 6116 emch2 = itext_ichar_fmt (d_after, fmt, lispobj);
6116 #ifdef emacs 6117 #ifdef emacs
6117 pos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d)); 6118 charpos = offset_to_charxpos (lispobj, PTR_TO_OFFSET (d));
6118 BEGIN_REGEX_MALLOC_OK (); 6119 BEGIN_REGEX_MALLOC_OK ();
6119 UPDATE_SYNTAX_CACHE_FORWARD (scache, pos); 6120 UPDATE_SYNTAX_CACHE_FORWARD (scache, charpos);
6120 #endif 6121 #endif
6121 syn2 = SYNTAX_FROM_CACHE (scache, emch2); 6122 syn2 = SYNTAX_FROM_CACHE (scache, emch2);
6122 END_REGEX_MALLOC_OK (); 6123 END_REGEX_MALLOC_OK ();
6123 } 6124 }
6124 RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS (); 6125 RE_MATCH_RELOCATE_MOVEABLE_DATA_POINTERS ();