Changeset 860 in svn for trunk/processor


Ignore:
Timestamp:
2012-03-29T02:54:33Z (7 years ago)
Author:
Xuefer
Message:

kill warnings

Location:
trunk/processor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r856 r860  
    354354
    355355        for (i = 0; i < assert_names_count; ++i) {
    356             if (!zend_hash_exists(done_names, assert_names[i], strlen(assert_names[i]) + 1)) {
     356            if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], strlen(assert_names[i]) + 1)) {
    357357                fprintf(stderr
    358358                    , "missing field at %s `#'%d %s`' : %s\n"
  • trunk/processor/main.m4

    r856 r860  
    2525define(`INDENT', `xc_dprint_indent(indent);')
    2626dnl }}}
    27 dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:forcetype=$2)
     27dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:realtype=$2)
    2828define(`ALLOC', `
    2929    pushdef(`COUNT', `ifelse(`$3', `', `1', `$3')')
    3030    pushdef(`SIZE', `sizeof($2)ifelse(`$3', `', `', ` * $3')')
    31     pushdef(`FORCETYPE', `ifelse(`$5', , `$2', `$5')')
     31    pushdef(`REALTYPE', `ifelse(`$5', , `$2', `$5')')
    3232    /* allocate */
    3333    IFCALC(`
     
    5656            void *oldp = processor->p;
    5757        ')
    58         $1 = (FORCETYPE *) (processor->p = (char *) ALIGN(processor->p));
     58        $1 = (REALTYPE *) (processor->p = (char *) ALIGN(processor->p));
    5959        ifelse(`$4', `', `
    6060                IFASSERT(`memsetptr($1, (void *) (unsigned long) __LINE__, SIZE);')
     
    7272    IFRESTORE(`ifelse(`$4', `', `
    7373            ifelse(
    74                 FORCETYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);',
    75                 FORCETYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);',
    76                 `', `', `$1 = (FORCETYPE *) emalloc(SIZE);')
     74                REALTYPE*COUNT, `zval*1', `ALLOC_ZVAL($1);',
     75                REALTYPE*COUNT, `HashTable*1', `ALLOC_HASHTABLE($1);',
     76                `', `', `$1 = (REALTYPE *) emalloc(SIZE);')
    7777            IFASSERT(`memsetptr($1, (void *) __LINE__, SIZE);')
    7878        ', `
    79             $1 = (FORCETYPE *) ecalloc(COUNT, sizeof($2));
    80         ')
    81     ')
     79            $1 = (REALTYPE *) ecalloc(COUNT, sizeof($2));
     80        ')
     81    ')
     82    popdef(`REALTYPE')
    8283    popdef(`COUNT')
    8384    popdef(`SIZE')
    8485')
    85 dnl CALLOC(1:dst, 2:type [, 3:count=1, 4:forcetype=$2 ])
     86dnl CALLOC(1:dst, 2:type [, 3:count=1, 4:realtype=$2 ])
    8687define(`CALLOC', `ALLOC(`$1', `$2', `$3', `1', `$4')')
    8788dnl }}}
     
    9697        IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);')
    9798#else
    98         IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, $2->name_length, 1);')
     99        IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), (char *) $2->name, $2->name_length, 1);')
    99100#endif
    100101    }
     
    212213    define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"')
    213214    IFASSERT(`dnl
    214         if (zend_hash_exists(&done_names, "$1", sizeof("$1"))) {
     215        if (zend_u_hash_exists(&done_names, IS_STRING, "$1", sizeof("$1"))) {
    215216            fprintf(stderr
    216217                , "duplicate field at %s `#'%d FUNC_NAME`' : %s\n"
  • trunk/processor/process.m4

    r844 r860  
    1515dnl }}}
    1616define(`PROCESS_xc_ztstring', `dnl {{{ (1:elm)
     17    pushdef(`REALPTRTYPE', `zend_class_entry')
    1718    PROC_STRING(`$1')
     19    popdef(`REALPTRTYPE')
    1820')
    1921dnl }}}
     
    7476    )
    7577')
    76 define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4:force_type])
     78define(`PROCESS_ARRAY', `dnl {{{ (1:count, 2:type, 3:elm, [4:real_type])
    7779    if (src->$3) {
    7880        int LOOPCOUNTER;
     
    8789                    ++LOOPCOUNTER) {
    8890                pushdef(`dst', `arr')
    89                 pushdef(`SRC', defn(`SRC') `[LOOPCOUNTER]')
     91                pushdef(`SRC', `ifelse(`$4', `', `', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]')
    9092                popdef(`add_assoc_bool_ex', `add_next_index_bool($1, $3)')
    9193                popdef(`add_assoc_string_ex', `add_next_index_string($1, $3)')
     
    125127                DISABLECHECK(`
    126128                    pushdef(`DST', defn(`DST') `[LOOPCOUNTER]')
    127                     pushdef(`SRC', ((const char **) defn(`SRC'))`[LOOPCOUNTER]')
     129                    pushdef(`SRC', `ifelse(`$4', `', `', `', `', `($2)')' defn(`SRC') `[LOOPCOUNTER]')
    128130                    PROCESS(`$2', `$3')
    129131                    popdef(`SRC')
  • trunk/processor/string.m4

    r844 r860  
    6060        ')
    6161        IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE);')
    62         IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));')
     62        IFSTORE(`DSTPTR = ifdef(`REALPTRTYPE', `(REALPTRTYPE() *)') ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE));')
    6363        IFRESTORE(`
    64             DSTPTR = STRDUP() (SRCPTR, ($3) - 1);
     64            DSTPTR = ifdef(`REALPTRTYPE', `(REALPTRTYPE() *)') STRDUP() (SRCPTR, ($3) - 1);
    6565        ')
    66         FIXPOINTER_EX(`PTRTYPE', DSTPTR)
     66        FIXPOINTER_EX(ifdef(`REALPTRTYPE', `REALPTRTYPE()', `PTRTYPE'), DSTPTR)
    6767        IFDASM(`
    6868            ifelse(STRTYPE,zstr_uchar, `
     
    7070                ', ` dnl else
    7171                ifelse(STRTYPE,zstr_char, `
    72                     add_assoc_stringl_ex(dst, ZEND_STRS("$4"), ZSTR_S($2), $3-1, 1);
     72                    add_assoc_stringl_ex(dst, ZEND_STRS("$4"), (char *) ZSTR_S($2), $3-1, 1);
    7373                    ', `
    74                     add_assoc_stringl_ex(dst, ZEND_STRS("$4"), $2, $3-1, 1);
     74                    add_assoc_stringl_ex(dst, ZEND_STRS("$4"), (char *) $2, $3-1, 1);
    7575                ')
    7676            ')
Note: See TracChangeset for help on using the changeset viewer.