@@ -2457,9 +2457,9 @@ static size_t character_width(uint32_t c)
2457
2457
}
2458
2458
2459
2459
/* Do a binary search to see if we fall in any of the fullwidth ranges */
2460
- int lo = 0 , hi = sizeof (mbfl_eaw_table ) / sizeof (mbfl_eaw_table [0 ]);
2460
+ unsigned int lo = 0 , hi = sizeof (mbfl_eaw_table ) / sizeof (mbfl_eaw_table [0 ]);
2461
2461
while (lo < hi ) {
2462
- int probe = (lo + hi ) / 2 ;
2462
+ unsigned int probe = (lo + hi ) / 2 ;
2463
2463
if (c < mbfl_eaw_table [probe ].begin ) {
2464
2464
hi = probe ;
2465
2465
} else if (c > mbfl_eaw_table [probe ].end ) {
@@ -2533,7 +2533,7 @@ static zend_string* mb_trim_string(zend_string *input, zend_string *marker, cons
2533
2533
if (out_len <= to_skip ) {
2534
2534
to_skip -= out_len ;
2535
2535
} else {
2536
- for (int i = to_skip ; i < out_len ; i ++ ) {
2536
+ for (unsigned int i = to_skip ; i < out_len ; i ++ ) {
2537
2537
uint32_t w = wchar_buf [i ];
2538
2538
input_err |= (w == MBFL_BAD_INPUT );
2539
2539
remaining_width -= character_width (w );
@@ -2593,7 +2593,7 @@ static zend_string* mb_trim_string(zend_string *input, zend_string *marker, cons
2593
2593
if (out_len <= from ) {
2594
2594
from -= out_len ;
2595
2595
} else {
2596
- for (int i = from ; i < out_len ; i ++ ) {
2596
+ for (unsigned int i = from ; i < out_len ; i ++ ) {
2597
2597
width -= character_width (wchar_buf [i ]);
2598
2598
if (width < 0 ) {
2599
2599
enc -> from_wchar (wchar_buf + from , i - from , & buf , true);
@@ -2794,8 +2794,8 @@ static void remove_non_encodings_from_elist(const mbfl_encoding **elist, size_t
2794
2794
/* mbstring supports some 'text encodings' which aren't really text encodings
2795
2795
* at all, but really 'byte encodings', like Base64, QPrint, and so on.
2796
2796
* These should never be returned by `mb_detect_encoding`. */
2797
- int shift = 0 ;
2798
- for (int i = 0 ; i < * size ; i ++ ) {
2797
+ unsigned int shift = 0 ;
2798
+ for (unsigned int i = 0 ; i < * size ; i ++ ) {
2799
2799
const mbfl_encoding * encoding = elist [i ];
2800
2800
if (encoding -> no_encoding <= mbfl_no_encoding_charset_min ) {
2801
2801
shift ++ ; /* Remove this encoding from the list */
@@ -4620,7 +4620,7 @@ MBSTRING_API bool php_mb_check_encoding(const char *input, size_t length, const
4620
4620
* buffer of 128 codepoints, convert and check just a few codepoints first */
4621
4621
size_t out_len = encoding -> to_wchar (& in , & length , wchar_buf , 8 , & state );
4622
4622
ZEND_ASSERT (out_len <= 8 );
4623
- for (int i = 0 ; i < out_len ; i ++ ) {
4623
+ for (unsigned int i = 0 ; i < out_len ; i ++ ) {
4624
4624
if (wchar_buf [i ] == MBFL_BAD_INPUT ) {
4625
4625
return false;
4626
4626
}
@@ -4629,7 +4629,7 @@ MBSTRING_API bool php_mb_check_encoding(const char *input, size_t length, const
4629
4629
while (length ) {
4630
4630
out_len = encoding -> to_wchar (& in , & length , wchar_buf , 128 , & state );
4631
4631
ZEND_ASSERT (out_len <= 128 );
4632
- for (int i = 0 ; i < out_len ; i ++ ) {
4632
+ for (unsigned int i = 0 ; i < out_len ; i ++ ) {
4633
4633
if (wchar_buf [i ] == MBFL_BAD_INPUT ) {
4634
4634
return false;
4635
4635
}
0 commit comments