Skip to content

Commit 7c1ec84

Browse files
committed
ext/mbstring: Use size_t where more appropriate instead of int
1 parent 298f848 commit 7c1ec84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/mbstring/mbstring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3517,7 +3517,7 @@ static zend_string* jp_kana_convert(zend_string *input, const mbfl_encoding *enc
35173517
continue;
35183518
}
35193519

3520-
for (int i = 0; i < out_len-1; i++) {
3520+
for (size_t i = 0; i < out_len-1; i++) {
35213521
uint32_t second = 0;
35223522
bool consumed = false;
35233523
*converted++ = mb_convert_kana_codepoint(wchar_buf[i], wchar_buf[i+1], &consumed, &second, mode);
@@ -3589,7 +3589,7 @@ PHP_FUNCTION(mb_convert_kana)
35893589
} else if (c == 'a') {
35903590
opt |= MBFL_ZEN2HAN_ALL | MBFL_ZEN2HAN_ALPHA | MBFL_ZEN2HAN_NUMERIC;
35913591
} else {
3592-
for (int i = 0; i < sizeof(mb_convert_kana_flags) / sizeof(char); i++) {
3592+
for (size_t i = 0; i < sizeof(mb_convert_kana_flags) / sizeof(char); i++) {
35933593
if (c == mb_convert_kana_flags[i]) {
35943594
opt |= (1 << i);
35953595
goto next_option;
@@ -3930,7 +3930,7 @@ static zend_string* html_numeric_entity_encode(zend_string *input, const mbfl_en
39303930

39313931
/* Run through wchars and see if any of them fall into the ranges
39323932
* which we want to convert to HTML entities */
3933-
for (int i = 0; i < out_len; i++) {
3933+
for (size_t i = 0; i < out_len; i++) {
39343934
uint32_t w = wchar_buf[i];
39353935

39363936
if (html_numeric_entity_convert(w, convmap, mapsize, &w)) {

0 commit comments

Comments
 (0)