pajoye Sat Jul 22 09:39:25 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/filter sanitizing_filters.c filter.c Log: - silent compiler warnings (char/unsigned char) http://cvs.php.net/viewvc.cgi/php-src/ext/filter/sanitizing_filters.c?r1=1.11.2.1&r2=1.11.2.2&diff_format=u Index: php-src/ext/filter/sanitizing_filters.c diff -u php-src/ext/filter/sanitizing_filters.c:1.11.2.1 php-src/ext/filter/sanitizing_filters.c:1.11.2.2 --- php-src/ext/filter/sanitizing_filters.c:1.11.2.1 Wed Jul 19 06:57:21 2006 +++ php-src/ext/filter/sanitizing_filters.c Sat Jul 22 09:39:24 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sanitizing_filters.c,v 1.11.2.1 2006/07/19 06:57:21 tony2001 Exp $ */ +/* $Id: sanitizing_filters.c,v 1.11.2.2 2006/07/22 09:39:24 pajoye Exp $ */ #include "php_filter.h" #include "filter_private.h" @@ -58,7 +58,7 @@ register int x, y; smart_str str = {0}; int len = Z_STRLEN_P(value); - unsigned char *s = Z_STRVAL_P(value); + unsigned char *s = (unsigned char *)Z_STRVAL_P(value); if (Z_STRLEN_P(value) == 0) { return; @@ -106,7 +106,7 @@ } str[y] = '\0'; efree(Z_STRVAL_P(value)); - Z_STRVAL_P(value) = str; + Z_STRVAL_P(value) = (char *)str; Z_STRLEN_P(value) = y; } @@ -120,7 +120,7 @@ return; } - str = Z_STRVAL_P(value); + str = (unsigned char *)Z_STRVAL_P(value); buf = safe_emalloc(1, Z_STRLEN_P(value) + 1, 1); c = 0; for (i = 0; i < Z_STRLEN_P(value); i++) { @@ -134,7 +134,7 @@ /* update zval string data */ buf[c] = '\0'; efree(Z_STRVAL_P(value)); - Z_STRVAL_P(value) = buf; + Z_STRVAL_P(value) = (char *)buf; Z_STRLEN_P(value) = c; } /* }}} */ @@ -149,7 +149,7 @@ { int l, i; - l = strlen(allowed_list); + l = strlen((char*)allowed_list); for (i = 0; i < l; ++i) { (*map)[allowed_list[i]] = flag; } @@ -160,7 +160,7 @@ unsigned char *buf, *str; int i, c; - str = Z_STRVAL_P(value); + str = (unsigned char *)Z_STRVAL_P(value); buf = safe_emalloc(1, Z_STRLEN_P(value) + 1, 1); c = 0; for (i = 0; i < Z_STRLEN_P(value); i++) { @@ -172,7 +172,7 @@ /* update zval string data */ buf[c] = '\0'; efree(Z_STRVAL_P(value)); - Z_STRVAL_P(value) = buf; + Z_STRVAL_P(value) = (char *)buf; Z_STRLEN_P(value) = c; } /* }}} */ @@ -255,7 +255,7 @@ void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL) { /* Check section 6 of rfc 822 http://www.faqs.org/rfcs/rfc822.html */ - unsigned char *allowed_list = LOWALPHA HIALPHA DIGIT "!#$%&'*+-/=?^_`{|[EMAIL PROTECTED]"; + unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT "!#$%&'*+-/=?^_`{|[EMAIL PROTECTED]"; filter_map map; filter_map_init(&map); @@ -269,7 +269,7 @@ { /* Strip all chars not part of section 5 of * http://www.faqs.org/rfcs/rfc1738.html */ - unsigned char *allowed_list = LOWALPHA HIALPHA DIGIT SAFE EXTRA NATIONAL PUNCTUATION RESERVED; + unsigned char allowed_list[] = LOWALPHA HIALPHA DIGIT SAFE EXTRA NATIONAL PUNCTUATION RESERVED; filter_map map; filter_map_init(&map); @@ -282,7 +282,7 @@ void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL) { /* strip everything [^0-9+-] */ - unsigned char *allowed_list = "+-" DIGIT; + unsigned char allowed_list[] = "+-" DIGIT; filter_map map; filter_map_init(&map); @@ -295,7 +295,7 @@ void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL) { /* strip everything [^0-9+-] */ - unsigned char *allowed_list = "+-" DIGIT; + unsigned char allowed_list[] = "+-" DIGIT; filter_map map; filter_map_init(&map); @@ -303,13 +303,13 @@ /* depending on flags, strip '.', 'e', ",", "'" */ if (flags & FILTER_FLAG_ALLOW_FRACTION) { - filter_map_update(&map, 2, "."); + filter_map_update(&map, 2, (unsigned char *) "."); } if (flags & FILTER_FLAG_ALLOW_THOUSAND) { - filter_map_update(&map, 3, ","); + filter_map_update(&map, 3, (unsigned char *) ","); } if (flags & FILTER_FLAG_ALLOW_SCIENTIFIC) { - filter_map_update(&map, 4, "eE"); + filter_map_update(&map, 4, (unsigned char *) "eE"); } filter_map_apply(value, &map); } http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.52.2.4&r2=1.52.2.5&diff_format=u Index: php-src/ext/filter/filter.c diff -u php-src/ext/filter/filter.c:1.52.2.4 php-src/ext/filter/filter.c:1.52.2.5 --- php-src/ext/filter/filter.c:1.52.2.4 Sat Jul 22 09:09:06 2006 +++ php-src/ext/filter/filter.c Sat Jul 22 09:39:24 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filter.c,v 1.52.2.4 2006/07/22 09:09:06 pajoye Exp $ */ +/* $Id: filter.c,v 1.52.2.5 2006/07/22 09:39:24 pajoye Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -274,7 +274,7 @@ { php_info_print_table_start(); php_info_print_table_row( 2, "Input Validation and Filtering", "enabled" ); - php_info_print_table_row( 2, "Revision", "$Revision: 1.52.2.4 $"); + php_info_print_table_row( 2, "Revision", "$Revision: 1.52.2.5 $"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -648,7 +648,7 @@ zval *array_ptr = NULL; zval **element; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|a", &args_array, &args_from, &values) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la|a", &args_from, &args_array, &values) == FAILURE) { RETURN_FALSE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php