- warning hunt
authorMichael Wallner <mike@php.net>
Fri, 17 Jun 2005 15:31:06 +0000 (15:31 +0000)
committerMichael Wallner <mike@php.net>
Fri, 17 Jun 2005 15:31:06 +0000 (15:31 +0000)
http_api.c
http_auth_api.c
http_functions.c
http_headers_api.c
http_message_api.c
http_message_object.c
http_methods.c
http_request_api.c
php_http_message_api.h

index 48e3c3151b4f6a9b5d130f2b0c3238e92f29de3e..5bf39207c4ee7ce10630ddc1f8452c5cc9902679 100644 (file)
@@ -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] == '_')) {
index a2c54ae56f20f986e05f4163b22a1ca9d9d8056e..645d335ee5ade720303c62a49bc41c101b46add8 100644 (file)
@@ -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);
index 544a32b2dc703e8723aedf402270246dd26dae59..8e27b767ab08d11ae123b9aa074120c5ec83c6c6 100644 (file)
@@ -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 <a href=\"%s?%s\">%s?%s</a>.\n")];
 
index 96a8b66fb5ea573ec370f49d8cd704cfc0124767..8c124cb46214a66d7e112a83482df1f93a872973 100644 (file)
@@ -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;
index 7f22d17095d1a5afb90da96969edc411914e2e73..47cd1ddd2bf28d3b5d3e33fa28338f6e944d7f7d 100644 (file)
@@ -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"));
        }
index e934f8bd6a1792de423e1ae4fcfb925450ef5b26..c26a2f196a3c595d8e238ad9b8dd3e826871ca67 100644 (file)
@@ -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;
index efc1cf73469d7515f6e6a2d5273cff3f15791e44..c18e5aec630aa7603f5e678ab23296862ed82b81 100644 (file)
@@ -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);
 
index 3dabcd759d5302d2094f534ebec04ef39836268c..64bbef7fad0412d9e7055f115c54c7b7a4d138f2 100644 (file)
@@ -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) {
index 731e1709ffe96d0c04fcfaef33c5977dbbd1d8e5..c31e6b8d657ccf0ef427a348fcdae2a2cc052fe9 100644 (file)
@@ -35,7 +35,7 @@ struct _http_message {
 
        union {
                struct {
-                       float http_version;
+                       double http_version;
                        char *method;
                        char *URI;
                } request;