Changeset 1112


Ignore:
Timestamp:
2012-08-01T19:55:06+02:00 (21 months ago)
Author:
moo
Message:

refactor: more strict standard

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/devel/run

    r1103 r1112  
    1010    if [[ $# -gt 0 ]]; then 
    1111        args=("$@") 
     12    elif [[ $type = "make" ]]; then 
     13        args=() 
    1214    fi 
    1315fi 
     
    142144    phpize --clean \ 
    143145    && phpize \ 
    144     && CFLAGS="-g -O0 -Wall -Wno-unused -W -Wshadow -Werror=implicit-function-declaration -std=c89 -D_GNU_SOURCE -D_POSIX_SOURCE -Dinline=" ./configure \ 
     146    && CFLAGS="-g -O0 -pedantic-errors -Wno-variadic-macros -Wno-long-long -Wall -Wno-unused -W -Wshadow -Werror=implicit-function-declaration -std=c89 -D_GNU_SOURCE -D_POSIX_SOURCE -Dinline=" ./configure \ 
    145147        --enable-xcache-cacher \ 
    146148        --enable-xcache-optimizer \ 
  • trunk/mod_decoder/xc_decoder.c

    r1003 r1112  
     1static char dummy = 1; 
  • trunk/mod_encoder/xc_encoder.c

    r1003 r1112  
     1static char dummy = 1; 
  • trunk/mod_optimizer/xc_optimizer.c

    r1047 r1112  
    141141/* {{{ op_flowinfo helper func */ 
    142142enum { 
    143     XC_OPNUM_INVALID = -1, 
     143    XC_OPNUM_INVALID = -1 
    144144}; 
    145145typedef struct { 
  • trunk/processor/struct.m4

    r1049 r1112  
    4747            int xc_autocheck_assert_size = SIZEOF_$1, assert_count = COUNTOF_$1; 
    4848            int xc_autocheck_done_size = 0, xc_autocheck_done_count = 0; 
    49             const char *xc_autocheck_assert_names[] = { ifdef(`ELEMENTSOF_$1', `ELEMENTSOF_$1') }; 
     49            ifdef(`ELEMENTSOF_$1', ` 
     50                const char *xc_autocheck_assert_names[] = { ELEMENTSOF_$1 }; 
     51                size_t xc_autocheck_assert_names_count = sizeof(xc_autocheck_assert_names) / sizeof(xc_autocheck_assert_names[0]); 
     52            ', ` 
     53                const char **xc_autocheck_assert_names = NULL; 
     54                size_t xc_autocheck_assert_names_count = 0; 
     55            ') 
    5056            zend_bool xc_autocheck_skip = 0; 
    5157            HashTable xc_autocheck_done_names; 
     
    7581        /* {{{ autocheck */ 
    7682        if (!xc_autocheck_skip) { 
    77             int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", xc_autocheck_assert_names, sizeof(xc_autocheck_assert_names) / sizeof(xc_autocheck_assert_names[0]), &xc_autocheck_done_names); 
     83            int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", xc_autocheck_assert_names, xc_autocheck_assert_names_count, &xc_autocheck_done_names); 
    7884 
    7985            if (xc_autocheck_done_count != assert_count) { 
  • 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.