Browse Source

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

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@645 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 12 years ago
parent
commit
3003e642fb
  1. 4
      processor/head.m4
  2. 4
      processor/processor.m4
  3. 11
      processor/string.m4

4
processor/head.m4

@ -130,7 +130,7 @@ static inline int xc_zstrlen(int type, zstr s)
#endif
/* {{{ xc_calc_string_n */
REDEF(`KIND', `calc')
static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, zstr str, long size IFASSERT(`, int relayline')) {
static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const zstr str, long size IFASSERT(`, int relayline')) {
pushdef(`__LINE__', `relayline')
int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size);
long dummy = 1;
@ -152,7 +152,7 @@ static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type,
/* }}} */
/* {{{ xc_store_string_n */
REDEF(`KIND', `store')
static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, zstr str, long size IFASSERT(`, int relayline')) {
static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const zstr str, long size IFASSERT(`, int relayline')) {
pushdef(`__LINE__', `relayline')
int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size);
zstr ret, *pret;

4
processor/processor.m4

@ -219,9 +219,9 @@ dnl {{{ zend_arg_info
#ifdef ZEND_ENGINE_2
DEF_STRUCT_P_FUNC(`zend_arg_info', , `
DISPATCH(zend_uint, name_len)
COPY(name)
PROC_ZSTRING_L(, name, name_len)
DISPATCH(zend_uint, class_name_len)
COPY(class_name)
PROC_ZSTRING_L(, class_name, class_name_len)
DISPATCH(zend_bool, array_type_hint)
DISPATCH(zend_bool, allow_null)
DISPATCH(zend_bool, pass_by_reference)

11
processor/string.m4

@ -20,6 +20,9 @@ define(`PROC_STRING_N_EX', `
STRTYPE, `zstr_uchar', `ZSTR_U($1)',
STRTYPE, `zstr_char', `ZSTR_S($1)',
`', `', `$1'))
pushdef(`U', ifelse(
PTRTYPE, `char', `',
PTRTYPE, `UChar', `u'))
if (SRCPTR == NULL) {
IFNOTMEMCPY(`IFCOPY(`
DSTPTR = NULL;
@ -55,11 +58,10 @@ define(`PROC_STRING_N_EX', `
fprintf(stderr, "\" len=%d\n", $3 - 1);
')
')
IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 IFASSERT(`, __LINE__'));')
IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, SRCSTR, $3 IFASSERT(`, __LINE__')));')
IFCALC(`xc_calc_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 IFASSERT(`, __LINE__'));')
IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 IFASSERT(`, __LINE__')));')
IFRESTORE(`
ALLOC(DSTPTR, `STRTYPE', `($3)')
memcpy(DSTPTR, SRCPTR, sizeof(STRTYPE) * ($3));
DSTPTR = e`'U`'strndup(SRCPTR, ($3) - 1);
')
FIXPOINTER_EX(`PTRTYPE', DSTPTR)
IFDASM(`
@ -74,6 +76,7 @@ define(`PROC_STRING_N_EX', `
')
')
}
popdef(`U')
popdef(`DSTPTR')
popdef(`SRCPTR')
popdef(`SRCSTR')

Loading…
Cancel
Save