summaryrefslogtreecommitdiff
path: root/Zend/zend_stream.c
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-08-28 15:41:27 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-08-28 15:41:27 +0200
commitfa8d9b1183f961cb6e0f0ef5a2d1b1d3744fe35b (patch)
treea00044117c3f56969a7b77b466bbdbdd45d66db7 /Zend/zend_stream.c
parent7690439edd93bf9dc868cbc34a12fbad6b26e777 (diff)
downloadphp-git-fa8d9b1183f961cb6e0f0ef5a2d1b1d3744fe35b.tar.gz
Improve type declarations for Zend APIs
Voidification of Zend API which always succeeded Use bool argument types instead of int for boolean arguments Use bool return type for functions which return true/false (1/0) Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics Closes GH-6002
Diffstat (limited to 'Zend/zend_stream.c')
-rw-r--r--Zend/zend_stream.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c
index 38b145736b..1dfc5b1bc1 100644
--- a/Zend/zend_stream.c
+++ b/Zend/zend_stream.c
@@ -73,7 +73,7 @@ ZEND_API void zend_stream_init_filename(zend_file_handle *handle, const char *fi
handle->filename = filename;
}
-ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle) /* {{{ */
+ZEND_API zend_result zend_stream_open(const char *filename, zend_file_handle *handle) /* {{{ */
{
zend_string *opened_path;
if (zend_stream_open_function) {
@@ -113,7 +113,7 @@ static ssize_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_t
return file_handle->handle.stream.reader(file_handle->handle.stream.handle, buf, len);
} /* }}} */
-ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len) /* {{{ */
+ZEND_API zend_result zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t *len) /* {{{ */
{
size_t file_size;
@@ -232,6 +232,7 @@ ZEND_API void zend_file_handle_dtor(zend_file_handle *fh) /* {{{ */
}
/* }}} */
+/* return int to be compatible with Zend linked list API */
ZEND_API int zend_compare_file_handles(zend_file_handle *fh1, zend_file_handle *fh2) /* {{{ */
{
if (fh1->type != fh2->type) {