[PHP-CVS] cvs: php-src /ext/mbstring mbstring.c php_mbregex.c /ext/mbstring/tests ini_language.phpt mb_output_handler_pattern-01.phpt mb_output_handler_pattern-02.phpt mb_output_handler_pattern-03.ph

2008-08-17 Thread Felipe Pena
felipe  Mon Aug 18 00:36:04 2008 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.c php_mbregex.c 
/php-src/ext/mbstring/tests ini_language.phpt 
mb_output_handler_pattern-01.phpt 
mb_output_handler_pattern-02.phpt 
mb_output_handler_pattern-03.phpt 
mb_output_handler_pattern-04.phpt 
mb_output_handler_pattern-05.phpt 
mb_output_handler_pattern-06.phpt 
mb_output_handler_pattern-07.phpt 
mb_output_handler_pattern-08.phpt 
mb_output_handler_pattern-09.phpt 
mb_output_handler_pattern-10.phpt 
mb_output_handler_pattern-11.phpt 
mb_output_handler_pattern-12.phpt 
mb_parse_str.phpt 
mb_regex_encoding_error1.phpt 
mb_regex_encoding_variation1.phpt 
mb_strtolower_basic.phpt 
mb_substr_error1.phpt 
mb_substr_variation1.phpt 
mb_substr_variation2.phpt 
  Log:
  - New parameter parsing API
  - Fixed tests
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.296&r2=1.297&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.296 
php-src/ext/mbstring/mbstring.c:1.297
--- php-src/ext/mbstring/mbstring.c:1.296   Mon Aug 11 15:40:41 2008
+++ php-src/ext/mbstring/mbstring.c Mon Aug 18 00:36:03 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.296 2008/08/11 15:40:41 nlopess Exp $ */
+/* $Id: mbstring.c,v 1.297 2008/08/18 00:36:03 felipe Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring"
@@ -3466,37 +3466,30 @@
 
 #define PHP_MBSTR_STACK_BLOCK_SIZE 32
 
-/* {{{ proto string mb_convert_variables(string to-encoding, mixed 
from-encoding [, mixed ...])
+/* {{{ proto string mb_convert_variables(string to-encoding, mixed 
from-encoding, mixed vars [, ...])
Converts the string resource in variables to desired encoding */
 PHP_FUNCTION(mb_convert_variables)
 {
-   zval ***args, ***stack, **var, **hash_entry;
+   zval ***args, ***stack, **var, **hash_entry, **zfrom_enc;
HashTable *target_hash;
mbfl_string string, result, *ret;
enum mbfl_no_encoding from_encoding, to_encoding;
mbfl_encoding_detector *identd;
mbfl_buffer_converter *convd;
-   int n, argc, stack_level, stack_max, elistsz;
+   int n, to_enc_len, argc, stack_level, stack_max, elistsz;
enum mbfl_no_encoding *elist;
-   char *name;
+   char *name, *to_enc;
void *ptmp;
 
-   argc = ZEND_NUM_ARGS();
-   if (argc < 3) {
-   WRONG_PARAM_COUNT;
-   }
-   args = (zval ***)ecalloc(argc, sizeof(zval **));
-   if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
-   efree((void *)args);
-   WRONG_PARAM_COUNT;
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sZ+", &to_enc, 
&to_enc_len, &zfrom_enc, &args, &argc) == FAILURE) {
+   return;
}
 
/* new encoding */
-   convert_to_string_ex(args[0]);
-   to_encoding = mbfl_name2no_encoding(Z_STRVAL_PP(args[0]));
+   to_encoding = mbfl_name2no_encoding(to_enc);
if (to_encoding == mbfl_no_encoding_invalid) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding 
\"%s\"", Z_STRVAL_PP(args[0]));
-   efree((void *)args);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding 
\"%s\"", to_enc);
+   efree(args);
RETURN_FALSE;
}
 
