]> granicus.if.org Git - php/commitdiff
found type is unnecessary
authorXinchen Hui <laruence@gmail.com>
Mon, 2 Feb 2015 06:45:19 +0000 (14:45 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 2 Feb 2015 06:45:19 +0000 (14:45 +0800)
Zend/zend_list.c
Zend/zend_list.h
ext/curl/interface.c
ext/mysql/php_mysql.c
ext/openssl/openssl.c
ext/sockets/conversions.c
ext/sockets/sockets.c
ext/standard/file.c
ext/standard/streamsfuncs.c
main/php_streams.h

index 6344074d9ca181ef9a0192a76740b2da43bb8856..2c653782ee7020135c3311f5de9193e9e43cd8d9 100644 (file)
@@ -98,19 +98,13 @@ ZEND_API zend_resource* zend_register_resource(void *rsrc_pointer, int rsrc_type
        return Z_RES_P(zv);
 }
 
-ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int *found_type, int resource_type1, int resource_type2)
+ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type1, int resource_type2)
 {
        if (resource_type1 == res->type) {
-               if (found_type) {
-                       *found_type = resource_type1;
-               }
                return res->ptr;
        }
 
        if (resource_type2 == res->type) {
-               if (found_type) {
-                       *found_type = resource_type2;
-               }
                return res->ptr;
        }
 
@@ -159,7 +153,7 @@ ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name,
        return zend_fetch_resource(Z_RES_P(res), resource_type_name, resource_type);
 }
 
-ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int *found_type, int resource_type1, int resource_type2)
+ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type1, int resource_type2)
 {
        const char *space, *class_name;
        if (res == NULL) {
@@ -177,7 +171,7 @@ ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name
                return NULL;
        }
 
-       return zend_fetch_resource2(Z_RES_P(res), resource_type_name, found_type, resource_type1, resource_type2);
+       return zend_fetch_resource2(Z_RES_P(res), resource_type_name, resource_type1, resource_type2);
 }
 
 void list_entry_destructor(zval *zv)
index d8865b3a7e2c9977c5c7f6a2a4235112dc021094..1fce748f53a48cb2c948ec0c820f4bc37774c524 100644 (file)
@@ -61,9 +61,9 @@ ZEND_API int zend_list_close(zend_resource *res);
 
 ZEND_API zend_resource *zend_register_resource(void *rsrc_pointer, int rsrc_type);
 ZEND_API void *zend_fetch_resource(zend_resource *res, const char *resource_type_name, int resource_type);
-ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int *found_type, int resource_type, int resource_type2);
+ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type, int resource_type2);
 ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name, int resource_type);
-ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int *found_type, int resource_type, int resource_type2);
+ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type, int resource_type2);
 
 ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res);
 ZEND_API int zend_fetch_list_dtor_id(const char *type_name);
