summaryrefslogtreecommitdiff
path: root/main/streams/streams.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-12-14 22:46:22 +0300
committerDmitry Stogov <dmitry@zend.com>2017-12-14 22:46:22 +0300
commit0f06df310c879e3506409277831c4cba7d4d9af7 (patch)
treeb671614a3bdeaf315fa1f69bbbc76fa7e2ab3477 /main/streams/streams.c
parent83e495e0fdc0c59b449bd173d0c8df1999239634 (diff)
downloadphp-git-0f06df310c879e3506409277831c4cba7d4d9af7.tar.gz
Turn "php_stream_wrapper"s into constants
Keep non-constant "php_stream_wrapper"s in API functions and callbacks for compatibility.
Diffstat (limited to 'main/streams/streams.c')
-rw-r--r--main/streams/streams.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index cf334cb4df..e92de7aabf 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -230,7 +230,7 @@ static void wrapper_list_dtor(zval *item) {
efree(list);
}
-PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options, const char *fmt, ...)
+PHPAPI void php_stream_wrapper_log_error(const php_stream_wrapper *wrapper, int options, const char *fmt, ...)
{
va_list args;
char *buffer = NULL;
@@ -1665,7 +1665,7 @@ static inline int php_stream_wrapper_scheme_validate(const char *protocol, unsig
}
/* API for registering GLOBAL wrappers */
-PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrapper *wrapper)
+PHPAPI int php_register_url_stream_wrapper(const char *protocol, const php_stream_wrapper *wrapper)
{
unsigned int protocol_len = (unsigned int)strlen(protocol);
int ret;
@@ -1676,7 +1676,7 @@ PHPAPI int php_register_url_stream_wrapper(const char *protocol, php_stream_wrap
}
str = zend_string_init_interned(protocol, protocol_len, 1);
- ret = zend_hash_add_ptr(&url_stream_wrappers_hash, str, wrapper) ? SUCCESS : FAILURE;
+ ret = zend_hash_add_ptr(&url_stream_wrappers_hash, str, (void*)wrapper) ? SUCCESS : FAILURE;
zend_string_release(str);
return ret;
}
@@ -1730,7 +1730,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
}
if (options & IGNORE_URL) {
- return (options & STREAM_LOCATE_WRAPPERS_ONLY) ? NULL : &php_plain_files_wrapper;
+ return (php_stream_wrapper*)((options & STREAM_LOCATE_WRAPPERS_ONLY) ? NULL : &php_plain_files_wrapper);
}
for (p = path; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) {
@@ -1765,7 +1765,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const
/* TODO: curl based streams probably support file:// properly */
if (!protocol || !strncasecmp(protocol, "file", n)) {
/* fall back on regular file access */
- php_stream_wrapper *plain_files_wrapper = &php_plain_files_wrapper;
+ php_stream_wrapper *plain_files_wrapper = (php_stream_wrapper*)&php_plain_files_wrapper;
if (protocol) {
int localhost = 0;