Changeset 16155 in webkit for trunk/JavaScriptCore/pcre/pcre_compile.c
- Timestamp:
- Aug 31, 2006, 2:28:29 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/pcre/pcre_compile.c
r15455 r16155 1489 1489 complete_callout(uschar *previous_callout, const pcre_uchar *ptr, compile_data *cd) 1490 1490 { 1491 int length = ptr - cd->start_pattern - GET(previous_callout, 2);1491 int length = INT_CAST(ptr - cd->start_pattern - GET(previous_callout, 2)); 1492 1492 PUT(previous_callout, 2 + LINK_SIZE, length); 1493 1493 } … … 1846 1846 { 1847 1847 BOOL local_negate = FALSE; 1848 int posix_class, i ;1848 int posix_class, i, namelen; 1849 1849 register const uschar *cbits = cd->cbits; 1850 1850 … … 1862 1862 } 1863 1863 1864 posix_class = check_posix_name(ptr, tempptr - ptr); 1864 namelen = INT_CAST(tempptr - ptr); 1865 posix_class = check_posix_name(ptr, namelen); 1865 1866 if (posix_class < 0) 1866 1867 { … … 2276 2277 else 2277 2278 { 2278 int len = class_utf8data - (code + 33);2279 int len = INT_CAST(class_utf8data - (code + 33)); 2279 2280 memmove(code + 1, code + 33, len); 2280 2281 code += len + 1; … … 2405 2406 uschar *lastchar = code - 1; 2406 2407 while((*lastchar & 0xc0) == 0x80) lastchar--; 2407 c = code - lastchar; /* Length of UTF-8 character */2408 c = INT_CAST(code - lastchar); /* Length of UTF-8 character */ 2408 2409 memcpy(utf8_char, lastchar, c); /* Save the char */ 2409 2410 c |= 0x80; /* Flag c as a length */ … … 2618 2619 register int i; 2619 2620 int ketoffset = 0; 2620 int len = code - previous;2621 int len = INT_CAST(code - previous); 2621 2622 uschar *bralink = NULL; 2622 2623 … … 2631 2632 register uschar *ket = previous; 2632 2633 do ket += GET(ket, 1); while (*ket != OP_KET); 2633 ketoffset = code - ket;2634 ketoffset = INT_CAST(code - ket); 2634 2635 } 2635 2636 … … 2677 2678 else 2678 2679 { 2679 int offset ;2680 int offset, tmpoffset; 2680 2681 *code = OP_END; 2681 2682 adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd); … … 2688 2689 filled in later when the ends of the brackets are reached. */ 2689 2690 2690 offset = (bralink == NULL)? 0 : previous - bralink; 2691 tmpoffset = INT_CAST(previous - bralink); 2692 offset = (bralink == NULL)? 0 : tmpoffset; 2691 2693 bralink = previous; 2692 2694 PUTINC(previous, 0, offset); … … 2732 2734 if (i != 0) 2733 2735 { 2734 int offset ;2736 int offset, tmpoffset; 2735 2737 *code++ = OP_BRA; 2736 offset = (bralink == NULL)? 0 : code - bralink; 2738 tmpoffset = INT_CAST(code - bralink); 2739 offset = (bralink == NULL)? 0 : tmpoffset; 2737 2740 bralink = code; 2738 2741 PUTINC(code, 0, offset); … … 2749 2752 { 2750 2753 int oldlinkoffset; 2751 int offset = code - bralink + 1;2754 int offset = INT_CAST(code - bralink + 1); 2752 2755 uschar *bra = code - offset; 2753 2756 oldlinkoffset = GET(bra, 1); … … 2783 2786 if (possessive_quantifier) 2784 2787 { 2785 int len = code - tempcode;2788 int len = INT_CAST(code - tempcode); 2786 2789 memmove(tempcode + 1+LINK_SIZE, tempcode, len); 2787 2790 code += 1 + LINK_SIZE; … … 2931 2934 2932 2935 while (*ptr++ != '>'); 2933 namelen = ptr - name - 1;2936 namelen = INT_CAST(ptr - name - 1); 2934 2937 2935 2938 /* FIXME: This won't work for UTF-16. */ … … 2970 2973 2971 2974 while (*ptr != ')') ptr++; 2972 namelen = ptr - name;2975 namelen = INT_CAST(ptr - name); 2973 2976 2974 2977 for (i = 0; i < cd->names_found; i++) … … 3587 3590 if (*ptr != '|') 3588 3591 { 3589 int length = code - last_branch;3592 int length = INT_CAST(code - last_branch); 3590 3593 do 3591 3594 { … … 4580 4583 } 4581 4584 name_count++; 4582 if (ptr - p > max_name_size) max_name_size = (ptr - p);4585 if (ptr - p > max_name_size) max_name_size = INT_CAST(ptr - p); 4583 4586 break; 4584 4587 } … … 4955 4958 4-byte pointers is run on another with 8-byte pointers. */ 4956 4959 4957 re->magic_number = MAGIC_NUMBER;4958 re->size = size;4960 re->magic_number = (pcre_uint32)MAGIC_NUMBER; 4961 re->size = (pcre_uint32)size; 4959 4962 re->options = options; 4960 4963 re->dummy1 = 0; … … 5017 5020 (pcre_free)(re); 5018 5021 PCRE_ERROR_RETURN: 5019 *erroroffset = ptr - (const pcre_uchar *)pattern;5022 *erroroffset = INT_CAST(ptr - (const pcre_uchar *)pattern); 5020 5023 PCRE_EARLY_ERROR_RETURN: 5021 5024 *errorptr = error_texts[errorcode];
Note:
See TracChangeset
for help on using the changeset viewer.