Permalink
Browse files

More TSRMLS_FETCH annihilation

  • Loading branch information...
zsuraski committed Jul 30, 2001
1 parent 11e5d2f commit 8ce8324e5907d9a08789b9a4bea3f1622057932a
View
@@ -466,7 +466,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
return SUCCESS;
}
-static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags)
+static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC)
{
char *spec_walk;
char buf[1024];
@@ -477,7 +477,6 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
void **p;
int arg_count;
int quiet = flags & ZEND_PARSE_PARAMS_QUIET;
- TSRMLS_FETCH();
for (spec_walk = type_spec; *spec_walk; spec_walk++) {
c = *spec_walk;
@@ -548,25 +547,25 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
return SUCCESS;
}
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...)
+ZEND_API int zend_parse_parameters_ex(int flags TSRMLS_DC, int num_args, char *type_spec, ...)
{
va_list va;
int retval;
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, flags);
+ retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
va_end(va);
return retval;
}
-ZEND_API int zend_parse_parameters(int num_args, char *type_spec, ...)
+ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)
{
va_list va;
int retval;
va_start(va, type_spec);
- retval = zend_parse_va_args(num_args, type_spec, &va, 0);
+ retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
va_end(va);
return retval;
View
@@ -117,8 +117,8 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
/* Parameter parsing API -- andrei */
#define ZEND_PARSE_PARAMS_QUIET 1<<1
-ZEND_API int zend_parse_parameters(int num_args, char *type_spec, ...);
-ZEND_API int zend_parse_parameters_ex(int flags, int num_args, char *type_spec, ...);
+ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...);
+ZEND_API int zend_parse_parameters_ex(int flags TSRMLS_DC, int num_args, char *type_spec, ...);
/* Parameter parsing API -- andrei */
@@ -1000,7 +1000,7 @@ ZEND_FUNCTION(get_resource_type)
RETURN_FALSE;
}
- resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type));
+ resource_type = zend_rsrc_list_get_rsrc_type(Z_LVAL_PP(z_resource_type) TSRMLS_CC);
if (resource_type) {
RETURN_STRING(resource_type, 1);
} else {
View
@@ -1080,7 +1080,7 @@ ZEND_API void execute(zend_op_array *op_array TSRMLS_DC)
binary_op_addr:
EG(binary_op)(&Ts[opline->result.u.var].tmp_var,
get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R),
- get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) );
+ get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) TSRMLS_CC);
FREE_OP(&opline->op1, EG(free_op1));
FREE_OP(&opline->op2, EG(free_op2));
NEXT_OPCODE();
@@ -1140,7 +1140,7 @@ binary_assign_op_addr: {
SEPARATE_ZVAL_IF_NOT_REF(var_ptr);
- EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
+ EG(binary_op)(*var_ptr, *var_ptr, get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) TSRMLS_CC);
Ts[opline->result.u.var].var.ptr_ptr = var_ptr;
SELECTIVE_PZVAL_LOCK(*var_ptr, &opline->result);
FREE_OP(&opline->op2, EG(free_op2));
@@ -1880,7 +1880,7 @@ binary_assign_op_addr: {
}
is_equal_function(&Ts[opline->result.u.var].tmp_var,
get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R),
- get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R));
+ get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) TSRMLS_CC);
FREE_OP(&opline->op2, EG(free_op2));
if (switch_expr_is_overloaded) {
View
@@ -381,7 +381,7 @@ int call_user_function_ex(HashTable *function_table, zval **object_pp, zval *fun
zend_op **original_opline_ptr;
int orig_free_op1, orig_free_op2;
int (*orig_unary_op)(zval *result, zval *op1);
- int (*orig_binary_op)(zval *result, zval *op1, zval *op2);
+ int (*orig_binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
zval function_name_copy;
TSRMLS_FETCH();
View
@@ -36,8 +36,6 @@
/*#undef ZTS*/
#ifdef ZTS
-#include "../TSRM/TSRM.h"
-
#ifdef __cplusplus
class ZendFlexLexer;
class ZendIniFlexLexer;
@@ -184,7 +182,7 @@ struct _zend_executor_globals {
zend_ptr_stack argument_stack;
int free_op1, free_op2;
int (*unary_op)(zval *result, zval *op1);
- int (*binary_op)(zval *result, zval *op1, zval *op2);
+ int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);
zval *garbage[2];
int garbage_ptr;
View
@@ -1143,7 +1143,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
}
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered)
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
{
Bucket *p1, *p2;
int result;
View
@@ -171,7 +171,7 @@ ZEND_API void zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_fun
ZEND_API void zend_hash_merge(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, int overwrite);
ZEND_API void zend_hash_merge_ex(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, uint size, zend_bool (*pReplaceOrig)(void *orig, void *p_new));
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func, compare_func_t compare_func, int renumber);
-ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered);
+ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC);
ZEND_API int zend_hash_minmax(HashTable *ht, int (*compar)(const void *, const void *), int flag, void **pData);
ZEND_API int zend_hash_num_elements(HashTable *ht);
View
@@ -40,8 +40,8 @@ typedef struct _zend_syntax_highlighter_ini {
BEGIN_EXTERN_C()
ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini);
-ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini);
-ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name);
+ZEND_API int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC);
+ZEND_API int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC);
ZEND_API void zend_html_putc(char c);
ZEND_API void zend_html_puts(char *s, uint len);
END_EXTERN_C()
View
@@ -128,7 +128,7 @@ static void ini_error(char *str)
error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
error_buf = (char *) emalloc(error_buf_len);
- sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno());
+ sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, zend_ini_scanner_get_lineno(TSRMLS_C));
if (CG(ini_parser_unbuffered_errors)) {
#ifdef PHP_WIN32
View
@@ -14,7 +14,7 @@ class ZendIniFlexLexer : public yyFlexLexer
#endif /* ZTS && __cplusplus */
BEGIN_EXTERN_C()
-int zend_ini_scanner_get_lineno(void);
+int zend_ini_scanner_get_lineno(TSRMLS_D);
char *zend_ini_scanner_get_filename(void);
int zend_ini_open_file_for_scanning(zend_file_handle *fh);
void zend_ini_close_file(zend_file_handle *fh);
View
@@ -70,10 +70,8 @@ char *zend_ini_scanner_get_filename()
#else /* ZTS */
-int zend_ini_scanner_get_lineno()
+int zend_ini_scanner_get_lineno(TSRMLS_D)
{
- TSRMLS_FETCH();
-
return CG(ini_scanner)->lineno();
}
@@ -139,7 +139,7 @@ start:
;
top_statement_list:
- top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { TSRMLS_FETCH(); HANDLE_INTERACTIVE(); }
+ top_statement_list { zend_do_extended_info(TSRMLS_C); } top_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
@@ -151,7 +151,7 @@ top_statement:
inner_statement_list:
- inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { TSRMLS_FETCH(); HANDLE_INTERACTIVE(); }
+ inner_statement_list { zend_do_extended_info(TSRMLS_C); } inner_statement { HANDLE_INTERACTIVE(); }
| /* empty */
;
@@ -530,7 +530,7 @@ static_scalar: /* compile-time evaluated scalars */
common_scalar { $$ = $1; }
| T_STRING { zend_do_fetch_constant(&$$, &$1, ZEND_CT TSRMLS_CC); }
| '+' static_scalar { $$ = $1; }
- | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one); $$ = $2; }
+ | '-' static_scalar { zval minus_one; minus_one.type = IS_LONG; minus_one.value.lval = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; $$.u.constant.type = IS_CONSTANT_ARRAY; }
;
@@ -502,11 +502,10 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
BEGIN_EXTERN_C()
-int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini)
+int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlighter_ini TSRMLS_DC)
{
zend_lex_state original_lex_state;
zend_file_handle file_handle;
- TSRMLS_FETCH();
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = filename;
@@ -523,14 +522,13 @@ int highlight_file(char *filename, zend_syntax_highlighter_ini *syntax_highlight
return SUCCESS;
}
-int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name)
+int highlight_string(zval *str, zend_syntax_highlighter_ini *syntax_highlighter_ini, char *str_name TSRMLS_DC)
{
zend_lex_state original_lex_state;
zval tmp = *str;
#ifdef ZTS
istrstream *input_stream;
#endif
- TSRMLS_FETCH();
str = &tmp;
zval_copy_ctor(str);
View
@@ -46,10 +46,9 @@ ZEND_API int zend_list_insert(void *ptr, int type)
return index;
}
-ZEND_API int zend_list_delete(int id)
+ZEND_API int _zend_list_delete(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
- TSRMLS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */
@@ -64,10 +63,9 @@ ZEND_API int zend_list_delete(int id)
}
-ZEND_API void *zend_list_find(int id, int *type)
+ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
{
zend_rsrc_list_entry *le;
- TSRMLS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
*type = le->type;
@@ -79,10 +77,9 @@ ZEND_API void *zend_list_find(int id, int *type)
}
-ZEND_API int zend_list_addref(int id)
+ZEND_API int _zend_list_addref(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
- TSRMLS_FETCH();
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */
@@ -109,7 +106,7 @@ ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int r
}
-ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...)
+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, ...)
{
int id;
int actual_resource_type;
@@ -378,7 +375,7 @@ void zend_destroy_rsrc_list_dtors(void)
}
-char *zend_rsrc_list_get_rsrc_type(int resource)
+char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC)
{
zend_rsrc_list_dtors_entry *lde;
int rsrc_type;
View
@@ -74,14 +74,18 @@ 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_addref(int id);
-ZEND_API int zend_list_delete(int id);
-ZEND_API void *zend_list_find(int id, int *type);
+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);
+
+#define zend_list_addref(id) _zend_list_addref(id TSRMLS_CC)
+#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 void *zend_fetch_resource(zval **passed_id, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
+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);
+ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
ZEND_API int zend_fetch_list_dtor_id(char *type_name);
extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
@@ -92,11 +96,11 @@ extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
}
#define ZEND_FETCH_RESOURCE(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type) \
- rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 1, resource_type); \
+ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1,resource_type2) \
- rsrc = (rsrc_type) zend_fetch_resource(passed_id, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
+ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \
ZEND_VERIFY_RESOURCE(rsrc);
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
Oops, something went wrong.

0 comments on commit 8ce8324

Please sign in to comment.