]> granicus.if.org Git - php/commitdiff
C++ compiler doesn't allow cast a void * to other pointer type
authorXinchen Hui <laruence@php.net>
Fri, 27 Jun 2014 04:35:34 +0000 (12:35 +0800)
committerXinchen Hui <laruence@php.net>
Fri, 27 Jun 2014 04:35:34 +0000 (12:35 +0800)
Zend/zend_execute.h
Zend/zend_string.h

index 1b74564dfdf79317905f5baff009c3bea1f159b0..b80d2adff844ab3935e95b8403876e6ac3c26c4a 100644 (file)
@@ -227,7 +227,7 @@ static zend_always_inline void *zend_vm_stack_alloc(size_t size TSRMLS_DC)
        int count = (size + (sizeof(zval) - 1)) / sizeof(zval);
 
        ZEND_VM_STACK_GROW_IF_NEEDED(count);
-       ret = (void*)EG(argument_stack)->top;
+       ret = EG(argument_stack)->top;
        EG(argument_stack)->top += count;
        return ret;
 }
index dfdc74eda87865c22040fa8851cc47d33b808d1f..5765188e2af02affe64066e99f568dcbf9d85245 100644 (file)
@@ -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 {