com php-src: Fix invalid conversion about emalloc: Zend/zend_ types.h
| From: | Xinchen Hui | Date: | Tue, 16 Jun 2015 03:12:37 +0000 |
| Subject: | com php-src: Fix invalid conversion about emalloc: Zend/zend_ types.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87286@lists.php.net to get a copy of this message | ||
Commit: 73031d92ce5d587e56f2cf38f8912b01aaa856ba
Author: Dreamsxin <dreamsxin@126.com> Tue, 16 Jun 2015 11:12:37 +0800
Parents: 60e658be818bded4f78e069b8ea2a6fa4f88c895
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=73031d92ce5d587e56f2cf38f8912b01aaa856ba
Log:
Fix invalid conversion about emalloc
Changed paths:
M Zend/zend_types.h
Diff:
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 6356518..cb6da0d 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -645,14 +645,14 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define ZVAL_NEW_ARR(z) do { \
zval *__z = (z); \
- zend_array *_arr = emalloc(sizeof(zend_array)); \
+ zend_array *_arr = (zend_array *) emalloc(sizeof(zend_array)); \
Z_ARR_P(__z) = _arr; \
Z_TYPE_INFO_P(__z) = IS_ARRAY_EX; \
} while (0)
#define ZVAL_NEW_PERSISTENT_ARR(z) do { \
zval *__z = (z); \
- zend_array *_arr = malloc(sizeof(zend_array)); \
+ zend_array *_arr = (zend_array *) malloc(sizeof(zend_array)); \
Z_ARR_P(__z) = _arr; \
Z_TYPE_INFO_P(__z) = IS_ARRAY_EX; \
} while (0)
@@ -670,7 +670,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
} while (0)
#define ZVAL_NEW_RES(z, h, p, t) do { \
- zend_resource *_res = emalloc(sizeof(zend_resource)); \
+ zend_resource *_res = (zend_resource *) emalloc(sizeof(zend_resource)); \
zval *__z; \
GC_REFCOUNT(_res) = 1; \
GC_TYPE_INFO(_res) = IS_RESOURCE; \
@@ -683,7 +683,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
} while (0)
#define ZVAL_NEW_PERSISTENT_RES(z, h, p, t) do { \
- zend_resource *_res = malloc(sizeof(zend_resource)); \
+ zend_resource *_res = (zend_resource *) malloc(sizeof(zend_resource)); \
zval *__z; \
GC_REFCOUNT(_res) = 1; \
GC_TYPE_INFO(_res) = IS_RESOURCE; \
@@ -702,7 +702,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
} while (0)
#define ZVAL_NEW_EMPTY_REF(z) do { \
- zend_reference *_ref = emalloc(sizeof(zend_reference)); \
+ zend_reference *_ref = (zend_reference *) emalloc(sizeof(zend_reference)); \
GC_REFCOUNT(_ref) = 1; \
GC_TYPE_INFO(_ref) = IS_REFERENCE; \
Z_REF_P(z) = _ref; \
@@ -710,7 +710,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
} while (0)
#define ZVAL_NEW_REF(z, r) do { \
- zend_reference *_ref = emalloc(sizeof(zend_reference)); \
+ zend_reference *_ref = (zend_reference *) emalloc(sizeof(zend_reference)); \
GC_REFCOUNT(_ref) = 1; \
GC_TYPE_INFO(_ref) = IS_REFERENCE; \
ZVAL_COPY_VALUE(&_ref->val, r); \
@@ -719,7 +719,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
} while (0)
#define ZVAL_NEW_PERSISTENT_REF(z, r) do { \
- zend_reference *_ref = malloc(sizeof(zend_reference)); \
+ zend_reference *_ref = (zend_reference *) malloc(sizeof(zend_reference)); \
GC_REFCOUNT(_ref) = 1; \
GC_TYPE_INFO(_ref) = IS_REFERENCE; \
ZVAL_COPY_VALUE(&_ref->val, r); \
@@ -729,7 +729,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define ZVAL_NEW_AST(z, a) do { \
zval *__z = (z); \
- zend_ast_ref *_ast = emalloc(sizeof(zend_ast_ref)); \
+ zend_ast_ref *_ast = (zend_ast_ref *) emalloc(sizeof(zend_ast_ref)); \
GC_REFCOUNT(_ast) = 1; \
GC_TYPE_INFO(_ast) = IS_CONSTANT_AST; \
_ast->ast = (a); \