- fix compiler warnings (unused vars & missing includes)
authorMichael Wallner <mike@php.net>
Wed, 25 May 2005 16:45:00 +0000 (16:45 +0000)
committerMichael Wallner <mike@php.net>
Wed, 25 May 2005 16:45:00 +0000 (16:45 +0000)
http_api.c
http_functions.c
http_message_api.c
http_methods.c
http_response_object.c

index 079e451..8ba8259 100644 (file)
@@ -30,6 +30,7 @@
 #include "php_http_send_api.h"
 
 #ifdef ZEND_ENGINE_2
+#      include "zend_exceptions.h"
 #      include "php_http_exception_object.h"
 #endif
 
index 4b611e0..ba2bd56 100644 (file)
@@ -980,8 +980,6 @@ PHP_FUNCTION(http_request_method_register)
 PHP_FUNCTION(http_request_method_unregister)
 {
        zval *method;
-       zend_bool numeric;
-       unsigned long existing;
 
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &method)) {
                RETURN_FALSE;
index 47cd1dd..7f22d17 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 = atof(http_line + lenof("HTTP/"));
+               new->info.response.http_version = (float) 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 = atof(http_line + line_length - lenof("1.1"));
+               new->info.request.http_version = (float) 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 4b24935..322836e 100644 (file)
@@ -40,6 +40,8 @@
 
 #ifdef ZEND_ENGINE_2
 
+#include "missing.h"
+
 ZEND_EXTERN_MODULE_GLOBALS(http)
 
 /* {{{ HttpResponse */
@@ -629,7 +631,6 @@ PHP_METHOD(HttpMessage, fromString)
        char *string = NULL;
        int length = 0;
        http_message *msg = NULL;
-       http_message_object obj;
 
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &length)) {
                RETURN_NULL();
@@ -889,7 +890,6 @@ PHP_METHOD(HttpMessage, getRequestUri)
        NO_ARGS;
 
        IF_RETVAL_USED {
-               zval *uri;
                getObject(http_message_object, obj);
 
                if (!HTTP_MSG_TYPE(REQUEST, obj->message)) {
@@ -972,7 +972,7 @@ PHP_METHOD(HttpMessage, getHttpVersion)
 PHP_METHOD(HttpMessage, setHttpVersion)
 {
        char v[4];
-       zval *zv, *version;
+       zval *zv;
        getObject(http_message_object, obj);
 
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &zv)) {
index 480479d..42416ec 100644 (file)
@@ -27,6 +27,8 @@
 
 #ifdef ZEND_ENGINE_2
 
+#include "missing.h"
+
 #define http_response_object_declare_default_properties() _http_response_object_declare_default_properties(TSRMLS_C)
 static inline void _http_response_object_declare_default_properties(TSRMLS_D);