From: Michael Wallner Date: Wed, 16 Apr 2014 18:10:53 +0000 (+0200) Subject: fix warning on extra argument to Countable::count(), fix zend_is_true X-Git-Tag: RELEASE_2_0_7~31 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=675133e438d78d42f48ad922c340e1e43bdaae11 fix warning on extra argument to Countable::count(), fix zend_is_true --- diff --git a/php_http_client.c b/php_http_client.c index b2bd7f8..489177b 100644 --- a/php_http_client.c +++ b/php_http_client.c @@ -390,7 +390,7 @@ static STATUS handle_response(void *arg, php_http_client_t *client, php_http_cli zval *info, *zresponse, *zrequest; HashTable *info_ht; - if (i_zend_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0 TSRMLS_CC))) { + if (z_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0 TSRMLS_CC))) { handle_history(&zclient, *request, *response TSRMLS_CC); } @@ -720,7 +720,9 @@ ZEND_BEGIN_ARG_INFO_EX(ai_HttpClient_count, 0, 0, 0) ZEND_END_ARG_INFO(); static PHP_METHOD(HttpClient, count) { - if (SUCCESS == zend_parse_parameters_none()) { + long count_mode = -1; + + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &count_mode)) { php_http_client_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC); RETVAL_LONG(zend_llist_count(&obj->client->requests)); diff --git a/php_http_message.c b/php_http_message.c index 61a1f74..a6414e4 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -1808,7 +1808,9 @@ ZEND_BEGIN_ARG_INFO_EX(ai_HttpMessage_count, 0, 0, 0) ZEND_END_ARG_INFO(); static PHP_METHOD(HttpMessage, count) { - if (SUCCESS == zend_parse_parameters_none()) { + long count_mode = -1; + + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &count_mode)) { long i = 0; php_http_message_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC); diff --git a/php_http_misc.h b/php_http_misc.h index 75090bd..fe08d6d 100644 --- a/php_http_misc.h +++ b/php_http_misc.h @@ -127,6 +127,12 @@ static inline const char *php_http_locate_bin_eol(const char *bin, size_t len, i # define PHP_HTTP_ZEND_LITERAL_CCN , NULL #endif +#if PHP_VERSION_ID < 50700 +# define z_is_true zend_is_true +#else +# define z_is_true(z) zend_is_true(z TSRMLS_CC) +#endif + #define INIT_PZVAL_ARRAY(zv, ht) \ { \ INIT_PZVAL((zv)); \