]> granicus.if.org Git - php/commitdiff
last portion of z/Z fixes
authorAntony Dovgal <tony2001@php.net>
Thu, 31 Aug 2006 16:14:43 +0000 (16:14 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 31 Aug 2006 16:14:43 +0000 (16:14 +0000)
ext/imap/php_imap.c
ext/oci8/oci8_statement.c
ext/posix/posix.c
ext/reflection/php_reflection.c
ext/sockets/sockets.c

index d148fffad61b5afba144d247584fa341cfab7168..f9a99be356ff99b28d5ab5d769344deb883eaecf 100644 (file)
@@ -1872,14 +1872,14 @@ PHP_FUNCTION(imap_fetchbody)
        Save a specific body section to a file */
 PHP_FUNCTION(imap_savebody)
 {
-       zval *stream, *out;
+       zval *stream, **out;
        pils *imap_ptr = NULL;
        php_stream *writer = NULL;
        char *section = "";
        int section_len = 0, close_stream = 1;
        long msgno, flags = 0;
        
-       if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rzl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
+       if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZl|sl", &stream, &out, &msgno, &section, &section_len, &flags)) {
                RETURN_FALSE;
        }
        
@@ -1889,17 +1889,17 @@ PHP_FUNCTION(imap_savebody)
                RETURN_FALSE;
        }
        
-       switch (Z_TYPE_P(out))
+       switch (Z_TYPE_PP(out))
        {
                case IS_LONG:
                case IS_RESOURCE:
                        close_stream = 0;
-                       php_stream_from_zval(writer, &out);
+                       php_stream_from_zval(writer, out);
                break;
 
                default:
-                       convert_to_string_ex(&out);
-                       writer = php_stream_open_wrapper(Z_STRVAL_P(out), "wb", REPORT_ERRORS, NULL);
+                       convert_to_string_ex(out);
+                       writer = php_stream_open_wrapper(Z_STRVAL_PP(out), "wb", REPORT_ERRORS, NULL);
                break;
        }
        
index a481607ba78d19551a6b24dd5c8e0de783794af7..03ae250ec4c796ba5c5e24e1c9d3d2f4b3aa1cc3 100644 (file)
@@ -1079,11 +1079,11 @@ sb4 php_oci_bind_out_callback(
  Helper function to get column by name and index */
 php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAMETERS, int need_data)
 {
-       zval *z_statement, *column_index;
+       zval *z_statement, **column_index;
        php_oci_statement *statement;
        php_oci_out_column *column;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &z_statement, &column_index) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rZ", &z_statement, &column_index) == FAILURE) {
                return NULL;
        }
 
@@ -1097,17 +1097,17 @@ php_oci_out_column *php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAME
                return NULL;
        }
        
-       if (Z_TYPE_P(column_index) == IS_STRING) {
-               column = php_oci_statement_get_column(statement, -1, Z_STRVAL_P(column_index), Z_STRLEN_P(column_index) TSRMLS_CC);
+       if (Z_TYPE_PP(column_index) == IS_STRING) {
+               column = php_oci_statement_get_column(statement, -1, Z_STRVAL_PP(column_index), Z_STRLEN_PP(column_index) TSRMLS_CC);
                if (!column) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_P(column_index));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column name \"%s\"", Z_STRVAL_PP(column_index));
                        return NULL;
                }
        } else {
-               convert_to_long(column_index);
-               column = php_oci_statement_get_column(statement, Z_LVAL_P(column_index), NULL, 0 TSRMLS_CC);
+               convert_to_long_ex(column_index);
+               column = php_oci_statement_get_column(statement, Z_LVAL_PP(column_index), NULL, 0 TSRMLS_CC);
                if (!column) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL_P(column_index));
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column index \"%ld\"", Z_LVAL_PP(column_index));
                        return NULL;
                }
        }
