]> granicus.if.org Git - php/commitdiff
- use TSRMLS_*C instead of TSRMLS_FETCH in zend_list_insert
authorPierre Joye <pajoye@php.net>
Thu, 16 Sep 2010 09:13:19 +0000 (09:13 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 16 Sep 2010 09:13:19 +0000 (09:13 +0000)
23 files changed:
UPGRADING.INTERNALS
Zend/zend_list.c
Zend/zend_list.h
ext/com_dotnet/com_persist.c
ext/com_dotnet/com_wrapper.c
ext/interbase/ibase_query.c
ext/libxml/libxml.c
ext/mssql/php_mssql.c
ext/oci8/oci8.c
ext/odbc/birdstep.c
ext/openssl/openssl.c
ext/openssl/xp_ssl.c
ext/pgsql/pgsql.c
ext/pspell/pspell.c
ext/shmop/shmop.c
ext/soap/php_http.c
ext/soap/soap.c
ext/standard/file.c
ext/standard/file.h
ext/standard/streamsfuncs.c
ext/sysvmsg/sysvmsg.c
main/streams/php_stream_context.h
main/streams/streams.c

index 4b5dac1b589d94297bbf34a093749cb3bee661e9..08e3085194788cc444bdb18759fe2d68d4e4b730 100644 (file)
@@ -66,4 +66,23 @@ ZEND_FAST_FREE_REL(p, fc_type)
 
 Use emalloc, emalloc_rel, efree or efree_rel instead.
 
+       f. zend_list_insert
+zend_list_insert uses now TSRMLS_DC:
 
+ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
+
+it has to be called using:
+
+zend_list_insert(a, SOMETYPE TSRMLS_CC);
+
+If zend_list_insert is used to register a resource, ZEND_REGISTER_RESOURCE
+could be used instead.
+
+       g. php_le_stream_context(TSRMLS_C)
+php_le_stream_context uses now TSRMLS_D:
+
+PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
+
+it has to be called using:
+
+context  = php_stream_context_alloc(TSRMLS_C);
index 83377e401baae80b455320398ed029da6da9f53a..b9d20dcc8b8e65c93beb8a4096ee781f4be03ffe 100644 (file)
@@ -32,11 +32,10 @@ ZEND_API int le_index_ptr;
 static HashTable list_destructors;
 
 
-ZEND_API int zend_list_insert(void *ptr, int type)
+ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC)
 {
        int index;
        zend_rsrc_list_entry le;
-       TSRMLS_FETCH();
 
        le.ptr=ptr;
        le.type=type;
@@ -92,11 +91,11 @@ ZEND_API int _zend_list_addref(int id TSRMLS_DC)
 }
 
 
-ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
+ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
 {
        int rsrc_id;
 
-       rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type);
+       rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type TSRMLS_CC);
        
        if (rsrc_result) {
                rsrc_result->value.lval = rsrc_id;
index 67a63e35bbcb740172a6603584e3c6bc1fb13307..35fcc38483d3db9349819d688b946f5ce9b68676 100644 (file)
@@ -70,7 +70,7 @@ void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC);
 int zend_init_rsrc_list_dtors(void);
 void zend_destroy_rsrc_list_dtors(void);
 
-ZEND_API int zend_list_insert(void *ptr, int type);
+ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
 ZEND_API int _zend_list_addref(int id TSRMLS_DC);
 ZEND_API int _zend_list_delete(int id TSRMLS_DC);
 ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
@@ -79,7 +79,7 @@ ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
 #define zend_list_delete(id)           _zend_list_delete(id TSRMLS_CC)
 #define zend_list_find(id, type)       _zend_list_find(id, type TSRMLS_CC)
 
-ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
+ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
 
 ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
@@ -107,7 +107,7 @@ extern ZEND_API int le_index_ptr;  /* list entry type for index pointers */
        (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2))
 
 #define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type)  \
-    zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type);
+    zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type TSRMLS_CC);
 
 #define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \
     if (le_id == 0) {                                  \
index cca51ec6a3c1b2142b92243624f99332cc4f19b6..3bbf2511d3c544a3831b74ed11c241a515bf53ba 100755 (executable)
@@ -277,7 +277,7 @@ PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
        stm->stream = stream;
 
        zend_list_addref(stream->rsrc_id);
-       stm->id = zend_list_insert(stm, le_istream);
+       stm->id = zend_list_insert(stm, le_istream TSRMLS_CC);
 
        return (IStream*)stm;
 }
