From d90ebc65a6f7c321a0921336746372a6ef5e34b2 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 24 Jan 2008 18:07:45 +0000 Subject: [PATCH] Fixed comilation warnings --- Zend/zend_API.h | 31 +++++++++++++++---------------- Zend/zend_builtin_functions.c | 4 ++-- Zend/zend_interfaces.c | 2 +- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 2 +- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 98298e1a7b3..154590397c2 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -522,22 +522,21 @@ END_EXTERN_C() Z_TYPE_P(z) = IS_STRING; \ } -#define ZVAL_ZVAL(z, zv, copy, dtor) { \ - int is_ref, refcount; \ - is_ref = Z_ISREF_P(z); \ - refcount = Z_REFCOUNT_P(z); \ - *(z) = *(zv); \ - if (copy) { \ - zval_copy_ctor(z); \ - } \ - if (dtor) { \ - if (!copy) { \ - ZVAL_NULL(zv); \ - } \ - zval_ptr_dtor(&zv); \ - } \ - Z_SET_ISREF_TO_P(z, is_ref); \ - Z_SET_REFCOUNT_P(z, refcount); \ +#define ZVAL_ZVAL(z, zv, copy, dtor) { \ + zend_uchar is_ref = Z_ISREF_P(z); \ + zend_uint refcount = Z_REFCOUNT_P(z); \ + *(z) = *(zv); \ + if (copy) { \ + zval_copy_ctor(z); \ + } \ + if (dtor) { \ + if (!copy) { \ + ZVAL_NULL(zv); \ + } \ + zval_ptr_dtor(&zv); \ + } \ + Z_SET_ISREF_TO_P(z, is_ref); \ + Z_SET_REFCOUNT_P(z, refcount); \ } #define ZVAL_FALSE(z) ZVAL_BOOL(z, 0) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 0714117881d..0fb77f0c770 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1654,7 +1654,7 @@ ZEND_FUNCTION(get_defined_constants) zend_constant *val; int module_number; zval **modules; - const char **module_names; + char **module_names; zend_module_entry *module; int i = 1; @@ -1664,7 +1664,7 @@ ZEND_FUNCTION(get_defined_constants) module_names[0] = "internal"; zend_hash_internal_pointer_reset_ex(&module_registry, &pos); while (zend_hash_get_current_data_ex(&module_registry, (void *) &module, &pos) != FAILURE) { - module_names[i++] = module->name; + module_names[i++] = (char*)module->name; zend_hash_move_forward_ex(&module_registry, &pos); } module_names[i] = "user"; diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index f08823675a9..db4324ba7ba 100755 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -422,7 +422,7 @@ int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len zval_ptr_dtor(&retval); return FAILURE; case IS_STRING: - *buffer = estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); + *buffer = (unsigned char*)estrndup(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); *buf_len = Z_STRLEN_P(retval); result = SUCCESS; break; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9e9c509d8ab..2a76dfbad3c 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4099,7 +4099,7 @@ ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY) case ZEND_USER_OPCODE_DISPATCH: ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); + ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), EX(opline)); } } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index c2033bdbc69..d31e9cb5f60 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -612,7 +612,7 @@ static int ZEND_USER_OPCODE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS) case ZEND_USER_OPCODE_DISPATCH: ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline)); default: - ZEND_VM_DISPATCH(ret & 0xff, EX(opline)); + ZEND_VM_DISPATCH((zend_uchar)(ret & 0xff), EX(opline)); } }