@@ -1407,23 +1407,23 @@ PHP_FUNCTION(mb_detect_order)
1407
1407
}
1408
1408
/* }}} */
1409
1409
1410
- static inline int php_mb_check_code_point (zend_long cp )
1410
+ static inline bool php_mb_check_code_point (zend_long cp )
1411
1411
{
1412
1412
if (cp < 0 || cp >= 0x110000 ) {
1413
1413
/* Out of Unicode range */
1414
- return 0 ;
1414
+ return false ;
1415
1415
}
1416
1416
1417
1417
if (cp >= 0xd800 && cp <= 0xdfff ) {
1418
1418
/* Surrogate code-point. These are never valid on their own and we only allow a single
1419
1419
* substitute character. */
1420
- return 0 ;
1420
+ return false ;
1421
1421
}
1422
1422
1423
1423
/* As we do not know the target encoding of the conversion operation that is going to
1424
1424
* use the substitution character, we cannot check whether the codepoint is actually mapped
1425
1425
* in the given encoding at this point. Thus we have to accept everything. */
1426
- return 1 ;
1426
+ return true ;
1427
1427
}
1428
1428
1429
1429
/* {{{ Sets the current substitute_character or returns the current substitute_character */
@@ -5509,38 +5509,38 @@ static bool mb_check_str_encoding(zend_string *str, const mbfl_encoding *encodin
5509
5509
}
5510
5510
}
5511
5511
5512
- static int php_mb_check_encoding_recursive (HashTable * vars , const mbfl_encoding * encoding )
5512
+ static bool php_mb_check_encoding_recursive (HashTable * vars , const mbfl_encoding * encoding )
5513
5513
{
5514
5514
zend_long idx ;
5515
5515
zend_string * key ;
5516
5516
zval * entry ;
5517
- int valid = 1 ;
5517
+ bool valid = true ;
5518
5518
5519
5519
(void )(idx ); /* Suppress spurious compiler warning that `idx` is not used */
5520
5520
5521
5521
if (GC_IS_RECURSIVE (vars )) {
5522
5522
php_error_docref (NULL , E_WARNING , "Cannot not handle circular references" );
5523
- return 0 ;
5523
+ return false ;
5524
5524
}
5525
5525
GC_TRY_PROTECT_RECURSION (vars );
5526
5526
ZEND_HASH_FOREACH_KEY_VAL (vars , idx , key , entry ) {
5527
5527
ZVAL_DEREF (entry );
5528
5528
if (key ) {
5529
5529
if (!mb_check_str_encoding (key , encoding )) {
5530
- valid = 0 ;
5530
+ valid = false ;
5531
5531
break ;
5532
5532
}
5533
5533
}
5534
5534
switch (Z_TYPE_P (entry )) {
5535
5535
case IS_STRING :
5536
5536
if (!mb_check_str_encoding (Z_STR_P (entry ), encoding )) {
5537
- valid = 0 ;
5537
+ valid = false ;
5538
5538
break ;
5539
5539
}
5540
5540
break ;
5541
5541
case IS_ARRAY :
5542
5542
if (!php_mb_check_encoding_recursive (Z_ARRVAL_P (entry ), encoding )) {
5543
- valid = 0 ;
5543
+ valid = false ;
5544
5544
break ;
5545
5545
}
5546
5546
break ;
@@ -5552,7 +5552,7 @@ static int php_mb_check_encoding_recursive(HashTable *vars, const mbfl_encoding
5552
5552
break ;
5553
5553
default :
5554
5554
/* Other types are error. */
5555
- valid = 0 ;
5555
+ valid = false ;
5556
5556
break ;
5557
5557
}
5558
5558
} ZEND_HASH_FOREACH_END ();
0 commit comments