index 6f0a2d35f5ddb12384afca84b76b6d6c2f5d4408..598843c84e55f92be7c53538c51b5e253962bab0 100644 (file)
@@ -548,7 +548,7 @@ static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
                Z_ADDREF_P(object);
        disp->object = object;
 
-       disp->id = zend_list_insert(disp, le_dispatch);
+       disp->id = zend_list_insert(disp, le_dispatch TSRMLS_CC);
        
        return disp;
 }
index 82bb0bbd8d022ee4c15a6c725555cb723f5474d2..f5fd93a81370af5df906e82a36adc69a92cf52c0 100644 (file)
@@ -1857,7 +1857,7 @@ PHP_FUNCTION(ibase_execute)
                        if (ib_query->statement_type == isc_info_sql_stmt_exec_procedure) {
                                result->stmt = NULL;
                        }
-                       ib_query->result_res_id = zend_list_insert(result, le_result);
+                       ib_query->result_res_id = zend_list_insert(result, le_result TSRMLS_CC);
                        RETVAL_RESOURCE(ib_query->result_res_id);
                }
        } while (0);
index 8d07a180559df4fba681b1ba9870e33cd6d30849..f3e6745a9e2398d0065ff22ed08bef2c2489c52f 100644 (file)
@@ -313,7 +313,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
        }
 
        if (LIBXML(stream_context)) {
-               context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context());
+               context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C));
        }
 
        ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
index 84f6138bc538e0f293a7cbe17d7e5c47664cdd98..70bc6b6a86bedba8485487a719cea53362195bfc 100644 (file)
@@ -1998,7 +1998,7 @@ PHP_FUNCTION(mssql_init)
        statement->link = mssql_ptr;
        statement->executed=FALSE;
 
-       statement->id = zend_list_insert(statement,le_statement);
+       statement->id = zend_list_insert(statement,le_statement TSRMLS_CC);
        
        RETURN_RESOURCE(statement->id);
 }
index 6fd1389117abf13b281cf374d2b741a0c80ff091..f952115bbb658c17e39e381dbfb6a46334a06c8b 100644 (file)
@@ -1909,7 +1909,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
                                                                memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) {
                                                                /* do nothing */
                                                        } else {
-                                                               connection->rsrc_id = zend_list_insert(connection, le_pconnection);
+                                                               connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC);
                                                                /* Persistent connections: For old close semantics we artificially
                                                                 * bump up the refcount to prevent the non-persistent destructor
                                                                 * from getting called until request shutdown. The refcount is
@@ -2053,7 +2053,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
                new_le.ptr = connection;
                new_le.type = le_pconnection;
                connection->used_this_request = 1;
-               connection->rsrc_id = zend_list_insert(connection, le_pconnection);
+               connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC);
 
                /* Persistent connections: For old close semantics we artificially bump up the refcount to
                 * prevent the non-persistent destructor from getting called until request shutdown. The
@@ -2066,13 +2066,13 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
                OCI_G(num_persistent)++;
                OCI_G(num_links)++;
        } else if (!exclusive) {
-               connection->rsrc_id = zend_list_insert(connection, le_connection);
+               connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC);
                new_le.ptr = (void *)connection->rsrc_id;
                new_le.type = le_index_ptr;
                zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL);
                OCI_G(num_links)++;
        } else {
-               connection->rsrc_id = zend_list_insert(connection, le_connection);
+               connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC);
                OCI_G(num_links)++;
        }
 
@@ -2765,7 +2765,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
                }
                spool_le.ptr  = session_pool;
                spool_le.type = le_psessionpool;
-               zend_list_insert(session_pool, le_psessionpool);
+               zend_list_insert(session_pool, le_psessionpool TSRMLS_CC);
                zend_hash_update(&EG(persistent_list), session_pool->spool_hash_key, strlen(session_pool->spool_hash_key)+1,(void *)&spool_le, sizeof(zend_rsrc_list_entry),NULL);
        } else if (spool_out_le->type == le_psessionpool &&
                strlen(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key) == spool_hashed_details.len &&
index 1fe2a883b97202dce32e255281f35030801dde04..bc6779b4cad99976003c0a95c9ec2a45afbce356 100644 (file)
@@ -224,11 +224,11 @@ PHP_MSHUTDOWN_FUNCTION(birdstep)
 
 /* Some internal functions. Connections and result manupulate */
 
