From e76f27074a23b1cf83fdd81f97a5c767399225a6 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 27 Jul 2011 15:15:10 +0000 Subject: [PATCH] fix some warnings --- php_http_encoding.c | 2 ++ php_http_env.c | 4 ---- php_http_env_response.c | 4 ++++ php_http_message.c | 15 +++++---------- php_http_params.c | 2 ++ php_http_property_proxy.c | 1 + php_http_request.c | 2 -- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/php_http_encoding.c b/php_http_encoding.c index a418a21..e40de8a 100644 --- a/php_http_encoding.c +++ b/php_http_encoding.c @@ -222,6 +222,7 @@ retry_raw_inflate: wbits = PHP_HTTP_WINDOW_BITS_RAW; goto retry_raw_inflate; } + break; } inflateEnd(&Z); @@ -509,6 +510,7 @@ retry_raw_inflate: inflateInit2(ctx, PHP_HTTP_WINDOW_BITS_RAW); goto retry_raw_inflate; } + break; } php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Failed to update inflate stream: %s", zError(status)); diff --git a/php_http_env.c b/php_http_env.c index 0421505..b936ab1 100644 --- a/php_http_env.c +++ b/php_http_env.c @@ -589,10 +589,6 @@ PHP_HTTP_BEGIN_ARGS(persistentHandlesClean, 0) PHP_HTTP_ARG_VAL(ident, 0) PHP_HTTP_END_ARGS; -PHP_HTTP_BEGIN_ARGS(persistentHandlesIdent, 0) - PHP_HTTP_ARG_VAL(name, 0) -PHP_HTTP_END_ARGS; - PHP_HTTP_BEGIN_ARGS(parseParams, 1) PHP_HTTP_ARG_VAL(params, 0) PHP_HTTP_ARG_VAL(flags, 0) diff --git a/php_http_env_response.c b/php_http_env_response.c index e30cab9..f6e23cf 100644 --- a/php_http_env_response.c +++ b/php_http_env_response.c @@ -392,6 +392,7 @@ static STATUS php_http_env_response_send_head(php_http_env_response_t *r) switch (Z_LVAL_P(zdisposition_copy)) { case PHP_HTTP_CONTENT_DISPOSITION_NONE: ret = php_http_env_set_response_header_value(0, ZEND_STRL("Content-Disposition"), NULL, 1 TSRMLS_CC); + break; case PHP_HTTP_CONTENT_DISPOSITION_INLINE: tmp = "inline"; break; @@ -496,6 +497,7 @@ static STATUS php_http_env_response_send_head(php_http_env_response_t *r) if (PHP_HTTP_CACHE_HIT != php_http_env_is_response_cached_by_last_modified(options, ZEND_STRL("If-Modified-Since") TSRMLS_CC)) { break; } + /* fallthrough */ case PHP_HTTP_CACHE_HIT: ret = php_http_env_set_response_code(304 TSRMLS_CC); @@ -664,6 +666,8 @@ PHP_HTTP_API STATUS php_http_env_response_send(php_http_env_response_t *r) } break; } + + break; } } } else if (zbody) { diff --git a/php_http_message.c b/php_http_message.c index 0d11d01..12c189e 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -382,8 +382,9 @@ PHP_HTTP_API php_http_message_t *php_http_message_reverse(php_http_message_t *ms php_http_message_count(c, msg); if (c > 1) { - php_http_message_t *tmp = msg, **arr = ecalloc(c, sizeof(**arr)); - + php_http_message_t *tmp = msg, **arr; + + arr = ecalloc(c, sizeof(**arr)); for (i = 0; i < c; ++i) { arr[i] = tmp; tmp = tmp->parent; @@ -709,20 +710,12 @@ PHP_HTTP_BEGIN_ARGS(setHttpVersion, 1) PHP_HTTP_ARG_VAL(http_version, 0) PHP_HTTP_END_ARGS; -PHP_HTTP_BEGIN_ARGS(guessContentType, 1) - PHP_HTTP_ARG_VAL(magic_file, 0) - PHP_HTTP_ARG_VAL(magic_mode, 0) -PHP_HTTP_END_ARGS; - PHP_HTTP_EMPTY_ARGS(getParentMessage); -PHP_HTTP_EMPTY_ARGS(send); PHP_HTTP_EMPTY_ARGS(__toString); PHP_HTTP_BEGIN_ARGS(toString, 0) PHP_HTTP_ARG_VAL(include_parent, 0) PHP_HTTP_END_ARGS; -PHP_HTTP_EMPTY_ARGS(toMessageTypeObject); - PHP_HTTP_EMPTY_ARGS(count); PHP_HTTP_EMPTY_ARGS(serialize); @@ -811,9 +804,11 @@ static STATUS php_http_message_object_add_prophandler(const char *prop_str, size php_http_message_object_prophandler_t h = { read, write }; return zend_hash_add(&php_http_message_object_prophandlers, prop_str, prop_len + 1, (void *) &h, sizeof(h), NULL); } +/* static int php_http_message_object_has_prophandler(const char *prop_str, size_t prop_len) { return zend_hash_exists(&php_http_message_object_prophandlers, prop_str, prop_len + 1); } +*/ static STATUS php_http_message_object_get_prophandler(const char *prop_str, size_t prop_len, php_http_message_object_prophandler_t **handler) { return zend_hash_find(&php_http_message_object_prophandlers, prop_str, prop_len + 1, (void *) handler); } diff --git a/php_http_params.c b/php_http_params.c index b056048..e4d4a6f 100644 --- a/php_http_params.c +++ b/php_http_params.c @@ -129,6 +129,7 @@ PHP_HTTP_API STATUS php_http_params_parse(const char *param, int flags, php_http if (flags & PHP_HTTP_PARAMS_ALLOW_COMMA) { goto add; } + /* fallthrough */ default: if (!val) { val = c; @@ -143,6 +144,7 @@ PHP_HTTP_API STATUS php_http_params_parse(const char *param, int flags, php_http if (flags & PHP_HTTP_PARAMS_ALLOW_COMMA) { goto allow_comma; } + /* fallthrough */ case '\r': case '\n': case '\t': diff --git a/php_http_property_proxy.c b/php_http_property_proxy.c index 44ccd2c..426f3c3 100644 --- a/php_http_property_proxy.c +++ b/php_http_property_proxy.c @@ -149,6 +149,7 @@ static void php_http_property_proxy_object_write_dimension(zval *object, zval *o switch (Z_TYPE_P(property)) { case IS_NULL: array_init(property); + /* fallthrough */ case IS_ARRAY: Z_ADDREF_P(value); if (!offset) { diff --git a/php_http_request.c b/php_http_request.c index d3ac782..857beea 100644 --- a/php_http_request.c +++ b/php_http_request.c @@ -213,9 +213,7 @@ PHP_HTTP_BEGIN_ARGS(setMessageClass, 1) PHP_HTTP_END_ARGS; PHP_HTTP_EMPTY_ARGS(getResponseMessage); -PHP_HTTP_EMPTY_ARGS(getRawResponseMessage); PHP_HTTP_EMPTY_ARGS(getRequestMessage); -PHP_HTTP_EMPTY_ARGS(getRawRequestMessage); PHP_HTTP_EMPTY_ARGS(getHistory); PHP_HTTP_EMPTY_ARGS(clearHistory); PHP_HTTP_EMPTY_ARGS(send); -- 2.30.2