From: Michael Wallner Date: Mon, 25 Sep 2006 13:32:03 +0000 (+0000) Subject: - fix compiler warnings X-Git-Tag: RELEASE_1_3_1~9 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8204e46941884d867e78bb176f6306b309db72ba;p=m6w6%2Fext-http - fix compiler warnings --- diff --git a/http_encoding_api.c b/http_encoding_api.c index 1975295..0de420a 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -160,11 +160,12 @@ PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t enco /* {{{ int http_encoding_response_start(size_t) */ PHP_HTTP_API int _http_encoding_response_start(size_t content_length TSRMLS_DC) { - if ( php_ob_handler_used("ob_gzhandler" TSRMLS_CC) || - php_ob_handler_used("zlib output compression" TSRMLS_CC)) { - HTTP_G->send.deflate.encoding = 0; - } else if (HTTP_G->send.deflate.encoding) { - HTTP_G->send.deflate.encoding = 0; + int is_http = HTTP_G->send.deflate.encoding; + int is_zlib = php_ob_handler_used("ob_gzhandler" TSRMLS_CC) || php_ob_handler_used("zlib output compression" TSRMLS_CC); + + HTTP_G->send.deflate.encoding = 0; + + if (is_http && !is_zlib) { #ifdef HTTP_HAVE_ZLIB HashTable *selected; zval zsupported; @@ -203,16 +204,14 @@ PHP_HTTP_API int _http_encoding_response_start(size_t content_length TSRMLS_DC) #else php_start_ob_buffer_named("ob_gzhandler", 0, 0 TSRMLS_CC); #endif /* HTTP_HAVE_ZLIB */ - } else { - HTTP_G->send.deflate.encoding = 0; - if (content_length) { - /* emit a content-length header */ - char cl_header_str[128]; - size_t cl_header_len; - cl_header_len = snprintf(cl_header_str, lenof(cl_header_str), "Content-Length: %zu", content_length); - http_send_header_string_ex(cl_header_str, cl_header_len, 1); - } + } else if (content_length && !is_zlib) { + /* emit a content-length header */ + char cl_header_str[128]; + size_t cl_header_len; + cl_header_len = snprintf(cl_header_str, lenof(cl_header_str), "Content-Length: %zu", content_length); + http_send_header_string_ex(cl_header_str, cl_header_len, 1); } + return HTTP_G->send.deflate.encoding; } /* }}} */ diff --git a/http_querystring_object.c b/http_querystring_object.c index 7dfabe3..68d6e27 100644 --- a/http_querystring_object.c +++ b/http_querystring_object.c @@ -440,7 +440,7 @@ PHP_METHOD(HttpQueryString, singleton) 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(NULL, global, NULL, !global); + zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global); add_index_zval(instance, global, zobj); RETVAL_OBJECT(zobj, 1); } @@ -448,7 +448,7 @@ PHP_METHOD(HttpQueryString, singleton) MAKE_STD_ZVAL(instance); array_init(instance); - zobj = http_querystring_instantiate(NULL, global, NULL, !global); + zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global); add_index_zval(instance, global, zobj); RETVAL_OBJECT(zobj, 1); diff --git a/http_requestdatashare_object.c b/http_requestdatashare_object.c index af8e9d4..46299e6 100644 --- a/http_requestdatashare_object.c +++ b/http_requestdatashare_object.c @@ -157,7 +157,7 @@ static void _http_requestdatashare_object_write_prop(zval *object, zval *member, getObjectEx(http_requestdatashare_object, obj, object); SEPARATE_ZVAL_IF_NOT_REF(&value); - status = http_request_datashare_set(obj->share, Z_STRVAL_P(member), Z_STRLEN_P(member), zval_is_true(value)); + status = http_request_datashare_set(obj->share, Z_STRVAL_P(member), Z_STRLEN_P(member), (zend_bool) zval_is_true(value)); if (orig != value) { zval_ptr_dtor(&value); value = orig;