Changeset 28141 in webkit for trunk/JavaScriptCore/pcre/pcre_exec.cpp
- Timestamp:
- Nov 29, 2007, 3:06:57 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_exec.cpp
r28139 r28141 66 66 are on the heap, not on the stack. */ 67 67 68 typedefstruct eptrblock {69 struct eptrblock *epb_prev;70 U SPTRepb_saved_eptr;71 } eptrblock;68 struct eptrblock { 69 struct eptrblock* epb_prev; 70 UChar* epb_saved_eptr; 71 }; 72 72 73 73 /* Structure for remembering the local variables in a private frame */ … … 88 88 /* Function arguments that may change */ 89 89 90 const pcre_uchar* eptr;90 UChar* eptr; 91 91 const uschar* ecode; 92 92 int offset_top; … … 97 97 const uschar* data; 98 98 const uschar* next; 99 const pcre_uchar* pp;99 const UChar* pp; 100 100 const uschar* prev; 101 const pcre_uchar* saved_eptr;101 const UChar* saved_eptr; 102 102 103 103 int repeat_othercase; … … 126 126 const uschar *ctypes; /* Points to table of type maps */ 127 127 BOOL offset_overflow; /* Set if too many extractions */ 128 U SPTRstart_subject; /* Start of the subject string */129 U SPTRend_subject; /* End of the subject string */130 U SPTRend_match_ptr; /* Subject position at end match */128 UChar* start_subject; /* Start of the subject string */ 129 UChar* end_subject; /* End of the subject string */ 130 UChar* end_match_ptr; /* Subject position at end match */ 131 131 int end_offset_top; /* Highwater mark at end of match */ 132 132 BOOL multiline; … … 167 167 168 168 static void 169 pchars(const pcre_uchar *p, int length, BOOL is_subject, match_data *md)169 pchars(const UChar* p, int length, BOOL is_subject, match_data *md) 170 170 { 171 171 int c; … … 197 197 198 198 static BOOL 199 match_ref(int offset, U SPTReptr, int length, match_data *md)199 match_ref(int offset, UChar* eptr, int length, match_data *md) 200 200 { 201 U SPTRp = md->start_subject + md->offset_vector[offset];201 UChar* p = md->start_subject + md->offset_vector[offset]; 202 202 203 203 #ifdef DEBUG … … 224 224 while (length-- > 0) 225 225 { 226 pcre_uchar c = *p++;226 UChar c = *p++; 227 227 int othercase = _pcre_ucp_othercase(c); 228 pcre_uchar d = *eptr++;228 UChar d = *eptr++; 229 229 if (c != d && othercase != d) return false; 230 230 } … … 404 404 } 405 405 406 static int match(U SPTReptr, const uschar* ecode, int offset_top, match_data* md)406 static int match(UChar* eptr, const uschar* ecode, int offset_top, match_data* md) 407 407 { 408 408 int is_match = false; … … 776 776 prev_is_word = false; 777 777 else { 778 const pcre_uchar *lastptr = stack.currentFrame->eptr - 1;778 const UChar* lastptr = stack.currentFrame->eptr - 1; 779 779 while(isTrailingSurrogate(*lastptr)) 780 780 lastptr--; … … 2069 2069 2070 2070 match_data match_block; 2071 match_block.start_subject = (U SPTR)subject;2071 match_block.start_subject = (UChar*)subject; 2072 2072 match_block.end_subject = match_block.start_subject + length; 2073 U SPTRend_subject = match_block.end_subject;2073 UChar* end_subject = match_block.end_subject; 2074 2074 2075 2075 match_block.lcc = _pcre_default_tables + lcc_offset; … … 2148 2148 the loop runs just once. */ 2149 2149 2150 U SPTR start_match = (USPTR)subject + start_offset;2151 U SPTRreq_byte_ptr = start_match - 1;2150 UChar* start_match = (UChar*)subject + start_offset; 2151 UChar* req_byte_ptr = start_match - 1; 2152 2152 bool startline = re->options & PCRE_STARTLINE; 2153 2153 2154 2154 do { 2155 U SPTRsave_end_subject = end_subject;2155 UChar* save_end_subject = end_subject; 2156 2156 2157 2157 /* Reset the maximum number of extractions we might see. */ … … 2173 2173 2174 2174 if (first_byte >= 0) { 2175 pcre_uchar first_char = first_byte;2175 UChar first_char = first_byte; 2176 2176 if (first_byte_caseless) 2177 2177 while (start_match < end_subject) { … … 2224 2224 2225 2225 if (req_byte >= 0 && end_subject - start_match < REQ_BYTE_MAX) { 2226 U SPTRp = start_match + ((first_byte >= 0)? 1 : 0);2226 UChar* p = start_match + ((first_byte >= 0)? 1 : 0); 2227 2227 2228 2228 /* We don't need to repeat the search if we haven't yet reached the
Note:
See TracChangeset
for help on using the changeset viewer.