diff options
author | Xinchen Hui <laruence@gmail.com> | 2014-04-22 11:59:53 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2014-04-22 11:59:53 +0800 |
commit | 89d89b95861c4366f93e705546c0ca8c4443a425 (patch) | |
tree | d59aaef97b53a61bc7c10de368dad7adcc34fef7 /ext/spl/spl_array.c | |
parent | e48b9ad197b4ec6ac72e75538453cc350d0a41f4 (diff) | |
parent | fa588a5c82c0264dc10862495c993a914a421667 (diff) | |
download | php-git-89d89b95861c4366f93e705546c0ca8c4443a425.tar.gz |
Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
Diffstat (limited to 'ext/spl/spl_array.c')
-rw-r--r-- | ext/spl/spl_array.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 208f9de7a6..eafc280f0e 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -129,7 +129,7 @@ SPL_API int spl_hash_verify_pos_ex(spl_array_object * intern, HashTable * ht TSR /* IS_CONSISTENT(ht);*/ /* HASH_PROTECT_RECURSION(ht);*/ - if (ht->flags & HASH_FLAG_PACKED) { + if (ht->u.flags & HASH_FLAG_PACKED) { if (intern->pos_h == intern->pos && Z_TYPE(ht->arData[intern->pos_h].val) != IS_UNDEF) { return SUCCESS; } @@ -309,7 +309,7 @@ static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval return &EG(uninitialized_zval); } - if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->nApplyCount > 0)) { + if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->u.v.nApplyCount > 0)) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return &EG(error_zval);; } @@ -464,7 +464,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval if (!offset) { ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (ht->nApplyCount > 0) { + if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } @@ -481,7 +481,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval switch (Z_TYPE_P(offset)) { case IS_STRING: ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (ht->nApplyCount > 0) { + if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } @@ -492,7 +492,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval case IS_BOOL: case IS_LONG: ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (ht->nApplyCount > 0) { + if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } @@ -505,7 +505,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval return; case IS_NULL: ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (ht->nApplyCount > 0) { + if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } @@ -538,7 +538,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval switch(Z_TYPE_P(offset)) { case IS_STRING: ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (ht->nApplyCount > 0) { + if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } @@ -583,7 +583,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval index = Z_LVAL_P(offset); } ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC); - if (ht->nApplyCount > 0) { + if (ht->u.v.nApplyCount > 0) { zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited"); return; } @@ -827,7 +827,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /* ZEND_INIT_SYMTABLE_EX(intern->debug_info, zend_hash_num_elements(intern->std.properties) + 1, 0); } - if (intern->debug_info->nApplyCount == 0) { + if (intern->debug_info->u.v.nApplyCount == 0) { zend_hash_clean(intern->debug_info); zend_hash_copy(intern->debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref); @@ -1446,27 +1446,27 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam *Z_ARRVAL(tmp) = *aht; if (!use_arg) { - aht->nApplyCount++; + aht->u.v.nApplyCount++; zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 1, &tmp, NULL TSRMLS_CC); - aht->nApplyCount--; + aht->u.v.nApplyCount--; } else if (use_arg == SPL_ARRAY_METHOD_MAY_USER_ARG) { if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|z", &arg) == FAILURE) { zval_ptr_dtor(&tmp); zend_throw_exception(spl_ce_BadMethodCallException, "Function expects one argument at most", 0 TSRMLS_CC); return; } - aht->nApplyCount++; + aht->u.v.nApplyCount++; zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, arg? 2 : 1, &tmp, arg TSRMLS_CC); - aht->nApplyCount--; + aht->u.v.nApplyCount--; } else { if (ZEND_NUM_ARGS() != 1 || zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg) == FAILURE) { zval_ptr_dtor(&tmp); zend_throw_exception(spl_ce_BadMethodCallException, "Function expects exactly one argument", 0 TSRMLS_CC); return; } - aht->nApplyCount++; + aht->u.v.nApplyCount++; zend_call_method(NULL, NULL, NULL, fname, fname_len, &retval, 2, &tmp, arg TSRMLS_CC); - aht->nApplyCount--; + aht->u.v.nApplyCount--; } /* A tricky way to pass "aht" by reference, copy back and cleanup */ if (Z_ISREF(tmp) && Z_TYPE_P(Z_REFVAL(tmp))) { |