index c960874c42d1165767cf893280f0dc8db376b258..9f85fa60addd7b1a602d5341b58213954d15034a 100644 (file)
@@ -552,23 +552,23 @@ static int php_posix_stream_get_fd(zval *zfp, int *fd TSRMLS_DC)
    Determine terminal device name (POSIX.1, 4.7.2) */
 PHP_FUNCTION(posix_ttyname)
 {
-       zval *z_fd;
+       zval **z_fd;
        char *p;
        int fd;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &z_fd) == FAILURE) {
                RETURN_FALSE;
        }
 
-       switch (Z_TYPE_P(z_fd)) {
+       switch (Z_TYPE_PP(z_fd)) {
                case IS_RESOURCE:
-                       if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+                       if (!php_posix_stream_get_fd(*z_fd, &fd TSRMLS_CC)) {
                                RETURN_FALSE;
                        }
                        break;
                default:
-                       convert_to_long(z_fd);
-                       fd = Z_LVAL_P(z_fd);
+                       convert_to_long_ex(z_fd);
+                       fd = Z_LVAL_PP(z_fd);
        }
 
        if (NULL == (p = ttyname(fd))) {
@@ -584,22 +584,22 @@ PHP_FUNCTION(posix_ttyname)
    Determine if filedesc is a tty (POSIX.1, 4.7.1) */
 PHP_FUNCTION(posix_isatty)
 {
-       zval *z_fd;
+       zval **z_fd;
        int fd;
        
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &z_fd) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &z_fd) == FAILURE) {
                RETURN_FALSE;
        }
        
