Changeset 843 for trunk/processor/main.m4
- Timestamp:
- 03/25/2012 09:01:16 AM (14 months ago)
- Files:
-
- 1 modified
-
trunk/processor/main.m4 (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/processor/main.m4
r837 r843 20 20 define(`ZEND_STRS', `($1), (sizeof($1))') 21 21 define(`ZEND_STRL', `($1), (sizeof($1) - 1)') 22 define(`DST', `dst->$1') 23 define(`SRC', `src->$1') 22 24 dnl ============ 23 25 define(`INDENT', `xc_dprint_indent(indent);') … … 81 83 popdef(`SIZE') 82 84 ') 83 dnl CALLOC(1:dst, 2:type [, 3:count=1 ]) 84 define(`CALLOC', `ALLOC(`$1', `$2', `$3', `1')') 85 dnl }}} 86 dnl {{{ PROC_INT(1:elm, 2:format=%d, 3:type=, 4:spec=) 87 define(`PROC_INT', ` 88 IFNOTMEMCPY(`IFCOPY(`dst->$1 = src->$1;')') 89 IFDPRINT(` 90 INDENT() 91 ifelse( 92 `$3 $1', `zval_data_type type', `fprintf(stderr, "$3:$1:\t%d %s\n", src->$1, xc_get_data_type(src->$1));' 93 , `$3 $1', `int op_type', `fprintf(stderr, "$3:$1:\t%d %s\n", src->$1, xc_get_op_type(src->$1));' 94 , `$3 $1', `zend_uchar opcode', `fprintf(stderr, "$3:$1:\t%d %s\n", src->$1, xc_get_opcode(src->$1));' 95 , `', `', `fprintf(stderr, "$3:$1:\t%ifelse(`$2',`',`d',`$2')\n", src->$1);') 96 ') 97 IFDASM(` 98 ifelse( 99 `$3', `zend_bool', `add_assoc_bool_ex(dst, ZEND_STRS("$1"), src->$1 ? 1 : 0);' 100 , `', `', `add_assoc_long_ex(dst, ZEND_STRS("$1"), src->$1);' 101 ) 102 ') 103 DONE(`$1') 104 ') 85 dnl CALLOC(1:dst, 2:type [, 3:count=1, 4:forcetype=$2 ]) 86 define(`CALLOC', `ALLOC(`$1', `$2', `$3', `1', `$4')') 105 87 dnl }}} 106 88 dnl {{{ PROC_CLASS_ENTRY_P(1:elm) 107 define(`PROC_CLASS_ENTRY_P', `PROC_CLASS_ENTRY_P_EX(`dst->$1', ` src->$1', `$1')`'DONE(`$1')')89 define(`PROC_CLASS_ENTRY_P', `PROC_CLASS_ENTRY_P_EX(`dst->$1', `SRC(`$1')', `$1')`'DONE(`$1')') 108 90 dnl PROC_CLASS_ENTRY_P_EX(1:dst, 2:src, 3:elm-name) 109 91 define(`PROC_CLASS_ENTRY_P_EX', ` … … 151 133 dnl }}} 152 134 dnl {{{ COPY 153 define(`COPY', `IFNOTMEMCPY(`IFCOPY(`dst->$1 = src->$1;')')DONE(`$1')')135 define(`COPY', `IFNOTMEMCPY(`IFCOPY(`dst->$1 = SRC(`$1');')')DONE(`$1')') 154 136 dnl }}} 155 137 dnl {{{ COPY_N_EX 156 138 define(`COPY_N_EX', ` 157 ALLOC(`dst->$3', `$2', ` src->$1')139 ALLOC(`dst->$3', `$2', `SRC(`$1')') 158 140 IFCOPY(` 159 memcpy(dst->$3, src->$3, sizeof(dst->$3[0]) * src->$1);141 memcpy(dst->$3, SRC(`$3'), sizeof(dst->$3[0]) * SRC(`$1')); 160 142 ') 161 143 ') … … 168 150 dnl }}} 169 151 dnl {{{ COPYARRAY_EX 170 define(`COPYARRAY_EX', `IFNOTMEMCPY(`IFCOPY(`memcpy(dst->$1, src->$1, sizeof(dst->$1));')')')152 define(`COPYARRAY_EX', `IFNOTMEMCPY(`IFCOPY(`memcpy(dst->$1, SRC(`$1'), sizeof(dst->$1));')')') 171 153 dnl }}} 172 154 dnl {{{ COPYARRAY … … 226 208 } 227 209 ') 228 DONE_SIZE(`sizeof( src->$1)')210 DONE_SIZE(`sizeof(SRC(`$1'))') 229 211 ') 230 212 define(`DISABLECHECK', ` … … 261 243 include(srcdir`/processor/string.m4') 262 244 include(srcdir`/processor/struct.m4') 263 include(srcdir`/processor/ dispatch.m4')245 include(srcdir`/processor/process.m4') 264 246 include(srcdir`/processor/head.m4') 265 247

