Permalink
Browse files

- MFH: Added TSRMLS_DC to apply_func_args_t and zend_hash_apply_with_…

…arguments.
  • Loading branch information...
felipensp committed Jul 24, 2008
1 parent ae8a21a commit 0fbe6a0c14a7f8bc664484c33615d48a213ab662
View
@@ -933,7 +933,7 @@ ZEND_API int _array_init(zval *arg, uint size ZEND_FILE_LINE_DC) /* {{{ */
}
/* }}} */
-static int zend_merge_property(zval **value, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int zend_merge_property(zval **value TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
/* which name should a numeric property have ? */
if (hash_key->nKeyLength) {
@@ -959,7 +959,7 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro
zend_class_entry *old_scope = EG(scope);
EG(scope) = Z_OBJCE_P(obj);
- zend_hash_apply_with_arguments(properties, (apply_func_args_t)zend_merge_property, 2, obj, obj_ht);
+ zend_hash_apply_with_arguments(properties TSRMLS_CC, (apply_func_args_t)zend_merge_property, 2, obj, obj_ht);
EG(scope) = old_scope;
if (destroy_ht) {
@@ -1628,7 +1628,7 @@ ZEND_FUNCTION(restore_exception_handler)
/* }}} */
-static int copy_class_or_interface_name(zend_class_entry **pce, int num_args, va_list args, zend_hash_key *hash_key)
+static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *array = va_arg(args, zval *);
zend_uint mask = va_arg(args, zend_uint);
@@ -1656,7 +1656,7 @@ ZEND_FUNCTION(get_declared_classes)
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) copy_class_or_interface_name, 3, return_value, mask, comply);
+ zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) copy_class_or_interface_name, 3, return_value, mask, comply);
}
/* }}} */
@@ -1672,12 +1672,12 @@ ZEND_FUNCTION(get_declared_interfaces)
}
array_init(return_value);
- zend_hash_apply_with_arguments(EG(class_table), (apply_func_args_t) copy_class_or_interface_name, 3, return_value, mask, comply);
+ zend_hash_apply_with_arguments(EG(class_table) TSRMLS_CC, (apply_func_args_t) copy_class_or_interface_name, 3, return_value, mask, comply);
}
/* }}} */
-static int copy_function_name(zend_function *func, int num_args, va_list args, zend_hash_key *hash_key)
+static int copy_function_name(zend_function *func TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
zval *internal_ar = va_arg(args, zval *),
*user_ar = va_arg(args, zval *);
@@ -1714,7 +1714,7 @@ ZEND_FUNCTION(get_defined_functions)
array_init(user);
array_init(return_value);
- zend_hash_apply_with_arguments(EG(function_table), (apply_func_args_t) copy_function_name, 2, internal, user);
+ zend_hash_apply_with_arguments(EG(function_table) TSRMLS_CC, (apply_func_args_t) copy_function_name, 2, internal, user);
if (zend_hash_add(Z_ARRVAL_P(return_value), "internal", sizeof("internal"), (void **)&internal, sizeof(zval *), NULL) == FAILURE) {
zval_ptr_dtor(&internal);
View
@@ -243,13 +243,12 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */
}
/* }}} */
-static int zval_copy_static_var(zval **p, int num_args, va_list args, zend_hash_key *key) /* {{{ */
+static int zval_copy_static_var(zval **p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
{
HashTable *target = va_arg(args, HashTable*);
zend_bool is_ref;
if (Z_TYPE_PP(p) & (IS_LEXICAL_VAR|IS_LEXICAL_REF)) {
- TSRMLS_FETCH();
is_ref = Z_TYPE_PP(p) & IS_LEXICAL_REF;
if (!EG(active_symbol_table)) {
@@ -297,7 +296,7 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
ALLOC_HASHTABLE(closure->func.op_array.static_variables);
zend_hash_init(closure->func.op_array.static_variables, zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_apply_with_arguments(static_variables, (apply_func_args_t)zval_copy_static_var, 1, closure->func.op_array.static_variables);
+ zend_hash_apply_with_arguments(static_variables TSRMLS_CC, (apply_func_args_t)zval_copy_static_var, 1, closure->func.op_array.static_variables);
}
(*closure->func.op_array.refcount)++;
}
View
@@ -2780,7 +2780,7 @@ ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, zend_class_entry
}
}
-static int inherit_static_prop(zval **p, int num_args, va_list args, zend_hash_key *key)
+static int inherit_static_prop(zval **p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key)
{
HashTable *target = va_arg(args, HashTable*);
@@ -2812,9 +2812,9 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
if (parent_ce->type != ce->type) {
/* User class extends internal class */
zend_update_class_constants(parent_ce TSRMLS_CC);
- zend_hash_apply_with_arguments(CE_STATIC_MEMBERS(parent_ce), (apply_func_args_t)inherit_static_prop, 1, &ce->default_static_members);
+ zend_hash_apply_with_arguments(CE_STATIC_MEMBERS(parent_ce) TSRMLS_CC, (apply_func_args_t)inherit_static_prop, 1, &ce->default_static_members);
} else {
- zend_hash_apply_with_arguments(&parent_ce->default_static_members, (apply_func_args_t)inherit_static_prop, 1, &ce->default_static_members TSRMLS_CC);
+ zend_hash_apply_with_arguments(&parent_ce->default_static_members TSRMLS_CC, (apply_func_args_t)inherit_static_prop, 1, &ce->default_static_members TSRMLS_CC);
}
zend_hash_merge_ex(&ce->properties_info, &parent_ce->properties_info, (copy_ctor_func_t) (ce->type & ZEND_INTERNAL_CLASS ? zend_duplicate_property_info_internal : zend_duplicate_property_info), sizeof(zend_property_info), (merge_checker_func_t) do_inherit_property_access_check, ce);
View
@@ -312,7 +312,7 @@ ZEND_METHOD(error_exception, getSeverity)
/* }}} */
-static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char **str;
int *len;
@@ -372,7 +372,6 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
double dval = Z_DVAL_PP(arg);
char *s_tmp;
int l_tmp;
- TSRMLS_FETCH();
s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
@@ -389,7 +388,6 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
char *class_name;
zend_uint class_name_len;
int dup;
- TSRMLS_FETCH();
TRACE_APPEND_STR("Object(");
@@ -410,7 +408,7 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
}
/* }}} */
-static int _build_trace_string(zval **frame, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int _build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char *s_tmp, **str;
int *len, *num;
@@ -445,7 +443,7 @@ static int _build_trace_string(zval **frame, int num_args, va_list args, zend_ha
TRACE_APPEND_CHR('(');
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
int last_len = *len;
- zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)_build_trace_args, 2, str, len);
+ zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)_build_trace_args, 2, str, len);
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
}
@@ -464,7 +462,7 @@ ZEND_METHOD(exception, getTraceAsString)
int res_len = 0, *len = &res_len, num = 0;
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)_build_trace_string, 3, str, len, &num);
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
sprintf(s_tmp, "#%d {main}", num);
View
@@ -709,7 +709,7 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
}
-ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int num_args, ...)
+ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int num_args, ...)
{
Bucket *p;
va_list args;
@@ -726,7 +726,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t ap
hash_key.arKey = p->arKey;
hash_key.nKeyLength = p->nKeyLength;
hash_key.h = p->h;
- result = apply_func(p->pData, num_args, args, &hash_key);
+ result = apply_func(p->pData TSRMLS_CC, num_args, args, &hash_key);
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
View
@@ -127,13 +127,13 @@ ZEND_API int zend_hash_add_empty_element(HashTable *ht, const char *arKey, uint
typedef int (*apply_func_t)(void *pDest TSRMLS_DC);
typedef int (*apply_func_arg_t)(void *pDest, void *argument TSRMLS_DC);
-typedef int (*apply_func_args_t)(void *pDest, int num_args, va_list args, zend_hash_key *hash_key);
+typedef int (*apply_func_args_t)(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key);
ZEND_API void zend_hash_graceful_destroy(HashTable *ht);
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht);
ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC);
ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC);
-ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...);
+ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int, ...);
/* This function should be used with special care (in other words,
* it should usually not be used). When used with the ZEND_HASH_APPLY_STOP
View
@@ -169,13 +169,13 @@ ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t
end_write(ht);
}
-ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int num_args, ...)
+ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int num_args, ...)
{
va_list args;
va_start(args, num_args);
begin_write(ht);
- zend_hash_apply_with_arguments(TS_HASH(ht), apply_func, num_args, args);
+ zend_hash_apply_with_arguments(TS_HASH(ht) TSRMLS_CC, apply_func, num_args, args);
end_write(ht);
va_end(args);
}
View
@@ -72,7 +72,7 @@ ZEND_API int zend_ts_hash_add_empty_element(TsHashTable *ht, char *arKey, uint n
ZEND_API void zend_ts_hash_graceful_destroy(TsHashTable *ht);
ZEND_API void zend_ts_hash_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC);
ZEND_API void zend_ts_hash_apply_with_argument(TsHashTable *ht, apply_func_arg_t apply_func, void * TSRMLS_DC);
-ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht, apply_func_args_t apply_func, int, ...);
+ZEND_API void zend_ts_hash_apply_with_arguments(TsHashTable *ht TSRMLS_DC, apply_func_args_t apply_func, int, ...);
ZEND_API void zend_ts_hash_reverse_apply(TsHashTable *ht, apply_func_t apply_func TSRMLS_DC);
@@ -1002,7 +1002,7 @@ void _mysqlnd_free(void *ptr MYSQLND_MEM_D)
/* }}} */
/* {{{ mysqlnd_build_trace_args */
-static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend_hash_key *hash_key)
+static int mysqlnd_build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
char **str;
int *len;
@@ -1042,7 +1042,6 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
}
case IS_UNICODE: {
int l_added;
- TSRMLS_FETCH();
/*
* We do not want to apply current error mode here, since
@@ -1095,7 +1094,6 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
double dval = Z_DVAL_PP(arg);
char *s_tmp;
int l_tmp;
- TSRMLS_FETCH();
s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
@@ -1112,7 +1110,6 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
zstr class_name;
zend_uint class_name_len;
int dup;
- TSRMLS_FETCH();
TRACE_APPEND_STR("Object(");
@@ -1143,7 +1140,7 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
/* }}} */
-static int mysqlnd_build_trace_string(zval **frame, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int mysqlnd_build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char *s_tmp, **str;
int *len, *num;
@@ -1179,7 +1176,7 @@ static int mysqlnd_build_trace_string(zval **frame, int num_args, va_list args,
TRACE_APPEND_CHR('(');
if (zend_ascii_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
int last_len = *len;
- zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)mysqlnd_build_trace_args, 2, str, len);
+ zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)mysqlnd_build_trace_args, 2, str, len);
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
}
@@ -1217,7 +1214,7 @@ static int mysqlnd_build_trace_string(zval **frame, int num_args, va_list args,
/* }}} */
-static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int mysqlnd_build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char **str;
int *len;
@@ -1277,7 +1274,6 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
double dval = Z_DVAL_PP(arg);
char *s_tmp;
int l_tmp;
- TSRMLS_FETCH();
s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
@@ -1294,7 +1290,6 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
char *class_name;
zend_uint class_name_len;
int dup;
- TSRMLS_FETCH();
TRACE_APPEND_STR("Object(");
@@ -1315,7 +1310,7 @@ static int mysqlnd_build_trace_args(zval **arg, int num_args, va_list args, zend
}
/* }}} */
-static int mysqlnd_build_trace_string(zval **frame, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
+static int mysqlnd_build_trace_string(zval **frame TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
{
char *s_tmp, **str;
int *len, *num;
@@ -1350,7 +1345,7 @@ static int mysqlnd_build_trace_string(zval **frame, int num_args, va_list args,
TRACE_APPEND_CHR('(');
if (zend_hash_find(ht, "args", sizeof("args"), (void**)&tmp) == SUCCESS) {
int last_len = *len;
- zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp), (apply_func_args_t)mysqlnd_build_trace_args, 2, str, len);
+ zend_hash_apply_with_arguments(Z_ARRVAL_PP(tmp) TSRMLS_CC, (apply_func_args_t)mysqlnd_build_trace_args, 2, str, len);
if (last_len != *len) {
*len -= 2; /* remove last ', ' */
}
@@ -1371,7 +1366,7 @@ char * mysqlnd_get_backtrace(TSRMLS_D)
MAKE_STD_ZVAL(trace);
zend_fetch_debug_backtrace(trace, 0, 0 TSRMLS_CC);
- zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)mysqlnd_build_trace_string, 3, str, len, &num);
+ zend_hash_apply_with_arguments(Z_ARRVAL_P(trace) TSRMLS_CC, (apply_func_args_t)mysqlnd_build_trace_string, 3, str, len, &num);
zval_ptr_dtor(&trace);
s_tmp = emalloc(1 + MAX_LENGTH_OF_LONG + 7 + 1);
Oops, something went wrong.

0 comments on commit 0fbe6a0

Please sign in to comment.