From 669d2e6a8bdc642b6b52693f4593f199ddd7e8d2 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 28 Mar 2006 20:20:40 +0000 Subject: [PATCH] - get rid of 1001 strict-aliasing warnings --- http_api.c | 4 ++-- http_cookie_api.c | 4 ++-- http_filter_api.c | 2 +- http_functions.c | 4 ++-- http_headers_api.c | 8 ++++---- http_message_api.c | 6 +++--- http_querystring_object.c | 12 ++++++------ http_request_api.c | 16 ++++++++-------- http_request_body_api.c | 6 +++--- http_request_object.c | 20 ++++++++++---------- http_request_pool_api.c | 6 +++--- http_response_object.c | 2 +- http_send_api.c | 10 +++++----- php_http.h | 2 +- php_http_message_api.h | 2 +- php_http_std_defs.h | 10 +++++----- php_http_url_api.h | 16 ++++++++-------- 17 files changed, 65 insertions(+), 65 deletions(-) diff --git a/http_api.c b/http_api.c index 5946680..c932266 100644 --- a/http_api.c +++ b/http_api.c @@ -201,10 +201,10 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen #ifdef ZEND_ENGINE_2 zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); #endif - if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) { + if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) { return NULL; } - if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), (char *) key, key_size, (void **) &var)) || (Z_TYPE_PP(var) != IS_STRING)) { + if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), (char *) key, key_size, (void *) &var)) || (Z_TYPE_PP(var) != IS_STRING)) { return NULL; } if (check && !(Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) { diff --git a/http_cookie_api.c b/http_cookie_api.c index c216e2d..fa6b253 100644 --- a/http_cookie_api.c +++ b/http_cookie_api.c @@ -66,7 +66,7 @@ PHP_HTTP_API void _http_cookie_list_free(http_cookie_list **list TSRMLS_DC) PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC) { zval **cookie = NULL; - if ((SUCCESS != zend_hash_find(&list->cookies, (char *) name, name_len + 1, (void **) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) { + if ((SUCCESS != zend_hash_find(&list->cookies, (char *) name, name_len + 1, (void *) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) { return NULL; } return Z_STRVAL_PP(cookie); @@ -75,7 +75,7 @@ PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, co PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC) { zval **extra = NULL; - if ((SUCCESS != zend_hash_find(&list->extras, (char *) name, name_len + 1, (void **) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) { + if ((SUCCESS != zend_hash_find(&list->extras, (char *) name, name_len + 1, (void *) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) { return NULL; } return Z_STRVAL_PP(extra); diff --git a/http_filter_api.c b/http_filter_api.c index 2553d68..02467de 100644 --- a/http_filter_api.c +++ b/http_filter_api.c @@ -484,7 +484,7 @@ static php_stream_filter *http_filter_create(const char *name, zval *params, int { case IS_ARRAY: case IS_OBJECT: - if (SUCCESS != zend_hash_find(HASH_OF(params), "flags", sizeof("flags"), (void **) &tmp)) { + if (SUCCESS != zend_hash_find(HASH_OF(params), "flags", sizeof("flags"), (void *) &tmp)) { break; } default: diff --git a/http_functions.c b/http_functions.c index 04377f5..aeb41da 100644 --- a/http_functions.c +++ b/http_functions.c @@ -250,7 +250,7 @@ PHP_FUNCTION(http_build_str) zval **value; \ \ zend_hash_internal_pointer_reset(Z_ARRVAL_P(supported)); \ - if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(supported), (void **) &value)) { \ + if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(supported), (void *) &value)) { \ RETVAL_ZVAL(*value, 1, 0); \ } else { \ RETVAL_NULL(); \ @@ -1206,7 +1206,7 @@ PHP_FUNCTION(http_match_request_header) zval **bodyonly; \ \ /* check if only the body should be returned */ \ - if (options && (SUCCESS == zend_hash_find(Z_ARRVAL_P(options), "bodyonly", sizeof("bodyonly"), (void **) &bodyonly)) && zval_is_true(*bodyonly)) { \ + if (options && (SUCCESS == zend_hash_find(Z_ARRVAL_P(options), "bodyonly", sizeof("bodyonly"), (void *) &bodyonly)) && zval_is_true(*bodyonly)) { \ http_message *msg = http_message_parse(PHPSTR_VAL(&request.conv.response), PHPSTR_LEN(&request.conv.response)); \ \ if (msg) { \ diff --git a/http_headers_api.c b/http_headers_api.c index c262145..c778662 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -392,7 +392,7 @@ PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header } /* if we already have got such a header make an array of those */ - if (SUCCESS == zend_hash_find(headers, key, keylen + 1, (void **) &previous)) { + if (SUCCESS == zend_hash_find(headers, key, keylen + 1, (void *) &previous)) { /* convert to array */ if (Z_TYPE_PP(previous) != IS_ARRAY) { convert_to_array(*previous); @@ -429,7 +429,7 @@ PHP_HTTP_API void _http_get_request_headers_ex(HashTable *headers, zend_bool pre #ifdef ZEND_ENGINE_2 zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); #endif - if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) { + if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) { FOREACH_KEYLEN(pos, *hsv, key, keylen, idx) { if (key && keylen > 6 && !strncmp(key, "HTTP_", 5)) { zval **header, *orig; @@ -440,7 +440,7 @@ PHP_HTTP_API void _http_get_request_headers_ex(HashTable *headers, zend_bool pre key = pretty_key(estrndup(key, keylen), keylen, 1, 1); } - zend_hash_get_current_data_ex(Z_ARRVAL_PP(hsv), (void **) &header, &pos); + zend_hash_get_current_data_ex(Z_ARRVAL_PP(hsv), (void *) &header, &pos); orig = *header; convert_to_string_ex(header); @@ -474,7 +474,7 @@ PHP_HTTP_API zend_bool _http_match_request_header_ex(const char *header, const c zend_hash_init(&headers, 0, NULL, ZVAL_PTR_DTOR, 0); http_get_request_headers_ex(&headers, 1); - if (SUCCESS == zend_hash_find(&headers, name, name_len+1, (void **) &data)) { + if (SUCCESS == zend_hash_find(&headers, name, name_len+1, (void *) &data)) { result = (match_case ? strcmp(Z_STRVAL_PP(data), value) : strcasecmp(Z_STRVAL_PP(data), value)) ? 0 : 1; } zend_hash_destroy(&headers); diff --git a/http_message_api.c b/http_message_api.c index 402d3dd..59fb327 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -137,7 +137,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char msg = http_message_init_rel(msg, 0); - if (SUCCESS != http_parse_headers_cb(message, &msg->hdrs, 1, (http_info_callback) http_message_info_callback, (void **) &msg)) { + if (SUCCESS != http_parse_headers_cb(message, &msg->hdrs, 1, (http_info_callback) http_message_info_callback, (void *) &msg)) { if (free_msg) { http_message_free(&msg); } @@ -250,7 +250,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char ZVAL_ADDREF(c); zend_hash_add(&msg->hdrs, "X-Original-Content-Encoding", sizeof("X-Original-Content-Encoding"), (void *) &c, sizeof(zval *), NULL); zend_hash_del(&msg->hdrs, "Content-Encoding", sizeof("Content-Encoding")); - if (SUCCESS == zend_hash_find(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void **) &original_len)) { + if (SUCCESS == zend_hash_find(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &original_len)) { ZVAL_ADDREF(*original_len); zend_hash_add(&msg->hdrs, "X-Original-Content-Length", sizeof("X-Original-Content-Length"), (void *) original_len, sizeof(zval *), NULL); zend_hash_update(&msg->hdrs, "Content-Length", sizeof("Content-Length"), (void *) &len, sizeof(zval *), NULL); @@ -528,7 +528,7 @@ PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC) add_assoc_zval(&options, "headers", &headers); /* check host header */ - if (SUCCESS == zend_hash_find(&message->hdrs, "Host", sizeof("Host"), (void **) &zhost)) { + if (SUCCESS == zend_hash_find(&message->hdrs, "Host", sizeof("Host"), (void *) &zhost)) { char *colon = NULL; php_url parts, *url = php_url_parse(message->http.info.request.url); diff --git a/http_querystring_object.c b/http_querystring_object.c index d47c495..55d355d 100644 --- a/http_querystring_object.c +++ b/http_querystring_object.c @@ -295,7 +295,7 @@ static inline int _http_querystring_modify_array_ex(zval *qarray, char *key, int } /* update */ - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), key, keylen, (void **) &qarray_entry)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), key, keylen, (void *) &qarray_entry)) { zval equal; /* recursive */ @@ -370,7 +370,7 @@ static inline void _http_querystring_get(zval *this_ptr, int type, char *name, u { zval **arrval, *qarray = GET_PROP(queryArray); - if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void **) &arrval))) { + if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void *) &arrval))) { RETVAL_ZVAL(*arrval, 1, 0); if (type) { @@ -404,15 +404,15 @@ PHP_METHOD(HttpQueryString, __construct) #ifdef ZEND_ENGINE_2 zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC); #endif - if ( (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &_SERVER)) && + if ( (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &_SERVER)) && (Z_TYPE_PP(_SERVER) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_PP(_SERVER), "QUERY_STRING", sizeof("QUERY_STRING"), (void **) &QUERY_STRING))) { + (SUCCESS == zend_hash_find(Z_ARRVAL_PP(_SERVER), "QUERY_STRING", sizeof("QUERY_STRING"), (void *) &QUERY_STRING))) { qstring = *QUERY_STRING; #ifdef ZEND_ENGINE_2 zend_is_auto_global("_GET", lenof("_GET") TSRMLS_CC); #endif - if ((SUCCESS == zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void **) &_GET)) && (Z_TYPE_PP(_GET) == IS_ARRAY)) { + if ((SUCCESS == zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void *) &_GET)) && (Z_TYPE_PP(_GET) == IS_ARRAY)) { qarray = *_GET; } else { http_error(HE_WARNING, HTTP_E_QUERYSTRING, "Could not acquire reference to superglobal GET array"); @@ -556,7 +556,7 @@ PHP_METHOD(HttpQueryString, singleton) zval **zobj_ptr = NULL, *zobj = NULL; if (Z_TYPE_P(instance) == IS_ARRAY) { - if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void **) &zobj_ptr)) { + if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void *) &zobj_ptr)) { RETVAL_ZVAL(*zobj_ptr, 1, 0); } else { zobj = http_querystring_instantiate(global); diff --git a/http_request_api.c b/http_request_api.c index a1779aa..06b69f7 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -560,9 +560,9 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti zval **prs, **pre; zend_hash_internal_pointer_reset(Z_ARRVAL_P(zoption)); - if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void **) &prs)) { + if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void *) &prs)) { zend_hash_move_forward(Z_ARRVAL_P(zoption)); - if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void **) &pre)) { + if (SUCCESS == zend_hash_get_current_data(Z_ARRVAL_P(zoption), (void *) &pre)) { zval *prs_cpy = zval_copy(IS_LONG, *prs), *pre_cpy = zval_copy(IS_LONG, *pre); if (Z_LVAL_P(prs_cpy) && Z_LVAL_P(pre_cpy)) { @@ -629,9 +629,9 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti FOREACH_VAL(pos1, zoption, rr) { if (Z_TYPE_PP(rr) == IS_ARRAY) { zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(rr), &pos2); - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void **) &rb, &pos2)) { + if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void *) &rb, &pos2)) { zend_hash_move_forward_ex(Z_ARRVAL_PP(rr), &pos2); - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void **) &re, &pos2)) { + if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(rr), (void *) &re, &pos2)) { if ( ((Z_TYPE_PP(rb) == IS_LONG) || ((Z_TYPE_PP(rb) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(rb), Z_STRLEN_PP(rb), NULL, NULL, 1))) && ((Z_TYPE_PP(re) == IS_LONG) || ((Z_TYPE_PP(re) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(re), Z_STRLEN_PP(re), NULL, NULL, 1)))) { zval *rbl = zval_copy(IS_LONG, *rb), *rel = zval_copy(IS_LONG, *re); @@ -673,7 +673,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti FOREACH_KEY(pos, zoption, header_key, header_idx) { if (header_key) { zval **header_val; - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void **) &header_val, &pos)) { + if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void *) &header_val, &pos)) { char header[1024] = {0}; ZVAL_ADDREF(*header_val); @@ -741,7 +741,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti FOREACH_KEY(pos, zoption, cookie_key, cookie_idx) { if (cookie_key) { zval **cookie_val; - if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void **) &cookie_val, &pos)) { + if (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(zoption), (void *) &cookie_val, &pos)) { zval *val = zval_copy(IS_STRING, *cookie_val); phpstr_appendf(&request->_cache.cookies, "%s=%s; ", cookie_key, Z_STRVAL_P(val)); zval_free(&val); @@ -1105,9 +1105,9 @@ static inline zval *_http_request_option_ex(http_request *r, HashTable *options, if (!options || #ifdef ZEND_ENGINE_2 - (SUCCESS != zend_hash_quick_find(options, key, keylen, h, (void **) &zoption)) + (SUCCESS != zend_hash_quick_find(options, key, keylen, h, (void *) &zoption)) #else - (SUCCESS != zend_hash_find(options, key, keylen, (void **) &zoption)) + (SUCCESS != zend_hash_find(options, key, keylen, (void *) &zoption)) #endif ) { return NULL; diff --git a/http_request_body_api.c b/http_request_body_api.c index dd76edb..fcaa635 100644 --- a/http_request_body_api.c +++ b/http_request_body_api.c @@ -85,9 +85,9 @@ PHP_HTTP_API http_request_body *_http_request_body_fill(http_request_body *body, if (Z_TYPE_PP(data) != IS_ARRAY) { http_error(HE_NOTICE, HTTP_E_INVALID_PARAM, "Unrecognized type of post file array entry"); - } else if ( SUCCESS != zend_hash_find(Z_ARRVAL_PP(data), "name", sizeof("name"), (void **) &name) || - SUCCESS != zend_hash_find(Z_ARRVAL_PP(data), "type", sizeof("type"), (void **) &type) || - SUCCESS != zend_hash_find(Z_ARRVAL_PP(data), "file", sizeof("file"), (void **) &file)) { + } else if ( SUCCESS != zend_hash_find(Z_ARRVAL_PP(data), "name", sizeof("name"), (void *) &name) || + SUCCESS != zend_hash_find(Z_ARRVAL_PP(data), "type", sizeof("type"), (void *) &type) || + SUCCESS != zend_hash_find(Z_ARRVAL_PP(data), "file", sizeof("file"), (void *) &file)) { http_error(HE_NOTICE, HTTP_E_INVALID_PARAM, "Post file array entry misses either 'name', 'type' or 'file' entry"); } else { CURLcode err; diff --git a/http_request_object.c b/http_request_object.c index 7791d4c..047e2a3 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -459,12 +459,12 @@ static inline void _http_request_object_check_request_content_type(zval *this_pt zval **headers, *opts = GET_PROP(options); if ( (Z_TYPE_P(opts) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "headers", sizeof("headers"), (void **) &headers)) && + (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "headers", sizeof("headers"), (void *) &headers)) && (Z_TYPE_PP(headers) == IS_ARRAY)) { zval **ct_header; /* only override if not already set */ - if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(headers), "Content-Type", sizeof("Content-Type"), (void **) &ct_header))) { + if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(headers), "Content-Type", sizeof("Content-Type"), (void *) &ct_header))) { add_assoc_stringl(*headers, "Content-Type", Z_STRVAL_P(ctype), Z_STRLEN_P(ctype), 1); } else /* or not a string, zero length string or a string of spaces */ @@ -580,7 +580,7 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ zval **entry, *pcb; if ( (Z_TYPE_P(options) != IS_ARRAY) - || (SUCCESS != zend_hash_find(Z_ARRVAL_P(options), "onprogress", sizeof("onprogress"), (void **) &entry) + || (SUCCESS != zend_hash_find(Z_ARRVAL_P(options), "onprogress", sizeof("onprogress"), (void *) &entry) || (!zval_is_true(*entry)))) { MAKE_STD_ZVAL(pcb); array_init(pcb); @@ -728,7 +728,7 @@ static inline void _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAM if (prettify_keys && opts) { zend_hash_apply_with_arguments(Z_ARRVAL_P(opts), apply_pretty_key, 0); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(new_opts), key, len, (void **) &entry)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(new_opts), key, len, (void *) &entry)) { if (overwrite) { zend_hash_clean(Z_ARRVAL_PP(entry)); } @@ -762,7 +762,7 @@ static inline void _http_request_get_options_subr(INTERNAL_FUNCTION_PARAMETERS, array_init(return_value); if ( (Z_TYPE_P(opts) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), key, len, (void **) &options))) { + (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), key, len, (void *) &options))) { convert_to_array(*options); array_copy(*options, return_value); } @@ -1647,11 +1647,11 @@ PHP_METHOD(HttpRequest, getResponseHeader) data = GET_PROP(responseData); if ( (Z_TYPE_P(data) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "headers", sizeof("headers"), (void **) &headers)) && + (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "headers", sizeof("headers"), (void *) &headers)) && (Z_TYPE_PP(headers) == IS_ARRAY)) { if (!header_len || !header_name) { RETVAL_ZVAL(*headers, 1, 0); - } else if (SUCCESS == zend_hash_find(Z_ARRVAL_PP(headers), pretty_key(header_name, header_len, 1, 1), header_len + 1, (void **) &header)) { + } else if (SUCCESS == zend_hash_find(Z_ARRVAL_PP(headers), pretty_key(header_name, header_len, 1, 1), header_len + 1, (void *) &header)) { RETVAL_ZVAL(*header, 1, 0); } else { RETVAL_FALSE; @@ -1684,7 +1684,7 @@ PHP_METHOD(HttpRequest, getResponseCookies) data = GET_PROP(responseData); if ( (Z_TYPE_P(data) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "headers", sizeof("headers"), (void **) &headers)) && + (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "headers", sizeof("headers"), (void *) &headers)) && (Z_TYPE_PP(headers) == IS_ARRAY)) { int i = 0; ulong idx = 0; @@ -1775,7 +1775,7 @@ PHP_METHOD(HttpRequest, getResponseBody) zval *data = GET_PROP(responseData); if ( (Z_TYPE_P(data) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "body", sizeof("body"), (void **) &body))) { + (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "body", sizeof("body"), (void *) &body))) { RETURN_ZVAL(*body, 1, 0); } else { RETURN_FALSE; @@ -1853,7 +1853,7 @@ PHP_METHOD(HttpRequest, getResponseInfo) } if (info_len && info_name) { - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(info), pretty_key(info_name, info_len, 0, 0), info_len + 1, (void **) &infop)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(info), pretty_key(info_name, info_len, 0, 0), info_len + 1, (void *) &infop)) { RETURN_ZVAL(*infop, 1, 0); } else { http_error_ex(HE_NOTICE, HTTP_E_INVALID_PARAM, "Could not find response info named %s", info_name); diff --git a/http_request_pool_api.c b/http_request_pool_api.c index 31261cf..cf84218 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -289,11 +289,11 @@ static void move_backtrace_args(zval *from, zval *to TSRMLS_DC) zval **args, **trace_0, *old_trace_0, *trace = NULL; if ((trace = zend_read_property(zend_exception_get_default(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) { - if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void **) &trace_0)) { + if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { old_trace_0 = *trace_0; - if (SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void **) &args)) { + if (SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void *) &args)) { if ((trace = zend_read_property(zend_exception_get_default(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) { - if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void **) &trace_0)) { + if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) { ZVAL_ADDREF(*args); add_assoc_zval(*trace_0, "args", *args); zend_hash_del(Z_ARRVAL_P(old_trace_0), "args", sizeof("args")); diff --git a/http_response_object.c b/http_response_object.c index 918647d..9fb4771 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -331,7 +331,7 @@ PHP_METHOD(HttpResponse, getHeader) zend_hash_init(&headers_ht, sizeof(zval *), NULL, ZVAL_PTR_DTOR, 0); if ( (SUCCESS == http_parse_headers_ex(PHPSTR_VAL(&headers), &headers_ht, 1)) && - (SUCCESS == zend_hash_find(&headers_ht, name, name_len + 1, (void **) &header))) { + (SUCCESS == zend_hash_find(&headers_ht, name, name_len + 1, (void *) &header))) { RETVAL_ZVAL(*header, 1, 0); } else { RETVAL_NULL(); diff --git a/http_send_api.c b/http_send_api.c index 82bdff0..93271db 100644 --- a/http_send_api.c +++ b/http_send_api.c @@ -341,9 +341,9 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s /* single range */ zval **range, **begin, **end; - if ( SUCCESS != zend_hash_index_find(&ranges, 0, (void **) &range) || - SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void **) &begin) || - SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void **) &end)) { + if ( SUCCESS != zend_hash_index_find(&ranges, 0, (void *) &range) || + SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void *) &begin) || + SUCCESS != zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void *) &end)) { /* this should never happen */ zend_hash_destroy(&ranges); http_send_status(500); @@ -379,8 +379,8 @@ PHP_HTTP_API STATUS _http_send_ex(const void *data_ptr, size_t data_size, http_s } FOREACH_HASH_VAL(pos, &ranges, range) { - if ( SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void **) &begin) && - SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void **) &end)) { + if ( SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 0, (void *) &begin) && + SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(range), 1, (void *) &end)) { char preface_str[512]; size_t preface_len; diff --git a/php_http.h b/php_http.h index 553796a..32ce1e3 100644 --- a/php_http.h +++ b/php_http.h @@ -15,7 +15,7 @@ #ifndef PHP_EXT_HTTP_H #define PHP_EXT_HTTP_H -#define PHP_EXT_HTTP_VERSION "1.0.0RC2" +#define PHP_EXT_HTTP_VERSION "1.0.0RC3-dev" #ifdef HAVE_CONFIG_H # include "config.h" diff --git a/php_http_message_api.h b/php_http_message_api.h index 763cd47..e3ab839 100644 --- a/php_http_message_api.h +++ b/php_http_message_api.h @@ -56,7 +56,7 @@ PHP_HTTP_API void _http_message_set_info(http_message *message, http_info *info) static inline zval *_http_message_header_ex(http_message *msg, char *key_str, size_t key_len) { zval **header; - if (SUCCESS == zend_hash_find(&msg->hdrs, key_str, key_len, (void **) &header)) { + if (SUCCESS == zend_hash_find(&msg->hdrs, key_str, key_len, (void *) &header)) { return *header; } return NULL; diff --git a/php_http_std_defs.h b/php_http_std_defs.h index 51b6125..a3a3056 100644 --- a/php_http_std_defs.h +++ b/php_http_std_defs.h @@ -149,7 +149,7 @@ typedef int STATUS; #define FOREACH_VAL(pos, array, val) FOREACH_HASH_VAL(pos, Z_ARRVAL_P(array), val) #define FOREACH_HASH_VAL(pos, hash, val) \ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ - zend_hash_get_current_data_ex(hash, (void **) &val, &pos) == SUCCESS; \ + zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ zend_hash_move_forward_ex(hash, &pos)) #define FOREACH_KEY(pos, array, strkey, numkey) FOREACH_HASH_KEY(pos, Z_ARRVAL_P(array), strkey, numkey) @@ -168,14 +168,14 @@ typedef int STATUS; #define FOREACH_HASH_KEYVAL(pos, hash, strkey, numkey, val) \ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ zend_hash_get_current_key_ex(hash, &strkey, NULL, &numkey, 0, &pos) != HASH_KEY_NON_EXISTANT && \ - zend_hash_get_current_data_ex(hash, (void **) &val, &pos) == SUCCESS; \ + zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ zend_hash_move_forward_ex(hash, &pos)) #define FOREACH_KEYLENVAL(pos, array, strkey, keylen, numkey, val) FOREACH_HASH_KEYLENVAL(pos, Z_ARRVAL_P(array), strkey, keylen, numkey, val) #define FOREACH_HASH_KEYLENVAL(pos, hash, strkey, keylen, numkey, val) \ for ( zend_hash_internal_pointer_reset_ex(hash, &pos); \ zend_hash_get_current_key_ex(hash, &strkey, &keylen, &numkey, 0, &pos) != HASH_KEY_NON_EXISTANT && \ - zend_hash_get_current_data_ex(hash, (void **) &val, &pos) == SUCCESS; \ + zend_hash_get_current_data_ex(hash, (void *) &val, &pos) == SUCCESS; \ zend_hash_move_forward_ex(hash, &pos)) #define array_copy(src, dst) zend_hash_copy(Z_ARRVAL_P(dst), Z_ARRVAL_P(src), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *)) @@ -190,13 +190,13 @@ typedef int STATUS; \ for ( zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(src), &pos); \ zend_hash_get_current_key_ex(Z_ARRVAL_P(src), &key, &klen, &idx, 0, &pos) != HASH_KEY_NON_EXISTANT && \ - zend_hash_get_current_data_ex(Z_ARRVAL_P(src), (void **) &data, &pos) == SUCCESS; \ + zend_hash_get_current_data_ex(Z_ARRVAL_P(src), (void *) &data, &pos) == SUCCESS; \ zend_hash_move_forward_ex(Z_ARRVAL_P(src), &pos)) \ { \ if (key) { \ zval **tmp; \ \ - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(dst), key, klen, (void **) &tmp)) { \ + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(dst), key, klen, (void *) &tmp)) { \ if (Z_TYPE_PP(tmp) != IS_ARRAY) { \ convert_to_array_ex(tmp); \ } \ diff --git a/php_http_url_api.h b/php_http_url_api.h index dc00899..a4c5df0 100644 --- a/php_http_url_api.h +++ b/php_http_url_api.h @@ -49,35 +49,35 @@ static inline php_url *_array2url(HashTable *ht TSRMLS_DC) zval **e; php_url *url = ecalloc(1, sizeof(php_url)); - if ((SUCCESS == zend_hash_find(ht, "scheme", sizeof("scheme"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "scheme", sizeof("scheme"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->scheme = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if ((SUCCESS == zend_hash_find(ht, "user", sizeof("user"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "user", sizeof("user"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->user = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if ((SUCCESS == zend_hash_find(ht, "pass", sizeof("pass"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "pass", sizeof("pass"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->pass = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if ((SUCCESS == zend_hash_find(ht, "host", sizeof("host"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "host", sizeof("host"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->host = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if ((SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->path = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if ((SUCCESS == zend_hash_find(ht, "query", sizeof("query"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "query", sizeof("query"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->query = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if ((SUCCESS == zend_hash_find(ht, "fragment", sizeof("fragment"), (void **) &e)) + if ((SUCCESS == zend_hash_find(ht, "fragment", sizeof("fragment"), (void *) &e)) && (Z_TYPE_PP(e) == IS_STRING) && Z_STRLEN_PP(e)) { url->fragment = estrndup(Z_STRVAL_PP(e), Z_STRLEN_PP(e)); } - if (SUCCESS == zend_hash_find(ht, "port", sizeof("port"), (void **) &e)) { + if (SUCCESS == zend_hash_find(ht, "port", sizeof("port"), (void *) &e)) { if (Z_TYPE_PP(e) == IS_LONG) { url->port = (unsigned short) Z_LVAL_PP(e); } else { -- 2.30.2