-static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc)
+static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc TSRMLS_DC)
 {
        int ind;
 
-       ind = zend_list_insert(conn,php_birdstep_module.le_link);
+       ind = zend_list_insert(conn,php_birdstep_module.le_link TSRMLS_CC);
        conn->hdbc = hdbc;
        conn->index = ind;
 
@@ -314,7 +314,7 @@ PHP_FUNCTION(birdstep_connect)
                RETURN_FALSE;
        }
        new = (VConn *)emalloc(sizeof(VConn));
-       ind = birdstep_add_conn(list,new,hdbc);
+       ind = birdstep_add_conn(list,new,hdbc TSRMLS_CC);
        php_birdstep_module.num_links++;
        RETURN_LONG(ind);
 }
index 044bd5eb1eee757926e98454145fd87c3f27a357..ac2fcd4bfc1aa3257995c94d4b58fd6dcf516833 100644 (file)
@@ -1236,7 +1236,7 @@ static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * r
        }
 
        if (cert && makeresource && resourceval) {
-               *resourceval = zend_list_insert(cert, le_x509);
+               *resourceval = zend_list_insert(cert, le_x509 TSRMLS_CC);
        }
        return cert;
 }
@@ -2435,7 +2435,7 @@ PHP_FUNCTION(openssl_csr_sign)
        }
        
        /* Succeeded; lets return the cert */
-       RETVAL_RESOURCE(zend_list_insert(new_cert, le_x509));
+       RETVAL_RESOURCE(zend_list_insert(new_cert, le_x509 TSRMLS_CC));
        new_cert = NULL;
        
 cleanup:
@@ -2512,7 +2512,7 @@ PHP_FUNCTION(openssl_csr_new)
                                                RETVAL_TRUE;
                                                
                                                if (X509_REQ_sign(csr, req.priv_key, req.digest)) {
-                                                       RETVAL_RESOURCE(zend_list_insert(csr, le_csr));
+                                                       RETVAL_RESOURCE(zend_list_insert(csr, le_csr TSRMLS_CC));
                                                        csr = NULL;                     
                                                } else {
                                                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error signing request");
@@ -2521,7 +2521,7 @@ PHP_FUNCTION(openssl_csr_new)
                                                if (we_made_the_key) {
                                                        /* and a resource for the private key */
                                                        zval_dtor(out_pkey);
-                                                       ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key));
+                                                       ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key TSRMLS_CC));
                                                        req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
                                                } else if (key_resource != -1) {
                                                        req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
@@ -2594,7 +2594,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
        }
 
        tpubkey=X509_REQ_get_pubkey(csr);
-       RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key));
+       RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key TSRMLS_CC));
        return;
 }
 /* }}} */
@@ -2948,7 +2948,7 @@ PHP_FUNCTION(openssl_pkey_new)
                                        OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, iqmp);
                                        if (rsa->n && rsa->d) {
                                                if (EVP_PKEY_assign_RSA(pkey, rsa)) {
-                                                       RETURN_RESOURCE(zend_list_insert(pkey, le_key));
+                                                       RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC));
                                                }
                                        }
                                        RSA_free(rsa);
@@ -2972,7 +2972,7 @@ PHP_FUNCTION(openssl_pkey_new)
                                                        DSA_generate_key(dsa);
                                                }
                                                if (EVP_PKEY_assign_DSA(pkey, dsa)) {
-                                                       RETURN_RESOURCE(zend_list_insert(pkey, le_key));
+                                                       RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC));
                                                }
                                        }
                                        DSA_free(dsa);
@@ -2995,7 +2995,7 @@ PHP_FUNCTION(openssl_pkey_new)
                                                        DH_generate_key(dh);
                                                }
                                                if (EVP_PKEY_assign_DH(pkey, dh)) {
-                                                       RETURN_RESOURCE(zend_list_insert(pkey, le_key));
+                                                       RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC));
                                                }
                                        }
                                        DH_free(dh);
