[PHP-CVS] cvs: php-src(PHP_5_3) /ext/bcmath bcmath.c /ext/bz2 bz2.c /ext/curl interface.c /ext/date php_date.c /ext/dom domimplementation.c /ext/exif exif.c /ext/gd gd.c /ext/openssl openssl.c

2008-10-21 Thread Arnaud Le Blanc
lbarnaudTue Oct 21 23:39:16 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/bcmath bcmath.c 
/php-src/ext/bz2bz2.c 
/php-src/ext/curl   interface.c 
/php-src/ext/date   php_date.c 
/php-src/ext/domdomimplementation.c 
/php-src/ext/exif   exif.c 
/php-src/ext/gd gd.c 
/php-src/ext/opensslopenssl.c 
/php-src/ext/simplexml  simplexml.c 
/php-src/ext/soap   soap.c 
/php-src/ext/socketssockets.c 
/php-src/ext/sysvshmsysvshm.c 
/php-src/ext/zipphp_zip.c 
  Log:
  MFH: initialize optional vars
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/bcmath.c?r1=1.62.2.2.2.8.2.3r2=1.62.2.2.2.8.2.4diff_format=u
Index: php-src/ext/bcmath/bcmath.c
diff -u php-src/ext/bcmath/bcmath.c:1.62.2.2.2.8.2.3 
php-src/ext/bcmath/bcmath.c:1.62.2.2.2.8.2.4
--- php-src/ext/bcmath/bcmath.c:1.62.2.2.2.8.2.3Tue Jun 24 16:01:32 2008
+++ php-src/ext/bcmath/bcmath.c Tue Oct 21 23:39:14 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bcmath.c,v 1.62.2.2.2.8.2.3 2008/06/24 16:01:32 felipe Exp $ */
+/* $Id: bcmath.c,v 1.62.2.2.2.8.2.4 2008/10/21 23:39:14 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -215,7 +215,7 @@
 PHP_FUNCTION(bcadd)
 {
char *left, *right;
-   long scale_param;
+   long scale_param = 0;
bc_num first, second, result;
int left_len, right_len;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
@@ -255,7 +255,7 @@
 {
char *left, *right;
int left_len, right_len;
-   long scale_param;
+   long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
@@ -294,7 +294,7 @@
 {
char *left, *right;
int left_len, right_len;
-   long scale_param;
+   long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
@@ -333,7 +333,7 @@
 {
char *left, *right;
int left_len, right_len;
-   long scale_param;
+   long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
@@ -457,7 +457,7 @@
 {
char *left, *right;
int left_len, right_len;
-   long scale_param;
+   long scale_param = 0;
bc_num first, second, result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
@@ -496,7 +496,7 @@
 {
char *left;
int left_len;
-   long scale_param;
+   long scale_param = 0;
bc_num result;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
@@ -533,7 +533,7 @@
 {
char *left, *right;
int left_len, right_len;
-   long scale_param;
+   long scale_param = 0;
bc_num first, second;
int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2.c?r1=1.14.2.3.2.12.2.6r2=1.14.2.3.2.12.2.7diff_format=u
Index: php-src/ext/bz2/bz2.c
diff -u php-src/ext/bz2/bz2.c:1.14.2.3.2.12.2.6 
php-src/ext/bz2/bz2.c:1.14.2.3.2.12.2.7
--- php-src/ext/bz2/bz2.c:1.14.2.3.2.12.2.6 Wed Jul 23 11:25:14 2008
+++ php-src/ext/bz2/bz2.c   Tue Oct 21 23:39:14 2008
@@ -16,7 +16,7 @@
   +--+
 */
  
-/* $Id: bz2.c,v 1.14.2.3.2.12.2.6 2008/07/23 11:25:14 tony2001 Exp $ */
+/* $Id: bz2.c,v 1.14.2.3.2.12.2.7 2008/10/21 23:39:14 lbarnaud Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -482,8 +482,8 @@
 static PHP_FUNCTION(bzcompress)
 {
char *source;  /* Source data to compress */
-   long  zblock_size; /* Optional block size to use */
-   long  zwork_factor;/* Optional work factor to use */
+   long  zblock_size = 0; /* Optional block size to use */
+   long  zwork_factor = 0;/* Optional work factor to use */
char *dest = NULL; /* Destination to place the 
compressed data into */
int   error,   /* Error Container */
  block_size  = 4, /* Block size for 
compression algorithm */
http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.12r2=1.62.2.14.2.27.2.13diff_format=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.12 
php-src/ext/curl/interface.c:1.62.2.14.2.27.2.13
--- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.12Tue Jul 29 10:42:44 2008
+++ php-src/ext/curl/interface.cTue Oct 21 23:39:14 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: interface.c,v 1.62.2.14.2.27.2.12 2008/07/29 10:42:44 tony2001 Exp $ */
+/* $Id: interface.c,v 1.62.2.14.2.27.2.13 2008/10/21 23:39:14 lbarnaud Exp $ */
 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/bcmath bcmath.c