index 0b6711c8a9aaad771e8f3584c1d0e680b6acc028..cb9e168a177c8a6e38ca0c85a0765baff340c03d 100644 (file)
@@ -230,7 +230,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
        }
 
        if (!Z_ISUNDEF(ch->handlers->std_err)) {
-               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream == NULL) {
                        if (reporterror) {
                                php_error_docref(NULL, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
@@ -242,7 +242,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
                }
        }
        if (ch->handlers->read && !Z_ISUNDEF(ch->handlers->read->stream)) {
-               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->read->stream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->read->stream, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream == NULL) {
                        if (reporterror) {
                                php_error_docref(NULL, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
@@ -256,7 +256,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
                }
        }
        if (ch->handlers->write_header && !Z_ISUNDEF(ch->handlers->write_header->stream)) {
-               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write_header->stream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write_header->stream, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream == NULL) {
                        if (reporterror) {
                                php_error_docref(NULL, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
@@ -270,7 +270,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
                }
        }
        if (ch->handlers->write && !Z_ISUNDEF(ch->handlers->write->stream)) {
-               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write->stream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write->stream, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream == NULL) {
                        if (reporterror) {
                                php_error_docref(NULL, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
@@ -2281,11 +2281,10 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
                case CURLOPT_STDERR:
                case CURLOPT_WRITEHEADER: {
                        FILE *fp = NULL;
-                       int type;
                        php_stream *what = NULL;
 
                        if (Z_TYPE_P(zvalue) != IS_NULL) {
-                               what = (php_stream *)zend_fetch_resource2_ex(zvalue, "File-Handle", &type, php_file_le_stream(), php_file_le_pstream());
+                               what = (php_stream *)zend_fetch_resource2_ex(zvalue, "File-Handle", php_file_le_stream(), php_file_le_pstream());
                                if (!what) {
                                        return FAILURE;
                                }
@@ -2860,7 +2859,7 @@ PHP_FUNCTION(curl_exec)
 
        if (!Z_ISUNDEF(ch->handlers->std_err)) {
                php_stream  *stream;
-               stream = (php_stream*)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = (php_stream*)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream) {
                        php_stream_flush(stream);
                }
index 6495c1ec4c95c51d8d9759b7ee40de2c3e74e5b6..f593e184e15a0070aacf41becb68d0dc83d0d4d8 100644 (file)
@@ -543,7 +543,7 @@ static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv)
                return NULL;
        }
 
-       if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(zv), "MySQL-Link", NULL, le_link, le_plink))) {
+       if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(zv), "MySQL-Link", le_link, le_plink))) {
                return NULL;
        }
 
@@ -1109,11 +1109,11 @@ PHP_FUNCTION(mysql_close)
        }
 
        if (mysql_link) {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(MySG(default_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(MySG(default_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1160,7 +1160,7 @@ PHP_FUNCTION(mysql_select_db)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1203,7 +1203,7 @@ PHP_FUNCTION(mysql_get_host_info)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1228,7 +1228,7 @@ PHP_FUNCTION(mysql_get_proto_info)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1253,7 +1253,7 @@ PHP_FUNCTION(mysql_get_server_info)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1279,7 +1279,7 @@ PHP_FUNCTION(mysql_info)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1308,7 +1308,7 @@ PHP_FUNCTION(mysql_thread_id)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1339,7 +1339,7 @@ PHP_FUNCTION(mysql_stat)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1374,7 +1374,7 @@ PHP_FUNCTION(mysql_client_encoding)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1403,7 +1403,7 @@ PHP_FUNCTION(mysql_set_charset)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1437,7 +1437,7 @@ PHP_FUNCTION(mysql_create_db)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1470,7 +1470,7 @@ PHP_FUNCTION(mysql_drop_db)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1593,7 +1593,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1636,7 +1636,7 @@ PHP_FUNCTION(mysql_db_query)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1664,7 +1664,7 @@ PHP_FUNCTION(mysql_list_dbs)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1702,7 +1702,7 @@ PHP_FUNCTION(mysql_list_tables)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1741,7 +1741,7 @@ PHP_FUNCTION(mysql_list_fields)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1778,7 +1778,7 @@ PHP_FUNCTION(mysql_list_processes)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1817,7 +1817,7 @@ PHP_FUNCTION(mysql_error)
                }
                mysql = (php_mysql_conn*)MySG(default_link)->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1848,7 +1848,7 @@ PHP_FUNCTION(mysql_errno)
                }
                mysql = (php_mysql_conn*)MySG(default_link)->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1874,7 +1874,7 @@ PHP_FUNCTION(mysql_affected_rows)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1927,7 +1927,7 @@ PHP_FUNCTION(mysql_real_escape_string)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -1959,7 +1959,7 @@ PHP_FUNCTION(mysql_insert_id)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
@@ -2727,7 +2727,7 @@ PHP_FUNCTION(mysql_ping)
                CHECK_LINK(res);
                mysql = (php_mysql_conn*)res->ptr;
        } else {
-               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
+               if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
                        RETURN_FALSE;
                }
        }
index e3b4f4899e4051e83fce708a06dff7c475d72eab..5a0d4687de83dafcd2b8b33edf3122369796dedd 100644 (file)
@@ -3219,9 +3219,8 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
 
        if (Z_TYPE_P(val) == IS_RESOURCE) {
                void * what;
-               int type;
 
-               what = zend_fetch_resource2_ex(val, "OpenSSL X.509/key", &type, le_x509, le_key);
+               what = zend_fetch_resource2_ex(val, "OpenSSL X.509/key", le_x509, le_key);
                if (!what) {
                        TMP_CLEAN;
                }
@@ -3229,11 +3228,11 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
                        *resourceval = Z_RES_P(val);
                        Z_ADDREF_P(val);
                }
-               if (type == le_x509) {
+               if (Z_RES_P(val)->type == le_x509) {
                        /* extract key from cert, depending on public_key param */
                        cert = (X509*)what;
                        free_cert = 0;
-               } else if (type == le_key) {
+               } else if (Z_RES_P(val)->type == le_key) {
                        int is_priv;
 
                        is_priv = php_openssl_is_private_key((EVP_PKEY*)what);
index 270648c5e3ec76a36c23b845e50f897c13eca42a..963db66818d897030bf32c93c132738accb61a4f 100644 (file)
@@ -1357,7 +1357,7 @@ static void from_zval_write_fd_array_aux(zval *elem, unsigned i, void **args, se
                        return;
                }
 
-               stream = (php_stream *)zend_fetch_resource2_ex(elem, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = (php_stream *)zend_fetch_resource2_ex(elem, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream == NULL) {
                        do_from_zval_err(ctx, "resource is not a stream or a socket");
                        return;
index 68d75e8d3be1b054874a3ecbd80d7755622959fd..a3c8545179a3e632ddf65564f8d2557a0d08a08d 100644 (file)
@@ -974,7 +974,7 @@ PHP_FUNCTION(socket_set_nonblock)
        if (!Z_ISUNDEF(php_sock->zstream)) {
                php_stream *stream;
                /* omit notice if resource doesn't exist anymore */
-               stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream != NULL) {
                        if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 0,
                                        NULL) != -1) {
@@ -1014,7 +1014,7 @@ PHP_FUNCTION(socket_set_block)
         * state */
        if (!Z_ISUNDEF(php_sock->zstream)) {
                php_stream *stream;
-               stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, php_file_le_stream(), php_file_le_pstream());
                if (stream != NULL) {
                        if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 1,
                                        NULL) != -1) {
index 49b3689c53309c14e8758b4728425d4d25286d8e..7c8fd1b0a5be6235322ac911b2988057e59785db 100644 (file)
@@ -1151,7 +1151,7 @@ PHPAPI PHP_FUNCTION(fgetss)
    Implements a mostly ANSI compatible fscanf() */
 PHP_FUNCTION(fscanf)
 {
-       int result, type, argc = 0;
+       int result, argc = 0;
        size_t format_len;
        zval *args = NULL;
        zval *file_handle;
@@ -1163,7 +1163,7 @@ PHP_FUNCTION(fscanf)
                return;
        }
 
-       what = zend_fetch_resource2(Z_RES_P(file_handle), "File-Handle", &type, php_file_le_stream(), php_file_le_pstream());
+       what = zend_fetch_resource2(Z_RES_P(file_handle), "File-Handle", php_file_le_stream(), php_file_le_pstream());
 
        /* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up
         * with a leak if we have an invalid filehandle. This needs changing
index f1e27e322f2c58436bd37f362a5109a6eca7b3c4..46c2aaa9a1ab1030530c2896533a55ba249160c0 100644 (file)
@@ -920,7 +920,7 @@ static php_stream_context *decode_context_param(zval *contextresource)
        if (context == NULL) {
                php_stream *stream;
 
-               stream = zend_fetch_resource2_ex(contextresource, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
+               stream = zend_fetch_resource2_ex(contextresource, NULL, php_file_le_stream(), php_file_le_pstream());
 
                if (stream) {
                        context = PHP_STREAM_CONTEXT(stream);
index 177624df48cfb4d8ca50ce665a59d00144d8734d..3cd0c047cd9bbffb0e86d8cd2de38ee51d0d7ee4 100644 (file)
@@ -255,18 +255,18 @@ END_EXTERN_C()
 
 #define php_stream_from_zval(xstr, pzval)      do { \
        if (((xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), \
-                               "stream", NULL, php_file_le_stream(), php_file_le_pstream())) == NULL) { \
+                               "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \
                RETURN_FALSE; \
        } \
 } while (0)
 #define php_stream_from_res(xstr, res) do { \
        if (((xstr) = (php_stream*)zend_fetch_resource2((res), \
-                               "stream", NULL, php_file_le_stream(), php_file_le_pstream())) == NULL) { \
+                               "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \
                RETURN_FALSE; \
        } \
 } while (0)
-#define php_stream_from_res_no_verify(xstr, pzval)     (xstr) = (php_stream*)zend_fetch_resource((res), "stream", NULL, php_file_le_stream(), php_file_le_pstream())
-#define php_stream_from_zval_no_verify(xstr, pzval)    (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", NULL, php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_res_no_verify(xstr, pzval)     (xstr) = (php_stream*)zend_fetch_resource((res), "stream", php_file_le_stream(), php_file_le_pstream())
+#define php_stream_from_zval_no_verify(xstr, pzval)    (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", php_file_le_stream(), php_file_le_pstream())
 
 BEGIN_EXTERN_C()
 PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed);