johannes                Fri Nov 28 20:38:20 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysqli mysqli_embedded.c 
  Log:
  MFH: Change to zend_parse_parameters
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_embedded.c?r1=1.4.2.1.2.2.2.2&r2=1.4.2.1.2.2.2.3&diff_format=u
Index: php-src/ext/mysqli/mysqli_embedded.c
diff -u php-src/ext/mysqli/mysqli_embedded.c:1.4.2.1.2.2.2.2 
php-src/ext/mysqli/mysqli_embedded.c:1.4.2.1.2.2.2.3
--- php-src/ext/mysqli/mysqli_embedded.c:1.4.2.1.2.2.2.2        Mon Dec 31 
07:17:10 2007
+++ php-src/ext/mysqli/mysqli_embedded.c        Fri Nov 28 20:38:20 2008
@@ -32,36 +32,35 @@
 PHP_FUNCTION(mysqli_embedded_server_start)
 {
 #ifdef HAVE_EMBEDDED_MYSQLI
+       long start;
+       zval *args;
+       zval *grps;
+
        int     argc = 0;
        char **arguments;
        char **groups;
-       zval **args, **grps, **start;
        HashPosition pos;
        int index, rc;
 
-       if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &start, &args, 
&grps) == FAILURE) {
-               ZEND_WRONG_PARAM_COUNT();
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "laa", &start, 
&args, &grps) == FAILURE) {
+               return;
        }
 
-       convert_to_long_ex(start);
-       convert_to_array_ex(args);
-       convert_to_array_ex(grps);
-
-       if (!Z_LVAL_PP(start)) {
+       if (!start) {
                mysql_server_init(-1,NULL, NULL);
                RETURN_TRUE;
        }
        /* get arguments */
-       if ((argc = zend_hash_num_elements(HASH_OF(*args)))) {
+       if ((argc = zend_hash_num_elements(HASH_OF(args)))) {
                arguments = safe_emalloc(sizeof(char *), argc + 1, 0);
                arguments[0] = NULL; 
 
-               zend_hash_internal_pointer_reset_ex(HASH_OF(*args), &pos);
+               zend_hash_internal_pointer_reset_ex(HASH_OF(args), &pos);
 
-               for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*args), 
&pos))       {
+               for (index = 0;; zend_hash_move_forward_ex(HASH_OF(args), 
&pos))        {
                        zval **item;
 
-                       if (zend_hash_get_current_data_ex(HASH_OF(*args), (void 
**) &item, &pos) == FAILURE) {
+                       if (zend_hash_get_current_data_ex(HASH_OF(args), (void 
**) &item, &pos) == FAILURE) {
                                break;
                        }
 
@@ -73,16 +72,16 @@
        }
 
        /* get groups */
-       if ((zend_hash_num_elements(HASH_OF(*grps)))) {
-               groups = safe_emalloc(sizeof(char *), 
zend_hash_num_elements(HASH_OF(*grps)) + 1, 0);
+       if ((zend_hash_num_elements(HASH_OF(grps)))) {
+               groups = safe_emalloc(sizeof(char *), 
zend_hash_num_elements(HASH_OF(grps)) + 1, 0);
                groups[0] = NULL; 
 
-               zend_hash_internal_pointer_reset_ex(HASH_OF(*grps), &pos);
+               zend_hash_internal_pointer_reset_ex(HASH_OF(grps), &pos);
 
-               for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*grps), 
&pos))       {
+               for (index = 0;; zend_hash_move_forward_ex(HASH_OF(grps), 
&pos))        {
                        zval ** item;
 
-                       if (zend_hash_get_current_data_ex(HASH_OF(*grps), (void 
**) &item, &pos) == FAILURE) {
+                       if (zend_hash_get_current_data_ex(HASH_OF(grps), (void 
**) &item, &pos) == FAILURE) {
                                break;
                        }
 



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

Reply via email to