2008-06-24 Thread Felipe Pena
felipe  Tue Jun 24 16:01:32 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/bcmath bcmath.c 
  Log:
  - New parameter parsing API
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/bcmath.c?r1=1.62.2.2.2.8.2.2r2=1.62.2.2.2.8.2.3diff_format=u
Index: php-src/ext/bcmath/bcmath.c
diff -u php-src/ext/bcmath/bcmath.c:1.62.2.2.2.8.2.2 
php-src/ext/bcmath/bcmath.c:1.62.2.2.2.8.2.3
--- php-src/ext/bcmath/bcmath.c:1.62.2.2.2.8.2.2Mon Dec 31 07:17:06 2007
+++ php-src/ext/bcmath/bcmath.c Tue Jun 24 16:01:32 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: bcmath.c,v 1.62.2.2.2.8.2.2 2007/12/31 07:17:06 sebastian Exp $ */
+/* $Id: bcmath.c,v 1.62.2.2.2.8.2.3 2008/06/24 16:01:32 felipe Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -214,38 +214,31 @@
Returns the sum of two arbitrary precision numbers */
 PHP_FUNCTION(bcadd)
 {
-   zval **left, **right, **scale_param;
+   char *left, *right;
+   long scale_param;
bc_num first, second, result;
-   int scale = BCG(bc_precision);
+   int left_len, right_len;
+   int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
-   switch (ZEND_NUM_ARGS()) {
-   case 2:
-   if (zend_get_parameters_ex(2, left, right) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   break;
-   case 3:
-   if (zend_get_parameters_ex(3, left, right, 
scale_param) == FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   convert_to_long_ex(scale_param);
-   scale = (int) ((int)Z_LVAL_PP(scale_param)  0) 
? 0 : Z_LVAL_PP(scale_param);
-   break;
-   default:
-   WRONG_PARAM_COUNT;
-   break;
+   if (zend_parse_parameters(argc TSRMLS_CC, ss|l, left, left_len, 
right, right_len, scale_param) == FAILURE) {
+   return;
+   }
+   
+   if (argc == 3) {
+   scale = (int) ((int)scale_param  0) ? 0 : scale_param;
}
-   convert_to_string_ex(left);
-   convert_to_string_ex(right);
+
bc_init_num(first TSRMLS_CC);
bc_init_num(second TSRMLS_CC);
bc_init_num(result TSRMLS_CC);
-   php_str2num(first, Z_STRVAL_PP(left) TSRMLS_CC);
-   php_str2num(second, Z_STRVAL_PP(right) TSRMLS_CC);
+   php_str2num(first, left TSRMLS_CC);
+   php_str2num(second, right TSRMLS_CC);
bc_add (first, second, result, scale);
+   
if (result-n_scale  scale) {
result-n_scale = scale;
}
+   
Z_STRVAL_P(return_value) = bc_num2str(result);
Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
Z_TYPE_P(return_value) = IS_STRING;
@@ -260,38 +253,31 @@
Returns the difference between two arbitrary precision numbers */
 PHP_FUNCTION(bcsub)
 {
-   zval **left, **right, **scale_param;
+   char *left, *right;
+   int left_len, right_len;
+   long scale_param;
bc_num first, second, result;
-   int scale = BCG(bc_precision);
+   int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
 
-   switch (ZEND_NUM_ARGS()) {
-   case 2:
-   if (zend_get_parameters_ex(2, left, right) == 
FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   break;
-   case 3:
-   if (zend_get_parameters_ex(3, left, right, 
scale_param) == FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-   convert_to_long_ex(scale_param);
-   scale = (int) ((int)Z_LVAL_PP(scale_param)  0) 
? 0 : Z_LVAL_PP(scale_param);
-   break;
-   default:
-   WRONG_PARAM_COUNT;
-   break;
+   if (zend_parse_parameters(argc TSRMLS_CC, ss|l, left, left_len, 
right, right_len, scale_param) == FAILURE) {
+   return;
+   }
+   
+   if (argc == 3) {
+   scale = (int) ((int)scale_param  0) ? 0 : scale_param;
}
-   convert_to_string_ex(left);
-   convert_to_string_ex(right);
+
bc_init_num(first TSRMLS_CC);
bc_init_num(second TSRMLS_CC);
bc_init_num(result TSRMLS_CC);
-   php_str2num(first, Z_STRVAL_PP(left) TSRMLS_CC);
-   php_str2num(second, Z_STRVAL_PP(right) TSRMLS_CC);
+   php_str2num(first, left TSRMLS_CC);
+   php_str2num(second, right TSRMLS_CC);
bc_sub (first, second, result, scale);
+
if (result-n_scale