Changeset 645


Ignore:
Timestamp:
2009-07-08T06:39:33+02:00 (5 years ago)
Author:
moo
Message:

reverted r643 as it's a false assertion. try another way to get ride of some const warning

Location:
trunk/processor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r512 r645  
    131131/* {{{ xc_calc_string_n */ 
    132132REDEF(`KIND', `calc') 
    133 static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, zstr str, long size IFASSERT(`, int relayline')) { 
     133static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const zstr str, long size IFASSERT(`, int relayline')) { 
    134134    pushdef(`__LINE__', `relayline') 
    135135    int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); 
     
    153153/* {{{ xc_store_string_n */ 
    154154REDEF(`KIND', `store') 
    155 static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, zstr str, long size IFASSERT(`, int relayline')) { 
     155static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const zstr str, long size IFASSERT(`, int relayline')) { 
    156156    pushdef(`__LINE__', `relayline') 
    157157    int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); 
  • trunk/processor/processor.m4

    r643 r645  
    220220DEF_STRUCT_P_FUNC(`zend_arg_info', , ` 
    221221    DISPATCH(zend_uint, name_len) 
    222     COPY(name) 
     222    PROC_ZSTRING_L(, name, name_len) 
    223223    DISPATCH(zend_uint, class_name_len) 
    224     COPY(class_name) 
     224    PROC_ZSTRING_L(, class_name, class_name_len) 
    225225    DISPATCH(zend_bool, array_type_hint) 
    226226    DISPATCH(zend_bool, allow_null) 
  • trunk/processor/string.m4

    r504 r645  
    2121            STRTYPE, `zstr_char',  `ZSTR_S($1)', 
    2222            `',      `',           `$1')) 
     23    pushdef(`U', ifelse( 
     24            PTRTYPE, `char',  `', 
     25            PTRTYPE, `UChar', `u')) 
    2326    if (SRCPTR == NULL) { 
    2427        IFNOTMEMCPY(`IFCOPY(` 
     
    5659            ') 
    5760        ') 
    58         IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 IFASSERT(`, __LINE__'));') 
    59         IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 IFASSERT(`, __LINE__')));') 
     61        IFCALC(`xc_calc_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 IFASSERT(`, __LINE__'));') 
     62        IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 IFASSERT(`, __LINE__')));') 
    6063        IFRESTORE(` 
    61             ALLOC(DSTPTR, `STRTYPE', `($3)') 
    62             memcpy(DSTPTR, SRCPTR, sizeof(STRTYPE) * ($3)); 
     64            DSTPTR = e`'U`'strndup(SRCPTR, ($3) - 1); 
    6365        ') 
    6466        FIXPOINTER_EX(`PTRTYPE', DSTPTR) 
     
    7577        ') 
    7678    } 
     79    popdef(`U') 
    7780    popdef(`DSTPTR') 
    7881    popdef(`SRCPTR') 
Note: See TracChangeset for help on using the changeset viewer.