diff options
| author | Xinchen Hui <laruence@php.net> | 2014-06-27 12:35:34 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@php.net> | 2014-06-27 12:35:34 +0800 |
| commit | f609d8c1c677d03d9ae380480ae72383c5a98106 (patch) | |
| tree | 2932520e9981d7fad8bf6f25e84fa01a5e682996 /Zend/zend_string.h | |
| parent | 9af4b18b81502a2bea089a21ae7e43197322abe5 (diff) | |
| download | php-git-f609d8c1c677d03d9ae380480ae72383c5a98106.tar.gz | |
C++ compiler doesn't allow cast a void * to other pointer type
Diffstat (limited to 'Zend/zend_string.h')
| -rw-r--r-- | Zend/zend_string.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_string.h b/Zend/zend_string.h index dfdc74eda8..5765188e2a 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -109,7 +109,7 @@ static zend_always_inline zend_uint zend_str_delref(zend_string *s) static zend_always_inline zend_string *zend_str_alloc(int len, int persistent) { - zend_string *ret = pemalloc(_STR_HEADER_SIZE + len + 1, persistent); + zend_string *ret = (zend_string *)pemalloc(_STR_HEADER_SIZE + len + 1, persistent); GC_REFCOUNT(ret) = 1; #if 1 @@ -127,7 +127,7 @@ static zend_always_inline zend_string *zend_str_alloc(int len, int persistent) static zend_always_inline zend_string *zend_str_safe_alloc(size_t n, size_t m, size_t l, int persistent) { - zend_string *ret = safe_pemalloc(n, m, _STR_HEADER_SIZE + l + 1, persistent); + zend_string *ret = (zend_string *)safe_pemalloc(n, m, _STR_HEADER_SIZE + l + 1, persistent); GC_REFCOUNT(ret) = 1; #if 1 @@ -177,7 +177,7 @@ static zend_always_inline zend_string *zend_str_realloc(zend_string *s, int len, ret = STR_ALLOC(len, persistent); memcpy(ret->val, s->val, (len > s->len ? s->len : len) + 1); } else if (STR_REFCOUNT(s) == 1) { - ret = perealloc(s, _STR_HEADER_SIZE + len + 1, persistent); + ret = (zend_string *)perealloc(s, _STR_HEADER_SIZE + len + 1, persistent); ret->len = len; STR_FORGET_HASH_VAL(ret); } else { @@ -196,7 +196,7 @@ static zend_always_inline zend_string *zend_str_safe_realloc(zend_string *s, siz ret = STR_SAFE_ALLOC(n, m, l, persistent); memcpy(ret->val, s->val, ((n * m) + l > s->len ? s->len : ((n * m) + l)) + 1); } else if (STR_REFCOUNT(s) == 1) { - ret = safe_perealloc(s, n, m, _STR_HEADER_SIZE + l + 1, persistent); + ret = (zend_string *)safe_perealloc(s, n, m, _STR_HEADER_SIZE + l + 1, persistent); ret->len = (n * m) + l; STR_FORGET_HASH_VAL(ret); } else { |
