@@ -226,14 +226,14 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D
226
226
227
227
/* {{{ pcre_get_compiled_regex_cache
228
228
*/
229
- PHPAPI pcre_cache_entry * pcre_get_compiled_regex_cache (char * regex , zend_str_size_int regex_len TSRMLS_DC )
229
+ PHPAPI pcre_cache_entry * pcre_get_compiled_regex_cache (char * regex , int regex_len TSRMLS_DC )
230
230
{
231
231
pcre * re = NULL ;
232
232
pcre_extra * extra ;
233
233
int coptions = 0 ;
234
234
int soptions = 0 ;
235
235
const char * error ;
236
- zend_str_size erroffset ;
236
+ int erroffset ;
237
237
char delimiter ;
238
238
char start_delimiter ;
239
239
char end_delimiter ;
@@ -399,7 +399,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, zend_str_siz
399
399
re = pcre_compile (pattern ,
400
400
coptions ,
401
401
& error ,
402
- & erroffset ,
402
+ ( int * ) & erroffset ,
403
403
tables );
404
404
405
405
if (re == NULL ) {
@@ -508,7 +508,7 @@ PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *pr
508
508
/* }}} */
509
509
510
510
/* {{{ add_offset_pair */
511
- static inline void add_offset_pair (zval * result , char * str , zend_str_size_int len , zend_str_size_int offset , char * name )
511
+ static inline void add_offset_pair (zval * result , char * str , zend_str_size_int len , long offset , char * name )
512
512
{
513
513
zval * match_pair ;
514
514
@@ -546,17 +546,17 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
546
546
}
547
547
548
548
/* Compile regex or get it from cache. */
549
- if ((pce = pcre_get_compiled_regex_cache (regex , regex_len TSRMLS_CC )) == NULL ) {
549
+ if ((pce = pcre_get_compiled_regex_cache (regex , ( int ) regex_len TSRMLS_CC )) == NULL ) {
550
550
RETURN_FALSE ;
551
551
}
552
552
553
- php_pcre_match_impl (pce , subject , subject_len , return_value , subpats ,
553
+ php_pcre_match_impl (pce , subject , ( int ) subject_len , return_value , subpats ,
554
554
global , ZEND_NUM_ARGS () >= 4 , flags , start_offset TSRMLS_CC );
555
555
}
556
556
/* }}} */
557
557
558
558
/* {{{ php_pcre_match_impl() */
559
- PHPAPI void php_pcre_match_impl (pcre_cache_entry * pce , char * subject , zend_str_size_int subject_len , zval * return_value ,
559
+ PHPAPI void php_pcre_match_impl (pcre_cache_entry * pce , char * subject , int subject_len , zval * return_value ,
560
560
zval * subpats , int global , int use_flags , long flags , long start_offset TSRMLS_DC )
561
561
{
562
562
zval * result_set , /* Holds a set of subpatterns after
@@ -855,12 +855,12 @@ static int preg_get_backref(char **str, int *backref)
855
855
856
856
/* {{{ preg_do_repl_func
857
857
*/
858
- static int preg_do_repl_func (zval * function , char * subject , zend_str_size_int * offsets , char * * subpat_names , int count , char * * result TSRMLS_DC )
858
+ static int preg_do_repl_func (zval * function , char * subject , int * offsets , char * * subpat_names , int count , char * * result TSRMLS_DC )
859
859
{
860
860
zval * retval_ptr ; /* Function return value */
861
861
zval * * args [1 ]; /* Argument to pass to function */
862
862
zval * subpats ; /* Captured subpatterns */
863
- zend_str_size result_len ; /* Return value length */
863
+ int result_len ; /* Return value length */
864
864
int i ;
865
865
866
866
MAKE_STD_ZVAL (subpats );
@@ -894,8 +894,8 @@ static int preg_do_repl_func(zval *function, char *subject, zend_str_size_int *o
894
894
895
895
/* {{{ preg_do_eval
896
896
*/
897
- static int preg_do_eval (char * eval_str , zend_str_size_int eval_str_len , char * subject ,
898
- zend_str_size_int * offsets , int count , char * * result TSRMLS_DC )
897
+ static int preg_do_eval (char * eval_str , int eval_str_len , char * subject ,
898
+ int * offsets , int count , char * * result TSRMLS_DC )
899
899
{
900
900
zval retval ; /* Return value from evaluation */
901
901
char * eval_str_end , /* End of eval string */
@@ -904,10 +904,10 @@ static int preg_do_eval(char *eval_str, zend_str_size_int eval_str_len, char *su
904
904
* walk , /* Used to walk the code string */
905
905
* segment , /* Start of segment to append while walking */
906
906
walk_last ; /* Last walked character */
907
- zend_str_size match_len ; /* Length of the match */
908
- zend_str_size esc_match_len ; /* Length of the quote-escaped match */
909
- zend_str_size result_len ; /* Length of the result of the evaluation */
910
- zend_str_size backref ; /* Current backref */
907
+ zend_str_size match_len ; /* Length of the match */
908
+ zend_str_size esc_match_len ; /* Length of the quote-escaped match */
909
+ zend_str_size result_len ; /* Length of the result of the evaluation */
910
+ int backref ; /* Current backref */
911
911
char * compiled_string_description ;
912
912
smart_str code = {0 };
913
913
@@ -982,10 +982,10 @@ static int preg_do_eval(char *eval_str, zend_str_size_int eval_str_len, char *su
982
982
983
983
/* {{{ php_pcre_replace
984
984
*/
985
- PHPAPI char * php_pcre_replace (char * regex , zend_str_size_int regex_len ,
986
- char * subject , zend_str_size_int subject_len ,
985
+ PHPAPI char * php_pcre_replace (char * regex , int regex_len ,
986
+ char * subject , int subject_len ,
987
987
zval * replace_val , int is_callable_replace ,
988
- zend_str_size_int * result_len , int limit , int * replace_count TSRMLS_DC )
988
+ int * result_len , int limit , int * replace_count TSRMLS_DC )
989
989
{
990
990
pcre_cache_entry * pce ; /* Compiled regular expression */
991
991
@@ -1000,27 +1000,27 @@ PHPAPI char *php_pcre_replace(char *regex, zend_str_size_int regex_len,
1000
1000
/* }}} */
1001
1001
1002
1002
/* {{{ php_pcre_replace_impl() */
1003
- PHPAPI char * php_pcre_replace_impl (pcre_cache_entry * pce , char * subject , zend_str_size_int subject_len , zval * replace_val ,
1004
- int is_callable_replace , zend_str_size_int * result_len , int limit , int * replace_count TSRMLS_DC )
1003
+ PHPAPI char * php_pcre_replace_impl (pcre_cache_entry * pce , char * subject , int subject_len , zval * replace_val ,
1004
+ int is_callable_replace , int * result_len , int limit , int * replace_count TSRMLS_DC )
1005
1005
{
1006
1006
pcre_extra * extra = pce -> extra ;/* Holds results of studying */
1007
1007
pcre_extra extra_data ; /* Used locally for exec options */
1008
1008
int exoptions = 0 ; /* Execution options */
1009
1009
int count = 0 ; /* Count of matched subpatterns */
1010
- int * offsets ; /* Array of subpattern offsets */
1010
+ int * offsets ; /* Array of subpattern offsets */
1011
1011
char * * subpat_names ; /* Array for named subpatterns */
1012
1012
int num_subpats ; /* Number of captured subpatterns */
1013
1013
int size_offsets ; /* Size of the offsets array */
1014
- zend_str_size new_len ; /* Length of needed storage */
1015
- zend_str_size alloc_len ; /* Actual allocated length */
1016
- zend_str_size eval_result_len = 0 ; /* Length of the eval'ed or
1014
+ int new_len ; /* Length of needed storage */
1015
+ int alloc_len ; /* Actual allocated length */
1016
+ int eval_result_len = 0 ; /* Length of the eval'ed or
1017
1017
function-returned string */
1018
- zend_str_size match_len ; /* Length of the current match */
1019
- zend_str_size backref ; /* Backreference number */
1018
+ int match_len ; /* Length of the current match */
1019
+ int backref ; /* Backreference number */
1020
1020
int eval ; /* If the replacement string should be eval'ed */
1021
- zend_str_size start_offset ; /* Where the new search starts */
1021
+ int start_offset ; /* Where the new search starts */
1022
1022
int g_notempty = 0 ; /* If the match should not be empty */
1023
- zend_str_size replace_len = 0 ; /* Length of replacement string */
1023
+ int replace_len = 0 ; /* Length of replacement string */
1024
1024
char * result , /* Result of replacement */
1025
1025
* replace = NULL , /* Replacement string */
1026
1026
* new_buf , /* Temporary buffer for re-allocation */
@@ -1243,15 +1243,15 @@ PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, zend_st
1243
1243
1244
1244
/* {{{ php_replace_in_subject
1245
1245
*/
1246
- static char * php_replace_in_subject (zval * regex , zval * replace , zval * * subject , zend_str_size_int * result_len , int limit , int is_callable_replace , int * replace_count TSRMLS_DC )
1246
+ static char * php_replace_in_subject (zval * regex , zval * replace , zval * * subject , int * result_len , int limit , int is_callable_replace , int * replace_count TSRMLS_DC )
1247
1247
{
1248
1248
zval * * regex_entry ,
1249
1249
* * replace_entry = NULL ,
1250
1250
* replace_value ,
1251
1251
empty_replace ;
1252
1252
char * subject_value ,
1253
1253
* result ;
1254
- zend_str_size subject_len ;
1254
+ int subject_len ;
1255
1255
1256
1256
/* Make sure we're dealing with strings. */
1257
1257
convert_to_string_ex (subject );
@@ -1339,7 +1339,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
1339
1339
* * subject_entry ,
1340
1340
* * zcount = NULL ;
1341
1341
char * result ;
1342
- zend_str_size result_len ;
1342
+ int result_len ;
1343
1343
int limit_val = -1 ;
1344
1344
long limit = -1 ;
1345
1345
char * string_key ;
@@ -1397,11 +1397,11 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
1397
1397
switch (zend_hash_get_current_key (Z_ARRVAL_PP (subject ), & string_key , & num_key , 0 ))
1398
1398
{
1399
1399
case HASH_KEY_IS_STRING :
1400
- add_assoc_stringl (return_value , string_key , result , result_len , 0 );
1400
+ add_assoc_stringl (return_value , string_key , result , ( zend_str_size ) result_len , 0 );
1401
1401
break ;
1402
1402
1403
1403
case HASH_KEY_IS_LONG :
1404
- add_index_stringl (return_value , num_key , result , result_len , 0 );
1404
+ add_index_stringl (return_value , num_key , result , ( zend_str_size ) result_len , 0 );
1405
1405
break ;
1406
1406
}
1407
1407
} else {
@@ -1415,7 +1415,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
1415
1415
old_replace_count = replace_count ;
1416
1416
if ((result = php_replace_in_subject (* regex , * replace , subject , & result_len , limit_val , is_callable_replace , & replace_count TSRMLS_CC )) != NULL ) {
1417
1417
if (!is_filter || replace_count > old_replace_count ) {
1418
- RETVAL_STRINGL (result , result_len , 0 );
1418
+ RETVAL_STRINGL (result , ( zend_str_size ) result_len , 0 );
1419
1419
} else {
1420
1420
efree (result );
1421
1421
}
@@ -1472,17 +1472,17 @@ static PHP_FUNCTION(preg_split)
1472
1472
}
1473
1473
1474
1474
/* Compile regex or get it from cache. */
1475
- if ((pce = pcre_get_compiled_regex_cache (regex , regex_len TSRMLS_CC )) == NULL ) {
1475
+ if ((pce = pcre_get_compiled_regex_cache (regex , ( int ) regex_len TSRMLS_CC )) == NULL ) {
1476
1476
RETURN_FALSE ;
1477
1477
}
1478
1478
1479
- php_pcre_split_impl (pce , subject , subject_len , return_value , limit_val , flags TSRMLS_CC );
1479
+ php_pcre_split_impl (pce , subject , ( int ) subject_len , return_value , limit_val , flags TSRMLS_CC );
1480
1480
}
1481
1481
/* }}} */
1482
1482
1483
1483
/* {{{ php_pcre_split
1484
1484
*/
1485
- PHPAPI void php_pcre_split_impl (pcre_cache_entry * pce , char * subject , zend_str_size_int subject_len , zval * return_value ,
1485
+ PHPAPI void php_pcre_split_impl (pcre_cache_entry * pce , char * subject , int subject_len , zval * return_value ,
1486
1486
long limit_val , long flags TSRMLS_DC )
1487
1487
{
1488
1488
pcre_extra * extra = NULL ; /* Holds results of studying */
@@ -1753,7 +1753,7 @@ static PHP_FUNCTION(preg_grep)
1753
1753
}
1754
1754
1755
1755
/* Compile regex or get it from cache. */
1756
- if ((pce = pcre_get_compiled_regex_cache (regex , regex_len TSRMLS_CC )) == NULL ) {
1756
+ if ((pce = pcre_get_compiled_regex_cache (regex , ( int ) regex_len TSRMLS_CC )) == NULL ) {
1757
1757
RETURN_FALSE ;
1758
1758
}
1759
1759
0 commit comments