Changeset 1112 in svn for trunk/xcache/xc_utils.c


Ignore:
Timestamp:
2012-08-01T17:55:06Z (3 years ago)
Author:
Xuefer
Message:

refactor: more strict standard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache/xc_utils.c

    r1017 r1112  
    5151/* }}} */
    5252
    53 static int xc_apply_function(zend_function *zf, apply_func_t applyer TSRMLS_DC) /* {{{ */
     53typedef struct {
     54    apply_func_t applyer;
     55} xc_apply_func_info;
     56static int xc_apply_function(zend_function *zf, xc_apply_func_info *fi TSRMLS_DC) /* {{{ */
    5457{
    5558    switch (zf->type) {
    5659    case ZEND_USER_FUNCTION:
    5760    case ZEND_EVAL_CODE:
    58         return applyer(&zf->op_array TSRMLS_CC);
     61        return fi->applyer(&zf->op_array TSRMLS_CC);
    5962        break;
    6063
     
    6972/* }}} */
    7073typedef struct {
    71     apply_func_t applyer;
     74    xc_apply_func_info fi;
    7275    zend_class_entry *ce;
    7376} xc_apply_method_info;
     
    9497    }
    9598#endif
    96     return xc_apply_function(zf, mi->applyer TSRMLS_CC);
    97 }
    98 /* }}} */
    99 static int xc_apply_cest(xc_cest_t *cest, apply_func_t applyer TSRMLS_DC) /* {{{ */
     99    return xc_apply_function(zf, &mi->fi TSRMLS_CC);
     100}
     101/* }}} */
     102static int xc_apply_cest(xc_cest_t *cest, xc_apply_func_info *fi TSRMLS_DC) /* {{{ */
    100103{
    101104    xc_apply_method_info mi;
    102105
    103     mi.applyer = applyer;
    104     mi.ce      = CestToCePtr(*cest);
     106    mi.fi = *fi;
     107    mi.ce = CestToCePtr(*cest);
    105108    zend_hash_apply_with_argument(&(CestToCePtr(*cest)->function_table), (apply_func_arg_t) xc_apply_method, &mi TSRMLS_CC);
    106109    return 0;
     
    109112int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC) /* {{{ */
    110113{
    111     zend_hash_apply_with_argument(cr->function_table, (apply_func_arg_t) xc_apply_function, (void *) applyer TSRMLS_CC);
    112     zend_hash_apply_with_argument(cr->class_table, (apply_func_arg_t) xc_apply_cest, (void *) applyer TSRMLS_CC);
     114    xc_apply_func_info fi;
     115    fi.applyer = applyer;
     116    zend_hash_apply_with_argument(cr->function_table, (apply_func_arg_t) xc_apply_function, &fi TSRMLS_CC);
     117    zend_hash_apply_with_argument(cr->class_table, (apply_func_arg_t) xc_apply_cest, &fi TSRMLS_CC);
    113118
    114119    return applyer(cr->op_array TSRMLS_CC);
Note: See TracChangeset for help on using the changeset viewer.