@@ -2494,9 +2494,9 @@ static size_t character_width(uint32_t c)
2494
2494
}
2495
2495
2496
2496
/* Do a binary search to see if we fall in any of the fullwidth ranges */
2497
- int lo = 0 , hi = sizeof (mbfl_eaw_table ) / sizeof (mbfl_eaw_table [0 ]);
2497
+ unsigned int lo = 0 , hi = sizeof (mbfl_eaw_table ) / sizeof (mbfl_eaw_table [0 ]);
2498
2498
while (lo < hi ) {
2499
- int probe = (lo + hi ) / 2 ;
2499
+ unsigned int probe = (lo + hi ) / 2 ;
2500
2500
if (c < mbfl_eaw_table [probe ].begin ) {
2501
2501
hi = probe ;
2502
2502
} else if (c > mbfl_eaw_table [probe ].end ) {
@@ -2570,7 +2570,7 @@ static zend_string* mb_trim_string(zend_string *input, zend_string *marker, cons
2570
2570
if (out_len <= to_skip ) {
2571
2571
to_skip -= out_len ;
2572
2572
} else {
2573
- for (int i = to_skip ; i < out_len ; i ++ ) {
2573
+ for (unsigned int i = to_skip ; i < out_len ; i ++ ) {
2574
2574
uint32_t w = wchar_buf [i ];
2575
2575
input_err |= (w == MBFL_BAD_INPUT );
2576
2576
remaining_width -= character_width (w );
@@ -2630,7 +2630,7 @@ static zend_string* mb_trim_string(zend_string *input, zend_string *marker, cons
2630
2630
if (out_len <= from ) {
2631
2631
from -= out_len ;
2632
2632
} else {
2633
- for (int i = from ; i < out_len ; i ++ ) {
2633
+ for (unsigned int i = from ; i < out_len ; i ++ ) {
2634
2634
width -= character_width (wchar_buf [i ]);
2635
2635
if (width < 0 ) {
2636
2636
enc -> from_wchar (wchar_buf + from , i - from , & buf , true);
@@ -2831,8 +2831,8 @@ static void remove_non_encodings_from_elist(const mbfl_encoding **elist, size_t
2831
2831
/* mbstring supports some 'text encodings' which aren't really text encodings
2832
2832
* at all, but really 'byte encodings', like Base64, QPrint, and so on.
2833
2833
* These should never be returned by `mb_detect_encoding`. */
2834
- int shift = 0 ;
2835
- for (int i = 0 ; i < * size ; i ++ ) {
2834
+ unsigned int shift = 0 ;
2835
+ for (unsigned int i = 0 ; i < * size ; i ++ ) {
2836
2836
const mbfl_encoding * encoding = elist [i ];
2837
2837
if (encoding -> no_encoding <= mbfl_no_encoding_charset_min ) {
2838
2838
shift ++ ; /* Remove this encoding from the list */
@@ -4822,7 +4822,7 @@ MBSTRING_API bool php_mb_check_encoding(const char *input, size_t length, const
4822
4822
* buffer of 128 codepoints, convert and check just a few codepoints first */
4823
4823
size_t out_len = encoding -> to_wchar (& in , & length , wchar_buf , 8 , & state );
4824
4824
ZEND_ASSERT (out_len <= 8 );
4825
- for (int i = 0 ; i < out_len ; i ++ ) {
4825
+ for (unsigned int i = 0 ; i < out_len ; i ++ ) {
4826
4826
if (wchar_buf [i ] == MBFL_BAD_INPUT ) {
4827
4827
return false;
4828
4828
}
@@ -4831,7 +4831,7 @@ MBSTRING_API bool php_mb_check_encoding(const char *input, size_t length, const
4831
4831
while (length ) {
4832
4832
out_len = encoding -> to_wchar (& in , & length , wchar_buf , 128 , & state );
4833
4833
ZEND_ASSERT (out_len <= 128 );
4834
- for (int i = 0 ; i < out_len ; i ++ ) {
4834
+ for (unsigned int i = 0 ; i < out_len ; i ++ ) {
4835
4835
if (wchar_buf [i ] == MBFL_BAD_INPUT ) {
4836
4836
return false;
4837
4837
}
0 commit comments