1
0
Fork 0

kill some warning

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@844 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
3.0
Xuefer 11 years ago
parent 49275ed9ca
commit 94bb24973f

@ -108,8 +108,8 @@ define(`DEF_HASH_TABLE_FUNC', `
IFCOPY(`
#ifdef ZEND_ENGINE_2_4
memcpy(pnew, b, BUCKET_HEAD_SIZE(Bucket));
memcpy((char *) (pnew + 1), b->arKey, BUCKET_KEY_SIZE(b));
pnew->arKey = (const char *) (pnew + 1);
memcpy(pnew->arKey, b->arKey, BUCKET_KEY_SIZE(b));
#else
memcpy(pnew, b, bucketsize);
#endif

@ -110,7 +110,7 @@ IFASSERT(`dnl
static void *memsetptr(void *mem, void *content, size_t n)
{
void **p = (void **) mem;
void **end = (char *) mem + n;
void **end = (void **) ((char *) mem + n);
while (p < end - sizeof(content)) {
*p = content;
p += sizeof(content);
@ -147,7 +147,7 @@ static void xc_dprint_str_len(const char *str, int len) /* {{{ */
/* }}} */
#endif
/* {{{ xc_zstrlen_char */
static inline int xc_zstrlen_char(zstr s)
static inline int xc_zstrlen_char(const_zstr s)
{
return strlen(ZSTR_S(s));
}
@ -160,7 +160,7 @@ static inline int xc_zstrlen_uchar(zstr s)
}
/* }}} */
/* {{{ xc_zstrlen */
static inline int xc_zstrlen(int type, zstr s)
static inline int xc_zstrlen(int type, const_zstr s)
{
return type == IS_UNICODE ? xc_zstrlen_uchar(s) : xc_zstrlen_char(s);
}

@ -57,7 +57,7 @@ define(`ALLOC', `
')
$1 = (FORCETYPE *) (processor->p = (char *) ALIGN(processor->p));
ifelse(`$4', `', `
IFASSERT(`memsetptr($1, (void *) __LINE__, SIZE);')
IFASSERT(`memsetptr($1, (void *) (unsigned long) __LINE__, SIZE);')
', `
memset($1, 0, SIZE);
')
@ -158,6 +158,10 @@ dnl {{{ SETNULL_EX
define(`SETNULL_EX', `IFCOPY(`$1 = NULL;')')
define(`SETNULL', `SETNULL_EX(`dst->$1')DONE(`$1')')
dnl }}}
dnl {{{ SETZERO_EX
define(`SETZERO_EX', `IFCOPY(`$1 = 0;')')
define(`SETZERO', `SETZERO_EX(`dst->$1')DONE(`$1')')
dnl }}}
dnl {{{ COPYNULL_EX(1:dst, 2:elm-name)
define(`COPYNULL_EX', `
IFDASM(`add_assoc_null_ex(dst, ZEND_STRS("$2"));')
@ -170,6 +174,18 @@ define(`COPYNULL', `
COPYNULL_EX(`dst->$1', `$1')DONE(`$1')
')
dnl }}}
dnl {{{ COPYZERO_EX(1:dst, 2:elm-name)
define(`COPYZERO_EX', `
IFDASM(`add_assoc_long_ex(dst, ZEND_STRS("$2"), 0);')
IFNOTMEMCPY(`IFCOPY(`$1 = 0;')')
assert(patsubst($1, dst, src) == 0);
')
dnl }}}
dnl {{{ COPYZERO(1:elm)
define(`COPYZERO', `
COPYZERO_EX(`dst->$1', `$1')DONE(`$1')
')
dnl }}}
dnl {{{ LIST_DIFF(1:left-list, 2:right-list)
define(`foreach',
`pushdef(`$1')_foreach(`$1', `$2', `$3')popdef(`$1')')

@ -55,7 +55,7 @@ define(`PROCESS', `dnl PROCESS(1:type, 2:elm)
, `$1', `unsigned int', `PROCESS_SCALAR(`$2', `u', `$1')'
, `$1', `zend_ulong', `PROCESS_SCALAR(`$2', `lu', `$1')'
, `$1', `ulong', `PROCESS_SCALAR(`$2', `lu', `$1')'
, `$1', `size_t', `PROCESS_SCALAR(`$2', `u', `$1')'
, `$1', `size_t', `PROCESS_SCALAR(`$2', `lu', `$1')'
, `$1', `long', `PROCESS_SCALAR(`$2', `ld', `$1')'
, `$1', `time_t', `PROCESS_SCALAR(`$2', `ld', `$1')'
, `$1', `zend_ushort', `PROCESS_SCALAR(`$2', `hu', `$1')'

@ -404,12 +404,12 @@ DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
#ifdef ZEND_ENGINE_2_2
dnl runtime binding: ADD_INTERFACE will deal with it
COPYNULL(`interfaces')
COPYNULL(`num_interfaces')
COPYZERO(`num_interfaces')
# ifdef ZEND_ENGINE_2_4
dnl runtime binding: ADD_TRAIT will deal with it
COPYNULL(traits)
COPYNULL(num_traits)
COPYZERO(num_traits)
# endif
#else
IFRESTORE(`

@ -45,7 +45,7 @@ define(`PROC_STRING_N_EX', `
zend_make_printable_zval(&zv, &reszv, &usecopy);
fprintf(stderr, "string:%s:\t\"", "$1");
xc_dprint_str_len(Z_STRVAL(reszv), Z_STRLEN(reszv));
fprintf(stderr, "\" len=%d\n", $3 - 1);
fprintf(stderr, "\" len=%lu\n", (unsigned long) $3 - 1);
if (usecopy) {
zval_dtor(&reszv);
}
@ -55,7 +55,7 @@ define(`PROC_STRING_N_EX', `
', `
fprintf(stderr, "string:%s:\t\"", "$1");
xc_dprint_str_len(SRCPTR, $3 - 1);
fprintf(stderr, "\" len=%d\n", $3 - 1);
fprintf(stderr, "\" len=%lu\n", (unsigned long) $3 - 1);
')
')
IFCALC(`xc_calc_string_n(processor, ISTYPE, SRCSTR, $3 C_RELAYLINE);')

Loading…
Cancel
Save