]> granicus.if.org Git - php/commitdiff
fix datatype mismatches
authorAnatol Belski <ab@php.net>
Thu, 23 Oct 2014 08:18:59 +0000 (10:18 +0200)
committerAnatol Belski <ab@php.net>
Thu, 23 Oct 2014 08:30:03 +0000 (10:30 +0200)
ext/standard/head.c
ext/standard/head.h
ext/standard/url.c
ext/standard/url.h

index 3dd18ee0fd36a2e76884b47e9fcb21542fc39da9..1417b52bc0312be37c60a0b290c749db17da3a73 100644 (file)
@@ -73,10 +73,10 @@ PHPAPI int php_header(TSRMLS_D)
 }
 
 
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC)
 {
        char *cookie;
-       int len=sizeof("Set-Cookie: ");
+       size_t len=sizeof("Set-Cookie: ");
        zend_string *dt;
        sapi_header_line ctr = {0};
        int result;
@@ -164,7 +164,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
        }
 
        ctr.line = cookie;
-       ctr.line_len = strlen(cookie);
+       ctr.line_len = (uint)strlen(cookie);
 
        result = sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC);
        efree(cookie);
@@ -300,7 +300,7 @@ PHP_FUNCTION(http_response_code)
                zend_long old_response_code;
 
                old_response_code = SG(sapi_headers).http_response_code;
-               SG(sapi_headers).http_response_code = response_code;
+               SG(sapi_headers).http_response_code = (int)response_code;
 
                if (old_response_code) {
                        RETURN_LONG(old_response_code);
index e32810a6f3702287b114f9a42cd45283bc0de0c6..850a71dc7499a7e83a09110edf083331da7fa4b2 100644 (file)
@@ -38,6 +38,6 @@ PHP_FUNCTION(headers_list);
 PHP_FUNCTION(http_response_code);
 
 PHPAPI int php_header(TSRMLS_D);
-PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
+PHPAPI int php_setcookie(char *name, size_t name_len, char *value, size_t value_len, time_t expires, char *path, size_t path_len, char *domain, size_t domain_len, int secure, int url_encode, int httponly TSRMLS_DC);
 
 #endif
index 4fb2c73edb58b253f0e138900e13151d783c7ef4..7d408ef88a8ae80561b01e9ca1afc67be5d2ab55 100644 (file)
@@ -61,7 +61,7 @@ PHPAPI void php_url_free(php_url *theurl)
 
 /* {{{ php_replace_controlchars
  */
-PHPAPI char *php_replace_controlchars_ex(char *str, int len)
+PHPAPI char *php_replace_controlchars_ex(char *str, size_t len)
 {
        unsigned char *s = (unsigned char *)str;
        unsigned char *e = (unsigned char *)str + len;
@@ -94,7 +94,7 @@ PHPAPI php_url *php_url_parse(char const *str)
 
 /* {{{ php_url_parse
  */
-PHPAPI php_url *php_url_parse_ex(char const *str, int length)
+PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
 {
        char port_buf[6];
        php_url *ret = ecalloc(1, sizeof(php_url));
@@ -481,7 +481,7 @@ static unsigned char hexchars[] = "0123456789ABCDEF";
 
 /* {{{ php_url_encode
  */
-PHPAPI zend_string *php_url_encode(char const *s, int len)
+PHPAPI zend_string *php_url_encode(char const *s, size_t len)
 {
        register unsigned char c;
        unsigned char *to;
@@ -572,7 +572,7 @@ PHP_FUNCTION(urldecode)
 
 /* {{{ php_url_decode
  */
-PHPAPI int php_url_decode(char *str, int len)
+PHPAPI size_t php_url_decode(char *str, size_t len)
 {
        char *dest = str;
        char *data = str;
@@ -603,7 +603,7 @@ PHPAPI int php_url_decode(char *str, int len)
 
 /* {{{ php_raw_url_encode
  */
-PHPAPI zend_string *php_raw_url_encode(char const *s, int len)
+PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len)
 {
        register int x, y;
        zend_string *str;
@@ -679,7 +679,7 @@ PHP_FUNCTION(rawurldecode)
 
 /* {{{ php_raw_url_decode
  */
-PHPAPI int php_raw_url_decode(char *str, int len)
+PHPAPI size_t php_raw_url_decode(char *str, size_t len)
 {
        char *dest = str;
        char *data = str;
index 4d7a1f5b561dbf9e5831154de3c167a3d991a310..ec2676eaee148befdf50a158db7e793d7f7025ce 100644 (file)
@@ -33,11 +33,12 @@ typedef struct php_url {
 
 PHPAPI void php_url_free(php_url *theurl);
 PHPAPI php_url *php_url_parse(char const *str);
-PHPAPI php_url *php_url_parse_ex(char const *str, int length);
-PHPAPI int php_url_decode(char *str, int len); /* return value: length of decoded string */
-PHPAPI int php_raw_url_decode(char *str, int len); /* return value: length of decoded string */
-PHPAPI zend_string *php_url_encode(char const *s, int len);
-PHPAPI zend_string *php_raw_url_encode(char const *s, int len);
+PHPAPI php_url *php_url_parse_ex(char const *str, size_t length);
+PHPAPI size_t php_url_decode(char *str, size_t len); /* return value: length of decoded string */
+PHPAPI size_t php_raw_url_decode(char *str, size_t len); /* return value: length of decoded string */
+PHPAPI zend_string *php_url_encode(char const *s, size_t len);
+PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len);
+PHPAPI char *php_replace_controlchars_ex(char *str, size_t len);
 
 PHP_FUNCTION(parse_url);
 PHP_FUNCTION(urlencode);