-       switch (Z_TYPE_P(z_fd)) {
+       switch (Z_TYPE_PP(z_fd)) {
                case IS_RESOURCE:
-                       if (!php_posix_stream_get_fd(z_fd, &fd TSRMLS_CC)) {
+                       if (!php_posix_stream_get_fd(*z_fd, &fd TSRMLS_CC)) {
                                RETURN_FALSE;
                        }
                        break;
                default:
-                       convert_to_long(z_fd);
-                       fd = Z_LVAL_P(z_fd);
+                       convert_to_long_ex(z_fd);
+                       fd = Z_LVAL_PP(z_fd);
        }
 
        if (isatty(fd)) {
index 24eea39a0f462400033059de8dbdb5cd03a31eb1..9574d26d153cf5f7cadcef306c68e31174292f87 100644 (file)
@@ -1774,7 +1774,7 @@ ZEND_METHOD(reflection_parameter, export)
 ZEND_METHOD(reflection_parameter, __construct)
 {
        parameter_reference *ref;
-       zval *reference, *parameter;
+       zval *reference, **parameter;
        zval *object;
        zval *name;
        reflection_object *intern;
@@ -1783,7 +1783,7 @@ ZEND_METHOD(reflection_parameter, __construct)
        int position;
        zend_class_entry *ce = NULL;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &reference, &parameter) == FAILURE) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zZ", &reference, &parameter) == FAILURE) {
                return;
        }
 
@@ -1800,7 +1800,6 @@ ZEND_METHOD(reflection_parameter, __construct)
                                unsigned int lcname_len;
                                zstr lcname;
 
-                               convert_to_text_ex(&reference);
                                lcname = zend_u_str_case_fold(Z_TYPE_P(reference), Z_UNIVAL_P(reference), Z_UNILEN_P(reference), 1, &lcname_len);
                                if (zend_u_hash_find(EG(function_table), Z_TYPE_P(reference), lcname, lcname_len + 1, (void**) &fptr) == FAILURE) {
                                        efree(lcname.v);
@@ -1857,8 +1856,8 @@ ZEND_METHOD(reflection_parameter, __construct)
        
        /* Now, search for the parameter */
        arg_info = fptr->common.arg_info;
-       if (Z_TYPE_P(parameter) == IS_LONG) {
-               position= Z_LVAL_P(parameter);
+       if (Z_TYPE_PP(parameter) == IS_LONG) {
+               position= Z_LVAL_PP(parameter);
                if (position < 0 || (zend_uint)position >= fptr->common.num_args) {
                        _DO_THROW("The parameter specified by its offset could not be found");
                        /* returns out of this function */
@@ -1867,12 +1866,12 @@ ZEND_METHOD(reflection_parameter, __construct)
                zend_uint i;
 
                position= -1;
-               convert_to_text_ex(&parameter);
+               convert_to_text_ex(parameter);
                for (i = 0; i < fptr->common.num_args; i++) {
-                       if (Z_TYPE_P(parameter) == IS_STRING && arg_info[i].name.s && strcmp(arg_info[i].name.s, Z_STRVAL_P(parameter)) == 0) {
+                       if (Z_TYPE_PP(parameter) == IS_STRING && arg_info[i].name.s && strcmp(arg_info[i].name.s, Z_STRVAL_PP(parameter)) == 0) {
                                position= i;
                                break;
-                       } else if (Z_TYPE_P(parameter) == IS_UNICODE && arg_info[i].name.u && u_strcmp(arg_info[i].name.u, Z_USTRVAL_P(parameter)) == 0) {
+                       } else if (Z_TYPE_PP(parameter) == IS_UNICODE && arg_info[i].name.u && u_strcmp(arg_info[i].name.u, Z_USTRVAL_PP(parameter)) == 0) {
                                position= i;
                                break;
                        }
index ec14ce0d3885b6c200ab0044d00e106a2533792d..3ae8c2b7dc1719be1d71653a67d2c0d06d526945 100644 (file)
@@ -1596,7 +1596,7 @@ PHP_FUNCTION(socket_get_option)
    Sets socket options for the socket */
 PHP_FUNCTION(socket_set_option)
 {
-       zval                    *arg1, *arg4;
+       zval                    *arg1, **arg4;
        struct linger   lv;
        struct timeval tv;
        php_socket              *php_sock;
@@ -1617,7 +1617,7 @@ PHP_FUNCTION(socket_set_option)
        char                    *sec_key = "sec";
        char                    *usec_key = "usec";
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllz", &arg1, &level, &optname, &arg4) == FAILURE)
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rllZ", &arg1, &level, &optname, &arg4) == FAILURE)
                return;
 
        ZEND_FETCH_RESOURCE(php_sock, php_socket *, &arg1, -1, le_socket_name, le_socket);
@@ -1626,8 +1626,8 @@ PHP_FUNCTION(socket_set_option)
 
        switch (optname) {
                case SO_LINGER:
-                       convert_to_array_ex(&arg4);
-                       opt_ht = HASH_OF(arg4);
+                       convert_to_array_ex(arg4);
+                       opt_ht = HASH_OF(*arg4);
 
                        if (zend_hash_find(opt_ht, l_onoff_key, strlen(l_onoff_key) + 1, (void **)&l_onoff) == FAILURE) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", l_onoff_key);
@@ -1649,8 +1649,8 @@ PHP_FUNCTION(socket_set_option)
                        break;
                case SO_RCVTIMEO:
                case SO_SNDTIMEO:
-                       convert_to_array_ex(&arg4);
-                       opt_ht = HASH_OF(arg4);
+                       convert_to_array_ex(arg4);
+                       opt_ht = HASH_OF(*arg4);
 
                        if (zend_hash_find(opt_ht, sec_key, strlen(sec_key) + 1, (void **)&sec) == FAILURE) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "no key \"%s\" passed in optval", sec_key);
@@ -1675,8 +1675,8 @@ PHP_FUNCTION(socket_set_option)
 #endif
                        break;
                default:
-                       convert_to_long_ex(&arg4);
-                       ov = Z_LVAL_P(arg4);
+                       convert_to_long_ex(arg4);
+                       ov = Z_LVAL_PP(arg4);
                        
                        optlen = sizeof(ov);
                        opt_ptr = &ov;