Skip to content

Commit 2d3db4b

Browse files
committed
ext/iconv: Use bool type instead of int type
1 parent bba44fc commit 2d3db4b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ext/iconv/iconv.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -418,16 +418,16 @@ static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd
418418

419419
/* {{{ */
420420
#ifdef ICONV_BROKEN_IGNORE
421-
static int _php_check_ignore(const char *charset)
421+
static bool _php_check_ignore(const char *charset)
422422
{
423423
size_t clen = strlen(charset);
424424
if (clen >= 9 && strcmp("//IGNORE", charset+clen-8) == 0) {
425-
return 1;
425+
return true;
426426
}
427427
if (clen >= 19 && strcmp("//IGNORE//TRANSLIT", charset+clen-18) == 0) {
428-
return 1;
428+
return true;
429429
}
430-
return 0;
430+
return false;
431431
}
432432
#else
433433
#define _php_check_ignore(x) (0)
@@ -443,7 +443,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
443443
size_t bsz, result = 0;
444444
php_iconv_err_t retval = PHP_ICONV_ERR_SUCCESS;
445445
zend_string *out_buf;
446-
int ignore_ilseq = _php_check_ignore(out_charset);
446+
bool ignore_ilseq = _php_check_ignore(out_charset);
447447

448448
*out = NULL;
449449

@@ -560,7 +560,7 @@ static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_
560560
size_t out_left;
561561

562562
size_t cnt;
563-
int more;
563+
bool more;
564564

565565
*pretval = (size_t)-1;
566566

@@ -637,7 +637,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
637637

638638
size_t cnt;
639639
size_t total_len;
640-
int more;
640+
bool more;
641641

642642
err = _php_iconv_strlen(&total_len, str, nbytes, enc);
643643
if (err != PHP_ICONV_ERR_SUCCESS) {
@@ -775,7 +775,7 @@ static php_iconv_err_t _php_iconv_strpos(size_t *pretval,
775775
size_t ndl_buf_left;
776776

777777
size_t match_ofs;
778-
int more;
778+
bool more;
779779

780780
*pretval = (size_t)-1;
781781

0 commit comments

Comments
 (0)