From f51ba0ea2cab12b66e684a803197c0aad4d34f67 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 18 May 2006 17:42:47 +0000 Subject: [PATCH] s/IF_RETVAL_USED/if (return_value_used)/ --- http_functions.c | 4 ++-- http_message_object.c | 20 +++++++++--------- http_querystring_object.c | 2 +- http_request_object.c | 44 +++++++++++++++++++-------------------- http_requestpool_object.c | 6 +++--- http_response_object.c | 24 ++++++++++----------- php_http_std_defs.h | 6 ------ 7 files changed, 50 insertions(+), 56 deletions(-) diff --git a/http_functions.c b/http_functions.c index aa8e51b..155a06f 100644 --- a/http_functions.c +++ b/http_functions.c @@ -1838,7 +1838,7 @@ PHP_FUNCTION(http_request_method_unregister) */ PHP_FUNCTION(http_request_method_exists) { - IF_RETVAL_USED { + if (return_value_used) { zval *method; if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &method)) { @@ -1874,7 +1874,7 @@ PHP_FUNCTION(http_request_method_exists) */ PHP_FUNCTION(http_request_method_name) { - IF_RETVAL_USED { + if (return_value_used) { long method; if ((SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &method)) || (method < 0)) { diff --git a/http_message_object.c b/http_message_object.c index 8af5805..3c90c58 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -753,7 +753,7 @@ PHP_METHOD(HttpMessage, getBody) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); RETURN_PHPSTR(&obj->message->body, PHPSTR_FREE_NOT, 1); } @@ -790,7 +790,7 @@ PHP_METHOD(HttpMessage, getHeaders) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval headers; getObject(http_message_object, obj); @@ -862,7 +862,7 @@ PHP_METHOD(HttpMessage, getType) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); RETURN_LONG(obj->message->type); } @@ -898,7 +898,7 @@ PHP_METHOD(HttpMessage, getResponseCode) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); RETURN_LONG(obj->message->http.info.response.code); @@ -946,7 +946,7 @@ PHP_METHOD(HttpMessage, getResponseStatus) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); HTTP_CHECK_MESSAGE_TYPE_RESPONSE(obj->message, RETURN_FALSE); RETURN_STRING(obj->message->http.info.response.status, 1); @@ -990,7 +990,7 @@ PHP_METHOD(HttpMessage, getRequestMethod) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); RETURN_STRING(obj->message->http.info.request.method, 1); @@ -1043,7 +1043,7 @@ PHP_METHOD(HttpMessage, getRequestUrl) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); HTTP_CHECK_MESSAGE_TYPE_REQUEST(obj->message, RETURN_FALSE); RETURN_STRING(obj->message->http.info.request.url, 1); @@ -1090,7 +1090,7 @@ PHP_METHOD(HttpMessage, getHttpVersion) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { char ver[4] = {0}; getObject(http_message_object, obj); @@ -1182,7 +1182,7 @@ PHP_METHOD(HttpMessage, send) */ PHP_METHOD(HttpMessage, toString) { - IF_RETVAL_USED { + if (return_value_used) { char *string; size_t length; zend_bool include_parent = 0; @@ -1216,7 +1216,7 @@ PHP_METHOD(HttpMessage, toMessageTypeObject) NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_message_object, obj); switch (obj->message->type) diff --git a/http_querystring_object.c b/http_querystring_object.c index 6f452b9..7db43de 100644 --- a/http_querystring_object.c +++ b/http_querystring_object.c @@ -367,7 +367,7 @@ PHP_METHOD(HttpQueryString, set) } } - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(queryString); } } diff --git a/http_request_object.c b/http_request_object.c index 207ec6c..1c0f39a 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -772,7 +772,7 @@ static inline void _http_request_get_options_subr(INTERNAL_FUNCTION_PARAMETERS, { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *opts, **options; opts = GET_PROP(options); @@ -900,7 +900,7 @@ PHP_METHOD(HttpRequest, getOptions) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(options); } } @@ -1062,7 +1062,7 @@ PHP_METHOD(HttpRequest, getUrl) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(url); } } @@ -1100,7 +1100,7 @@ PHP_METHOD(HttpRequest, getMethod) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(method); } } @@ -1143,7 +1143,7 @@ PHP_METHOD(HttpRequest, getContentType) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(contentType); } } @@ -1202,7 +1202,7 @@ PHP_METHOD(HttpRequest, getQueryData) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(queryData); } } @@ -1314,7 +1314,7 @@ PHP_METHOD(HttpRequest, getPostFields) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(postFields); } } @@ -1394,7 +1394,7 @@ PHP_METHOD(HttpRequest, getRawPostData) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(rawPostData); } } @@ -1492,7 +1492,7 @@ PHP_METHOD(HttpRequest, getPostFiles) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(postFiles); } } @@ -1531,7 +1531,7 @@ PHP_METHOD(HttpRequest, getPutFile) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(putFile); } } @@ -1611,7 +1611,7 @@ PHP_METHOD(HttpRequest, getPutData) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(putData); } } @@ -1632,7 +1632,7 @@ PHP_METHOD(HttpRequest, getResponseData) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(responseData); } } @@ -1653,7 +1653,7 @@ PHP_METHOD(HttpRequest, getResponseData) */ PHP_METHOD(HttpRequest, getResponseHeader) { - IF_RETVAL_USED { + if (return_value_used) { zval *data, **headers, **header; char *header_name = NULL; int header_len = 0; @@ -1691,7 +1691,7 @@ PHP_METHOD(HttpRequest, getResponseHeader) */ PHP_METHOD(HttpRequest, getResponseCookies) { - IF_RETVAL_USED { + if (return_value_used) { long flags = 0; zval *allowed_extras_array = NULL, *data, **headers; @@ -1787,7 +1787,7 @@ PHP_METHOD(HttpRequest, getResponseBody) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval **body; zval *data = GET_PROP(responseData); @@ -1814,7 +1814,7 @@ PHP_METHOD(HttpRequest, getResponseCode) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(responseCode); } } @@ -1830,7 +1830,7 @@ PHP_METHOD(HttpRequest, getResponseStatus) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { RETURN_PROP(responseStatus); } } @@ -1854,7 +1854,7 @@ PHP_METHOD(HttpRequest, getResponseStatus) */ PHP_METHOD(HttpRequest, getResponseInfo) { - IF_RETVAL_USED { + if (return_value_used) { zval *info, **infop; char *info_name = NULL; int info_len = 0; @@ -1935,7 +1935,7 @@ PHP_METHOD(HttpRequest, getRequestMessage) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { http_message *msg; getObject(http_request_object, obj); @@ -1958,7 +1958,7 @@ PHP_METHOD(HttpRequest, getRawRequestMessage) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_request_object, obj); RETURN_PHPSTR_DUP(&obj->request->conv.request); @@ -1976,7 +1976,7 @@ PHP_METHOD(HttpRequest, getRawResponseMessage) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_request_object, obj); RETURN_PHPSTR_DUP(&obj->request->conv.response); @@ -2003,7 +2003,7 @@ PHP_METHOD(HttpRequest, getHistory) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *hist; SET_EH_THROW_HTTP(); diff --git a/http_requestpool_object.c b/http_requestpool_object.c index 4ca9de7..ddef318 100644 --- a/http_requestpool_object.c +++ b/http_requestpool_object.c @@ -391,7 +391,7 @@ PHP_METHOD(HttpRequestPool, valid) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_requestpool_object, obj); RETURN_BOOL(obj->iterator.pos >= 0 && obj->iterator.pos < zend_llist_count(&obj->pool.handles)); } @@ -406,7 +406,7 @@ PHP_METHOD(HttpRequestPool, current) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { long pos = 0; zval **current = NULL; zend_llist_position lpos; @@ -433,7 +433,7 @@ PHP_METHOD(HttpRequestPool, key) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { getObject(http_requestpool_object, obj); RETURN_LONG(obj->iterator.pos); } diff --git a/http_response_object.c b/http_response_object.c index f7ba0b2..7d2f390 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -384,7 +384,7 @@ PHP_METHOD(HttpResponse, getCache) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *cache_p, *cache = convert_to_type_ex(IS_BOOL, GET_STATIC_PROP(cache), &cache_p); RETVAL_ZVAL(cache, 1, 0); @@ -426,7 +426,7 @@ PHP_METHOD(HttpResponse, getGzip) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *gzip_p, *gzip = convert_to_type_ex(IS_BOOL, GET_STATIC_PROP(gzip), &gzip_p); RETVAL_ZVAL(gzip, 1, 0); @@ -485,7 +485,7 @@ PHP_METHOD(HttpResponse, getCacheControl) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *ccontrol_p, *ccontrol = convert_to_type_ex(IS_STRING, GET_STATIC_PROP(cacheControl), &ccontrol_p); RETVAL_ZVAL(ccontrol, 1, 0); @@ -532,7 +532,7 @@ PHP_METHOD(HttpResponse, getContentType) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *ctype_p, *ctype = convert_to_type_ex(IS_STRING, GET_STATIC_PROP(contentType), &ctype_p); RETVAL_ZVAL(ctype, 1, 0); @@ -643,7 +643,7 @@ PHP_METHOD(HttpResponse, getContentDisposition) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *cd_p, *cd = convert_to_type_ex(IS_STRING, GET_STATIC_PROP(contentDisposition), &cd_p); RETVAL_ZVAL(cd, 1, 0); @@ -686,7 +686,7 @@ PHP_METHOD(HttpResponse, getETag) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *etag_p, *etag = convert_to_type_ex(IS_STRING, GET_STATIC_PROP(eTag), &etag_p); RETVAL_ZVAL(etag, 1, 0); @@ -729,7 +729,7 @@ PHP_METHOD(HttpResponse, getLastModified) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *lm_p, *lm = convert_to_type_ex(IS_LONG, GET_STATIC_PROP(lastModified), &lm_p); RETVAL_ZVAL(lm, 1, 0); @@ -776,7 +776,7 @@ PHP_METHOD(HttpResponse, getThrottleDelay) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *delay_p, *delay = convert_to_type_ex(IS_DOUBLE, GET_STATIC_PROP(throttleDelay), &delay_p); RETVAL_ZVAL(delay, 1, 0); @@ -822,7 +822,7 @@ PHP_METHOD(HttpResponse, getBufferSize) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *size_p, *size = convert_to_type_ex(IS_LONG, GET_STATIC_PROP(bufferSize), &size_p); RETVAL_ZVAL(size, 1, 0); @@ -880,7 +880,7 @@ PHP_METHOD(HttpResponse, getData) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *the_data = GET_STATIC_PROP(data); RETURN_ZVAL(the_data, 1, 0); @@ -939,7 +939,7 @@ PHP_METHOD(HttpResponse, getStream) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *stream_p; RETVAL_RESOURCE(Z_LVAL_P(convert_to_type_ex(IS_LONG, GET_STATIC_PROP(stream), &stream_p))); @@ -998,7 +998,7 @@ PHP_METHOD(HttpResponse, getFile) { NO_ARGS; - IF_RETVAL_USED { + if (return_value_used) { zval *the_file_p, *the_file = convert_to_type_ex(IS_STRING, GET_STATIC_PROP(file), &the_file_p); RETVAL_ZVAL(the_file, 1, 0); diff --git a/php_http_std_defs.h b/php_http_std_defs.h index 154f778..b4218bd 100644 --- a/php_http_std_defs.h +++ b/php_http_std_defs.h @@ -96,12 +96,6 @@ typedef int STATUS; zend_error(E_NOTICE, "Wrong parameter count for %s()", get_active_function_name(TSRMLS_C)); \ } -/* check if return value is used */ -#define IF_RETVAL_USED \ - if (!return_value_used) { \ - return; \ - } else - /* CR LF */ #define HTTP_CRLF "\r\n" -- 2.30.2