@@ -1403,23 +1403,23 @@ PHP_FUNCTION(mb_detect_order)
1403
1403
}
1404
1404
/* }}} */
1405
1405
1406
- static inline int php_mb_check_code_point (zend_long cp )
1406
+ static inline bool php_mb_check_code_point (zend_long cp )
1407
1407
{
1408
1408
if (cp < 0 || cp >= 0x110000 ) {
1409
1409
/* Out of Unicode range */
1410
- return 0 ;
1410
+ return false ;
1411
1411
}
1412
1412
1413
1413
if (cp >= 0xd800 && cp <= 0xdfff ) {
1414
1414
/* Surrogate code-point. These are never valid on their own and we only allow a single
1415
1415
* substitute character. */
1416
- return 0 ;
1416
+ return false ;
1417
1417
}
1418
1418
1419
1419
/* As we do not know the target encoding of the conversion operation that is going to
1420
1420
* use the substitution character, we cannot check whether the codepoint is actually mapped
1421
1421
* in the given encoding at this point. Thus we have to accept everything. */
1422
- return 1 ;
1422
+ return true ;
1423
1423
}
1424
1424
1425
1425
/* {{{ Sets the current substitute_character or returns the current substitute_character */
@@ -5296,38 +5296,38 @@ static bool mb_check_str_encoding(zend_string *str, const mbfl_encoding *encodin
5296
5296
}
5297
5297
}
5298
5298
5299
- static int php_mb_check_encoding_recursive (HashTable * vars , const mbfl_encoding * encoding )
5299
+ static bool php_mb_check_encoding_recursive (HashTable * vars , const mbfl_encoding * encoding )
5300
5300
{
5301
5301
zend_long idx ;
5302
5302
zend_string * key ;
5303
5303
zval * entry ;
5304
- int valid = 1 ;
5304
+ bool valid = true ;
5305
5305
5306
5306
(void )(idx ); /* Suppress spurious compiler warning that `idx` is not used */
5307
5307
5308
5308
if (GC_IS_RECURSIVE (vars )) {
5309
5309
php_error_docref (NULL , E_WARNING , "Cannot not handle circular references" );
5310
- return 0 ;
5310
+ return false ;
5311
5311
}
5312
5312
GC_TRY_PROTECT_RECURSION (vars );
5313
5313
ZEND_HASH_FOREACH_KEY_VAL (vars , idx , key , entry ) {
5314
5314
ZVAL_DEREF (entry );
5315
5315
if (key ) {
5316
5316
if (!mb_check_str_encoding (key , encoding )) {
5317
- valid = 0 ;
5317
+ valid = false ;
5318
5318
break ;
5319
5319
}
5320
5320
}
5321
5321
switch (Z_TYPE_P (entry )) {
5322
5322
case IS_STRING :
5323
5323
if (!mb_check_str_encoding (Z_STR_P (entry ), encoding )) {
5324
- valid = 0 ;
5324
+ valid = false ;
5325
5325
break ;
5326
5326
}
5327
5327
break ;
5328
5328
case IS_ARRAY :
5329
5329
if (!php_mb_check_encoding_recursive (Z_ARRVAL_P (entry ), encoding )) {
5330
- valid = 0 ;
5330
+ valid = false ;
5331
5331
break ;
5332
5332
}
5333
5333
break ;
@@ -5339,7 +5339,7 @@ static int php_mb_check_encoding_recursive(HashTable *vars, const mbfl_encoding
5339
5339
break ;
5340
5340
default :
5341
5341
/* Other types are error. */
5342
- valid = 0 ;
5342
+ valid = false ;
5343
5343
break ;
5344
5344
}
5345
5345
} ZEND_HASH_FOREACH_END ();
0 commit comments