Skip to content

Commit f609d8c

Browse files
committed
C++ compiler doesn't allow cast a void * to other pointer type
1 parent 9af4b18 commit f609d8c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Zend/zend_execute.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static zend_always_inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC)
227227
int count = (size + (sizeof(zval) - 1)) / sizeof(zval);
228228

229229
ZEND_VM_STACK_GROW_IF_NEEDED(count);
230-
ret = (void*)EG(argument_stack)->top;
230+
ret = EG(argument_stack)->top;
231231
EG(argument_stack)->top += count;
232232
return ret;
233233
}

Zend/zend_string.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static zend_always_inline zend_uint zend_str_delref(zend_string *s)
109109

110110
static zend_always_inline zend_string *zend_str_alloc(int len, int persistent)
111111
{
112-
zend_string *ret = pemalloc(_STR_HEADER_SIZE + len + 1, persistent);
112+
zend_string *ret = (zend_string *)pemalloc(_STR_HEADER_SIZE + len + 1, persistent);
113113

114114
GC_REFCOUNT(ret) = 1;
115115
#if 1
@@ -127,7 +127,7 @@ static zend_always_inline zend_string *zend_str_alloc(int len, int persistent)
127127

128128
static zend_always_inline zend_string *zend_str_safe_alloc(size_t n, size_t m, size_t l, int persistent)
129129
{
130-
zend_string *ret = safe_pemalloc(n, m, _STR_HEADER_SIZE + l + 1, persistent);
130+
zend_string *ret = (zend_string *)safe_pemalloc(n, m, _STR_HEADER_SIZE + l + 1, persistent);
131131

132132
GC_REFCOUNT(ret) = 1;
133133
#if 1
@@ -177,7 +177,7 @@ static zend_always_inline zend_string *zend_str_realloc(zend_string *s, int len,
177177
ret = STR_ALLOC(len, persistent);
178178
memcpy(ret->val, s->val, (len > s->len ? s->len : len) + 1);
179179
} else if (STR_REFCOUNT(s) == 1) {
180-
ret = perealloc(s, _STR_HEADER_SIZE + len + 1, persistent);
180+
ret = (zend_string *)perealloc(s, _STR_HEADER_SIZE + len + 1, persistent);
181181
ret->len = len;
182182
STR_FORGET_HASH_VAL(ret);
183183
} else {
@@ -196,7 +196,7 @@ static zend_always_inline zend_string *zend_str_safe_realloc(zend_string *s, siz
196196
ret = STR_SAFE_ALLOC(n, m, l, persistent);
197197
memcpy(ret->val, s->val, ((n * m) + l > s->len ? s->len : ((n * m) + l)) + 1);
198198
} else if (STR_REFCOUNT(s) == 1) {
199-
ret = safe_perealloc(s, n, m, _STR_HEADER_SIZE + l + 1, persistent);
199+
ret = (zend_string *)safe_perealloc(s, n, m, _STR_HEADER_SIZE + l + 1, persistent);
200200
ret->len = (n * m) + l;
201201
STR_FORGET_HASH_VAL(ret);
202202
} else {

0 commit comments

Comments
 (0)