]> granicus.if.org Git - php/commitdiff
Remove a couple TSRMLS_FETCH() calls around ext/main/sapi
authorKalle Sommer Nielsen <kalle@php.net>
Tue, 13 Apr 2010 11:02:15 +0000 (11:02 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Tue, 13 Apr 2010 11:02:15 +0000 (11:02 +0000)
13 files changed:
ext/com_dotnet/com_persist.c
ext/com_dotnet/com_wrapper.c
ext/curl/interface.c
ext/ereg/ereg.c
ext/ereg/php_ereg.h
ext/oci8/oci8_statement.c
ext/openssl/openssl.c
ext/sybase_ct/php_sybase_ct.c
main/main.c
sapi/apache/php_apache.c
sapi/apache_hooks/mod_php5.c
sapi/apache_hooks/php_apache.c
sapi/phttpd/phttpd.c

index 9df476dc0478098102ba21ee47bc71b6c0dd3465..8a1cf50175edd47b8af7146ca2f97c484e3537ee 100755 (executable)
@@ -45,22 +45,16 @@ typedef struct {
 } 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 @@ static struct IStreamVtbl php_istream_vtbl = {
        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;
index 6e40afc048b719207947f6ae07e0affe740a00a3..0536e7b40d7d1d7c46455bdd5a2c98acd5d2f914 100644 (file)
@@ -52,12 +52,12 @@ typedef struct {
 
 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 @@ static inline void trace(char *fmt, ...)
 }
 /* }}} */
 
-#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 @@ static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
        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);
index dcfa865f1d9f0171b5f00b926b7e001a2660838b..81ceb84dcc12a82bd0881f290b2422af722118aa 100644 (file)
@@ -163,14 +163,12 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
 # 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 @@ PHP_FUNCTION(curl_init)
 #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 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
                        }
 #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;
                                }
index fbdd6b17147e2c3e5c9d4b833988b2656dee36cc..e1726cbeef44a196a02608c588060ceef4f9b4c0 100644 (file)
@@ -124,12 +124,11 @@ static int ereg_clean_cache(void *data, void *arg TSRMLS_DC)
 
 /* {{{ _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 @@ static void _free_ereg_cache(reg_cache *rc)
 #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_FUNCTION(eregi)
 
 /* {{{ 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 @@ static void php_do_ereg_replace(INTERNAL_FUNCTION_PARAMETERS, int icase)
        }
 
        /* 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 {
index b25001e0cdc1032a7b42bdc49d593ec8bc8b1998..ad7d5463383b8a35ea9b7cf86cfa12f3c2cfdaf7 100644 (file)
@@ -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);
index 2cbc2847733390b6de63ca57c91536f5cc6da78e..fa5d91559210f4ea9556af2f09f9354c9d231fbb 100644 (file)
@@ -336,9 +336,9 @@ php_oci_out_column *php_oci_statement_get_column(php_oci_statement *statement, l
 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 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
        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 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf
                case SQLT_BFILE: {
                                php_oci_descriptor *descr;
                                int dtype;
-                               TSRMLS_FETCH();
 
                                if (outcol->data_type == SQLT_BFILE) {
                                        dtype = OCI_DTYPE_FILE;
index b18108f7e18f456745adade9a2fc4f88be7a0d18..b11709aa480d09390a40a9b331252181d8fcb748 100644 (file)
@@ -852,12 +852,10 @@ static void php_openssl_dispose_config(struct php_x509_request * req TSRMLS_DC)
 }
 /* }}} */
 
-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 @@ static EVP_PKEY * php_openssl_generate_private_key(struct php_x509_request * req
        }
 
        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) {
index afc253791423e68d114e9dccfbbc531abc31e459..43014e60cf566dc16300cec0d43ae441d00e8aac 100644 (file)
@@ -1188,11 +1188,10 @@ static int php_sybase_finish_results(sybase_result *result TSRMLS_DC)
                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 @@ static int php_sybase_fetch_result_row (sybase_result *result, int numrows)
        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 @@ static sybase_result * php_sybase_fetch_result_set (sybase_link *sybase_ptr, int
        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 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
                        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 @@ static void php_sybase_query (INTERNAL_FUNCTION_PARAMETERS, int buffered)
                                        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 @@ PHP_FUNCTION(sybase_fetch_row)
 
        /* 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 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics)
 
        /* 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 @@ PHP_FUNCTION(sybase_data_seek)
 
        /* 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 @@ PHP_FUNCTION(sybase_result)
        
        /* 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) {
index 8015476b93ef94a1de5bc106a55c4b3d50af6095..9827c23d1f58ac5b0b224c3fe382e01c2194f4c2 100644 (file)
@@ -113,9 +113,9 @@ PHPAPI int core_globals_id;
 #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 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
 
 #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;
        }
index 8faa6f34f0ea31a998c8112ed764a48442d91a0c..20a51609355672f2aa7b20de0b6fc6338a3a2c93 100644 (file)
@@ -533,14 +533,14 @@ PHP_FUNCTION(apache_lookup_uri)
 
 
 #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;
index 7b6d18de9a96d8b3af7c6573d72e46a6a1458acb..33d20969bebade396446c9b2b3cc07e6f7d92886 100644 (file)
@@ -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                 |
-   | license@php.net so we can mail you a copy immediately.                          |
+   | obtain it through the world-wide-web, please send a note to         |
+   | license@php.net so we can mail you a copy immediately.              |
    +----------------------------------------------------------------------+
-   | Authors: Rasmus Lerdorf <rasmus@php.net>                                                    |
-   | (with helpful hints from Dean Gaudet <dgaudet@arctic.org>                   |
-   | PHP 4.0 patches by Zeev Suraski <zeev@zend.com>                                     |
+   | Authors: Rasmus Lerdorf <rasmus@php.net>                             |
+   | (with helpful hints from Dean Gaudet <dgaudet@arctic.org>           |
+   | PHP 4.0 patches by Zeev Suraski <zeev@zend.com>                     |
    +----------------------------------------------------------------------+
  */
 /* $Id$ */
index 3e0c9f0a35e4c18caebd764fff0e109dc83013b6..20425ba1513247aa71d85f958702572ceaa69cd5 100644 (file)
@@ -1906,13 +1906,14 @@ PHP_FUNCTION(apache_lookup_uri)
 
 
 #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;
index 11df607db728e4be2351df050a5da707ec4307d7..d0748ce54e12ddf298714fb01fe855b683fcb47d 100644 (file)
@@ -71,7 +71,6 @@ php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
 {
     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 @@ php_phttpd_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
 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 @@ php_phttpd_sapi_read_cookies(TSRMLS_D)
 /*
     int i;
     char *http_cookie = NULL;
-    NTSRMLS_FETCH();
  
     i = Ns_SetIFind(NSG(conn->headers), "cookie");
     if(i != -1) {
@@ -135,7 +131,6 @@ php_phttpd_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
 /*
     uint max_read;
     uint total_read = 0;
-    NTSRMLS_FETCH();
  
     max_read = MIN(NSG(data_avail), count_bytes);
  
@@ -243,12 +238,11 @@ php_phttpd_request_dtor(TSRMLS_D TSRMLS_DC)
 }
 
 
-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;