@@ -3012,7 +3012,7 @@ PHP_FUNCTION(openssl_pkey_new)
        {
                if (php_openssl_generate_private_key(&req TSRMLS_CC)) {
                        /* pass back a key resource */
-                       RETVAL_RESOURCE(zend_list_insert(req.priv_key, le_key));
+                       RETVAL_RESOURCE(zend_list_insert(req.priv_key, le_key TSRMLS_CC));
                        /* make sure the cleanup code doesn't zap it! */
                        req.priv_key = NULL;
                }
index 412a445d1182758fc99753cd11ff22f6dc08c07e..c265869966141620d12d9dc51f541288995672c6 100644 (file)
@@ -471,7 +471,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
                                                        zval_is_true(*val)) {
                                                MAKE_STD_ZVAL(zcert);
                                                ZVAL_RESOURCE(zcert, zend_list_insert(peer_cert, 
-                                                                       php_openssl_get_x509_list_id()));
+                                                                       php_openssl_get_x509_list_id() TSRMLS_CC));
                                                php_stream_context_set_option(stream->context,
                                                                "ssl", "peer_certificate",
                                                                zcert);
@@ -500,7 +500,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
                                                                MAKE_STD_ZVAL(zcert);
                                                                ZVAL_RESOURCE(zcert,
                                                                                zend_list_insert(mycert,
-                                                                                       php_openssl_get_x509_list_id()));
+                                                                                       php_openssl_get_x509_list_id() TSRMLS_CC));
                                                                add_next_index_zval(arr, zcert);
                                                                FREE_ZVAL(zcert);
                                                        }
index afb22f615ea923c6617680fedba74f6dc410e7a0..e10d8ce5144a28f9acb74963b539cfa6fda29f4b 100644 (file)
@@ -3169,7 +3169,7 @@ PHP_FUNCTION(pg_lo_open)
                                } else {
                                        pgsql_lofp->conn = pgsql;
                                        pgsql_lofp->lofd = pgsql_lofd;
-                                       Z_LVAL_P(return_value) = zend_list_insert(pgsql_lofp, le_lofp);
+                                       Z_LVAL_P(return_value) = zend_list_insert(pgsql_lofp, le_lofp TSRMLS_CC);
                                        Z_TYPE_P(return_value) = IS_LONG;
                                }
                        }
index bc4af6409472fa8928f705a3c3184d6927841e25..ae7c1736991eb984c7905b4bab4b512275f0e4dc 100644 (file)
@@ -347,7 +347,7 @@ static PHP_FUNCTION(pspell_new)
        }
        
        manager = to_pspell_manager(ret);
-       ind = zend_list_insert(manager, le_pspell);
+       ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
        RETURN_LONG(ind);
 }
 /* }}} */
index c6e930c01e101f1781ca031ff3575d7db81b7f80..7e057afae70f8c4e9c5d2fe2820a65c68baeeedb 100644 (file)
@@ -226,7 +226,7 @@ PHP_FUNCTION(shmop_open)
 
        shmop->size = shm.shm_segsz;
 
-       rsid = zend_list_insert(shmop, shm_type);
+       rsid = zend_list_insert(shmop, shm_type TSRMLS_CC);
        RETURN_LONG(rsid);
 err:
        efree(shmop);
index c1bcf926a25d2a659f9178caec4c1f684283f587..f01a4541d0e61f7114599ddd2e547ce9a6e93407 100644 (file)
@@ -380,7 +380,7 @@ try_again:
 
        if (stream) {
                zval **cookies, **login, **password;
-         int ret = zend_list_insert(phpurl, le_url);
+         int ret = zend_list_insert(phpurl, le_url TSRMLS_CC);
 
                add_property_resource(this_ptr, "httpurl", ret);
                /*zend_list_addref(ret);*/
index 2265575b58fa8f8e89d8c336f8d8a87076356585..f447896d9612160ba40ec1ff69e35dc276838c08 100644 (file)
@@ -1298,7 +1298,7 @@ PHP_METHOD(SoapServer, SoapServer)
                service->typemap = soap_create_typemap(service->sdl, typemap_ht TSRMLS_CC);
        }
 
