From: Michael Wallner Date: Fri, 17 Jun 2005 15:31:06 +0000 (+0000) Subject: - warning hunt X-Git-Tag: RELEASE_0_10_0~45 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4f8c51464143f79fd4367c386e5108361ce83a42;p=m6w6%2Fext-http - warning hunt --- diff --git a/http_api.c b/http_api.c index 48e3c31..5bf3920 100644 --- a/http_api.c +++ b/http_api.c @@ -41,13 +41,14 @@ ZEND_EXTERN_MODULE_GLOBALS(http); char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen) { if (key && key_len) { - unsigned i, wasalpha; - if (wasalpha = isalpha(key[0])) { - key[0] = uctitle ? toupper(key[0]) : tolower(key[0]); + size_t i; + int wasalpha; + if (wasalpha = isalpha((int) key[0])) { + key[0] = (char) (uctitle ? toupper((int) key[0]) : tolower((int) key[0])); } for (i = 1; i < key_len; i++) { - if (isalpha(key[i])) { - key[i] = ((!wasalpha) && uctitle) ? toupper(key[i]) : tolower(key[i]); + if (isalpha((int) key[i])) { + key[i] = (char) (((!wasalpha) && uctitle) ? toupper((int) key[i]) : tolower((int) key[i])); wasalpha = 1; } else { if (xhyphen && (key[i] == '_')) { diff --git a/http_auth_api.c b/http_auth_api.c index a2c54ae..645d335 100644 --- a/http_auth_api.c +++ b/http_auth_api.c @@ -61,7 +61,7 @@ PHP_HTTP_API STATUS _http_auth_basic_credentials(char **user, char **pass TSRMLS HTTP_GSC(zauth, "HTTP_AUTHORIZATION", FAILURE); { int decoded_len; - char *colon, *decoded = php_base64_decode(Z_STRVAL_P(zauth), Z_STRLEN_P(zauth), &decoded_len); + char *colon, *decoded = (char *) php_base64_decode((const unsigned char *) Z_STRVAL_P(zauth), Z_STRLEN_P(zauth), &decoded_len); if (colon = strchr(decoded + 6, ':')) { *user = estrndup(decoded + 6, colon - decoded - 6); diff --git a/http_functions.c b/http_functions.c index 544a32b..8e27b76 100644 --- a/http_functions.c +++ b/http_functions.c @@ -460,7 +460,7 @@ PHP_FUNCTION(http_redirect) size_t query_len = 0; zend_bool session = 0, permanent = 0; zval *params = NULL; - char *query, *url, *URI, + char *query = NULL, *url = NULL, *URI, LOC[HTTP_URI_MAXLEN + sizeof("Location: ")], RED[HTTP_URI_MAXLEN * 2 + sizeof("Redirecting to %s?%s.\n")]; diff --git a/http_headers_api.c b/http_headers_api.c index 96a8b66..8c124cb 100644 --- a/http_headers_api.c +++ b/http_headers_api.c @@ -370,7 +370,7 @@ PHP_HTTP_API void _http_parse_headers_default_callback(const char *http_line, Ha PHP_HTTP_API void _http_get_request_headers_ex(HashTable *headers, zend_bool prettify TSRMLS_DC) { char *key = NULL; - long idx = 0; + ulong idx = 0; zval array; Z_ARRVAL(array) = headers; diff --git a/http_message_api.c b/http_message_api.c index 7f22d17..47cd1dd 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -59,14 +59,14 @@ static void _http_message_headers_cb(const char *http_line, HashTable **headers, // response if (!strncmp(http_line, "HTTP/1.", lenof("HTTP/1."))) { new->type = HTTP_MSG_RESPONSE; - new->info.response.http_version = (float) atof(http_line + lenof("HTTP/")); + new->info.response.http_version = atof(http_line + lenof("HTTP/")); new->info.response.code = atoi(http_line + lenof("HTTP/1.1 ")); } else // request if (!strncmp(http_line + line_length - lenof("HTTP/1.1"), "HTTP/1.", lenof("HTTP/1."))) { const char *method_sep_uri = strchr(http_line, ' '); new->type = HTTP_MSG_REQUEST; - new->info.request.http_version = (float) atof(http_line + line_length - lenof("1.1")); + new->info.request.http_version = atof(http_line + line_length - lenof("1.1")); new->info.request.method = estrndup(http_line, method_sep_uri - http_line); new->info.request.URI = estrndup(method_sep_uri + 1, http_line + line_length - method_sep_uri - 1 - lenof(" HTTP/1.1")); } diff --git a/http_message_object.c b/http_message_object.c index e934f8b..c26a2f1 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -283,11 +283,11 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va switch (msg->type) { case HTTP_MSG_REQUEST: - msg->info.request.http_version = (float) Z_DVAL_P(value); + msg->info.request.http_version = Z_DVAL_P(value); break; case HTTP_MSG_RESPONSE: - msg->info.response.http_version = (float) Z_DVAL_P(value); + msg->info.response.http_version = Z_DVAL_P(value); break; } break; diff --git a/http_methods.c b/http_methods.c index efc1cf7..c18e5ae 100644 --- a/http_methods.c +++ b/http_methods.c @@ -1133,7 +1133,7 @@ PHP_METHOD(HttpRequest, __destruct) PHP_METHOD(HttpRequest, setOptions) { char *key = NULL; - long idx = 0; + ulong idx = 0; zval *opts, *old_opts, **opt; getObject(http_request_object, obj); diff --git a/http_request_api.c b/http_request_api.c index 3dabcd7..64bbef7 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -181,7 +181,6 @@ void *_http_request_data_copy(int type, void *data TSRMLS_DC) /* {{{ void http_request_data_free_string(char **) */ void _http_request_data_free_string(void *string) { - //fprintf(stderr, "FREE STRING %p (%s)\n", *((char **)string), *((char **)string)); efree(*((char **)string)); } /* }}} */ @@ -863,7 +862,6 @@ static size_t http_curl_write_callback(char *buf, size_t len, size_t n, void *s) /* {{{ static size_t http_curl_read_callback(void *, size_t, size_t, void *) */ static size_t http_curl_read_callback(void *data, size_t len, size_t n, void *s) { - static char *offset = NULL, *original = NULL; HTTP_CURL_CALLBACK_DATA(s, http_request_body *, body); if (body->type != HTTP_REQUEST_BODY_UPLOADFILE) { diff --git a/php_http_message_api.h b/php_http_message_api.h index 731e170..c31e6b8 100644 --- a/php_http_message_api.h +++ b/php_http_message_api.h @@ -35,7 +35,7 @@ struct _http_message { union { struct { - float http_version; + double http_version; char *method; char *URI; } request;