Changeset 860 in svn


Ignore:
Timestamp:
2012-03-29T04:54:33+02:00 (3 years ago)
Author:
Xuefer
Message:

kill warnings

Location:
trunk
Files:
8 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            ')
  • trunk/utils.c

    r853 r860  
    482482
    483483#ifdef HAVE_XCACHE_CONSTANT
    484 void xc_install_constant(ZEND_24(const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
     484void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
    485485{
    486486    if (zend_u_hash_add(EG(zend_constants), type, key, len,
     
    502502/* }}} */
    503503#endif
    504 void xc_install_function(ZEND_24(const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
     504void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
    505505{
    506506    zend_bool istmpkey;
     
    532532}
    533533/* }}} */
    534 ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
     534ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(NOTHING, const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC) /* {{{ */
    535535{
    536536    zend_bool istmpkey;
     
    630630#endif
    631631#ifdef ZEND_ENGINE_2_1
    632 static zend_bool xc_auto_global_callback(ZEND_24(const) char *name, uint name_len TSRMLS_DC) /* {{{ */
     632static zend_bool xc_auto_global_callback(ZEND_24(NOTHING, const) char *name, uint name_len TSRMLS_DC) /* {{{ */
    633633{
    634634    return 0;
     
    710710/* }}} */
    711711#endif
    712 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(const) char *filename TSRMLS_DC) /* {{{ */
     712xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC) /* {{{ */
    713713{
    714714    HashTable *h;
     
    905905    if (install != XC_NoInstall) {
    906906        CG(in_compilation)    = 1;
    907         CG(compiled_filename) = ZEND_24((char *)) sandbox->filename;
     907        CG(compiled_filename) = ZEND_24(NOTHING, (char *)) sandbox->filename;
    908908        CG(zend_lineno)       = 0;
    909909        xc_sandbox_install(sandbox, install TSRMLS_CC);
  • trunk/utils.h

    r847 r860  
    6969/* installer */
    7070#ifdef HAVE_XCACHE_CONSTANT
    71 void xc_install_constant(ZEND_24(const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
     71void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
    7272#endif
    73 void xc_install_function(ZEND_24(const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
    74 ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
     73void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
     74ZESW(xc_cest_t *, void) xc_install_class(ZEND_24(NOTHING, const) char *filename, xc_cest_t *cest, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC);
    7575
    7676#if defined(E_STRICT) || defined(E_DEPRECATED)
     
    8181typedef struct {
    8282    int alloc;
    83     ZEND_24(const) char *filename;
     83    ZEND_24(NOTHING, const) char *filename;
    8484
    8585    HashTable orig_included_files;
     
    122122
    123123void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce));
    124 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(const) char *filename TSRMLS_DC);
     124xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, const) char *filename TSRMLS_DC);
    125125void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC);
    126126
  • trunk/xcache.c

    r859 r860  
    11341134}
    11351135/* }}} */
    1136 static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, ZEND_24(const) char *filepath TSRMLS_DC) /* {{{*/
    1137 {
    1138     entry_php->filepath     = filepath;
     1136static void xc_entry_init_key_php_entry(xc_entry_php_t *entry_php, const char *filepath TSRMLS_DC) /* {{{*/
     1137{
     1138    entry_php->filepath     = ZEND_24((char *), NOTHING) filepath;
    11391139    entry_php->filepath_len = strlen(entry_php->filepath);
    11401140    entry_php->dirpath      = estrndup(entry_php->filepath, entry_php->filepath_len);
     
    16961696
    16971697    xc_undo_pass_two(compiler->new_php.op_array TSRMLS_CC);
    1698     xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) compiler->new_php.SRMLS_CC);
     1698    xc_foreach_early_binding_class(compiler->new_php.op_array, xc_cache_early_binding_class_cb, (void *) &compiler->new_php TSRMLS_CC);
    16991699    xc_redo_pass_two(compiler->new_php.op_array TSRMLS_CC);
    17001700    /* }}} */
     
    31453145PHP_FUNCTION(xcache_is_autoglobal)
    31463146{
    3147     char *name;
    3148     int name_len;
    3149 
    3150     if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
     3147    zval *name;
     3148
     3149    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name) == FAILURE) {
    31513150        return;
    31523151    }
    31533152
    3154     RETURN_BOOL(zend_hash_exists(CG(auto_globals), name, name_len + 1));
     3153    RETURN_BOOL(zend_u_hash_exists(CG(auto_globals), UG(unicode), Z_STRVAL_P(name), Z_STRLEN_P(name) + 1));
    31553154}
    31563155/* }}} */
  • trunk/xcache.h

    r859 r860  
    4343#endif
    4444#ifdef ZEND_ENGINE_2_4
    45 #   define ZEND_24(x) x
    46 #else
    47 #   define ZEND_24(x)
     45#   define ZEND_24(pre24, v24) v24
     46#else
     47#   define ZEND_24(pre24, v24) pre24
    4848#endif
    4949
     
    191191#ifndef IS_UNICODE
    192192#   define zend_u_hash_add(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
    193        zend_hash_add(ht, arKey, nKeyLength, pData, nDataSize, pDest)
     193       zend_hash_add(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData, nDataSize, pDest)
    194194
    195195#   define zend_u_hash_quick_add(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \
    196        zend_hash_quick_add(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)
     196       zend_hash_quick_add(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData, nDataSize, pDest)
    197197
    198198#   define zend_u_hash_update(ht, type, arKey, nKeyLength, pData, nDataSize, pDest) \
    199        zend_hash_update(ht, arKey, nKeyLength, pData, nDataSize, pDest)
     199       zend_hash_update(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData, nDataSize, pDest)
    200200
    201201#   define zend_u_hash_quick_update(ht, type, arKey, nKeyLength, h, pData, nDataSize, pDest) \
    202        zend_hash_quick_update(ht, arKey, nKeyLength, h, pData, nDataSize, pDest)
     202       zend_hash_quick_update(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData, nDataSize, pDest)
    203203
    204204#   define zend_u_hash_find(ht, type, arKey, nKeyLength, pData) \
    205        zend_hash_find(ht, arKey, nKeyLength, pData)
     205       zend_hash_find(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, pData)
    206206
    207207#   define zend_u_hash_quick_find(ht, type, arKey, nKeyLength, h, pData) \
    208        zend_hash_quick_find(ht, arKey, nKeyLength, h, pData)
     208       zend_hash_quick_find(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength, h, pData)
     209
     210#   define zend_u_hash_exists(ht, type, arKey, nKeyLength) \
     211       zend_hash_exists(ht, ZEND_24((char *), NOTHING) arKey, nKeyLength)
    209212
    210213#   define add_u_assoc_zval_ex(arg, type, key, key_len, value) \
     
    438441
    439442    int    filepath_len;
    440     ZEND_24(const) char *filepath;
     443    ZEND_24(NOTHING, const) char *filepath;
    441444    int    dirpath_len;
    442445    char  *dirpath;
Note: See TracChangeset for help on using the changeset viewer.