@@ -3510,13 +3503,13 @@
/* pre-conversion encoding */
elist = NULL;
elistsz = 0;
-   switch (Z_TYPE_PP(args[1])) {
+   switch (Z_TYPE_PP(zfrom_enc)) {
case IS_ARRAY:
-   php_mb_parse_encoding_array(*args[1], &elist, &elistsz, 0 
TSRMLS_CC);
+   php_mb_parse_encoding_array(*zfrom_enc, &elist, &elistsz, 0 
TSRMLS_CC);
break;
default:
-   convert_to_string_ex(args[1]);
-   php_mb_parse_encoding_list(Z_STRVAL_PP(args[1]), 
Z_STRLEN_PP(args[1]), &elist, &elistsz, 0 TSRMLS_CC);
+   convert_to_string_ex(zfrom_enc);
+   php_mb_parse_encoding_list(Z_STRVAL_PP(zfrom_enc), 
Z_STRLEN_PP(zfrom_enc), &elist, &elistsz, 0 TSRMLS_CC);
break;
}
if (elistsz <= 0) {
@@ -3531,7 +3524,7 @@
stack_level = 0;
identd = mbfl_encoding_detector_new(elist, elistsz

[PHP-CVS] cvs: php-src /ext/mbstring mbstring.c php_mbregex.c

2008-07-25 Thread Moriyoshi Koizumi
moriyoshi   Fri Jul 25 14:04:39 2008 UTC

  Modified files:  
/php-src/ext/mbstring   mbstring.c php_mbregex.c 
  Log:
  - Fix warnings
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.290&r2=1.291&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.290 
php-src/ext/mbstring/mbstring.c:1.291
--- php-src/ext/mbstring/mbstring.c:1.290   Fri Jul 25 13:56:50 2008
+++ php-src/ext/mbstring/mbstring.c Fri Jul 25 14:04:39 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: mbstring.c,v 1.290 2008/07/25 13:56:50 moriyoshi Exp $ */
+/* $Id: mbstring.c,v 1.291 2008/07/25 14:04:39 moriyoshi Exp $ */
 
 /*
  * PHP 4 Multibyte String module "mbstring"
@@ -2269,7 +2269,7 @@
RETURN_FALSE;
}
 
-   if (offset > haystack.len) {
+   if ((unsigned int)offset > haystack.len) {
RETURN_FALSE;
}
 
@@ -2677,11 +2677,11 @@
}
}
 
-   if (from > string.len) {
+   if ((unsigned int)from > string.len) {
RETURN_FALSE;
}
 
-   if (((unsigned) from + (unsigned) len) > string.len) {
+   if (((unsigned int)from + (unsigned int)len) > string.len) {
len = string.len - from;
}
 
@@ -3063,7 +3063,7 @@
}
 
if (ZEND_NUM_ARGS() < 3) {
-   strict = MBSTRG(strict_detection);
+   strict = (zend_bool)MBSTRG(strict_detection);
}
 
if (size > 0 && list != NULL) {
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/php_mbregex.c?r1=1.63&r2=1.64&diff_format=u
Index: php-src/ext/mbstring/php_mbregex.c
diff -u php-src/ext/mbstring/php_mbregex.c:1.63 
php-src/ext/mbstring/php_mbregex.c:1.64
--- php-src/ext/mbstring/php_mbregex.c:1.63 Thu Jul 17 16:08:08 2008
+++ php-src/ext/mbstring/php_mbregex.c  Fri Jul 25 14:04:39 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_mbregex.c,v 1.63 2008/07/17 16:08:08 moriyoshi Exp $ */
+/* $Id: php_mbregex.c,v 1.64 2008/07/25 14:04:39 moriyoshi Exp $ */
 
 
 #ifdef HAVE_CONFIG_H
@@ -921,7 +921,7 @@
zval_dtor(&v);
}
n = regs->end[0];
-   if ((size_t)(pos - (OnigUChar *)string) < n) {
+   if ((pos - (OnigUChar *)string) < n) {
pos = (OnigUChar *)string + n;
} else {
if (pos < string_lim) {
@@ -1014,7 +1014,7 @@
}
 
/* add it to the array */
-   if (regs->beg[0] < string_len && regs->beg[0] >= (size_t)(pos - 
(OnigUChar *)string)) {
+   if (regs->beg[0] < string_len && regs->beg[0] >= (pos - 
(OnigUChar *)string)) {
add_next_index_stringl(return_value, (char *)pos, 
((OnigUChar *)(string + regs->beg[0]) - pos), 1);
} else {
err = -2;
@@ -1246,7 +1246,7 @@
 {
zval **arg_str, **arg_pattern, **arg_options;
OnigSyntaxType *syntax = NULL;
-   int option;
+   OnigOptionType option;
 
option = MBREX(regex_default_options);
syntax = MBREX(regex_default_syntax);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php