com php-src: fix datatype mismatches: ext/standard/filters.c
| From: | Anatol Belski | Date: | Thu, 23 Oct 2014 08:29:59 +0000 |
| Subject: | com php-src: fix datatype mismatches: ext/standard/filters.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82481@lists.php.net to get a copy of this message | ||
Commit: 303973f076068bc42ee42597ed2c67e2c8afb051
Author: Anatol Belski <ab@php.net> Thu, 23 Oct 2014 09:42:46 +0200
Parents: ddaae1a02ca5fae8f0397ae2da01320c39a2a41e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=303973f076068bc42ee42597ed2c67e2c8afb051
Log:
fix datatype mismatches
Changed paths:
M ext/standard/filters.c
Diff:
diff --git a/ext/standard/filters.c b/ext/standard/filters.c
index 0a83a4c..3fd27af 100644
--- a/ext/standard/filters.c
+++ b/ext/standard/filters.c
@@ -176,14 +176,14 @@ typedef struct _php_strip_tags_filter {
int persistent;
} php_strip_tags_filter;
-static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, int
allowed_tags_len, int persistent)
+static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, size_t
allowed_tags_len, int persistent)
{
if (allowed_tags != NULL) {
if (NULL == (inst->allowed_tags = pemalloc(allowed_tags_len, persistent))) {
return FAILURE;
}
memcpy((char *)inst->allowed_tags, allowed_tags, allowed_tags_len);
- inst->allowed_tags_len = allowed_tags_len;
+ inst->allowed_tags_len = (int)allowed_tags_len;
} else {
inst->allowed_tags = NULL;
}
@@ -861,7 +861,8 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins
/* Check to see if this is EOL whitespace. */
if (inst->lbchars != NULL) {
unsigned char *ps2;
- unsigned int j, lb_cnt2;
+ unsigned int lb_cnt2;
+ size_t j;
lb_cnt2 = 0;
ps2 = ps;
@@ -1318,6 +1319,7 @@ static int php_conv_get_int_prop_ex(const HashTable *ht, int *pretval, char
*fie
}
#endif
+/* XXX this might need an additional fix so it uses size_t, whereby unsigned is quite big so
leaving as is for now */
static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, char *field_name,
size_t field_name_len)
{
zend_ulong l;
@@ -1326,7 +1328,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int
*pretval,
*pretval = 0;
if ((err = php_conv_get_ulong_prop_ex(ht, &l, field_name, field_name_len)) ==
PHP_CONV_ERR_SUCCESS) {
- *pretval = l;
+ *pretval = (unsigned int)l;
}
return err;
}
@@ -1931,12 +1933,12 @@ typedef struct _php_chunked_filter_data {
int persistent;
} php_chunked_filter_data;
-static int php_dechunk(char *buf, int len, php_chunked_filter_data *data)
+static size_t php_dechunk(char *buf, size_t len, php_chunked_filter_data *data)
{
char *p = buf;
char *end = p + len;
char *out = buf;
- int out_len = 0;
+ size_t out_len = 0;
while (p < end) {
switch (data->state) {