-       ret = zend_list_insert(service, le_service);
+       ret = zend_list_insert(service, le_service TSRMLS_CC);
        add_property_resource(this_ptr, "service", ret);
 
        SOAP_SERVER_END_CODE();
@@ -2621,7 +2621,7 @@ PHP_METHOD(SoapClient, SoapClient)
                SOAP_GLOBAL(soap_version) = soap_version;
 
                sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
-               ret = zend_list_insert(sdl, le_sdl);
+               ret = zend_list_insert(sdl, le_sdl TSRMLS_CC);
 
                add_property_resource(this_ptr, "sdl", ret);
 
@@ -2633,7 +2633,7 @@ PHP_METHOD(SoapClient, SoapClient)
                if (typemap) {
                        int ret;
 
-                       ret = zend_list_insert(typemap, le_typemap);
+                       ret = zend_list_insert(typemap, le_typemap TSRMLS_CC);
                        add_property_resource(this_ptr, "typemap", ret);
                }
        }
index ddbeb02642c6d7ae7cecb5aa914883a608f9c1d2..2d7e581bbc21e6c58a5b7e224c392585772497b5 100644 (file)
@@ -138,7 +138,7 @@ php_file_globals file_globals;
 /* sharing globals is *evil* */
 static int le_stream_context = FAILURE;
 
-PHPAPI int php_le_stream_context(void)
+PHPAPI int php_le_stream_context(TSRMLS_D)
 {
        return le_stream_context;
 }
index eef483af96cbaf15c0ea3d60e18942fcfdbf1185..cdf356f352c34a2f205baf32b6d2dbf5dcbfd7e7 100644 (file)
@@ -72,7 +72,7 @@ PHP_FUNCTION(sys_get_temp_dir);
 
 PHP_MINIT_FUNCTION(user_streams);
 
-PHPAPI int php_le_stream_context(void);
+PHPAPI int php_le_stream_context(TSRMLS_D);
 PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
 PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
 PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC);
index d1a07ac5b0b2c215ef4dc9e9c7ac913896a18ad6..e88bdf751a84efd98c77bb785d2bd20b25791984 100644 (file)
@@ -953,7 +953,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
 {
        php_stream_context *context = NULL;
 
-       context = zend_fetch_resource(&contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context());
+       context = zend_fetch_resource(&contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context(TSRMLS_C));
        if (context == NULL) {
                php_stream *stream;
 
index 9a044580b1744222e9c4a8d21f0eef541a71ba61..4ed09f4a2f03df8dad5b97765612a087bc67ebaa 100644 (file)
@@ -271,7 +271,7 @@ PHP_FUNCTION(msg_get_queue)
                        RETURN_FALSE;
                }
        }
-       RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg));      
+       RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg TSRMLS_CC));    
 }
 /* }}} */
 
index c14b37ef5830be1b8a705fc1fd9fd77c33a88772..52c3875ec7570045a7a8c00901c9090edd8e1988 100644 (file)
@@ -33,7 +33,7 @@ typedef void (*php_stream_notification_func)(php_stream_context *context,
    If no context was passed, use the default context
    The the default context has not yet been created, do it now. */
 #define php_stream_context_from_zval(zcontext, nocontext) ( \
-               (zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()) : \
+               (zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C)) : \
                (nocontext) ? NULL : \
                FG(default_context) ? FG(default_context) : \
                (FG(default_context) = php_stream_context_alloc()) )
index 6aa52b3cb4fc351af264deeb38d2bdd333679af1..5610d0cba0a457e8815c86c5e4376b1ea4c2b28b 100755 (executable)
@@ -1998,7 +1998,7 @@ PHPAPI void php_stream_context_free(php_stream_context *context)
        efree(context);
 }
 
-PHPAPI php_stream_context *php_stream_context_alloc(void)
+PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
 {
        php_stream_context *context;
 
@@ -2007,7 +2007,7 @@ PHPAPI php_stream_context *php_stream_context_alloc(void)
        MAKE_STD_ZVAL(context->options);
        array_init(context->options);
 
-       context->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context());
+       context->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context(TSRMLS_C));
        return context;
 }