@@ -54,7 +54,7 @@ static _locale_t current_locale = NULL;
54
54
55
55
#define TYPE_PAIR (t1 ,t2 ) (((t1) << 4) | (t2))
56
56
57
- static const unsigned char tolower_map [256 ] = {
57
+ const unsigned char zend_tolower_map [256 ] = {
58
58
0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x06 ,0x07 ,0x08 ,0x09 ,0x0a ,0x0b ,0x0c ,0x0d ,0x0e ,0x0f ,
59
59
0x10 ,0x11 ,0x12 ,0x13 ,0x14 ,0x15 ,0x16 ,0x17 ,0x18 ,0x19 ,0x1a ,0x1b ,0x1c ,0x1d ,0x1e ,0x1f ,
60
60
0x20 ,0x21 ,0x22 ,0x23 ,0x24 ,0x25 ,0x26 ,0x27 ,0x28 ,0x29 ,0x2a ,0x2b ,0x2c ,0x2d ,0x2e ,0x2f ,
@@ -73,7 +73,7 @@ static const unsigned char tolower_map[256] = {
73
73
0xf0 ,0xf1 ,0xf2 ,0xf3 ,0xf4 ,0xf5 ,0xf6 ,0xf7 ,0xf8 ,0xf9 ,0xfa ,0xfb ,0xfc ,0xfd ,0xfe ,0xff
74
74
};
75
75
76
- static const unsigned char toupper_map [256 ] = {
76
+ const unsigned char zend_toupper_map [256 ] = {
77
77
0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x05 ,0x06 ,0x07 ,0x08 ,0x09 ,0x0a ,0x0b ,0x0c ,0x0d ,0x0e ,0x0f ,
78
78
0x10 ,0x11 ,0x12 ,0x13 ,0x14 ,0x15 ,0x16 ,0x17 ,0x18 ,0x19 ,0x1a ,0x1b ,0x1c ,0x1d ,0x1e ,0x1f ,
79
79
0x20 ,0x21 ,0x22 ,0x23 ,0x24 ,0x25 ,0x26 ,0x27 ,0x28 ,0x29 ,0x2a ,0x2b ,0x2c ,0x2d ,0x2e ,0x2f ,
@@ -92,8 +92,6 @@ static const unsigned char toupper_map[256] = {
92
92
0xf0 ,0xf1 ,0xf2 ,0xf3 ,0xf4 ,0xf5 ,0xf6 ,0xf7 ,0xf8 ,0xf9 ,0xfa ,0xfb ,0xfc ,0xfd ,0xfe ,0xff
93
93
};
94
94
95
- #define i_zend_tolower_ascii (c ) (tolower_map[(unsigned char)(c)])
96
- #define i_zend_toupper_ascii (c ) (toupper_map[(unsigned char)(c)])
97
95
98
96
/**
99
97
* Functions using locale lowercase:
@@ -2706,7 +2704,7 @@ static zend_always_inline void zend_str_tolower_impl(char *dest, const char *str
2706
2704
}
2707
2705
#endif
2708
2706
while (p < end ) {
2709
- * q ++ = i_zend_tolower_ascii (* p ++ );
2707
+ * q ++ = zend_tolower_ascii (* p ++ );
2710
2708
}
2711
2709
}
2712
2710
/* }}} */
@@ -2734,23 +2732,11 @@ static zend_always_inline void zend_str_toupper_impl(char *dest, const char *str
2734
2732
}
2735
2733
#endif
2736
2734
while (p < end ) {
2737
- * q ++ = i_zend_toupper_ascii (* p ++ );
2735
+ * q ++ = zend_toupper_ascii (* p ++ );
2738
2736
}
2739
2737
}
2740
2738
/* }}} */
2741
2739
2742
- ZEND_API int ZEND_FASTCALL zend_tolower_ascii (int c ) /* {{{ */
2743
- {
2744
- return i_zend_tolower_ascii (c );
2745
- }
2746
- /* }}} */
2747
-
2748
- ZEND_API int ZEND_FASTCALL zend_toupper_ascii (int c ) /* {{{ */
2749
- {
2750
- return i_zend_toupper_ascii (c );
2751
- }
2752
- /* }}} */
2753
-
2754
2740
ZEND_API char * ZEND_FASTCALL zend_str_tolower_copy (char * dest , const char * source , size_t length ) /* {{{ */
2755
2741
{
2756
2742
zend_str_tolower_impl (dest , source , length );
@@ -2798,7 +2784,7 @@ ZEND_API char* ZEND_FASTCALL zend_str_tolower_dup_ex(const char *source, size_t
2798
2784
const unsigned char * end = p + length ;
2799
2785
2800
2786
while (p < end ) {
2801
- if (* p != i_zend_tolower_ascii (* p )) {
2787
+ if (* p != zend_tolower_ascii (* p )) {
2802
2788
char * res = (char * )emalloc (length + 1 );
2803
2789
unsigned char * r ;
2804
2790
@@ -2822,7 +2808,7 @@ ZEND_API char* ZEND_FASTCALL zend_str_toupper_dup_ex(const char *source, size_t
2822
2808
const unsigned char * end = p + length ;
2823
2809
2824
2810
while (p < end ) {
2825
- if (* p != i_zend_toupper_ascii (* p )) {
2811
+ if (* p != zend_toupper_ascii (* p )) {
2826
2812
char * res = (char * )emalloc (length + 1 );
2827
2813
unsigned char * r ;
2828
2814
@@ -2876,13 +2862,13 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, boo
2876
2862
#endif
2877
2863
2878
2864
while (p < end ) {
2879
- if (* p != i_zend_tolower_ascii (* p )) {
2865
+ if (* p != zend_tolower_ascii (* p )) {
2880
2866
zend_string * res = zend_string_alloc (length , persistent );
2881
2867
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2882
2868
2883
2869
unsigned char * q = p + (ZSTR_VAL (res ) - ZSTR_VAL (str ));
2884
2870
while (p < end ) {
2885
- * q ++ = i_zend_tolower_ascii (* p ++ );
2871
+ * q ++ = zend_tolower_ascii (* p ++ );
2886
2872
}
2887
2873
ZSTR_VAL (res )[length ] = '\0' ;
2888
2874
return res ;
@@ -2930,13 +2916,13 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_toupper_ex(zend_string *str, boo
2930
2916
#endif
2931
2917
2932
2918
while (p < end ) {
2933
- if (* p != i_zend_toupper_ascii (* p )) {
2919
+ if (* p != zend_toupper_ascii (* p )) {
2934
2920
zend_string * res = zend_string_alloc (length , persistent );
2935
2921
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2936
2922
2937
2923
unsigned char * q = p + (ZSTR_VAL (res ) - ZSTR_VAL (str ));
2938
2924
while (p < end ) {
2939
- * q ++ = i_zend_toupper_ascii (* p ++ );
2925
+ * q ++ = zend_toupper_ascii (* p ++ );
2940
2926
}
2941
2927
ZSTR_VAL (res )[length ] = '\0' ;
2942
2928
return res ;
@@ -2991,8 +2977,8 @@ ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp(const char *s1, size_t len1, c
2991
2977
2992
2978
len = MIN (len1 , len2 );
2993
2979
while (len -- ) {
2994
- c1 = i_zend_tolower_ascii (* (unsigned char * )s1 ++ );
2995
- c2 = i_zend_tolower_ascii (* (unsigned char * )s2 ++ );
2980
+ c1 = zend_tolower_ascii (* (unsigned char * )s1 ++ );
2981
+ c2 = zend_tolower_ascii (* (unsigned char * )s2 ++ );
2996
2982
if (c1 != c2 ) {
2997
2983
return c1 - c2 ;
2998
2984
}
@@ -3012,8 +2998,8 @@ ZEND_API int ZEND_FASTCALL zend_binary_strncasecmp(const char *s1, size_t len1,
3012
2998
}
3013
2999
len = MIN (length , MIN (len1 , len2 ));
3014
3000
while (len -- ) {
3015
- c1 = i_zend_tolower_ascii (* (unsigned char * )s1 ++ );
3016
- c2 = i_zend_tolower_ascii (* (unsigned char * )s2 ++ );
3001
+ c1 = zend_tolower_ascii (* (unsigned char * )s1 ++ );
3002
+ c2 = zend_tolower_ascii (* (unsigned char * )s2 ++ );
3017
3003
if (c1 != c2 ) {
3018
3004
return c1 - c2 ;
3019
3005
}
0 commit comments