From 1828ec21e29e90d9e84baf8ff4dc10ba83c6d0d2 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 27 Jan 2015 23:28:31 +0800 Subject: [PATCH] Fixed some annoying warnings --- ext/opcache/zend_accelerator_module.c | 2 +- main/main.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 7997deaa95..625fe65d4e 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -282,7 +282,7 @@ static int filename_is_in_cache(char *filename, int filename_len) { char *key; int key_length; - zend_file_handle handle = {0}; + zend_file_handle handle = {{0}, NULL, NULL, 0, 0}; zend_persistent_script *persistent_script; handle.filename = filename; diff --git a/main/main.c b/main/main.c index 3aef805580..538e8fe7d2 100644 --- a/main/main.c +++ b/main/main.c @@ -761,7 +761,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c buffer_len = (int)vspprintf(&buffer, 0, format, args); if (PG(html_errors)) { - replace_buffer = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL); + replace_buffer = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, NULL); efree(buffer); buffer = replace_buffer->val; buffer_len = (int)replace_buffer->len; @@ -820,7 +820,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c } if (PG(html_errors)) { - replace_origin = php_escape_html_entities(origin, origin_len, 0, ENT_COMPAT, NULL); + replace_origin = php_escape_html_entities((unsigned char*)origin, origin_len, 0, ENT_COMPAT, NULL); efree(origin); origin = replace_origin->val; } @@ -1136,7 +1136,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ if (PG(html_errors)) { if (type == E_ERROR || type == E_PARSE) { - zend_string *buf = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL); + zend_string *buf = php_escape_html_entities((unsigned char*)buffer, buffer_len, 0, ENT_COMPAT, NULL); php_printf("%s
\n%s: %s in %s on line %d
\n%s", STR_PRINT(prepend_string), error_type_str, buf->val, error_filename, error_lineno, STR_PRINT(append_string)); zend_string_free(buf); } else { @@ -2472,7 +2472,7 @@ void php_module_shutdown(void) PHPAPI int php_execute_script(zend_file_handle *primary_file) { zend_file_handle *prepend_file_p, *append_file_p; - zend_file_handle prepend_file = {0}, append_file = {0}; + zend_file_handle prepend_file = {{0}, NULL, NULL, 0, 0}, append_file = {{0}, NULL, NULL, 0, 0}; #if HAVE_BROKEN_GETCWD volatile int old_cwd_fd = -1; #else @@ -2631,7 +2631,7 @@ PHPAPI int php_handle_auth_data(const char *auth) char *pass; zend_string *user; - user = php_base64_decode(auth + 6, strlen(auth) - 6); + user = php_base64_decode((const unsigned char*)auth + 6, strlen(auth) - 6); if (user) { pass = strchr(user->val, ':'); if (pass) { -- 2.49.0