Fixed apply_func_arg_t, and it's better not using cast (compiler friendly)

This commit is contained in:
Xinchen Hui 2014-05-25 19:56:51 +08:00
parent c2082ece52
commit 0175d994c0
6 changed files with 26 additions and 20 deletions

View file

@ -1541,9 +1541,10 @@ typedef struct _zend_abstract_info {
int ctor;
} zend_abstract_info;
static int zend_verify_abstract_class_function(zval *zv, zend_abstract_info *ai TSRMLS_DC) /* {{{ */
static int zend_verify_abstract_class_function(zval *zv, void *arg TSRMLS_DC) /* {{{ */
{
zend_function *fn = Z_PTR_P(zv);
zend_function *fn = (zend_function *)Z_PTR_P(zv);
zend_abstract_info *ai = (zend_abstract_info *)arg;
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
if (ai->cnt < MAX_ABSTRACT_INFO_CNT) {
@ -1571,7 +1572,7 @@ void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC) /* {{{ */
if ((ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) && !(ce->ce_flags & ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
memset(&ai, 0, sizeof(ai));
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t) zend_verify_abstract_class_function, &ai TSRMLS_CC);
zend_hash_apply_with_argument(&ce->function_table, zend_verify_abstract_class_function, &ai TSRMLS_CC);
if (ai.cnt) {
zend_error(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",