Changeset 1439 for trunk


Ignore:
Timestamp:
2013-11-05T15:35:34+01:00 (5 months ago)
Author:
moo
Message:

code cleanup

Location:
trunk/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r1380 r1439  
    158158/* }}} */ 
    159159#endif 
    160 /* {{{ xc_zstrlen_char */ 
    161 static inline size_t xc_zstrlen_char(const_zstr s) 
     160static inline size_t xc_zstrlen_char(const_zstr s) /* {{{ */ 
    162161{ 
    163162    return strlen(ZSTR_S(s)); 
     
    165164/* }}} */ 
    166165#ifdef IS_UNICODE 
    167 /* {{{ xc_zstrlen_uchar */ 
    168 static inline size_t xc_zstrlen_uchar(zstr s) 
     166static inline size_t xc_zstrlen_uchar(zstr s) /* {{{ */ 
    169167{ 
    170168    return u_strlen(ZSTR_U(s)); 
    171169} 
    172170/* }}} */ 
    173 /* {{{ xc_zstrlen */ 
    174 static inline size_t xc_zstrlen(int type, const_zstr s) 
     171static inline size_t xc_zstrlen(int type, const_zstr s) /* {{{ */ 
    175172{ 
    176173    return type == IS_UNICODE ? xc_zstrlen_uchar(s) : xc_zstrlen_char(s); 
     
    182179/* }}} */ 
    183180#endif 
    184 /* {{{ xc_calc_string_n */ 
    185 REDEF(`PROCESSOR_TYPE', `calc') 
    186181#undef C_RELAYLINE 
    187182#define C_RELAYLINE 
     
    190185#define C_RELAYLINE , __LINE__ 
    191186') 
    192 static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { 
     187static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { /* {{{ */ 
     188    pushdef(`PROCESSOR_TYPE', `calc') 
    193189    pushdef(`__LINE__', `relayline') 
    194190    size_t realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); 
     
    208204    ') 
    209205    popdef(`__LINE__') 
    210 } 
    211 /* }}} */ 
    212 /* {{{ xc_store_string_n */ 
    213 REDEF(`PROCESSOR_TYPE', `store') 
    214 static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { 
     206    popdef(`PROCESSOR_TYPE') 
     207} 
     208/* }}} */ 
     209static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { /* {{{ */ 
     210    pushdef(`PROCESSOR_TYPE', `store') 
    215211    pushdef(`__LINE__', `relayline') 
    216212    size_t realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); 
     
    234230 
    235231    popdef(`__LINE__') 
     232    popdef(`PROCESSOR_TYPE') 
    236233} 
    237234/* }}} */ 
     
    258255    return (zend_ulong) -1; 
    259256} 
    260 define(`xc_get_class_num', `xc_get_class_numNOTDEFINED') 
    261 /* }}} */ 
    262 /* {{{ xc_get_class */ 
     257define(`xc_get_class_num', `IFSTORE(``xc_get_class_num'($@)',``xc_get_class_num' can be use in store only')') 
     258/* }}} */ 
    263259#ifdef ZEND_ENGINE_2 
    264 static zend_class_entry *xc_get_class(xc_processor_t *processor, zend_ulong class_num) { 
     260static zend_class_entry *xc_get_class(xc_processor_t *processor, zend_ulong class_num) { /* {{{ */ 
    265261    /* must be parent or currrent class */ 
    266262    assert(class_num <= processor->active_class_index + 1); 
    267263    return CestToCePtr(processor->php_dst->classinfos[class_num - 1].cest); 
    268264} 
    269 #endif 
    270 define(`xc_get_class', `xc_get_classNOTDEFINED') 
    271 /* }}} */ 
     265define(`xc_get_class', `IFRESTORE(``xc_get_class'($@)',``xc_get_class' can be use in restore only')') 
     266/* }}} */ 
     267#endif 
    272268#ifdef ZEND_ENGINE_2 
    273269/* fix method on store */ 
  • trunk/processor/main.m4

    r1416 r1439  
    133133')') 
    134134dnl }}} 
     135dnl {{{ IFNOTMEMCPY 
     136define(`IFNOTMEMCPY', `ifdef(`USEMEMCPY', `', `$1')') 
     137dnl }}} 
    135138dnl {{{ COPY 
    136139define(`COPY', `IFNOTMEMCPY(`IFCOPY(`DST(`$1') = SRC(`$1');')')DONE(`$1')') 
     
    245248define(`IFDASM', `ifelse(PROCESSOR_TYPE, `dasm', `$1', `$2')') 
    246249dnl }}} 
     250 
    247251EXPORT(`zend_op') 
    248252EXPORT(`zend_op_array') 
     
    263267include(srcdir`/processor/head.m4') 
    264268 
    265 define(`IFNOTMEMCPY', `ifdef(`USEMEMCPY', `', `$1')') 
    266269REDEF(`PROCESSOR_TYPE', `calc') include(srcdir`/processor/processor.m4') 
    267 pushdef(`xc_get_class_num', ``xc_get_class_num'($@)') 
    268270REDEF(`PROCESSOR_TYPE', `store') include(srcdir`/processor/processor.m4') 
    269 popdef(`xc_get_class_num') 
    270 pushdef(`xc_get_class', ``xc_get_class'($@)') 
    271271REDEF(`PROCESSOR_TYPE', `restore') include(srcdir`/processor/processor.m4') 
    272 popdef(`xc_get_class') 
    273  
    274 REDEF(`IFNOTMEMCPY', `$1') 
     272 
    275273#ifdef HAVE_XCACHE_DPRINT 
    276274REDEF(`PROCESSOR_TYPE', `dprint') include(srcdir`/processor/processor.m4') 
Note: See TracChangeset for help on using the changeset viewer.