kalle Tue, 13 Apr 2010 11:02:15 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=297955
Log: Remove a couple TSRMLS_FETCH() calls around ext/main/sapi Changed paths: U php/php-src/trunk/ext/com_dotnet/com_persist.c U php/php-src/trunk/ext/com_dotnet/com_wrapper.c U php/php-src/trunk/ext/curl/interface.c U php/php-src/trunk/ext/ereg/ereg.c U php/php-src/trunk/ext/ereg/php_ereg.h U php/php-src/trunk/ext/oci8/oci8_statement.c U php/php-src/trunk/ext/openssl/openssl.c U php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c U php/php-src/trunk/main/main.c U php/php-src/trunk/sapi/apache/php_apache.c U php/php-src/trunk/sapi/apache_hooks/mod_php5.c U php/php-src/trunk/sapi/apache_hooks/php_apache.c U php/php-src/trunk/sapi/phttpd/phttpd.c
Modified: php/php-src/trunk/ext/com_dotnet/com_persist.c =================================================================== --- php/php-src/trunk/ext/com_dotnet/com_persist.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/com_dotnet/com_persist.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -45,22 +45,16 @@ } php_istream; static int le_istream; -static void istream_destructor(php_istream *stm); +static void istream_destructor(php_istream *stm TSRMLS_DC); static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { php_istream *stm = (php_istream *)rsrc->ptr; - istream_destructor(stm); + istream_destructor(stm TSRMLS_CC); } -#ifdef ZTS -# define TSRMLS_FIXED() TSRMLS_FETCH(); -#else -# define TSRMLS_FIXED() -#endif - #define FETCH_STM() \ - TSRMLS_FIXED() \ + TSRMLS_FETCH(); \ php_istream *stm = (php_istream*)This; \ if (GetCurrentThreadId() != stm->engine_thread) \ return RPC_E_WRONG_THREAD; @@ -250,10 +244,8 @@ stm_clone }; -static void istream_destructor(php_istream *stm) +static void istream_destructor(php_istream *stm TSRMLS_DC) { - TSRMLS_FETCH(); - if (stm->id) { int id = stm->id; stm->id = 0; Modified: php/php-src/trunk/ext/com_dotnet/com_wrapper.c =================================================================== --- php/php-src/trunk/ext/com_dotnet/com_wrapper.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/com_dotnet/com_wrapper.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -52,12 +52,12 @@ static int le_dispatch; -static void disp_destructor(php_dispatchex *disp); +static void disp_destructor(php_dispatchex *disp TSRMLS_DC); static void dispatch_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { php_dispatchex *disp = (php_dispatchex *)rsrc->ptr; - disp_destructor(disp); + disp_destructor(disp TSRMLS_CC); } int php_com_wrapper_minit(INIT_FUNC_ARGS) @@ -86,14 +86,8 @@ } /* }}} */ -#ifdef ZTS -# define TSRMLS_FIXED() TSRMLS_FETCH(); -#else -# define TSRMLS_FIXED() -#endif - #define FETCH_DISP(methname) \ - TSRMLS_FIXED() \ + TSRMLS_FETCH(); \ php_dispatchex *disp = (php_dispatchex*)This; \ if (COMG(rshutdown_started)) { \ trace(" PHP Object:%p (name:unknown) %s\n", disp->object, methname); \ @@ -559,10 +553,8 @@ return disp; } -static void disp_destructor(php_dispatchex *disp) -{ - TSRMLS_FETCH(); - +static void disp_destructor(php_dispatchex *disp TSRMLS_DC) +{ /* Object store not available during request shutdown */ if (COMG(rshutdown_started)) { trace("destroying COM wrapper for PHP object %p (name:unknown)\n", disp->object); Modified: php/php-src/trunk/ext/curl/interface.c =================================================================== --- php/php-src/trunk/ext/curl/interface.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/curl/interface.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -163,14 +163,12 @@ # define php_curl_ret(__ret) RETVAL_FALSE; return; #endif -static int php_curl_option_url(php_curl *ch, const char *url, const int len) /* {{{ */ +static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */ { CURLcode error = CURLE_OK; #if LIBCURL_VERSION_NUM < 0x071100 char *copystr = NULL; #endif - TSRMLS_FETCH(); - /* Disable file:// if open_basedir or safe_mode are used */ if ((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) { #if LIBCURL_VERSION_NUM >= 0x071304 @@ -1474,7 +1472,7 @@ #endif if (url) { - if (!php_curl_option_url(ch, url, url_len)) { + if (!php_curl_option_url(ch, url, url_len TSRMLS_CC)) { _php_curl_close_ex(ch TSRMLS_CC); RETURN_FALSE; } @@ -1737,7 +1735,7 @@ } #endif if (option == CURLOPT_URL) { - if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue))) { + if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC)) { RETVAL_FALSE; return 1; } Modified: php/php-src/trunk/ext/ereg/ereg.c =================================================================== --- php/php-src/trunk/ext/ereg/ereg.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/ereg/ereg.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -124,12 +124,11 @@ /* {{{ _php_regcomp */ -static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) +static int _php_regcomp(regex_t *preg, const char *pattern, int cflags TSRMLS_DC) { int r = 0; int patlen = strlen(pattern); reg_cache *rc = NULL; - TSRMLS_FETCH(); if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) { /* easier than dealing with overflow as it happens */ @@ -201,7 +200,7 @@ #undef regfree #define regfree(a); #undef regcomp -#define regcomp(a, b, c) _php_regcomp(a, b, c) +#define regcomp(a, b, c) _php_regcomp(a, b, c TSRMLS_CC) static void php_ereg_init_globals(zend_ereg_globals *ereg_globals TSRMLS_DC) { @@ -400,7 +399,7 @@ /* {{{ php_ereg_replace * this is the meat and potatoes of regex replacement! */ -PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended) +PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC) { regex_t re; regmatch_t *subs; @@ -593,7 +592,7 @@ } /* do the actual work */ - ret = php_ereg_replace(pattern, replace, string, icase, 1); + ret = php_ereg_replace(pattern, replace, string, icase, 1 TSRMLS_CC); if (ret == (char *) -1) { RETVAL_FALSE; } else { Modified: php/php-src/trunk/ext/ereg/php_ereg.h =================================================================== --- php/php-src/trunk/ext/ereg/php_ereg.h 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/ereg/php_ereg.h 2010-04-13 11:02:15 UTC (rev 297955) @@ -27,7 +27,7 @@ extern zend_module_entry ereg_module_entry; #define phpext_ereg_ptr &ereg_module_entry -PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended); +PHPAPI char *php_ereg_replace(const char *pattern, const char *replace, const char *string, int icase, int extended TSRMLS_DC); PHP_FUNCTION(ereg); PHP_FUNCTION(eregi); Modified: php/php-src/trunk/ext/oci8/oci8_statement.c =================================================================== --- php/php-src/trunk/ext/oci8/oci8_statement.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/oci8/oci8_statement.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -336,9 +336,9 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **bufpp, ub4 **alenpp, ub1 *piecep, dvoid **indpp, ub2 **rcpp) { php_oci_out_column *outcol = (php_oci_out_column *)ctx; + TSRMLS_FETCH(); if (!outcol) { - TSRMLS_FETCH(); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid context pointer value"); return OCI_ERROR; @@ -347,7 +347,6 @@ switch(outcol->data_type) { case SQLT_RSET: { php_oci_statement *nested_stmt; - TSRMLS_FETCH(); nested_stmt = php_oci_statement_create(outcol->statement->connection, NULL, 0 TSRMLS_CC); if (!nested_stmt) { @@ -372,7 +371,6 @@ case SQLT_BFILE: { php_oci_descriptor *descr; int dtype; - TSRMLS_FETCH(); if (outcol->data_type == SQLT_BFILE) { dtype = OCI_DTYPE_FILE; Modified: php/php-src/trunk/ext/openssl/openssl.c =================================================================== --- php/php-src/trunk/ext/openssl/openssl.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/openssl/openssl.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -852,12 +852,10 @@ } /* }}} */ -static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded) /* {{{ */ +static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *seeded TSRMLS_DC) /* {{{ */ { char buffer[MAXPATHLEN]; - TSRMLS_FETCH(); - *egdsocket = 0; *seeded = 0; @@ -2742,7 +2740,7 @@ } randfile = CONF_get_string(req->req_config, req->section_name, "RANDFILE"); - php_openssl_load_rand_file(randfile, &egdsocket, &seeded); + php_openssl_load_rand_file(randfile, &egdsocket, &seeded TSRMLS_CC); if ((req->priv_key = EVP_PKEY_new()) != NULL) { switch(req->priv_key_type) { Modified: php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c =================================================================== --- php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/ext/sybase_ct/php_sybase_ct.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -1188,11 +1188,10 @@ ZVAL_STRINGL(&result, buf, length- 1, 1); \ } -static int php_sybase_fetch_result_row (sybase_result *result, int numrows) +static int php_sybase_fetch_result_row(sybase_result *result, int numrows TSRMLS_DC) { int i, j; CS_INT retcode; - TSRMLS_FETCH(); /* We've already fetched everything */ if (result->last_retcode == CS_END_DATA || result->last_retcode == CS_END_RESULTS) { @@ -1282,7 +1281,7 @@ return retcode; } -static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr, int buffered, int store) +static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store TSRMLS_DC) { int num_fields; sybase_result *result; @@ -1401,7 +1400,7 @@ if (buffered) { retcode = CS_SUCCEED; } else { - if ((retcode = php_sybase_fetch_result_row(result, -1)) == CS_FAIL) { + if ((retcode = php_sybase_fetch_result_row(result, -1 TSRMLS_CC)) == CS_FAIL) { return NULL; } } @@ -1538,7 +1537,7 @@ case CS_PARAM_RESULT: case CS_ROW_RESULT: case CS_STATUS_RESULT: - result = php_sybase_fetch_result_set(sybase_ptr, buffered, store); + result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC); if (result == NULL) { ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); RETURN_FALSE; @@ -1564,7 +1563,7 @@ case CS_PARAM_RESULT: case CS_ROW_RESULT: if (status != Q_RESULT) { - result = php_sybase_fetch_result_set(sybase_ptr, buffered, store); + result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC); if (result == NULL) { ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); sybase_ptr->dead = 1; @@ -1756,7 +1755,7 @@ /* Unbuffered? */ if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - php_sybase_fetch_result_row(result, 1); + php_sybase_fetch_result_row(result, 1 TSRMLS_CC); } /* At the end? */ @@ -1792,7 +1791,7 @@ /* Unbuffered ? Fetch next row */ if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS) { - php_sybase_fetch_result_row(result, 1); + php_sybase_fetch_result_row(result, 1 TSRMLS_CC); } /* At the end? */ @@ -1910,7 +1909,7 @@ /* Unbuffered ? */ if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && offset >= result->num_rows) { - php_sybase_fetch_result_row(result, offset+ 1); + php_sybase_fetch_result_row(result, offset+ 1 TSRMLS_CC); } if (offset < 0 || offset >= result->num_rows) { @@ -2044,7 +2043,7 @@ /* Unbuffered ? */ if (result->last_retcode != CS_END_DATA && result->last_retcode != CS_END_RESULTS && row >= result->num_rows) { - php_sybase_fetch_result_row(result, row); + php_sybase_fetch_result_row(result, row TSRMLS_CC); } if (row < 0 || row >= result->num_rows) { Modified: php/php-src/trunk/main/main.c =================================================================== --- php/php-src/trunk/main/main.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/main/main.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -113,9 +113,9 @@ #ifdef PHP_WIN32 #include "win32_internal_function_disabled.h" -static php_win32_disable_functions() { +static php_win32_disable_functions(TSRMLS_D) +{ int i; - TSRMLS_FETCH(); if (EG(windows_version_info).dwMajorVersion < 5) { for (i = 0; i < function_name_cnt_5; i++) { @@ -2044,7 +2044,7 @@ #ifdef PHP_WIN32 /* Disable incompatible functions for the running platform */ - if (php_win32_disable_functions() == FAILURE) { + if (php_win32_disable_functions(TSRMLS_C) == FAILURE) { php_printf("Unable to disable unsupported functions\n"); return FAILURE; } Modified: php/php-src/trunk/sapi/apache/php_apache.c =================================================================== --- php/php-src/trunk/sapi/apache/php_apache.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/sapi/apache/php_apache.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -533,14 +533,14 @@ #if 0 +/* This function is most likely a bad idea. Just playing with it for now. - +*/ PHP_FUNCTION(apache_exec_uri) { char *filename; int filename_len; request_rec *rr=NULL; - TSRMLS_FETCH(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { return; Modified: php/php-src/trunk/sapi/apache_hooks/mod_php5.c =================================================================== --- php/php-src/trunk/sapi/apache_hooks/mod_php5.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/sapi/apache_hooks/mod_php5.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -1,20 +1,20 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2010 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/3_01.txt | + | that is bundled with this package in the file LICENSE, and is | + | available at through the world-wide-web at | + | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | lice...@php.net so we can mail you a copy immediately. | + | obtain it through the world-wide-web, please send a note to | + | lice...@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Rasmus Lerdorf <ras...@php.net> | - | (with helpful hints from Dean Gaudet <dgau...@arctic.org> | - | PHP 4.0 patches by Zeev Suraski <z...@zend.com> | + | Authors: Rasmus Lerdorf <ras...@php.net> | + | (with helpful hints from Dean Gaudet <dgau...@arctic.org> | + | PHP 4.0 patches by Zeev Suraski <z...@zend.com> | +----------------------------------------------------------------------+ */ /* $Id$ */ Modified: php/php-src/trunk/sapi/apache_hooks/php_apache.c =================================================================== --- php/php-src/trunk/sapi/apache_hooks/php_apache.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/sapi/apache_hooks/php_apache.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -1906,13 +1906,14 @@ #if 0 +/* This function is most likely a bad idea. Just playing with it for now. +*/ PHP_FUNCTION(apache_exec_uri) { zval **filename; request_rec *rr=NULL; - TSRMLS_FETCH(); if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) { WRONG_PARAM_COUNT; Modified: php/php-src/trunk/sapi/phttpd/phttpd.c =================================================================== --- php/php-src/trunk/sapi/phttpd/phttpd.c 2010-04-13 09:56:11 UTC (rev 297954) +++ php/php-src/trunk/sapi/phttpd/phttpd.c 2010-04-13 11:02:15 UTC (rev 297955) @@ -71,7 +71,6 @@ { char *header_name, *header_content; char *p; - TSRMLS_FETCH(); http_sendheaders(PHG(cip)->fd, PHG(cip), SG(sapi_headers).http_response_code, NULL); @@ -97,8 +96,6 @@ static int php_phttpd_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) { - TSRMLS_FETCH(); - if (SG(sapi_headers).send_default_content_type) { fd_printf(PHG(cip)->fd,"Content-Type: text/html\n"); } @@ -115,7 +112,6 @@ /* int i; char *http_cookie = NULL; - NTSRMLS_FETCH(); i = Ns_SetIFind(NSG(conn->headers), "cookie"); if(i != -1) { @@ -135,7 +131,6 @@ /* uint max_read; uint total_read = 0; - NTSRMLS_FETCH(); max_read = MIN(NSG(data_avail), count_bytes); @@ -243,12 +238,11 @@ } -int php_doit(TSRMLS_D TSRMLS_DC) +int php_doit(TSRMLS_D) { struct stat sb; zend_file_handle file_handle; struct httpinfo *hip = PHG(cip)->hip; - TSRMLS_FETCH(); if (php_request_startup(TSRMLS_C) == FAILURE) { return -1;
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php