Use bool for silent parameter in SPL directory.c

This commit is contained in:
George Peter Banyard 2022-05-27 10:26:15 +01:00
parent 8f63505d71
commit a493c94471
No known key found for this signature in database
GPG Key ID: 3306078E3194AEBD

View File

@ -1944,7 +1944,7 @@ static zend_result spl_filesystem_file_read_csv(spl_filesystem_object *intern, c
} }
/* }}} */ /* }}} */
static zend_result spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */ static zend_result spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_object *intern, bool silent) /* {{{ */
{ {
zval retval; zval retval;
@ -2026,7 +2026,7 @@ static bool spl_filesystem_file_is_empty_line(spl_filesystem_object *intern) /*
} }
/* }}} */ /* }}} */
static zend_result spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, int silent) /* {{{ */ static zend_result spl_filesystem_file_read_line(zval * this_ptr, spl_filesystem_object *intern, bool silent) /* {{{ */
{ {
zend_result ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent); zend_result ret = spl_filesystem_file_read_line_ex(this_ptr, intern, silent);
@ -2052,7 +2052,7 @@ static void spl_filesystem_file_rewind(zval * this_ptr, spl_filesystem_object *i
intern->u.file.current_line_num = 0; intern->u.file.current_line_num = 0;
} }
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
spl_filesystem_file_read_line(this_ptr, intern, 1); spl_filesystem_file_read_line(this_ptr, intern, /* silent */ true);
} }
} /* }}} */ } /* }}} */
@ -2206,7 +2206,7 @@ PHP_METHOD(SplFileObject, current)
CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern); CHECK_SPL_FILE_OBJECT_IS_INITIALIZED(intern);
if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) { if (!intern->u.file.current_line && Z_ISUNDEF(intern->u.file.current_zval)) {
spl_filesystem_file_read_line(ZEND_THIS, intern, 1); spl_filesystem_file_read_line(ZEND_THIS, intern, /* silent */ true);
} }
if (intern->u.file.current_line && (!SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || Z_ISUNDEF(intern->u.file.current_zval))) { if (intern->u.file.current_line && (!SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV) || Z_ISUNDEF(intern->u.file.current_zval))) {
RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len); RETURN_STRINGL(intern->u.file.current_line, intern->u.file.current_line_len);
@ -2228,7 +2228,7 @@ PHP_METHOD(SplFileObject, key)
/* Do not read the next line to support correct counting with fgetc() /* Do not read the next line to support correct counting with fgetc()
if (!intern->u.file.current_line) { if (!intern->u.file.current_line) {
spl_filesystem_file_read_line(ZEND_THIS, intern, 1); spl_filesystem_file_read_line(ZEND_THIS, intern, silent true);
} */ } */
RETURN_LONG(intern->u.file.current_line_num); RETURN_LONG(intern->u.file.current_line_num);
} /* }}} */ } /* }}} */
@ -2244,7 +2244,7 @@ PHP_METHOD(SplFileObject, next)
spl_filesystem_file_free_line(intern); spl_filesystem_file_free_line(intern);
if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) { if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_AHEAD)) {
spl_filesystem_file_read_line(ZEND_THIS, intern, 1); spl_filesystem_file_read_line(ZEND_THIS, intern, /* silent */ true);
} }
intern->u.file.current_line_num++; intern->u.file.current_line_num++;
} /* }}} */ } /* }}} */
@ -2743,7 +2743,7 @@ PHP_METHOD(SplFileObject, seek)
spl_filesystem_file_rewind(ZEND_THIS, intern); spl_filesystem_file_rewind(ZEND_THIS, intern);
for (i = 0; i < line_pos; i++) { for (i = 0; i < line_pos; i++) {
if (spl_filesystem_file_read_line(ZEND_THIS, intern, 1) == FAILURE) { if (spl_filesystem_file_read_line(ZEND_THIS, intern, /* silent */ true) == FAILURE) {
return; return;
} }
} }