Changeset 646 for branches/1.3/processor/string.m4
- Timestamp:
- 07/08/2009 06:40:03 AM (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 modified
-
. (modified) (1 prop)
-
processor/string.m4 (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/processor/string.m4
r622 r646 21 21 STRTYPE, `zstr_char', `ZSTR_S($1)', 22 22 `', `', `$1')) 23 pushdef(`U', ifelse( 24 PTRTYPE, `char', `', 25 PTRTYPE, `UChar', `u')) 23 26 if (SRCPTR == NULL) { 24 27 IFNOTMEMCPY(`IFCOPY(` … … 56 59 ') 57 60 ') 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__')));') 60 63 IFRESTORE(` 61 ALLOC(DSTPTR, `STRTYPE', `($3)') 62 memcpy(DSTPTR, SRCPTR, sizeof(STRTYPE) * ($3)); 64 DSTPTR = e`'U`'strndup(SRCPTR, ($3) - 1); 63 65 ') 64 66 FIXPOINTER_EX(`PTRTYPE', DSTPTR) … … 75 77 ') 76 78 } 79 popdef(`U') 77 80 popdef(`DSTPTR') 78 81 popdef(`SRCPTR')

