diff options
| author | Anatol Belski <ab@php.net> | 2014-08-25 19:28:33 +0200 | 
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2014-08-25 19:28:33 +0200 | 
| commit | 6f9f0bf2056f0dc17d9bcc6dd3b7d28ac878c6fc (patch) | |
| tree | 0866cc3799560c2eee9a7d84940dbfe615f50c5c | |
| parent | c3e3c98ec666812daaaca896cf5ef758a8a6df14 (diff) | |
| download | php-git-6f9f0bf2056f0dc17d9bcc6dd3b7d28ac878c6fc.tar.gz | |
master renames phase 2
64 files changed, 461 insertions, 463 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 4c97e4231b..36b09cebe3 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -226,7 +226,7 @@ again:  		    break;  		case IS_TRUE:  		    if (CG(one_char_string)['1']) { -				ZVAL_LONG_STR(expr_copy, CG(one_char_string)['1']); +				ZVAL_INTERNED_STR(expr_copy, CG(one_char_string)['1']);  			} else {  				ZVAL_NEW_STR(expr_copy, zend_string_init("1", 1, 0));  			} @@ -443,7 +443,7 @@ static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_  #ifdef ZTS  static zend_bool asp_tags_default		  = 0;  static zend_bool short_tags_default		  = 1; -static zend_uint compiler_options_default = ZEND_COMPILE_DEFAULT; +static uint32_t compiler_options_default = ZEND_COMPILE_DEFAULT;  #else  # define asp_tags_default			0  # define short_tags_default			1 diff --git a/Zend/zend.h b/Zend/zend.h index 4c784cd9a0..e377005288 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -293,7 +293,7 @@ typedef enum {  #include "zend_hash.h"  #include "zend_llist.h" -#define INTERNAL_FUNCTION_PARAMETERS zend_uint param_count, zval *return_value TSRMLS_DC +#define INTERNAL_FUNCTION_PARAMETERS uint32_t param_count, zval *return_value TSRMLS_DC  #define INTERNAL_FUNCTION_PARAM_PASSTHRU param_count, return_value TSRMLS_CC  #define USED_RET() \ @@ -402,22 +402,22 @@ void zend_error_noreturn(int type, const char *format, ...) __attribute__ ((nore  #include "zend_string.h" -static zend_always_inline zend_uint zval_refcount_p(zval* pz) { +static zend_always_inline uint32_t zval_refcount_p(zval* pz) {  	ZEND_ASSERT(Z_REFCOUNTED_P(pz) || Z_IMMUTABLE_P(pz));  	return GC_REFCOUNT(Z_COUNTED_P(pz));  } -static zend_always_inline zend_uint zval_set_refcount_p(zval* pz, zend_uint rc) { +static zend_always_inline uint32_t zval_set_refcount_p(zval* pz, uint32_t rc) {  	ZEND_ASSERT(Z_REFCOUNTED_P(pz));  	return GC_REFCOUNT(Z_COUNTED_P(pz)) = rc;  } -static zend_always_inline zend_uint zval_addref_p(zval* pz) { +static zend_always_inline uint32_t zval_addref_p(zval* pz) {  	ZEND_ASSERT(Z_REFCOUNTED_P(pz));  	return ++GC_REFCOUNT(Z_COUNTED_P(pz));  } -static zend_always_inline zend_uint zval_delref_p(zval* pz) { +static zend_always_inline uint32_t zval_delref_p(zval* pz) {  	ZEND_ASSERT(Z_REFCOUNTED_P(pz));  	return --GC_REFCOUNT(Z_COUNTED_P(pz));  } @@ -463,7 +463,7 @@ struct _zend_trait_alias {  	/**  	* modifiers to be set on trait method  	*/ -	zend_uint modifiers; +	uint32_t modifiers;  };  typedef struct _zend_trait_alias zend_trait_alias; @@ -472,7 +472,7 @@ struct _zend_class_entry {  	zend_string *name;  	struct _zend_class_entry *parent;  	int refcount; -	zend_uint ce_flags; +	uint32_t ce_flags;  	HashTable function_table;  	HashTable properties_info; @@ -506,22 +506,22 @@ struct _zend_class_entry {  	union _zend_function *(*get_static_method)(zend_class_entry *ce, zend_string* method TSRMLS_DC);  	/* serializer callbacks */ -	int (*serialize)(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -	int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +	int (*serialize)(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); +	int (*unserialize)(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);  	zend_class_entry **interfaces; -	zend_uint num_interfaces; +	uint32_t num_interfaces;  	zend_class_entry **traits; -	zend_uint num_traits; +	uint32_t num_traits;  	zend_trait_alias **trait_aliases;  	zend_trait_precedence **trait_precedences;  	union {  		struct {  			zend_string *filename; -			zend_uint line_start; -			zend_uint line_end; +			uint32_t line_start; +			uint32_t line_end;  			zend_string *doc_comment;  		} user;  		struct { diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 02d6484afd..27668e4888 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2657,7 +2657,7 @@ int zend_next_free_module(void) /* {{{ */  }  /* }}} */ -static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, zend_uint ce_flags TSRMLS_DC) /* {{{ */ +static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class_entry, uint32_t ce_flags TSRMLS_DC) /* {{{ */  {  	zend_class_entry *class_entry = malloc(sizeof(zend_class_entry));  	zend_string *lowercase_name = zend_string_alloc(orig_class_entry->name->len, 1); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index e29f09501c..55d9e57e3c 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -36,8 +36,8 @@ typedef struct _zend_function_entry {  	const char *fname;  	void (*handler)(INTERNAL_FUNCTION_PARAMETERS);  	const struct _zend_arg_info *arg_info; -	zend_uint num_args; -	zend_uint flags; +	uint32_t num_args; +	uint32_t flags;  } zend_function_entry;  typedef struct _zend_fcall_info { @@ -46,7 +46,7 @@ typedef struct _zend_fcall_info {  	zval function_name;  	zend_array *symbol_table;  	zval *retval; -	zend_uint param_count; +	uint32_t param_count;  	zval *params;  	zend_object *object;  	zend_bool no_separation; @@ -68,9 +68,9 @@ typedef struct _zend_fcall_info_cache {  #define ZEND_FUNCTION(name)				ZEND_NAMED_FUNCTION(ZEND_FN(name))  #define ZEND_METHOD(classname, name)	ZEND_NAMED_FUNCTION(ZEND_MN(classname##_##name)) -#define ZEND_FENTRY(zend_name, name, arg_info, flags)	{ #zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags }, +#define ZEND_FENTRY(zend_name, name, arg_info, flags)	{ #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags }, -#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags)   { zend_name, name, arg_info, (zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags }, +#define ZEND_RAW_FENTRY(zend_name, name, arg_info, flags)   { zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },  #define ZEND_RAW_NAMED_FE(zend_name, name, arg_info) ZEND_RAW_FENTRY(#zend_name, name, arg_info, 0)  #define ZEND_NAMED_FE(zend_name, name, arg_info)	ZEND_FENTRY(zend_name, name, arg_info, 0) @@ -455,8 +455,8 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval  #define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value TSRMLS_CC)        -ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, zend_uint param_count, zval params[] TSRMLS_DC); -ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, zend_uint param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC); +ZEND_API int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[] TSRMLS_DC); +ZEND_API int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC);  ZEND_API extern const zend_fcall_info empty_fcall_info;  ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache; @@ -560,7 +560,7 @@ END_EXTERN_C()  	} while (0)  #define ZVAL_EMPTY_STRING(z) do {				\ -		ZVAL_LONG_STR(z, STR_EMPTY_ALLOC());		\ +		ZVAL_INTERNED_STR(z, STR_EMPTY_ALLOC());		\  	} while (0)  #define ZVAL_PSTRINGL(z, s, l) do {				\ @@ -601,7 +601,7 @@ END_EXTERN_C()  #define RETVAL_LONG(l) 					ZVAL_LONG(return_value, l)  #define RETVAL_DOUBLE(d) 				ZVAL_DOUBLE(return_value, d)  #define RETVAL_STR(s)			 		ZVAL_STR(return_value, s) -#define RETVAL_LONG_STR(s)		 		ZVAL_LONG_STR(return_value, s) +#define RETVAL_LONG_STR(s)		 		ZVAL_INTERNED_STR(return_value, s)  #define RETVAL_NEW_STR(s)		 		ZVAL_NEW_STR(return_value, s)  #define RETVAL_STRING(s)		 		ZVAL_STRING(return_value, s)  #define RETVAL_STRINGL(s, l)		 	ZVAL_STRINGL(return_value, s, l) diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index b8edffeb47..13b6e17ce9 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -1276,7 +1276,7 @@ static void zend_mm_check_leaks(zend_mm_heap *heap TSRMLS_DC)  {  	zend_mm_segment *segment = heap->segments_list;  	zend_mm_block *p, *q; -	zend_uint total = 0; +	uint32_t total = 0;  	if (!segment) {  		return; diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 631c825033..dc4d0e126d 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1080,7 +1080,7 @@ ZEND_FUNCTION(get_object_vars)  }  /* }}} */ -static int same_name(const char *key, const char *name, zend_uint name_len) +static int same_name(const char *key, const char *name, uint32_t name_len)  {  	char *lcname = zend_str_tolower_dup(name, name_len);  	int ret = memcmp(lcname, key, name_len) == 0; @@ -1694,9 +1694,9 @@ static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_lis  {  	zend_class_entry *ce = (zend_class_entry *)Z_PTR_P(el);  	zval *array = va_arg(args, zval *); -	zend_uint mask = va_arg(args, zend_uint); -	zend_uint comply = va_arg(args, zend_uint); -	zend_uint comply_mask = (comply)? mask:0; +	uint32_t mask = va_arg(args, uint32_t); +	uint32_t comply = va_arg(args, uint32_t); +	uint32_t comply_mask = (comply)? mask:0;  	if ((hash_key->key && hash_key->key->val[0] != 0)  		&& (comply_mask == (ce->ce_flags & mask))) { @@ -1715,8 +1715,8 @@ static int copy_class_or_interface_name(zval *el TSRMLS_DC, int num_args, va_lis     Returns an array of all declared traits. */  ZEND_FUNCTION(get_declared_traits)  { -	zend_uint mask = ZEND_ACC_TRAIT; -	zend_uint comply = 1; +	uint32_t mask = ZEND_ACC_TRAIT; +	uint32_t comply = 1;  	if (zend_parse_parameters_none() == FAILURE) {  		return; @@ -1732,8 +1732,8 @@ ZEND_FUNCTION(get_declared_traits)     Returns an array of all declared classes. */  ZEND_FUNCTION(get_declared_classes)  { -	zend_uint mask = ZEND_ACC_INTERFACE | (ZEND_ACC_TRAIT & ~ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); -	zend_uint comply = 0; +	uint32_t mask = ZEND_ACC_INTERFACE | (ZEND_ACC_TRAIT & ~ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); +	uint32_t comply = 0;  	if (zend_parse_parameters_none() == FAILURE) {  		return; @@ -1748,8 +1748,8 @@ ZEND_FUNCTION(get_declared_classes)     Returns an array of all declared interfaces. */  ZEND_FUNCTION(get_declared_interfaces)  { -	zend_uint mask = ZEND_ACC_INTERFACE; -	zend_uint comply = 1; +	uint32_t mask = ZEND_ACC_INTERFACE; +	uint32_t comply = 1;  	if (zend_parse_parameters_none() == FAILURE) {  		return; diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 63cf7d7935..525be9dca1 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -308,7 +308,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_  		}  		if (arg_info) { -			zend_uint i, required = closure->func.common.required_num_args; +			uint32_t i, required = closure->func.common.required_num_args;  			array_init(&val); diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c9864f3a7c..7595e1adde 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -97,7 +97,7 @@ ZEND_API zend_compiler_globals compiler_globals;  ZEND_API zend_executor_globals executor_globals;  #endif -static void zend_push_function_call_entry(zend_function *fbc, zend_uint opline_num TSRMLS_DC) /* {{{ */ +static void zend_push_function_call_entry(zend_function *fbc, uint32_t opline_num TSRMLS_DC) /* {{{ */  {  	zend_function_call_entry fcall = { fbc, opline_num };  	zend_stack_push(&CG(function_call_stack), &fcall); @@ -292,9 +292,9 @@ ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */  }  /* }}} */ -static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */ +static uint32_t get_temporary_variable(zend_op_array *op_array) /* {{{ */  { -	return (zend_uint)op_array->T++; +	return (uint32_t)op_array->T++;  }  /* }}} */ @@ -563,7 +563,7 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zval *zv, int un  static inline zend_bool zend_is_function_or_method_call(const znode *variable) /* {{{ */  { -	zend_uint type = variable->EA; +	uint32_t type = variable->EA;  	return  ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL));  } @@ -1253,7 +1253,7 @@ void zend_do_if_end(TSRMLS_D) /* {{{ */  void zend_check_writable_variable(const znode *variable) /* {{{ */  { -	zend_uint type = variable->EA; +	uint32_t type = variable->EA;  	if (type & ZEND_PARSED_METHOD_CALL) {  		zend_error_noreturn(E_COMPILE_ERROR, "Can't use method return value in write context"); @@ -1279,7 +1279,7 @@ void zend_do_end_variable_parse(znode *variable, int type, int arg_offset TSRMLS  	zend_llist_element *le = fetch_list_ptr->head;  	zend_op *opline = NULL;  	zend_op *opline_ptr; -	zend_uint this_var = -1; +	uint32_t this_var = -1;  	/* TODO: $foo->x->y->z = 1 should fetch "x" and "y" for R or RW, not just W */ @@ -1508,7 +1508,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n  	zend_op_array op_array;  	zend_string *name = Z_STR(function_name->u.constant);  	int function_begin_line = function_token->u.op.opline_num; -	zend_uint fn_flags; +	uint32_t fn_flags;  	zend_string *lcname;  	zend_bool orig_interactive;  	ALLOCA_FLAG(use_heap) @@ -1955,7 +1955,7 @@ void zend_do_receive_param(zend_uchar op, znode *varname, znode *initialization,  int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace TSRMLS_DC) /* {{{ */  {  	zend_op *opline; -	zend_uint op_number; +	uint32_t op_number;  	zend_function *function;  	zend_string *lcname;  	char *is_compound = memchr(Z_STRVAL(function_name->u.constant), '\\', Z_STRLEN(function_name->u.constant)); @@ -2062,7 +2062,7 @@ void zend_do_clone(znode *result, znode *expr TSRMLS_DC) /* {{{ */  void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRMLS_DC) /* {{{ */  { -	zend_uint op_number; +	uint32_t op_number;  	zend_op *opline;  	op_number = get_next_op_number(CG(active_op_array)); @@ -2453,7 +2453,7 @@ void zend_release_labels(int temporary TSRMLS_DC) /* {{{ */  void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_class_member TSRMLS_DC) /* {{{ */  { -	zend_uint length; +	uint32_t length;  	if (!result) {  		result = prefix; @@ -2484,7 +2484,7 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c  int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */  {  	znode class_node; -	zend_uint op_number; +	uint32_t op_number;  	zend_op *opline;  	if (method_name->op_type == IS_CONST) { @@ -2593,12 +2593,12 @@ static int zend_do_convert_call(zend_op *init_opline, zend_op *opline, zend_long  }  /* }}} */ -static int zend_do_convert_call_user_func(zend_op *init_opline, zend_uint num_args TSRMLS_DC) /* {{{ */ +static int zend_do_convert_call_user_func(zend_op *init_opline, uint32_t num_args TSRMLS_DC) /* {{{ */  {  	zend_op *opline = init_opline + 1;  	int level = 0;  	int converted = 0; -	zend_uint arg_num = 0; +	uint32_t arg_num = 0;  	zend_function *func = NULL;  	while (1) { @@ -2751,7 +2751,7 @@ static int zend_do_convert_strlen(zend_op *init_opline, znode *result TSRMLS_DC)  }  /* }}} */ -static int zend_do_convert_type_check(zend_op *init_opline, znode *result, zend_uint type TSRMLS_DC) /* {{{ */ +static int zend_do_convert_type_check(zend_op *init_opline, znode *result, uint32_t type TSRMLS_DC) /* {{{ */  {  	zend_op *opline = init_opline + 1;  	zend_op *send = NULL; @@ -2841,7 +2841,7 @@ void zend_do_end_function_call(znode *function_name, znode *result, int is_metho  		}  		opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];  	} else { -		zend_uint call_flags = 0; +		uint32_t call_flags = 0;  		opline = &CG(active_op_array)->opcodes[fcall->op_number];  		opline->extended_value = fcall->arg_num; @@ -3245,7 +3245,7 @@ void zend_do_yield(znode *result, znode *value, znode *key, zend_bool is_variabl  }  /* }}} */ -static int zend_add_try_element(zend_uint try_op TSRMLS_DC) /* {{{ */ +static int zend_add_try_element(uint32_t try_op TSRMLS_DC) /* {{{ */  {  	int try_catch_offset = CG(active_op_array)->last_try_catch++; @@ -3258,7 +3258,7 @@ static int zend_add_try_element(zend_uint try_op TSRMLS_DC) /* {{{ */  }  /* }}} */ -static void zend_add_catch_element(int offset, zend_uint catch_op TSRMLS_DC) /* {{{ */ +static void zend_add_catch_element(int offset, uint32_t catch_op TSRMLS_DC) /* {{{ */  {  	CG(active_op_array)->try_catch_array[offset].catch_op = catch_op;  } @@ -3551,7 +3551,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC) /* {{{  }  /* }}} */ -char *zend_visibility_string(zend_uint fn_flags) /* {{{ */ +char *zend_visibility_string(uint32_t fn_flags) /* {{{ */  {  	if (fn_flags & ZEND_ACC_PRIVATE) {  		return "private"; @@ -3588,7 +3588,7 @@ static zend_function *do_inherit_method(zend_function *old_function TSRMLS_DC) /  static zend_bool zend_do_perform_implementation_check(const zend_function *fe, const zend_function *proto TSRMLS_DC) /* {{{ */  { -	zend_uint i, num_args; +	uint32_t i, num_args;  	/* If it's a user function then arg_info == NULL means we don't have any parameters but  	 * we still need to do the arg number checks.  We are only willing to ignore this for internal @@ -3730,7 +3730,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c  static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{{ */  {  	char *offset, *buf; -	zend_uint length = 1024; +	uint32_t length = 1024;  	offset = buf = (char *)emalloc(length * sizeof(char));  	if (fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) { @@ -3754,14 +3754,14 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{  	*(offset++) = '(';  	if (fptr->common.arg_info) { -		zend_uint i, required; +		uint32_t i, required;  		zend_arg_info *arg_info = fptr->common.arg_info;  		required = fptr->common.required_num_args;  		for (i = 0; i < fptr->common.num_args;) {  			if (arg_info->class_name) {  				const char *class_name; -				zend_uint class_name_len; +				uint32_t class_name_len;  				if (!strcasecmp(arg_info->class_name, "self") && fptr->common.scope ) {  					class_name = fptr->common.scope->name->val;  					class_name_len = fptr->common.scope->name->len; @@ -3777,7 +3777,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{  				offset += class_name_len;  				*(offset++) = ' ';  			} else if (arg_info->type_hint) { -				zend_uint type_name_len; +				uint32_t type_name_len;  				char *type_name = zend_get_type_by_const(arg_info->type_hint);  				type_name_len = strlen(type_name);  				REALLOC_BUF_IF_EXCEED(buf, offset, length, type_name_len); @@ -3803,7 +3803,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{  				memcpy(offset, arg_info->name, arg_info->name_len);  				offset += arg_info->name_len;  			} else { -				zend_uint idx = i; +				uint32_t idx = i;  				memcpy(offset, "param", 5);  				offset += 5;  				do { @@ -3818,7 +3818,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{  				if (fptr->type == ZEND_USER_FUNCTION) {  					zend_op *precv = NULL;  					{ -						zend_uint idx  = i; +						uint32_t idx  = i;  						zend_op *op = ((zend_op_array *)fptr)->opcodes;  						zend_op *end = op + ((zend_op_array *)fptr)->last; @@ -3896,8 +3896,8 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{  static void do_inheritance_check_on_method(zend_function *child, zend_function *parent TSRMLS_DC) /* {{{ */  { -	zend_uint child_flags; -	zend_uint parent_flags = parent->common.fn_flags; +	uint32_t child_flags; +	uint32_t parent_flags = parent->common.fn_flags;  	if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0  		&& parent->common.fn_flags & ZEND_ACC_ABSTRACT @@ -3968,7 +3968,7 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *  static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_function *parent, zend_string *key, zend_class_entry *child_ce) /* {{{ */  { -	zend_uint parent_flags = parent->common.fn_flags; +	uint32_t parent_flags = parent->common.fn_flags;  	zend_function *child;  	TSRMLS_FETCH(); @@ -4047,7 +4047,7 @@ static inline void do_implement_interface(zend_class_entry *ce, zend_class_entry  ZEND_API void zend_do_inherit_interfaces(zend_class_entry *ce, const zend_class_entry *iface TSRMLS_DC) /* {{{ */  {  	/* expects interface to be contained in ce's interface list already */ -	zend_uint i, ce_num, if_num = iface->num_interfaces; +	uint32_t i, ce_num, if_num = iface->num_interfaces;  	zend_class_entry *entry;  	if (if_num==0) { @@ -4286,9 +4286,9 @@ static void do_inherit_iface_constant(zend_string *name, zval *zv, zend_class_en  ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) /* {{{ */  { -	zend_uint i, ignore = 0; -	zend_uint current_iface_num = ce->num_interfaces; -	zend_uint parent_iface_num  = ce->parent ? ce->parent->num_interfaces : 0; +	uint32_t i, ignore = 0; +	uint32_t current_iface_num = ce->num_interfaces; +	uint32_t parent_iface_num  = ce->parent ? ce->parent->num_interfaces : 0;  	zend_function *func;  	zend_string *key;  	zval *zv; @@ -4339,9 +4339,9 @@ ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry  ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */  { -	zend_uint i, ignore = 0; -	zend_uint current_trait_num = ce->num_traits; -	zend_uint parent_trait_num  = ce->parent ? ce->parent->num_traits : 0; +	uint32_t i, ignore = 0; +	uint32_t current_trait_num = ce->num_traits; +	uint32_t parent_trait_num  = ce->parent ? ce->parent->num_traits : 0;  	for (i = 0; i < ce->num_traits; i++) {  		if (ce->traits[i] == NULL) { @@ -4368,8 +4368,8 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr  static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn TSRMLS_DC) /* {{{ */  { -	zend_uint    fn_flags = fn->common.scope->ce_flags; -	zend_uint other_flags = other_fn->common.scope->ce_flags; +	uint32_t    fn_flags = fn->common.scope->ce_flags; +	uint32_t other_flags = other_fn->common.scope->ce_flags;  	return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)  		&& ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)) @@ -4586,7 +4586,7 @@ static int zend_traits_copy_functions(zend_string *fnname, zend_function *fn, ze  static void zend_check_trait_usage(zend_class_entry *ce, zend_class_entry *trait TSRMLS_DC) /* {{{ */  { -	zend_uint i; +	uint32_t i;  	if ((trait->ce_flags & ZEND_ACC_TRAIT) != ZEND_ACC_TRAIT) {  		zend_error_noreturn(E_COMPILE_ERROR, "Class %s is not a trait, Only traits may be used in 'as' and 'insteadof' statements", trait->name->val); @@ -4734,7 +4734,7 @@ static void zend_traits_compile_exclude_table(HashTable* exclude_table, zend_tra  static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{ */  { -	zend_uint i; +	uint32_t i;  	HashTable *overriden = NULL;  	zend_string *key;  	zend_function *fn; @@ -4798,7 +4798,7 @@ static void zend_do_traits_property_binding(zend_class_entry *ce TSRMLS_DC) /* {  	const char* class_name_unused;  	zend_bool not_compatible;  	zval* prop_value; -	zend_uint flags; +	uint32_t flags;  	zend_string *doc_comment;  	/* In the following steps the properties are inserted into the property table @@ -5185,7 +5185,7 @@ void zend_do_early_binding(TSRMLS_D) /* {{{ */  				    ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) &&  				     (ce->type == ZEND_INTERNAL_CLASS))) {  				    if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) { -						zend_uint *opline_num = &CG(active_op_array)->early_binding; +						uint32_t *opline_num = &CG(active_op_array)->early_binding;  						while (*opline_num != -1) {  							opline_num = &CG(active_op_array)->opcodes[*opline_num].result.opline_num; @@ -5230,7 +5230,7 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS  {  	if (op_array->early_binding != -1) {  		zend_bool orig_in_compilation = CG(in_compilation); -		zend_uint opline_num = op_array->early_binding; +		uint32_t opline_num = op_array->early_binding;  		zend_class_entry *ce;  		CG(in_compilation) = 1; @@ -5801,7 +5801,7 @@ ZEND_API int zend_unmangle_property_name_ex(const char *mangled_property, int le  }  /* }}} */ -void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC) /* {{{ */ +void zend_do_declare_property(znode *var_name, znode *value, uint32_t access_type TSRMLS_DC) /* {{{ */  {  	zval property;  	zend_property_info *existing_property_info; @@ -6311,7 +6311,7 @@ void zend_do_end_array(znode *result, const znode *array_node TSRMLS_DC) /* {{{  	if (constant_array) {  		/* try to construct constant array */ -		zend_uint size; +		uint32_t size;  		zend_long num;  		zend_string *str; @@ -7461,7 +7461,7 @@ int zend_get_class_fetch_type(const char *class_name, uint class_name_len) /* {{  }  /* }}} */ -ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var) /* {{{ */ +ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var) /* {{{ */  {  	return op_array->vars[EX_VAR_TO_NUM(var)];  } diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 6d56a5bda3..af33b3e007 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -54,7 +54,7 @@ typedef struct _zend_op_array zend_op_array;  typedef struct _zend_op zend_op;  typedef struct _zend_compiler_context { -	zend_uint  opcodes_size; +	uint32_t  opcodes_size;  	int        vars_size;  	int        literals_size;  	int        current_brk_cont; @@ -64,11 +64,11 @@ typedef struct _zend_compiler_context {  } zend_compiler_context;  typedef union _znode_op { -	zend_uint      constant; -	zend_uint      var; -	zend_uint      num; +	uint32_t      constant; +	uint32_t      var; +	uint32_t      num;  	zend_ulong     hash; -	zend_uint      opline_num; /*  Needs to be signed */ +	uint32_t      opline_num; /*  Needs to be signed */  	zend_op       *jmp_addr;  	zval          *zv;  	void          *ptr;        /* Used for passing pointers from the compile to execution phase, currently used for traits */ @@ -82,7 +82,7 @@ typedef struct _znode { /* used only during compilation */  		zend_op_array *op_array;  		zend_ast *ast;  	} u; -	zend_uint EA;      /* extended attributes */ +	uint32_t EA;      /* extended attributes */  } znode;  typedef struct _zend_execute_data zend_execute_data; @@ -118,14 +118,14 @@ typedef struct _zend_brk_cont_element {  typedef struct _zend_label {  	int brk_cont; -	zend_uint opline_num; +	uint32_t opline_num;  } zend_label;  typedef struct _zend_try_catch_element { -	zend_uint try_op; -	zend_uint catch_op;  /* ketchup! */ -	zend_uint finally_op; -	zend_uint finally_end; +	uint32_t try_op; +	uint32_t catch_op;  /* ketchup! */ +	uint32_t finally_op; +	uint32_t finally_end;  } zend_try_catch_element;  #if SIZEOF_ZEND_INT == 8 @@ -208,11 +208,11 @@ typedef struct _zend_try_catch_element {  /* function has arguments with type hinting */  #define ZEND_ACC_HAS_TYPE_HINTS			0x10000000 -char *zend_visibility_string(zend_uint fn_flags); +char *zend_visibility_string(uint32_t fn_flags);  typedef struct _zend_property_info { -	zend_uint flags; +	uint32_t flags;  	zend_string *name;  	zend_ulong h;  	int offset; @@ -222,9 +222,9 @@ typedef struct _zend_property_info {  typedef struct _zend_arg_info {  	const char *name;			// TODO: convert into zend_string ??? -	zend_uint name_len; +	uint32_t name_len;  	const char *class_name;		// TODO: convert into zend_string ??? -	zend_uint class_name_len; +	uint32_t class_name_len;  	zend_uchar type_hint;  	zend_uchar pass_by_reference;  	zend_bool allow_null; @@ -237,9 +237,9 @@ typedef struct _zend_arg_info {   */  typedef struct _zend_internal_function_info {  	const char *_name; -	zend_uint _name_len; +	uint32_t _name_len;  	const char *_class_name; -	zend_uint required_num_args; +	uint32_t required_num_args;  	zend_uchar _type_hint;  	zend_bool return_reference;  	zend_bool _allow_null; @@ -251,22 +251,22 @@ struct _zend_op_array {  	zend_uchar type;  	zend_string *function_name;  	zend_class_entry *scope; -	zend_uint fn_flags; +	uint32_t fn_flags;  	zend_function *prototype; -	zend_uint num_args; -	zend_uint required_num_args; +	uint32_t num_args; +	uint32_t required_num_args;  	zend_arg_info *arg_info;  	/* END of common elements */ -	zend_uint *refcount; +	uint32_t *refcount;  	zend_op *opcodes; -	zend_uint last; +	uint32_t last;  	zend_string **vars;  	int last_var; -	zend_uint T; +	uint32_t T;  	zend_brk_cont_element *brk_cont_array;  	int last_brk_cont; @@ -278,13 +278,13 @@ struct _zend_op_array {  	/* static variables support */  	HashTable *static_variables; -	zend_uint this_var; +	uint32_t this_var;  	zend_string *filename; -	zend_uint line_start; -	zend_uint line_end; +	uint32_t line_start; +	uint32_t line_end;  	zend_string *doc_comment; -	zend_uint early_binding; /* the linked list of delayed declarations */ +	uint32_t early_binding; /* the linked list of delayed declarations */  	zval *literals;  	int last_literal; @@ -304,10 +304,10 @@ typedef struct _zend_internal_function {  	zend_uchar type;  	zend_string* function_name;  	zend_class_entry *scope; -	zend_uint fn_flags; +	uint32_t fn_flags;  	zend_function *prototype; -	zend_uint num_args; -	zend_uint required_num_args; +	uint32_t num_args; +	uint32_t required_num_args;  	zend_arg_info *arg_info;  	/* END of common elements */ @@ -324,10 +324,10 @@ union _zend_function {  		zend_uchar type;  /* never used */  		zend_string *function_name;  		zend_class_entry *scope; -		zend_uint fn_flags; +		uint32_t fn_flags;  		union _zend_function *prototype; -		zend_uint num_args; -		zend_uint required_num_args; +		uint32_t num_args; +		uint32_t required_num_args;  		zend_arg_info *arg_info;  	} common; @@ -337,8 +337,8 @@ union _zend_function {  typedef struct _zend_function_call_entry {  	zend_function *fbc; -	zend_uint op_number; -	zend_uint arg_num; +	uint32_t op_number; +	uint32_t arg_num;  	zend_bool uses_argument_unpacking;  } zend_function_call_entry; @@ -367,7 +367,7 @@ struct _zend_execute_data {  	zend_execute_data   *call;             /* current call                   */  	void               **run_time_cache;  	zend_function       *func;             /* executed op_array              */ -	zend_uint            num_args; +	uint32_t            num_args;  	zend_uchar           flags;  	zend_uchar           frame_kind;  	zend_class_entry    *called_scope; @@ -435,7 +435,7 @@ void zend_resolve_non_class_name(znode *element_name, zend_bool *check_namespace  void zend_resolve_function_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);  void zend_resolve_const_name(znode *element_name, zend_bool *check_namespace TSRMLS_DC);  void zend_resolve_class_name(znode *class_name TSRMLS_DC); -ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, zend_uint var); +ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var);  #ifdef ZTS  const char *zend_get_zendtext(TSRMLS_D); @@ -559,7 +559,7 @@ void zend_do_default_before_statement(const znode *case_list, znode *default_tok  void zend_do_begin_class_declaration(const znode *class_token, znode *class_name, const znode *parent_class_name TSRMLS_DC);  void zend_do_end_class_declaration(const znode *class_token, const znode *parent_token TSRMLS_DC); -void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_type TSRMLS_DC); +void zend_do_declare_property(znode *var_name, znode *value, uint32_t access_type TSRMLS_DC);  void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC);  void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS_DC); diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index e23ee23458..b8ae88707b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -149,12 +149,12 @@ static const zend_internal_function zend_pass_function = {  #undef EX  #define EX(element) execute_data->element -ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, zend_uint var) +ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, uint32_t var)  {  	return EX_VAR(var);  } -static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_tmp(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)  {  	zval *ret = EX_VAR(var);  	should_free->var = ret; @@ -164,7 +164,7 @@ static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const zend_exec  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -172,7 +172,7 @@ static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_exec  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_var_deref(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_var_deref(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -181,7 +181,7 @@ static zend_always_inline zval *_get_zval_ptr_var_deref(zend_uint var, const zen  	return ret;  } -static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, zend_uint var, int type, const zend_execute_data *execute_data TSRMLS_DC) +static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, uint32_t var, int type, const zend_execute_data *execute_data TSRMLS_DC)  {  	zend_string *cv; @@ -205,7 +205,7 @@ static zend_never_inline zval *_get_zval_cv_lookup(zval *ptr, zend_uint var, int  	return ptr;  } -static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, zend_uint var, const zend_execute_data *execute_data TSRMLS_DC) +static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)  {  	zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var)); @@ -213,7 +213,7 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_R(zval *ptr, zend_uin  	return &EG(uninitialized_zval);  } -static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, zend_uint var, const zend_execute_data *execute_data TSRMLS_DC) +static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)  {  	zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var)); @@ -221,12 +221,12 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_UNSET(zval *ptr, zend  	return &EG(uninitialized_zval);  } -static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_IS(zval *ptr, zend_uint var, const zend_execute_data *execute_data TSRMLS_DC) +static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_IS(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)  {  	return &EG(uninitialized_zval);  } -static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, zend_uint var, const zend_execute_data *execute_data TSRMLS_DC) +static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)  {  	zend_string *cv = CV_DEF_OF(EX_VAR_TO_NUM(var)); @@ -235,13 +235,13 @@ static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_RW(zval *ptr, zend_ui  	return ptr;  } -static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, zend_uint var, const zend_execute_data *execute_data TSRMLS_DC) +static zend_always_inline zval *_get_zval_cv_lookup_BP_VAR_W(zval *ptr, uint32_t var, const zend_execute_data *execute_data TSRMLS_DC)  {  	ZVAL_NULL(ptr);  	return ptr;  } -static zend_always_inline zval *_get_zval_ptr_cv(const zend_execute_data *execute_data, zend_uint var, int type TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv(const zend_execute_data *execute_data, uint32_t var, int type TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -251,7 +251,7 @@ static zend_always_inline zval *_get_zval_ptr_cv(const zend_execute_data *execut  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_deref(const zend_execute_data *execute_data, zend_uint var, int type TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_deref(const zend_execute_data *execute_data, uint32_t var, int type TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -262,7 +262,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref(const zend_execute_data *  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -272,7 +272,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_dat  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_R(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_R(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -283,7 +283,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_R(const zend_execu  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -293,7 +293,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_UNSET(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_UNSET(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -304,7 +304,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_UNSET(const zend_e  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -314,7 +314,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_da  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -325,7 +325,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_IS(const zend_exec  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -335,7 +335,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_da  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_RW(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_RW(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -346,7 +346,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_RW(const zend_exec  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -356,12 +356,12 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_dat  	return ret;  } -static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_undef_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	return EX_VAR(var);  } -static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(const zend_execute_data *execute_data, uint32_t var TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -432,7 +432,7 @@ static inline zval *_get_zval_ptr_deref(int op_type, const znode_op *node, const  	return NULL;  } -static zend_always_inline zval *_get_zval_ptr_ptr_var(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC) +static zend_always_inline zval *_get_zval_ptr_ptr_var(uint32_t var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)  {  	zval *ret = EX_VAR(var); @@ -542,7 +542,7 @@ ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, ze  	}  } -ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC) +ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC)  {  	zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;  	const char *fname = zf->common.function_name->val; @@ -574,7 +574,7 @@ ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, zen  	}  } -static void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, zend_ulong fetch_type TSRMLS_DC) +static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zend_ulong fetch_type TSRMLS_DC)  {  	zend_arg_info *cur_arg_info;  	char *need_msg; @@ -623,7 +623,7 @@ static void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg  	}  } -static inline int zend_verify_missing_arg_type(zend_function *zf, zend_uint arg_num, zend_ulong fetch_type TSRMLS_DC) +static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_num, zend_ulong fetch_type TSRMLS_DC)  {  	zend_arg_info *cur_arg_info;  	char *need_msg; @@ -660,7 +660,7 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, zend_uint arg_  	return 0;  } -static void zend_verify_missing_arg(zend_execute_data *execute_data, zend_uint arg_num TSRMLS_DC) +static void zend_verify_missing_arg(zend_execute_data *execute_data, uint32_t arg_num TSRMLS_DC)  {  	if (EXPECTED(!(EX(func)->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) ||  	    zend_verify_missing_arg_type(EX(func), arg_num, EX(opline)->extended_value TSRMLS_CC)) { @@ -768,7 +768,7 @@ static inline void zend_assign_to_object(zval *retval, zval *object_ptr, zval *p  static void zend_assign_to_string_offset(zval *str_offset, zval *value, int value_type, zval *result TSRMLS_DC)  {  	zval *str = Z_STR_OFFSET_STR_P(str_offset); -	zend_uint offset = Z_STR_OFFSET_IDX_P(str_offset); +	uint32_t offset = Z_STR_OFFSET_IDX_P(str_offset);  	zend_string *old_str;  	if ((int)offset < 0) { @@ -816,7 +816,7 @@ static void zend_assign_to_string_offset(zval *str_offset, zval *value, int valu  		zend_uchar c = (zend_uchar)Z_STRVAL_P(str)[offset];  		if (CG(one_char_string)[c]) { -			ZVAL_LONG_STR(result, CG(one_char_string)[c]); +			ZVAL_INTERNED_STR(result, CG(one_char_string)[c]);  		} else {  			ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(str) + offset, 1, 0));  		} @@ -1319,7 +1319,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z  			zend_uchar c = (zend_uchar)Z_STRVAL_P(container)[offset];  			if (CG(one_char_string)[c]) { -				ZVAL_LONG_STR(result, CG(one_char_string)[c]); +				ZVAL_INTERNED_STR(result, CG(one_char_string)[c]);  			} else {  				ZVAL_NEW_STR(result, zend_string_init(Z_STRVAL_P(container) + offset, 1, 0));  			} @@ -1552,7 +1552,7 @@ void zend_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /*  static zend_always_inline void i_init_func_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */  { -	zend_uint first_extra_arg; +	uint32_t first_extra_arg;  	ZEND_ASSERT(EX(func) == (zend_function*)op_array);  	ZEND_ASSERT(EX(object) == Z_OBJ(EG(This))); @@ -1660,7 +1660,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da  	if (UNEXPECTED(EX(symbol_table) != NULL)) {  		zend_attach_symbol_table(execute_data);  	} else { -		zend_uint first_extra_arg = op_array->num_args; +		uint32_t first_extra_arg = op_array->num_args;  		if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {  			first_extra_arg--; @@ -1718,7 +1718,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data  	 * restore it simply by replacing a pointer.  	 */  	zend_execute_data *execute_data; -	zend_uint num_args = call->num_args; +	uint32_t num_args = call->num_args;  	EG(argument_stack) = zend_vm_stack_new_page(  		MAX(ZEND_VM_STACK_PAGE_SIZE,  @@ -1762,12 +1762,12 @@ ZEND_API void zend_init_execute_data(zend_execute_data *execute_data, zend_op_ar  static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(zend_op *opline, zend_execute_data *call TSRMLS_DC) /* {{{ */  { -	zend_uint arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK; +	uint32_t arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK;  	return ARG_SHOULD_BE_SENT_BY_REF(call->func, arg_num);  }  /* }}} */ -static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call, zend_uint passed_args, zend_uint additional_args TSRMLS_DC) /* {{{ */ +static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call, uint32_t passed_args, uint32_t additional_args TSRMLS_DC) /* {{{ */  {  	zend_execute_data *new_call;  	int used_stack = (EG(argument_stack)->top - (zval*)call) + additional_args; @@ -1803,7 +1803,7 @@ static zend_execute_data *zend_vm_stack_copy_call_frame(zend_execute_data *call,  }  /* }}} */ -static zend_always_inline void zend_vm_stack_extend_call_frame(zend_execute_data **call, zend_uint passed_args, zend_uint additional_args TSRMLS_DC) /* {{{ */ +static zend_always_inline void zend_vm_stack_extend_call_frame(zend_execute_data **call, uint32_t passed_args, uint32_t additional_args TSRMLS_DC) /* {{{ */  {  	if (EXPECTED(EG(argument_stack)->end - EG(argument_stack)->top > additional_args)) {  		EG(argument_stack)->top += additional_args; diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 921ea1748c..ae777cdafe 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -49,7 +49,7 @@ ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name,  ZEND_API int zend_eval_stringl_ex(char *str, int str_len, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);  ZEND_API char * zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info, zend_ulong fetch_type, char **class_name, zend_class_entry **pce TSRMLS_DC); -ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, zend_uint arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC); +ZEND_API void zend_verify_arg_error(int error_type, const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind, zval *arg TSRMLS_DC);  static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC)  { @@ -208,7 +208,7 @@ static zend_always_inline void zend_vm_stack_extend(int count TSRMLS_DC)  	EG(argument_stack) = p;  } -static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_function *func, zend_uint num_args, zend_uchar flags, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC) +static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_function *func, uint32_t num_args, zend_uchar flags, zend_class_entry *called_scope, zend_object *object, zend_execute_data *prev TSRMLS_DC)  {  	int used_stack = ZEND_CALL_FRAME_SLOT + num_args;  	zend_execute_data *call; @@ -230,7 +230,7 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_  static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *call TSRMLS_DC)  { -	zend_uint first_extra_arg = call->func->op_array.num_args - ((call->func->common.fn_flags & ZEND_ACC_VARIADIC) != 0); +	uint32_t first_extra_arg = call->func->op_array.num_args - ((call->func->common.fn_flags & ZEND_ACC_VARIADIC) != 0);   	if (UNEXPECTED(call->num_args > first_extra_arg)) {   		zval *end = EX_VAR_NUM_2(call, call->func->op_array.last_var + call->func->op_array.T); @@ -244,7 +244,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *  static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call TSRMLS_DC)  { -	zend_uint num_args = call->num_args;	 +	uint32_t num_args = call->num_args;	  	if (num_args > 0) {  		zval *end = ZEND_CALL_ARG(call, 1); @@ -300,7 +300,7 @@ void zend_shutdown_timeout_thread(void);   */  #define Z_OBJ_CLASS_NAME_P(obj) (((obj) && (obj)->handlers->get_class_entry != NULL && (obj)->handlers->get_class_entry) ? (obj)->handlers->get_class_entry(obj TSRMLS_CC)->name->val : "") -ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, zend_uint var); +ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, uint32_t var);  #define ZEND_USER_OPCODE_CONTINUE   0 /* execute next opcode */  #define ZEND_USER_OPCODE_RETURN     1 /* exit from executor (return from function) */ diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index c8a3c41afa..af309c5e64 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -633,13 +633,13 @@ ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC) /  }  /* }}} */ -int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, zend_uint param_count, zval params[] TSRMLS_DC) /* {{{ */ +int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[] TSRMLS_DC) /* {{{ */  {  	return call_user_function_ex(function_table, object, function_name, retval_ptr, param_count, params, 1, NULL TSRMLS_CC);  }  /* }}} */ -int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, zend_uint param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC) /* {{{ */ +int call_user_function_ex(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[], int no_separation, zend_array *symbol_table TSRMLS_DC) /* {{{ */  {  	zend_fcall_info fci; @@ -659,7 +659,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio  int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TSRMLS_DC) /* {{{ */  { -	zend_uint i; +	uint32_t i;  	zend_class_entry *calling_scope = NULL;  	zend_execute_data *call, dummy_execute_data;  	zend_fcall_info_cache fci_cache_local; @@ -1062,7 +1062,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s  {  	zval pv;  	zend_op_array *new_op_array; -	zend_uint original_compiler_options; +	uint32_t original_compiler_options;  	int retval;  	if (retval_ptr) { @@ -1584,7 +1584,7 @@ ZEND_API int zend_delete_global_variable(zend_string *name TSRMLS_DC) /* {{{ */  ZEND_API zend_array *zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */  { -	zend_uint i; +	uint32_t i;  	zend_execute_data *ex;  	zend_array *symbol_table; diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index 8d619f2e5e..84b7ef3208 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -77,7 +77,7 @@ typedef struct _gc_root_buffer {  	zend_refcounted          *ref;  	struct _gc_root_buffer   *next;     /* double-linked list               */  	struct _gc_root_buffer   *prev; -	zend_uint                 refcount; +	uint32_t                 refcount;  } gc_root_buffer;  typedef struct _zend_gc_globals { @@ -93,16 +93,16 @@ typedef struct _zend_gc_globals {  	gc_root_buffer    to_free;			/* list to free                     */  	gc_root_buffer   *next_to_free; -	zend_uint gc_runs; -	zend_uint collected; +	uint32_t gc_runs; +	uint32_t collected;  #if GC_BENCH -	zend_uint root_buf_length; -	zend_uint root_buf_peak; -	zend_uint zval_possible_root; -	zend_uint zval_buffered; -	zend_uint zval_remove_from_buffer; -	zend_uint zval_marked_grey; +	uint32_t root_buf_length; +	uint32_t root_buf_peak; +	uint32_t zval_possible_root; +	uint32_t zval_buffered; +	uint32_t zval_remove_from_buffer; +	uint32_t zval_marked_grey;  #endif  } zend_gc_globals; diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 922c6a3f2b..a2497cf16f 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -44,7 +44,7 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato  	{  		/* -1 required because we want the last run opcode, not the  		 * next to-be-run one. */ -		zend_uint op_num = execute_data->opline - op_array->opcodes - 1; +		uint32_t op_num = execute_data->opline - op_array->opcodes - 1;  		int i;  		for (i = 0; i < op_array->last_brk_cont; ++i) { @@ -143,7 +143,7 @@ static void zend_generator_dtor_storage(zend_object *object TSRMLS_DC) /* {{{ */  {  	zend_generator *generator = (zend_generator*) object;  	zend_execute_data *ex = generator->execute_data; -	zend_uint op_num, finally_op_num; +	uint32_t op_num, finally_op_num;  	int i;  	if (!ex || !ex->func->op_array.has_finally_block) { diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 8be149f767..758e373ac2 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -118,16 +118,16 @@ struct _zend_compiler_globals {  	int interactive; -	zend_uint start_lineno; +	uint32_t start_lineno;  	zend_bool increment_lineno;  	znode implementing_class; -	zend_uint access_type; +	uint32_t access_type;  	zend_string *doc_comment; -	zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */ +	uint32_t compiler_options; /* set of ZEND_COMPILE_* constants */  	zval       current_namespace;  	HashTable *current_import; diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 469b8a82ce..c698ba759d 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -87,15 +87,15 @@ static void zend_hash_do_resize(HashTable *ht);  			(ht)->arData = (Bucket *) safe_pemalloc((ht)->nTableSize, sizeof(Bucket), 0, (ht)->u.flags & HASH_FLAG_PERSISTENT);	\  			(ht)->u.flags |= HASH_FLAG_PACKED; \  		} else { \ -			(ht)->arData = (Bucket *) safe_pemalloc((ht)->nTableSize, sizeof(Bucket) + sizeof(zend_uint), 0, (ht)->u.flags & HASH_FLAG_PERSISTENT);	\ -			(ht)->arHash = (zend_uint*)((ht)->arData + (ht)->nTableSize);	\ -			memset((ht)->arHash, INVALID_IDX, (ht)->nTableSize * sizeof(zend_uint));	\ +			(ht)->arData = (Bucket *) safe_pemalloc((ht)->nTableSize, sizeof(Bucket) + sizeof(uint32_t), 0, (ht)->u.flags & HASH_FLAG_PERSISTENT);	\ +			(ht)->arHash = (uint32_t*)((ht)->arData + (ht)->nTableSize);	\ +			memset((ht)->arHash, INVALID_IDX, (ht)->nTableSize * sizeof(uint32_t));	\  		} \  		(ht)->nTableMask = (ht)->nTableSize - 1;						\  	}																	\  } while (0) -static const zend_uint uninitialized_bucket = {INVALID_IDX}; +static const uint32_t uninitialized_bucket = {INVALID_IDX};  ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)  { @@ -118,7 +118,7 @@ ZEND_API void _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor  	ht->nNumOfElements = 0;  	ht->nNextFreeElement = 0;  	ht->arData = NULL; -	ht->arHash = (zend_uint*)&uninitialized_bucket; +	ht->arHash = (uint32_t*)&uninitialized_bucket;  	ht->pDestructor = pDestructor;  	ht->nInternalPointer = INVALID_IDX;  	if (persistent) { @@ -148,8 +148,8 @@ ZEND_API void zend_hash_packed_to_hash(HashTable *ht)  {  	HANDLE_BLOCK_INTERRUPTIONS();  	ht->u.flags &= ~HASH_FLAG_PACKED; -	ht->arData = (Bucket *) safe_perealloc(ht->arData, ht->nTableSize, sizeof(Bucket) + sizeof(zend_uint), 0, ht->u.flags & HASH_FLAG_PERSISTENT); -	ht->arHash = (zend_uint*)(ht->arData + ht->nTableSize); +	ht->arData = (Bucket *) safe_perealloc(ht->arData, ht->nTableSize, sizeof(Bucket) + sizeof(uint32_t), 0, ht->u.flags & HASH_FLAG_PERSISTENT); +	ht->arHash = (uint32_t*)(ht->arData + ht->nTableSize);  	zend_hash_rehash(ht);  	HANDLE_UNBLOCK_INTERRUPTIONS();  } @@ -159,7 +159,7 @@ ZEND_API void zend_hash_to_packed(HashTable *ht)  	HANDLE_BLOCK_INTERRUPTIONS();  	ht->u.flags |= HASH_FLAG_PACKED;  	ht->arData = erealloc(ht->arData, ht->nTableSize * sizeof(Bucket)); -	ht->arHash = (zend_uint*)&uninitialized_bucket; +	ht->arHash = (uint32_t*)&uninitialized_bucket;  	HANDLE_UNBLOCK_INTERRUPTIONS();  } @@ -564,8 +564,8 @@ static void zend_hash_do_resize(HashTable *ht)  		HANDLE_UNBLOCK_INTERRUPTIONS();  	} else if ((ht->nTableSize << 1) > 0) {	/* Let's double the table size */  		HANDLE_BLOCK_INTERRUPTIONS(); -		ht->arData = (Bucket *) safe_perealloc(ht->arData, (ht->nTableSize << 1), sizeof(Bucket) + sizeof(zend_uint), 0, ht->u.flags & HASH_FLAG_PERSISTENT); -		ht->arHash = (zend_uint*)(ht->arData + (ht->nTableSize << 1)); +		ht->arData = (Bucket *) safe_perealloc(ht->arData, (ht->nTableSize << 1), sizeof(Bucket) + sizeof(uint32_t), 0, ht->u.flags & HASH_FLAG_PERSISTENT); +		ht->arHash = (uint32_t*)(ht->arData + (ht->nTableSize << 1));  		ht->nTableSize = (ht->nTableSize << 1);  		ht->nTableMask = ht->nTableSize - 1;  		zend_hash_rehash(ht); @@ -582,12 +582,12 @@ ZEND_API int zend_hash_rehash(HashTable *ht)  	if (UNEXPECTED(ht->nNumOfElements == 0)) {  		if (ht->nTableMask) { -			memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(zend_uint)); +			memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(uint32_t));  		}  		return SUCCESS;  	} -	memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(zend_uint)); +	memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(uint32_t));  	for (i = 0, j = 0; i < ht->nNumUsed; i++) {  		p = ht->arData + i;  		if (Z_TYPE(p->val) == IS_UNDEF) continue; @@ -934,7 +934,7 @@ ZEND_API void zend_hash_clean(HashTable *ht)  	ht->nInternalPointer = INVALID_IDX;  	if (ht->nTableMask) {  		if (!(ht->u.flags & HASH_FLAG_PACKED)) { -			memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(zend_uint));	 +			memset(ht->arHash, INVALID_IDX, ht->nTableSize * sizeof(uint32_t));	  		}  	}  } @@ -1188,7 +1188,7 @@ ZEND_API void zend_array_dup(HashTable *target, HashTable *source)  			target->nNumOfElements = source->nNumOfElements;  			target->nNextFreeElement = source->nNextFreeElement;  			target->arData = (Bucket *) safe_pemalloc(target->nTableSize, sizeof(Bucket), 0, 0); -			target->arHash = (zend_uint*)&uninitialized_bucket; +			target->arHash = (uint32_t*)&uninitialized_bucket;  			target->nInternalPointer = source->nInternalPointer;  			for (idx = 0; idx < source->nNumUsed; idx++) {		 @@ -1230,9 +1230,9 @@ ZEND_API void zend_array_dup(HashTable *target, HashTable *source)  			}  		} else {  			target->nNextFreeElement = source->nNextFreeElement; -			target->arData = (Bucket *) safe_pemalloc(target->nTableSize, sizeof(Bucket) + sizeof(zend_uint), 0, 0); -			target->arHash = (zend_uint*)(target->arData + target->nTableSize); -			memset(target->arHash, INVALID_IDX, target->nTableSize * sizeof(zend_uint)); +			target->arData = (Bucket *) safe_pemalloc(target->nTableSize, sizeof(Bucket) + sizeof(uint32_t), 0, 0); +			target->arHash = (uint32_t*)(target->arData + target->nTableSize); +			memset(target->arHash, INVALID_IDX, target->nTableSize * sizeof(uint32_t));  			for (idx = 0; idx < source->nNumUsed; idx++) {		  				p = source->arData + idx; @@ -1282,7 +1282,7 @@ ZEND_API void zend_array_dup(HashTable *target, HashTable *source)  		target->nNumOfElements = 0;  		target->nNextFreeElement = 0;  		target->arData = NULL; -		target->arHash = (zend_uint*)&uninitialized_bucket; +		target->arHash = (uint32_t*)&uninitialized_bucket;  	}  } @@ -1728,7 +1728,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,  		if (renumber) {  			ht->u.flags |= HASH_FLAG_PACKED;  			ht->arData = erealloc(ht->arData, ht->nTableSize * sizeof(Bucket)); -			ht->arHash = (zend_uint*)&uninitialized_bucket; +			ht->arHash = (uint32_t*)&uninitialized_bucket;  		} else {  			zend_hash_rehash(ht);  		} diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index d5420dae76..8c55f3d7c1 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -303,7 +303,7 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c  static int zend_implement_traversable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC)  {  	/* check that class_type is traversable at c-level or implements at least one of 'aggregate' and 'Iterator' */ -	zend_uint i; +	uint32_t i;  	if (class_type->get_iterator || (class_type->parent && class_type->parent->get_iterator)) {  		return SUCCESS; @@ -406,7 +406,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en  /* }}}*/  /* {{{ zend_user_serialize */ -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC)  {  	zend_class_entry * ce = Z_OBJCE_P(object);  	zval retval; @@ -443,7 +443,7 @@ ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint  /* }}} */  /* {{{ zend_user_unserialize */ -ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) +ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC)  {  	zval zdata; @@ -463,7 +463,7 @@ ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const uns  }  /* }}} */ -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */  {  	zend_class_entry *ce = Z_OBJCE_P(object);  	zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name->val); @@ -471,7 +471,7 @@ ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zen  }  /* }}} */ -ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */  {  	zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name->val);  	return FAILURE; diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index 7fe0e4e2f0..88e1dfe05b 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -61,11 +61,11 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c  ZEND_API void zend_register_interfaces(TSRMLS_D); -ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_user_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_user_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC); -ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); -ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC); +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC); +ZEND_API int zend_class_unserialize_deny(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC);  END_EXTERN_C() diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index c1b2f3ba6e..50930df20d 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -25,7 +25,7 @@  #include "zend_API.h"  #include "zend_objects_API.h"	 -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size) +ZEND_API void zend_objects_store_init(zend_objects_store *objects, uint32_t init_size)  {  	objects->object_buckets = (zend_object **) emalloc(init_size * sizeof(zend_object*));  	objects->top = 1; /* Skip 0 so that handles are true */ @@ -42,7 +42,7 @@ ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)  ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC)  { -	zend_uint i; +	uint32_t i;  	for (i = 1; i < objects->top ; i++) {  		zend_object *obj = objects->object_buckets[i]; @@ -60,7 +60,7 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS  ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)  { -	zend_uint i; +	uint32_t i;  	if (!objects->object_buckets) {  		return; @@ -76,7 +76,7 @@ ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSR  ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC)  { -	zend_uint i; +	uint32_t i;  	/* Free object properties but don't free object their selves */  	for (i = objects->top - 1; i > 0 ; i--) { @@ -134,7 +134,7 @@ ZEND_API void zend_objects_store_put(zend_object *object TSRMLS_DC)  ZEND_API void zend_objects_store_free(zend_object *object TSRMLS_DC) /* {{{ */  { -	zend_uint handle = object->handle; +	uint32_t handle = object->handle;  	void *ptr = ((char*)object) - object->handlers->offset;  	GC_REMOVE_FROM_BUFFER(object); @@ -169,7 +169,7 @@ ZEND_API void zend_objects_store_del(zend_object *object TSRMLS_DC) /* {{{ */  			}  			if (GC_REFCOUNT(object) == 0) { -				zend_uint handle = object->handle; +				uint32_t handle = object->handle;  				void *ptr;  				EG(objects_store).object_buckets[handle] = SET_OBJ_INVALID(object); diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h index 4d6afe6842..df22a26cc9 100644 --- a/Zend/zend_objects_API.h +++ b/Zend/zend_objects_API.h @@ -48,14 +48,14 @@  typedef struct _zend_objects_store {  	zend_object **object_buckets; -	zend_uint top; -	zend_uint size; +	uint32_t top; +	uint32_t size;  	int free_list_head;  } zend_objects_store;  /* Global store handling functions */  BEGIN_EXTERN_C() -ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size); +ZEND_API void zend_objects_store_init(zend_objects_store *objects, uint32_t init_size);  ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC);  ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC);  ZEND_API void zend_objects_store_destroy(zend_objects_store *objects); diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index b08dd9acf2..d09f28b0dc 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -43,7 +43,7 @@ static void zend_extension_op_array_dtor_handler(zend_extension *extension, zend  	}  } -static void op_array_alloc_ops(zend_op_array *op_array, zend_uint size) +static void op_array_alloc_ops(zend_op_array *op_array, uint32_t size)  {  	op_array->opcodes = erealloc(op_array->opcodes, size * sizeof(zend_op));  } @@ -59,7 +59,7 @@ void init_op_array(zend_op_array *op_array, zend_uchar type, int initial_ops_siz  		initial_ops_size = INITIAL_INTERACTIVE_OP_ARRAY_SIZE;  	} -	op_array->refcount = (zend_uint *) emalloc(sizeof(zend_uint)); +	op_array->refcount = (uint32_t *) emalloc(sizeof(uint32_t));  	*op_array->refcount = 1;  	op_array->last = 0;  	op_array->opcodes = NULL; @@ -321,7 +321,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)  {  	zval *literal = op_array->literals;  	zval *end; -	zend_uint i; +	uint32_t i;  	if (op_array->static_variables) {  		zend_hash_destroy(op_array->static_variables); @@ -392,7 +392,7 @@ void init_op(zend_op *op TSRMLS_DC)  zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC)  { -	zend_uint next_op_num = op_array->last++; +	uint32_t next_op_num = op_array->last++;  	zend_op *next_op;  	if (next_op_num >= CG(context).opcodes_size) { @@ -455,9 +455,9 @@ static void zend_extension_op_array_handler(zend_extension *extension, zend_op_a  	}  } -static void zend_check_finally_breakout(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC) +static void zend_check_finally_breakout(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num TSRMLS_DC)  { -	zend_uint i; +	uint32_t i;  	for (i = 0; i < op_array->last_try_catch; i++) {  		if ((op_num < op_array->try_catch_array[i].finally_op || @@ -480,10 +480,10 @@ static void zend_check_finally_breakout(zend_op_array *op_array, zend_uint op_nu  	}   } -static void zend_adjust_fast_call(zend_op_array *op_array, zend_uint fast_call, zend_uint start, zend_uint end TSRMLS_DC) +static void zend_adjust_fast_call(zend_op_array *op_array, uint32_t fast_call, uint32_t start, uint32_t end TSRMLS_DC)  {  	int i; -	zend_uint op_num = 0; +	uint32_t op_num = 0;  	for (i = 0; i < op_array->last_try_catch; i++) {  		if (op_array->try_catch_array[i].finally_op > start  @@ -501,10 +501,10 @@ static void zend_adjust_fast_call(zend_op_array *op_array, zend_uint fast_call,  	}  } -static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint fast_call, zend_uint op_num TSRMLS_DC) +static void zend_resolve_fast_call(zend_op_array *op_array, uint32_t fast_call, uint32_t op_num TSRMLS_DC)  {  	int i; -	zend_uint finally_op_num = 0; +	uint32_t finally_op_num = 0;  	for (i = 0; i < op_array->last_try_catch; i++) {  		if (op_num >= op_array->try_catch_array[i].finally_op @@ -523,13 +523,13 @@ static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint fast_call,  	}   } -static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num, zend_uint dst_num TSRMLS_DC) +static void zend_resolve_finally_call(zend_op_array *op_array, uint32_t op_num, uint32_t dst_num TSRMLS_DC)  { -	zend_uint start_op; +	uint32_t start_op;  	zend_op *opline; -	zend_uint i = op_array->last_try_catch; +	uint32_t i = op_array->last_try_catch; -	if (dst_num != (zend_uint)-1) { +	if (dst_num != (uint32_t)-1) {  		zend_check_finally_breakout(op_array, op_num, dst_num TSRMLS_CC);  	} @@ -601,10 +601,10 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,  	}	  } -static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num TSRMLS_DC) +static void zend_resolve_finally_ret(zend_op_array *op_array, uint32_t op_num TSRMLS_DC)  {  	int i; -	zend_uint catch_op_num = 0, finally_op_num = 0; +	uint32_t catch_op_num = 0, finally_op_num = 0;  	for (i = 0; i < op_array->last_try_catch; i++) {  		if (op_array->try_catch_array[i].try_op > op_num) { @@ -631,7 +631,7 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num T  static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)  { -	zend_uint i, j; +	uint32_t i, j;  	zend_op *opline;  	for (i = 0, j = op_array->last; i < j; i++) { @@ -640,7 +640,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)  			case ZEND_RETURN:  			case ZEND_RETURN_BY_REF:  			case ZEND_GENERATOR_RETURN: -				zend_resolve_finally_call(op_array, i, (zend_uint)-1 TSRMLS_CC); +				zend_resolve_finally_call(op_array, i, (uint32_t)-1 TSRMLS_CC);  				break;  			case ZEND_BRK:  			case ZEND_CONT: @@ -662,7 +662,7 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)  			}  			case ZEND_GOTO:  				if (Z_TYPE(op_array->literals[opline->op2.constant]) != IS_LONG) { -					zend_uint num = opline->op2.constant; +					uint32_t num = opline->op2.constant;  					opline->op2.zv = &op_array->literals[opline->op2.constant];  					zend_resolve_goto_label(op_array, opline, 1 TSRMLS_CC);  					opline->op2.constant = num;					 @@ -718,20 +718,20 @@ ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC)  		if (opline->op1_type == IS_CONST) {  			opline->op1.zv = &op_array->literals[opline->op1.constant];  		} else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) { -			opline->op1.var = (zend_uint)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->op1.var); +			opline->op1.var = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->op1.var);  		}  		if (opline->op2_type == IS_CONST) {  			opline->op2.zv = &op_array->literals[opline->op2.constant];  		} else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) { -			opline->op2.var = (zend_uint)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->op2.var); +			opline->op2.var = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->op2.var);  		}  		if (opline->result_type & (IS_VAR|IS_TMP_VAR)) { -			opline->result.var = (zend_uint)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->result.var); +			opline->result.var = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->result.var);  		}  		switch (opline->opcode) {  			case ZEND_DECLARE_INHERITED_CLASS:  			case ZEND_DECLARE_INHERITED_CLASS_DELAYED: -				opline->extended_value = (zend_uint)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->extended_value); +				opline->extended_value = (uint32_t)(zend_intptr_t)EX_VAR_NUM_2(NULL, op_array->last_var + opline->extended_value);  				break;  			case ZEND_GOTO:  				if (Z_TYPE_P(opline->op2.zv) != IS_LONG) { diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 31127f8e4f..025b56e3cd 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -135,7 +135,7 @@ ZEND_API zend_long zend_atol(const char *str, int str_len) /* {{{ */  }  /* }}} */ -ZEND_API double zend_string_to_double(const char *number, zend_uint length) /* {{{ */ +ZEND_API double zend_string_to_double(const char *number, uint32_t length) /* {{{ */  {  	double divisor = 10.0;  	double result = 0.0; @@ -2013,7 +2013,7 @@ ZEND_API int is_smaller_or_equal_function(zval *result, zval *op1, zval *op2 TSR  ZEND_API zend_bool instanceof_function_ex(const zend_class_entry *instance_ce, const zend_class_entry *ce, zend_bool interfaces_only TSRMLS_DC) /* {{{ */  { -	zend_uint i; +	uint32_t i;  	for (i=0; i<instance_ce->num_interfaces; i++) {  		if (instanceof_function(instance_ce->interfaces[i], ce TSRMLS_CC)) { diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 6eba27a9e4..fcf8ad42af 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -367,7 +367,7 @@ ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2  #define convert_to_cstring(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }  #define convert_to_string(op) if (Z_TYPE_P(op) != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); } -ZEND_API double zend_string_to_double(const char *number, zend_uint length); +ZEND_API double zend_string_to_double(const char *number, uint32_t length);  ZEND_API int zval_is_true(zval *op);  ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c index 71338d211e..049d29f6a2 100644 --- a/Zend/zend_static_allocator.c +++ b/Zend/zend_static_allocator.c @@ -22,13 +22,13 @@  /* Not checking emalloc() and erealloc() return values as they are supposed to bailout */ -inline static void block_init(Block *block, zend_uint block_size) +inline static void block_init(Block *block, uint32_t block_size)  {  	block->pos = block->bp = (char *) emalloc(block_size);  	block->end = block->bp + block_size;  } -inline static char *block_allocate(Block *block, zend_uint size) +inline static char *block_allocate(Block *block, uint32_t size)  {  	char *retval = block->pos;  	if ((block->pos += size) >= block->end) { @@ -50,7 +50,7 @@ void static_allocator_init(StaticAllocator *sa)  	sa->current_block = 0;  } -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size) +char *static_allocator_allocate(StaticAllocator *sa, uint32_t size)  {  	char *retval; @@ -67,7 +67,7 @@ char *static_allocator_allocate(StaticAllocator *sa, zend_uint size)  void static_allocator_destroy(StaticAllocator *sa)  { -	zend_uint i; +	uint32_t i;  	for (i=0; i<sa->num_blocks; i++) {  		block_free(&sa->Blocks[i]); diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h index 7516065707..cd9b0ff583 100644 --- a/Zend/zend_static_allocator.h +++ b/Zend/zend_static_allocator.h @@ -24,7 +24,7 @@  #define ALLOCATOR_BLOCK_SIZE 400000  /* Temporary */ -typedef unsigned int zend_uint; +typedef unsigned int uint32_t;  #define emalloc(s) malloc(s)  #define efree(p) free(p) @@ -36,12 +36,12 @@ typedef struct _Block {  typedef struct _StaticAllocator {  	Block *Blocks; -	zend_uint num_blocks; -	zend_uint current_block; +	uint32_t num_blocks; +	uint32_t current_block;  } StaticAllocator;  void static_allocator_init(StaticAllocator *sa); -char *static_allocator_allocate(StaticAllocator *sa, zend_uint size); +char *static_allocator_allocate(StaticAllocator *sa, uint32_t size);  void static_allocator_destroy(StaticAllocator *sa);  #endif /* ZEND_STATIC_ALLOCATOR_H */ diff --git a/Zend/zend_string.c b/Zend/zend_string.c index 132c98f740..03ab71aff5 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -50,8 +50,8 @@ void zend_interned_strings_init(TSRMLS_D)  	CG(interned_strings).nTableMask = CG(interned_strings).nTableSize - 1;  	CG(interned_strings).arData = (Bucket*) pecalloc(CG(interned_strings).nTableSize, sizeof(Bucket), 1); -	CG(interned_strings).arHash = (zend_uint*) pecalloc(CG(interned_strings).nTableSize, sizeof(zend_uint), 1); -	memset(CG(interned_strings).arHash, INVALID_IDX, CG(interned_strings).nTableSize * sizeof(zend_uint)); +	CG(interned_strings).arHash = (uint32_t*) pecalloc(CG(interned_strings).nTableSize, sizeof(uint32_t), 1); +	memset(CG(interned_strings).arHash, INVALID_IDX, CG(interned_strings).nTableSize * sizeof(uint32_t));  	/* interned empty string */  	str = zend_string_alloc(sizeof("")-1, 1); @@ -114,7 +114,7 @@ static zend_string *zend_new_interned_string_int(zend_string *str TSRMLS_DC)  	if (CG(interned_strings).nNumUsed >= CG(interned_strings).nTableSize) {  		if ((CG(interned_strings).nTableSize << 1) > 0) {	/* Let's double the table size */  			Bucket *d = (Bucket *) perealloc_recoverable(CG(interned_strings).arData, (CG(interned_strings).nTableSize << 1) * sizeof(Bucket), 1); -			zend_uint *h = (zend_uint *) perealloc_recoverable(CG(interned_strings).arHash, (CG(interned_strings).nTableSize << 1) * sizeof(zend_uint), 1); +			uint32_t *h = (uint32_t *) perealloc_recoverable(CG(interned_strings).arHash, (CG(interned_strings).nTableSize << 1) * sizeof(uint32_t), 1);  			if (d && h) {  				HANDLE_BLOCK_INTERRUPTIONS(); diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 5655402661..0d13575dbf 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -68,7 +68,7 @@ static zend_always_inline void zend_string_forget_hash_val(zend_string *s)  	s->h = 0;  } -static zend_always_inline zend_uint zend_string_refcount(zend_string *s) +static zend_always_inline uint32_t zend_string_refcount(zend_string *s)  {  	if (!IS_INTERNED(s)) {  		return GC_REFCOUNT(s); @@ -76,7 +76,7 @@ static zend_always_inline zend_uint zend_string_refcount(zend_string *s)  	return 1;  } -static zend_always_inline zend_uint zend_string_addref(zend_string *s) +static zend_always_inline uint32_t zend_string_addref(zend_string *s)  {  	if (!IS_INTERNED(s)) {  		return ++GC_REFCOUNT(s); @@ -84,7 +84,7 @@ static zend_always_inline zend_uint zend_string_addref(zend_string *s)  	return 1;  } -static zend_always_inline zend_uint zend_string_delref(zend_string *s) +static zend_always_inline uint32_t zend_string_delref(zend_string *s)  {  	if (!IS_INTERNED(s)) {  		return --GC_REFCOUNT(s); diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h index 45ac51495c..0adedff437 100644 --- a/Zend/zend_ts_hash.h +++ b/Zend/zend_ts_hash.h @@ -25,7 +25,7 @@  typedef struct _zend_ts_hashtable {  	HashTable hash; -	zend_uint reader; +	uint32_t reader;  #ifdef ZTS  	MUTEX_T mx_reader;  	MUTEX_T mx_writer; diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 3927ba6f0c..bb47f82842 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -42,8 +42,6 @@  typedef unsigned char zend_bool;  typedef unsigned char zend_uchar; -typedef uint32_t      zend_uint; -typedef unsigned short zend_ushort;  #ifdef ZEND_ENABLE_INT64  # ifdef ZEND_WIN32 @@ -127,26 +125,26 @@ struct _zval_struct {  				zend_uchar    const_flags,  				zend_uchar    reserved)	    /* various IS_VAR flags */  		} v; -		zend_uint type_info; +		uint32_t type_info;  	} u1;  	union { -		zend_uint     var_flags; -		zend_uint     next;                 /* hash collision chain */ -		zend_uint     str_offset;           /* string offset */ -		zend_uint     cache_slot;           /* literal cache slot */ +		uint32_t     var_flags; +		uint32_t     next;                 /* hash collision chain */ +		uint32_t     str_offset;           /* string offset */ +		uint32_t     cache_slot;           /* literal cache slot */  	} u2;  };  struct _zend_refcounted { -	zend_uint         refcount;			/* reference counter 32-bit */ +	uint32_t         refcount;			/* reference counter 32-bit */  	union {  		struct {  			ZEND_ENDIAN_LOHI_3(  				zend_uchar    type,  				zend_uchar    flags,    /* used for strings & objects */ -				zend_ushort   gc_info)  /* keeps GC root number (or 0) and color */ +				uint16_t   gc_info)  /* keeps GC root number (or 0) and color */  		} v; -		zend_uint type_info; +		uint32_t type_info;  	} u;  }; @@ -164,23 +162,23 @@ typedef struct _Bucket {  } Bucket;  typedef struct _HashTable {	 -	zend_uint         nTableSize; -	zend_uint         nTableMask; -	zend_uint         nNumUsed; -	zend_uint         nNumOfElements; +	uint32_t         nTableSize; +	uint32_t         nTableMask; +	uint32_t         nNumUsed; +	uint32_t         nNumOfElements;  	zend_long        nNextFreeElement;  	Bucket           *arData; -	zend_uint        *arHash; +	uint32_t        *arHash;  	dtor_func_t       pDestructor; -	zend_uint         nInternalPointer;  +	uint32_t         nInternalPointer;   	union {  		struct {  			ZEND_ENDIAN_LOHI_3(  				zend_uchar    flags,  				zend_uchar    nApplyCount, -				zend_ushort   reserve) +				uint16_t   reserve)  		} v; -		zend_uint flags; +		uint32_t flags;  	} u;  } HashTable; @@ -191,7 +189,7 @@ struct _zend_array {  struct _zend_object {  	zend_refcounted   gc; -	zend_uint         handle; // TODO: may be removed ??? +	uint32_t         handle; // TODO: may be removed ???  	zend_class_entry *ce;  	const zend_object_handlers *handlers;  	HashTable        *properties; @@ -520,7 +518,7 @@ static inline zend_uchar zval_get_type(const zval* pz) {  			IS_STRING_EX;						\  	} while (0) -#define ZVAL_LONG_STR(z, s) do {					\ +#define ZVAL_INTERNED_STR(z, s) do {					\  		zval *__z = (z);						\  		zend_string *__s = (s);					\  		Z_STR_P(__z) = __s;						\ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 6fd4dba65d..06a84b8835 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2671,7 +2671,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)  		EG(current_execute_data) = call;  		if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) { -			zend_uint i; +			uint32_t i;  			zval *p = ZEND_CALL_ARG(call, 1);  			for (i = 0; i < call->num_args; ++i) { @@ -3349,7 +3349,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)  		EX(call)->called_scope = NULL;  		EX(call)->object = NULL;  	} else { -		zend_uint arg_num = 1; +		uint32_t arg_num = 1;  		HashTable *ht = Z_ARRVAL_P(args);  		zval *arg, *param, tmp; @@ -3357,7 +3357,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)  		zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht) TSRMLS_CC);  		if (OP1_TYPE != IS_CONST && OP1_TYPE != IS_TMP_VAR && Z_IMMUTABLE_P(args)) { -			zend_uint i; +			uint32_t i;  			int separate = 0;  			/* check if any of arguments are going to be passed by reference */ @@ -3527,7 +3527,7 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)  ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)  {  	USE_OPLINE -	zend_uint arg_num = opline->op1.num; +	uint32_t arg_num = opline->op1.num;  	SAVE_OPLINE();  	if (UNEXPECTED(arg_num > EX(num_args))) { @@ -3546,7 +3546,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)  ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)  {  	USE_OPLINE -	zend_uint arg_num = opline->op1.num; +	uint32_t arg_num = opline->op1.num;  	zval *param;  	SAVE_OPLINE(); @@ -3574,8 +3574,8 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)  ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)  {  	USE_OPLINE -	zend_uint arg_num = opline->op1.num; -	zend_uint arg_count = EX(num_args); +	uint32_t arg_num = opline->op1.num; +	uint32_t arg_count = EX(num_args);  	zval *params;  	SAVE_OPLINE(); @@ -3990,7 +3990,7 @@ ZEND_VM_C_LABEL(str_index):  ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUSED|CV)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -5395,9 +5395,9 @@ ZEND_VM_HANDLER(155, ZEND_BIND_TRAITS, ANY, ANY)  ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)  { -	zend_uint op_num = EG(opline_before_exception) - EX(func)->op_array.opcodes; +	uint32_t op_num = EG(opline_before_exception) - EX(func)->op_array.opcodes;  	int i; -	zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0; +	uint32_t catch_op_num = 0, finally_op_num = 0, finally_op_end = 0;  	for (i = 0; i < EX(func)->op_array.last_try_catch; i++) {  		if (EX(func)->op_array.try_catch_array[i].try_op > op_num) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 9885f2e3e4..c74609e331 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -564,7 +564,7 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  		EG(current_execute_data) = call;  		if (fbc->common.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) { -			zend_uint i; +			uint32_t i;  			zval *p = ZEND_CALL_ARG(call, 1);  			for (i = 0; i < call->num_args; ++i) { @@ -904,7 +904,7 @@ static int ZEND_FASTCALL  ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  		EX(call)->called_scope = NULL;  		EX(call)->object = NULL;  	} else { -		zend_uint arg_num = 1; +		uint32_t arg_num = 1;  		HashTable *ht = Z_ARRVAL_P(args);  		zval *arg, *param, tmp; @@ -912,7 +912,7 @@ static int ZEND_FASTCALL  ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  		zend_vm_stack_extend_call_frame(&EX(call), 0, zend_hash_num_elements(ht) TSRMLS_CC);  		if (opline->op1_type != IS_CONST && opline->op1_type != IS_TMP_VAR && Z_IMMUTABLE_P(args)) { -			zend_uint i; +			uint32_t i;  			int separate = 0;  			/* check if any of arguments are going to be passed by reference */ @@ -1003,7 +1003,7 @@ static int ZEND_FASTCALL  ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  static int ZEND_FASTCALL  ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	USE_OPLINE -	zend_uint arg_num = opline->op1.num; +	uint32_t arg_num = opline->op1.num;  	SAVE_OPLINE();  	if (UNEXPECTED(arg_num > EX(num_args))) { @@ -1022,8 +1022,8 @@ static int ZEND_FASTCALL  ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  static int ZEND_FASTCALL  ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	USE_OPLINE -	zend_uint arg_num = opline->op1.num; -	zend_uint arg_count = EX(num_args); +	uint32_t arg_num = opline->op1.num; +	uint32_t arg_count = EX(num_args);  	zval *params;  	SAVE_OPLINE(); @@ -1297,9 +1297,9 @@ static int ZEND_FASTCALL  ZEND_BIND_TRAITS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS  static int ZEND_FASTCALL  ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  { -	zend_uint op_num = EG(opline_before_exception) - EX(func)->op_array.opcodes; +	uint32_t op_num = EG(opline_before_exception) - EX(func)->op_array.opcodes;  	int i; -	zend_uint catch_op_num = 0, finally_op_num = 0, finally_op_end = 0; +	uint32_t catch_op_num = 0, finally_op_num = 0, finally_op_end = 0;  	for (i = 0; i < EX(func)->op_array.last_try_catch; i++) {  		if (EX(func)->op_array.try_catch_array[i].try_op > op_num) { @@ -1738,7 +1738,7 @@ static int ZEND_FASTCALL  ZEND_INIT_FCALL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER  static int ZEND_FASTCALL  ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	USE_OPLINE -	zend_uint arg_num = opline->op1.num; +	uint32_t arg_num = opline->op1.num;  	zval *param;  	SAVE_OPLINE(); @@ -4305,7 +4305,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -5220,7 +5220,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -6103,7 +6103,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -6788,7 +6788,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -7731,7 +7731,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -9713,7 +9713,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -10552,7 +10552,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -11392,7 +11392,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -11961,7 +11961,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -12782,7 +12782,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -16376,7 +16376,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -18515,7 +18515,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -20721,7 +20721,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -22181,7 +22181,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -24104,7 +24104,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -25565,7 +25565,7 @@ constant_fetch_end:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -26845,7 +26845,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -28127,7 +28127,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -28918,7 +28918,7 @@ static int ZEND_FASTCALL  ZEND_ASSIGN_BW_XOR_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPC  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -29918,7 +29918,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -33374,7 +33374,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -35424,7 +35424,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -37510,7 +37510,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -38852,7 +38852,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); @@ -40637,7 +40637,7 @@ str_index:  static int ZEND_FASTCALL  ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)  {  	zval *array; -	zend_uint size; +	uint32_t size;  	USE_OPLINE  	array = EX_VAR(opline->result.var); diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index e82fd3f38b..c75d7f80d1 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -179,7 +179,7 @@ typedef struct {  	php_curl_handlers       *handlers;  	zend_resource           *res;  	zend_bool                in_callback; -	zend_uint				 clone; +	uint32_t				 clone;  	zend_bool                safe_upload;  } php_curl; diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index d9d9e3e3b1..18dd499fad 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -529,7 +529,7 @@ static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */  }  /* }}} */ -static int gmp_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +static int gmp_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */  {  	mpz_ptr gmpnum = GET_GMP_FROM_ZVAL(object);  	smart_str buf = {0}; @@ -556,7 +556,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, zend_uint *buf_le  }  /* }}} */ -static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned char *buf, uint32_t buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */  {  	mpz_ptr gmpnum;  	const unsigned char *p, *max; diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 826e5716c8..0276397393 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -106,7 +106,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz  	zend_op *opline;  	zend_op *end = op_array->opcodes + op_array->last;  	zend_code_block *blocks, *cur_block; -	zend_uint opno = 0; +	uint32_t opno = 0;  	memset(cfg, 0, sizeof(zend_cfg));  	blocks = cfg->blocks = zend_arena_calloc(&ctx->arena, op_array->last + 2, sizeof(zend_code_block)); @@ -1264,8 +1264,8 @@ static void assemble_code_blocks(zend_cfg *cfg, zend_op_array *op_array)  	op_array->opcodes = erealloc(new_opcodes, op_array->last * sizeof(zend_op));  	/* adjust early binding list */ -	if (op_array->early_binding != (zend_uint)-1) { -		zend_uint *opline_num = &op_array->early_binding; +	if (op_array->early_binding != (uint32_t)-1) { +		uint32_t *opline_num = &op_array->early_binding;  		zend_op *end;  		opline = op_array->opcodes; @@ -1441,7 +1441,7 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra  			if (block->op2_to) {  				zend_uchar same_type = ZEND_OP1_TYPE(last_op); -				zend_uint same_var = VAR_NUM_EX(last_op->op1); +				uint32_t same_var = VAR_NUM_EX(last_op->op1);  				zend_op *target;  				zend_op *target_end;  				zend_code_block *target_block = block->op2_to;; diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c index a8cbcbfc8d..87cae3b12c 100644 --- a/ext/opcache/Optimizer/compact_literals.c +++ b/ext/opcache/Optimizer/compact_literals.c @@ -44,7 +44,7 @@  #define LITERAL_NUM_SLOTS(info)   ((info & LITERAL_NUM_SLOTS_MASK) >> LITERAL_NUM_SLOTS_SHIFT)  typedef struct _literal_info { -	zend_uint  flags; /* bitmask (see defines above) */ +	uint32_t  flags; /* bitmask (see defines above) */  	union {  		int    num;   /* variable number or class name literal number */  	} u; @@ -71,9 +71,9 @@ static void optimizer_literal_obj_info(literal_info   *info,                                         zend_uchar      op_type,                                         znode_op        op,                                         int             constant, -                                       zend_uint       kind, -                                       zend_uint       slots, -                                       zend_uint       related, +                                       uint32_t       kind, +                                       uint32_t       slots, +                                       uint32_t       related,                                         zend_op_array  *op_array)  {  	/* For now we merge only $this object properties and methods. @@ -92,9 +92,9 @@ static void optimizer_literal_class_info(literal_info   *info,                                           zend_uchar      op_type,                                           znode_op        op,                                           int             constant, -                                         zend_uint       kind, -                                         zend_uint       slots, -                                         zend_uint       related, +                                         uint32_t       kind, +                                         uint32_t       slots, +                                         uint32_t       related,                                           zend_op_array  *op_array)  {  	if (op_type == IS_CONST) { diff --git a/ext/opcache/Optimizer/nop_removal.c b/ext/opcache/Optimizer/nop_removal.c index 80da02ce32..2d695c0495 100644 --- a/ext/opcache/Optimizer/nop_removal.c +++ b/ext/opcache/Optimizer/nop_removal.c @@ -26,12 +26,12 @@  static void nop_removal(zend_op_array *op_array)  {  	zend_op *end, *opline; -	zend_uint new_count, i, shift; +	uint32_t new_count, i, shift;  	int j; -	zend_uint *shiftlist; +	uint32_t *shiftlist;  	ALLOCA_FLAG(use_heap); -	shiftlist = (zend_uint *)DO_ALLOCA(sizeof(zend_uint) * op_array->last); +	shiftlist = (uint32_t *)DO_ALLOCA(sizeof(uint32_t) * op_array->last);  	i = new_count = shift = 0;  	end = op_array->opcodes + op_array->last;  	for (opline = op_array->opcodes; opline < end; opline++) { @@ -120,13 +120,13 @@ static void nop_removal(zend_op_array *op_array)  		}  		/* update early binding list */ -		if (op_array->early_binding != (zend_uint)-1) { -			zend_uint *opline_num = &op_array->early_binding; +		if (op_array->early_binding != (uint32_t)-1) { +			uint32_t *opline_num = &op_array->early_binding;  			do {  				*opline_num -= shiftlist[*opline_num];  				opline_num = &ZEND_RESULT(&op_array->opcodes[*opline_num]).opline_num; -			} while (*opline_num != (zend_uint)-1); +			} while (*opline_num != (uint32_t)-1);  		}  	}  	FREE_ALLOCA(shiftlist); diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index e4561f50b3..cc8a37e529 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -60,7 +60,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  				ZEND_OP2_TYPE(opline) == IS_CONST) {  				/* binary operation with constant operands */  				int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC) = get_binary_op(opline->opcode); -				zend_uint tv = ZEND_RESULT(opline).var;		/* temporary variable */ +				uint32_t tv = ZEND_RESULT(opline).var;		/* temporary variable */  				zval result;  				int er; @@ -92,7 +92,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  				opline->extended_value != IS_OBJECT &&  				opline->extended_value != IS_RESOURCE) {  				/* cast of constant operand */ -				zend_uint tv = ZEND_RESULT(opline).var;		/* temporary variable */ +				uint32_t tv = ZEND_RESULT(opline).var;		/* temporary variable */  				zval res;  				res = ZEND_OP1_LITERAL(opline);  				zval_copy_ctor(&res); @@ -135,7 +135,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  				/* unary operation on constant operand */  				unary_op_type unary_op = get_unary_op(opline->opcode);  				zval result; -				zend_uint tv = ZEND_RESULT(opline).var;		/* temporary variable */ +				uint32_t tv = ZEND_RESULT(opline).var;		/* temporary variable */  				int er;  				er = EG(error_reporting); @@ -238,7 +238,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  				fake_execute_data.func = (zend_function*)op_array;  				EG(current_execute_data) = &fake_execute_data;  				if ((offset = zend_get_constant_str("__COMPILER_HALT_OFFSET__", sizeof("__COMPILER_HALT_OFFSET__") - 1 TSRMLS_CC)) != NULL) { -					zend_uint tv = ZEND_RESULT(opline).var; +					uint32_t tv = ZEND_RESULT(opline).var;  					literal_dtor(&ZEND_OP2_LITERAL(opline));  					MAKE_NOP(opline); @@ -252,7 +252,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  				ZEND_OP2_TYPE(opline) == IS_CONST &&  				Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {  				/* substitute persistent constants */ -				zend_uint tv = ZEND_RESULT(opline).var; +				uint32_t tv = ZEND_RESULT(opline).var;  				zval c;  				if (!zend_get_persistent_constant(Z_STR(ZEND_OP2_LITERAL(opline)), &c, 1 TSRMLS_CC)) { @@ -300,7 +300,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  				}  				if (ce) { -					zend_uint tv = ZEND_RESULT(opline).var; +					uint32_t tv = ZEND_RESULT(opline).var;  					zval *c, t;  					if ((c = zend_hash_find(&ce->constants_table, @@ -480,7 +480,7 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {  		case ZEND_DEFINED:  			{  				zval c; -				zend_uint tv = ZEND_RESULT(opline).var; +				uint32_t tv = ZEND_RESULT(opline).var;  				if (!zend_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline)), &c, 0 TSRMLS_CC)) {  					break;  				} diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c index 810eedb646..1444fa6d3d 100644 --- a/ext/opcache/Optimizer/pass3.c +++ b/ext/opcache/Optimizer/pass3.c @@ -48,13 +48,13 @@  if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) {  	zend_op *opline;  	zend_op *end = op_array->opcodes + op_array->last; -	zend_uint *jmp_hitlist; +	uint32_t *jmp_hitlist;  	int jmp_hitlist_count;  	int i; -	zend_uint opline_num = 0; +	uint32_t opline_num = 0;  	ALLOCA_FLAG(use_heap); -	jmp_hitlist = (zend_uint *)DO_ALLOCA(sizeof(zend_uint)*op_array->last); +	jmp_hitlist = (uint32_t *)DO_ALLOCA(sizeof(uint32_t)*op_array->last);  	opline = op_array->opcodes;  	while (opline < end) { diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index 81ff920e10..9f14bac614 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -290,7 +290,7 @@ check_numeric:  static int replace_var_by_const(zend_op_array *op_array,                                  zend_op       *opline, -                                zend_uint      var, +                                uint32_t      var,                                  zval          *val TSRMLS_DC)  {  	zend_op *end = op_array->opcodes + op_array->last; @@ -344,7 +344,7 @@ static int replace_var_by_const(zend_op_array *op_array,  static void replace_tmp_by_const(zend_op_array *op_array,                                   zend_op       *opline, -                                 zend_uint      var, +                                 uint32_t      var,                                   zval          *val                                   TSRMLS_DC)  { diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h index b0ba12abc7..1ac883b561 100644 --- a/ext/opcache/Optimizer/zend_optimizer_internal.h +++ b/ext/opcache/Optimizer/zend_optimizer_internal.h @@ -25,7 +25,7 @@  #include "ZendAccelerator.h"  #define VAR_NUM(v) EX_VAR_TO_NUM(v) -#define NUM_VAR(v) ((zend_uint)(zend_uintptr_t)EX_VAR_NUM_2(0, v)) +#define NUM_VAR(v) ((uint32_t)(zend_uintptr_t)EX_VAR_NUM_2(0, v))  #define INV_COND(op)       ((op) == ZEND_JMPZ    ? ZEND_JMPNZ    : ZEND_JMPZ)  #define INV_EX_COND(op)    ((op) == ZEND_JMPZ_EX ? ZEND_JMPNZ    : ZEND_JMPZ) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index ad5a08a3d1..85adb20b50 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1283,7 +1283,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han  	zend_op_array *op_array;  	int do_bailout = 0;  	accel_time_t timestamp = 0; -	zend_uint orig_compiler_options = 0; +	uint32_t orig_compiler_options = 0;      /* Try to open file */      if (file_handle->type == ZEND_HANDLE_FILENAME) { @@ -1581,7 +1581,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T  	/* If script was not found or invalidated by validate_timestamps */  	if (!persistent_script) { -		zend_uint old_const_num = zend_hash_next_free_element(EG(zend_constants)); +		uint32_t old_const_num = zend_hash_next_free_element(EG(zend_constants));  		zend_op_array *op_array;  		/* Cache miss.. */ @@ -1608,7 +1608,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T  		}  		if (from_shared_memory) {  			/* Delete immutable arrays moved into SHM */ -			zend_uint new_const_num = zend_hash_next_free_element(EG(zend_constants)); +			uint32_t new_const_num = zend_hash_next_free_element(EG(zend_constants));  			while (new_const_num > old_const_num) {  				new_const_num--;  				zend_hash_index_del(EG(zend_constants), new_const_num); @@ -2185,13 +2185,13 @@ static int zend_accel_init_shm(TSRMLS_D)  	if (ZCG(accel_directives).interned_strings_buffer) {  		ZCSG(interned_strings).nTableMask = ZCSG(interned_strings).nTableSize - 1;  		ZCSG(interned_strings).arData = zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(Bucket)); -		ZCSG(interned_strings).arHash = (zend_uint*)zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(zend_uint)); +		ZCSG(interned_strings).arHash = (uint32_t*)zend_shared_alloc(ZCSG(interned_strings).nTableSize * sizeof(uint32_t));  		ZCSG(interned_strings_start) = zend_shared_alloc((ZCG(accel_directives).interned_strings_buffer * 1024 * 1024));  		if (!ZCSG(interned_strings).arData || !ZCSG(interned_strings_start)) {  			zend_accel_error(ACCEL_LOG_FATAL, ACCELERATOR_PRODUCT_NAME " cannot allocate buffer for interned strings");  			return FAILURE;  		} -		memset(ZCSG(interned_strings).arHash, INVALID_IDX, ZCSG(interned_strings).nTableSize * sizeof(zend_uint)); +		memset(ZCSG(interned_strings).arHash, INVALID_IDX, ZCSG(interned_strings).nTableSize * sizeof(uint32_t));  		ZCSG(interned_strings_end)   = ZCSG(interned_strings_start) + (ZCG(accel_directives).interned_strings_buffer * 1024 * 1024);  		ZCSG(interned_strings_top)   = ZCSG(interned_strings_start); diff --git a/ext/opcache/zend_accelerator_hash.c b/ext/opcache/zend_accelerator_hash.c index 02474fc11f..671792239b 100644 --- a/ext/opcache/zend_accelerator_hash.c +++ b/ext/opcache/zend_accelerator_hash.c @@ -36,7 +36,7 @@ void zend_accel_hash_clean(zend_accel_hash *accel_hash)  	memset(accel_hash->hash_table, 0, sizeof(zend_accel_hash_entry *)*accel_hash->max_num_entries);  } -void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size) +void zend_accel_hash_init(zend_accel_hash *accel_hash, uint32_t hash_size)  {  	uint i; @@ -71,7 +71,7 @@ void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size)   * Returns pointer the actual hash entry on success   * key needs to be already allocated as it is not copied   */ -zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, zend_uint key_length, zend_bool indirect, void *data) +zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char *key, uint32_t key_length, zend_bool indirect, void *data)  {  	zend_ulong hash_value;  	zend_ulong index; @@ -140,7 +140,7 @@ zend_accel_hash_entry* zend_accel_hash_update(zend_accel_hash *accel_hash, char  /* Returns the data associated with key on success   * Returns NULL if data doesn't exist   */ -void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_uint key_length) +void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, uint32_t key_length)  {  	zend_ulong hash_value;  	zend_ulong index; @@ -168,7 +168,7 @@ void* zend_accel_hash_find(zend_accel_hash *accel_hash, char *key, zend_uint key  /* Returns the hash entry associated with key on success   * Returns NULL if it doesn't exist   */ -zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, zend_uint key_length) +zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, char *key, uint32_t key_length)  {  	zend_ulong hash_value;  	zend_ulong index; @@ -193,7 +193,7 @@ zend_accel_hash_entry* zend_accel_hash_find_entry(zend_accel_hash *accel_hash, c  	return NULL;  } -int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, zend_uint key_length) +int zend_accel_hash_unlink(zend_accel_hash *accel_hash, char *key, uint32_t key_length)  {      zend_ulong hash_value;      zend_ulong index; diff --git a/ext/opcache/zend_accelerator_hash.h b/ext/opcache/zend_accelerator_hash.h index 2de28bffa7..5c995b43ee 100644 --- a/ext/opcache/zend_accelerator_hash.h +++ b/ext/opcache/zend_accelerator_hash.h @@ -47,7 +47,7 @@ typedef struct _zend_accel_hash_entry zend_accel_hash_entry;  struct _zend_accel_hash_entry {  	zend_ulong             hash_value;  	char                  *key; -	zend_uint              key_length; +	uint32_t              key_length;  	zend_accel_hash_entry *next;  	void                  *data;  	zend_bool              indirect; @@ -56,35 +56,35 @@ struct _zend_accel_hash_entry {  typedef struct _zend_accel_hash {  	zend_accel_hash_entry **hash_table;  	zend_accel_hash_entry  *hash_entries; -	zend_uint               num_entries; -	zend_uint               max_num_entries; -	zend_uint               num_direct_entries; +	uint32_t               num_entries; +	uint32_t               max_num_entries; +	uint32_t               num_direct_entries;  } zend_accel_hash; -void zend_accel_hash_init(zend_accel_hash *accel_hash, zend_uint hash_size); +void zend_accel_hash_init(zend_accel_hash *accel_hash, uint32_t hash_size);  void zend_accel_hash_clean(zend_accel_hash *accel_hash);  zend_accel_hash_entry* zend_accel_hash_update(  		zend_accel_hash        *accel_hash,  		char                   *key, -		zend_uint               key_length, +		uint32_t               key_length,  		zend_bool               indirect,  		void                   *data);  void* zend_accel_hash_find(  		zend_accel_hash        *accel_hash,  		char                   *key, -		zend_uint               key_length); +		uint32_t               key_length);  zend_accel_hash_entry* zend_accel_hash_find_entry(  		zend_accel_hash        *accel_hash,  		char                   *key, -		zend_uint               key_length); +		uint32_t               key_length);  int zend_accel_hash_unlink(  		zend_accel_hash        *accel_hash,  		char                   *key, -		zend_uint               key_length); +		uint32_t               key_length);  static inline zend_bool zend_accel_hash_is_full(zend_accel_hash *accel_hash)  { diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index e096869b83..46eb03ee47 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -27,7 +27,7 @@  #define ZEND_PROTECTED_REFCOUNT	(1<<30) -static zend_uint zend_accel_refcount = ZEND_PROTECTED_REFCOUNT; +static uint32_t zend_accel_refcount = ZEND_PROTECTED_REFCOUNT;  #if SIZEOF_SIZE_T <= SIZEOF_ZEND_INT  /* If sizeof(void*) == sizeof(ulong) we can use zend_hash index functions */ @@ -41,7 +41,7 @@ static zend_uint zend_accel_refcount = ZEND_PROTECTED_REFCOUNT;  typedef int (*id_function_t)(void *, void *);  typedef void (*unique_copy_ctor_func_t)(void *pElement); -static const zend_uint uninitialized_bucket = {INVALID_IDX}; +static const uint32_t uninitialized_bucket = {INVALID_IDX};  static int zend_prepare_function_for_execution(zend_op_array *op_array);  static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind); @@ -113,7 +113,7 @@ static int compact_hash_table(HashTable *ht)  		return 1;  	} -	d = (Bucket *)pemalloc(nSize * (sizeof(Bucket) + sizeof(zend_uint)), ht->u.flags & HASH_FLAG_PERSISTENT); +	d = (Bucket *)pemalloc(nSize * (sizeof(Bucket) + sizeof(uint32_t)), ht->u.flags & HASH_FLAG_PERSISTENT);  	if (!d) {  		return 0;  	} @@ -129,7 +129,7 @@ static int compact_hash_table(HashTable *ht)  	pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT);  	ht->arData = d; -	ht->arHash = (zend_uint *)(d + nSize); +	ht->arHash = (uint32_t *)(d + nSize);  	ht->nTableSize = nSize;  	ht->nTableMask = ht->nTableSize - 1;  	zend_hash_rehash(ht); @@ -348,14 +348,14 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)  	ht->nInternalPointer = source->nNumOfElements ? 0 : INVALID_IDX;  	if (!ht->nTableMask) { -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  		return;  	}  	if (source->u.flags & HASH_FLAG_PACKED) {  		ht->u.flags |= HASH_FLAG_PACKED;  		ht->arData = (Bucket *) emalloc(ht->nTableSize * sizeof(Bucket)); -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  		for (idx = 0; idx < source->nNumUsed; idx++) {  			p = source->arData + idx; @@ -379,9 +379,9 @@ static void zend_hash_clone_zval(HashTable *ht, HashTable *source, int bind)  			zend_clone_zval(&q->val, bind TSRMLS_CC);  		}  	} else { -		ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(zend_uint))); -		ht->arHash = (zend_uint*)(ht->arData + ht->nTableSize); -		memset(ht->arHash, INVALID_IDX, sizeof(zend_uint) * ht->nTableSize); +		ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t))); +		ht->arHash = (uint32_t*)(ht->arData + ht->nTableSize); +		memset(ht->arHash, INVALID_IDX, sizeof(uint32_t) * ht->nTableSize);  		for (idx = 0; idx < source->nNumUsed; idx++) {  			p = source->arData + idx; @@ -427,14 +427,14 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class  	ht->nInternalPointer = source->nNumOfElements ? 0 : INVALID_IDX;  	if (!ht->nTableMask) { -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  		return;  	}  	ZEND_ASSERT(!(source->u.flags & HASH_FLAG_PACKED)); -	ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(zend_uint))); -	ht->arHash = (zend_uint *)(ht->arData + ht->nTableSize); -	memset(ht->arHash, INVALID_IDX, sizeof(zend_uint) * ht->nTableSize); +	ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t))); +	ht->arHash = (uint32_t *)(ht->arData + ht->nTableSize); +	memset(ht->arHash, INVALID_IDX, sizeof(uint32_t) * ht->nTableSize);  	for (idx = 0; idx < source->nNumUsed; idx++) {		  		p = source->arData + idx; @@ -504,14 +504,14 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_cla  	ht->nInternalPointer = source->nNumOfElements ? 0 : INVALID_IDX;  	if (!ht->nTableMask) { -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  		return;  	}  	ZEND_ASSERT(!(source->u.flags & HASH_FLAG_PACKED)); -	ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(zend_uint))); -	ht->arHash = (zend_uint*)(ht->arData + ht->nTableSize); -	memset(ht->arHash, INVALID_IDX, sizeof(zend_uint) * ht->nTableSize); +	ht->arData = (Bucket *) emalloc(ht->nTableSize * (sizeof(Bucket) + sizeof(uint32_t))); +	ht->arHash = (uint32_t*)(ht->arData + ht->nTableSize); +	memset(ht->arHash, INVALID_IDX, sizeof(uint32_t) * ht->nTableSize);  	for (idx = 0; idx < source->nNumUsed; idx++) {		  		p = source->arData + idx; @@ -898,7 +898,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script,  		}  	} -	if (op_array->early_binding != (zend_uint)-1) { +	if (op_array->early_binding != (uint32_t)-1) {  		zend_string *orig_compiled_filename = CG(compiled_filename);  		CG(compiled_filename) = persistent_script->full_path;  		zend_do_delayed_early_binding(op_array TSRMLS_CC); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 67e3ab05a1..2427cfdec8 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -67,7 +67,7 @@ typedef void (*zend_persist_func_t)(zval* TSRMLS_DC);  static void zend_persist_zval(zval *z TSRMLS_DC);  static void zend_persist_zval_const(zval *z TSRMLS_DC); -static const zend_uint uninitialized_bucket = {INVALID_IDX}; +static const uint32_t uninitialized_bucket = {INVALID_IDX};  static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement TSRMLS_DC)  { @@ -75,19 +75,19 @@ static void zend_hash_persist(HashTable *ht, zend_persist_func_t pPersistElement  	Bucket *p;  	if (!ht->nTableMask) { -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  		return;  	}  	if (ht->u.flags & HASH_FLAG_PACKED) {  		zend_accel_store(ht->arData, sizeof(Bucket) * ht->nNumUsed); -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  	} else {  		Bucket *d = (Bucket*)ZCG(mem); -		zend_uint *h = (zend_uint*)(d + ht->nNumUsed); +		uint32_t *h = (uint32_t*)(d + ht->nNumUsed);  		ZCG(mem) = (void*)(h + ht->nTableSize);  		memcpy(d, ht->arData, sizeof(Bucket) * ht->nNumUsed); -		memcpy(h, ht->arHash, sizeof(zend_uint) * ht->nTableSize); +		memcpy(h, ht->arHash, sizeof(uint32_t) * ht->nTableSize);  		efree(ht->arData);  		ht->arData = d;  		ht->arHash = h; @@ -112,19 +112,19 @@ static void zend_hash_persist_immutable(HashTable *ht TSRMLS_DC)  	Bucket *p;  	if (!ht->nTableMask) { -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  		return;  	}  	if (ht->u.flags & HASH_FLAG_PACKED) {  		ht->arData = zend_accel_memdup(ht->arData, sizeof(Bucket) * ht->nNumUsed); -		ht->arHash = (zend_uint*)&uninitialized_bucket; +		ht->arHash = (uint32_t*)&uninitialized_bucket;  	} else {  		Bucket *d = (Bucket*)ZCG(mem); -		zend_uint *h = (zend_uint*)(d + ht->nNumUsed); +		uint32_t *h = (uint32_t*)(d + ht->nNumUsed);  		ZCG(mem) = (void*)(h + ht->nTableSize);  		memcpy(d, ht->arData, sizeof(Bucket) * ht->nNumUsed); -		memcpy(h, ht->arHash, sizeof(zend_uint) * ht->nTableSize); +		memcpy(h, ht->arHash, sizeof(uint32_t) * ht->nTableSize);  		ht->arData = d;  		ht->arHash = h;  	} @@ -399,7 +399,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc  			ZEND_ASSERT(new_ptr != NULL);  			op_array->arg_info = new_ptr;  		} else { -			zend_uint i; +			uint32_t i;  			zend_accel_store(op_array->arg_info, sizeof(zend_arg_info) * op_array->num_args);  			for (i = 0; i < op_array->num_args; i++) { diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index 1ffc98597a..1328213397 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -61,7 +61,7 @@ static uint zend_hash_persist_calc(HashTable *ht, uint (*pPersistElement)(zval *  	if (ht->u.flags & HASH_FLAG_PACKED) {  		ADD_SIZE(sizeof(Bucket) * ht->nNumUsed);  	} else { -		ADD_SIZE(sizeof(Bucket) * ht->nNumUsed + sizeof(zend_uint) * ht->nTableSize); +		ADD_SIZE(sizeof(Bucket) * ht->nNumUsed + sizeof(uint32_t) * ht->nTableSize);  	}  	for (idx = 0; idx < ht->nNumUsed; idx++) { @@ -194,7 +194,7 @@ static uint zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC)  	}  	if (op_array->arg_info) { -		zend_uint i; +		uint32_t i;  		ADD_DUP_SIZE(op_array->arg_info, sizeof(zend_arg_info) * op_array->num_args);  		for (i = 0; i < op_array->num_args; i++) { diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 6aec12e9b1..9be65164cd 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1351,7 +1351,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub  				 empty_replace;  	zend_string *result;  	zend_string	*subject_str = zval_get_string(subject); -	zend_uint replace_idx; +	uint32_t replace_idx;  	/* FIXME: This might need to be changed to STR_EMPTY_ALLOC(). Check if this zval could be dtor()'ed somehow */  	ZVAL_EMPTY_STRING(&empty_replace); diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index f9ae46e6e9..4045a20cee 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2267,7 +2267,7 @@ static zend_object *dbstmt_clone_obj(zval *zobject TSRMLS_DC)  }  zend_object_handlers pdo_dbstmt_object_handlers; -static int pdo_row_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC); +static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC);  void pdo_stmt_init(TSRMLS_D)  { @@ -2700,7 +2700,7 @@ zend_object *pdo_row_new(zend_class_entry *ce TSRMLS_DC)  	return &row->std;  } -static int pdo_row_serialize(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) +static int pdo_row_serialize(zval *object, unsigned char **buffer, uint32_t *buf_len, zend_serialize_data *data TSRMLS_DC)  {  	php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDORow instances may not be serialized");  	return FAILURE; diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8262b86e1d..94cb3fb273 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -192,8 +192,8 @@ typedef struct _property_reference {  /* Struct for parameters */  typedef struct _parameter_reference { -	zend_uint offset; -	zend_uint required; +	uint32_t offset; +	uint32_t required;  	struct _zend_arg_info *arg_info;  	zend_function *fptr;  } parameter_reference; @@ -406,7 +406,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in  	}  	if (ce->num_interfaces) { -		zend_uint i; +		uint32_t i;  		if (ce->ce_flags & ZEND_ACC_INTERFACE) {  			string_printf(str, " extends %s", ce->interfaces[0]->name->val); @@ -660,7 +660,7 @@ static void _const_string(string *str, char *name, zval *value, char *indent TSR  /* }}} */  /* {{{ _get_recv_opcode */ -static zend_op* _get_recv_op(zend_op_array *op_array, zend_uint offset) +static zend_op* _get_recv_op(zend_op_array *op_array, uint32_t offset)  {  	zend_op *op = op_array->opcodes;  	zend_op *end = op + op_array->last; @@ -679,7 +679,7 @@ static zend_op* _get_recv_op(zend_op_array *op_array, zend_uint offset)  /* }}} */  /* {{{ _parameter_string */ -static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, zend_uint offset, zend_uint required, char* indent TSRMLS_DC) +static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, char* indent TSRMLS_DC)  {  	string_printf(str, "Parameter #%d [ ", offset);  	if (offset >= required) { @@ -752,7 +752,7 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg  static void _function_parameter_string(string *str, zend_function *fptr, char* indent TSRMLS_DC)  {  	struct _zend_arg_info *arg_info = fptr->common.arg_info; -	zend_uint i, required = fptr->common.required_num_args; +	uint32_t i, required = fptr->common.required_num_args;  	if (!arg_info) {  		return; @@ -773,7 +773,7 @@ static void _function_parameter_string(string *str, zend_function *fptr, char* i  /* {{{ _function_closure_string */  static void _function_closure_string(string *str, zend_function *fptr, char* indent TSRMLS_DC)  { -	zend_uint i, count; +	uint32_t i, count;  	zend_ulong num_index;  	zend_string *key;  	HashTable *static_variables; @@ -1216,7 +1216,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM  /* }}} */  /* {{{ reflection_parameter_factory */ -static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, zend_uint offset, zend_uint required, zval *object TSRMLS_DC) +static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, uint32_t required, zval *object TSRMLS_DC)  {  	reflection_object *intern;  	parameter_reference *reference; @@ -2033,7 +2033,7 @@ ZEND_METHOD(reflection_function, getParameters)  {  	reflection_object *intern;  	zend_function *fptr; -	zend_uint i; +	uint32_t i;  	struct _zend_arg_info *arg_info;  	METHOD_NOTSTATIC(reflection_function_abstract_ptr); @@ -2221,7 +2221,7 @@ ZEND_METHOD(reflection_parameter, __construct)  	arg_info = fptr->common.arg_info;  	if (Z_TYPE_P(parameter) == IS_LONG) {  		position= Z_LVAL_P(parameter); -		if (position < 0 || (zend_uint)position >= fptr->common.num_args) { +		if (position < 0 || (uint32_t)position >= fptr->common.num_args) {  			if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {  				if (fptr->type != ZEND_OVERLOADED_FUNCTION) {  					zend_string_release(fptr->common.function_name); @@ -2235,7 +2235,7 @@ ZEND_METHOD(reflection_parameter, __construct)  			/* returns out of this function */  		}  	} else { -		zend_uint i; +		uint32_t i;  		position= -1;  		convert_to_string_ex(parameter); @@ -2269,7 +2269,7 @@ ZEND_METHOD(reflection_parameter, __construct)  	ref = (parameter_reference*) emalloc(sizeof(parameter_reference));  	ref->arg_info = &arg_info[position]; -	ref->offset = (zend_uint)position; +	ref->offset = (uint32_t)position;  	ref->required = fptr->common.required_num_args;  	ref->fptr = fptr;  	/* TODO: copy fptr */ @@ -4352,7 +4352,7 @@ ZEND_METHOD(reflection_class, getInterfaces)  	array_init(return_value);  	if (ce->num_interfaces) { -		zend_uint i; +		uint32_t i;  		for (i=0; i < ce->num_interfaces; i++) {  			zval interface; @@ -4369,7 +4369,7 @@ ZEND_METHOD(reflection_class, getInterfaceNames)  {  	reflection_object *intern;  	zend_class_entry *ce; -	zend_uint i; +	uint32_t i;  	if (zend_parse_parameters_none() == FAILURE) {  		return; @@ -4391,7 +4391,7 @@ ZEND_METHOD(reflection_class, getTraits)  {  	reflection_object *intern;  	zend_class_entry *ce; -	zend_uint i; +	uint32_t i;  	if (zend_parse_parameters_none() == FAILURE) {  		return; @@ -4414,7 +4414,7 @@ ZEND_METHOD(reflection_class, getTraitNames)  {  	reflection_object *intern;  	zend_class_entry *ce; -	zend_uint i; +	uint32_t i;  	if (zend_parse_parameters_none() == FAILURE) {  		return; @@ -4444,7 +4444,7 @@ ZEND_METHOD(reflection_class, getTraitAliases)  	array_init(return_value);  	if (ce->trait_aliases) { -		zend_uint i = 0; +		uint32_t i = 0;  		while (ce->trait_aliases[i]) {  			zend_string *mname;  			zend_trait_method_reference *cur_ref = ce->trait_aliases[i]->trait_method; diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 5d5f010f02..ad3bb85313 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -530,9 +530,9 @@ PHP_FUNCTION(spl_autoload_register)  		if (Z_TYPE_P(zcallable) == IS_OBJECT) {  			ZVAL_COPY(&alfi.closure, zcallable); -			lc_name = zend_string_alloc(func_name->len + sizeof(zend_uint), 0); +			lc_name = zend_string_alloc(func_name->len + sizeof(uint32_t), 0);  			zend_str_tolower_copy(lc_name->val, func_name->val, func_name->len); -			memcpy(lc_name->val + func_name->len, &Z_OBJ_HANDLE_P(zcallable), sizeof(zend_uint)); +			memcpy(lc_name->val + func_name->len, &Z_OBJ_HANDLE_P(zcallable), sizeof(uint32_t));  			lc_name->val[lc_name->len] = '\0';  		} else {  			ZVAL_UNDEF(&alfi.closure); @@ -550,8 +550,8 @@ PHP_FUNCTION(spl_autoload_register)  		if (obj_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {  			/* add object id to the hash to ensure uniqueness, for more reference look at bug #40091 */ -			lc_name = zend_string_realloc(lc_name, lc_name->len + sizeof(zend_uint), 0); -			memcpy(lc_name->val + lc_name->len - sizeof(zend_uint), &obj_ptr->handle, sizeof(zend_uint)); +			lc_name = zend_string_realloc(lc_name, lc_name->len + sizeof(uint32_t), 0); +			memcpy(lc_name->val + lc_name->len - sizeof(uint32_t), &obj_ptr->handle, sizeof(uint32_t));  			lc_name->val[lc_name->len] = '\0';  			ZVAL_OBJ(&alfi.obj, obj_ptr);  			Z_ADDREF(alfi.obj); @@ -639,9 +639,9 @@ PHP_FUNCTION(spl_autoload_unregister)  	}  	if (Z_TYPE_P(zcallable) == IS_OBJECT) { -		lc_name = zend_string_alloc(func_name->len + sizeof(zend_uint), 0); +		lc_name = zend_string_alloc(func_name->len + sizeof(uint32_t), 0);  		zend_str_tolower_copy(lc_name->val, func_name->val, func_name->len); -		memcpy(lc_name->val + func_name->len, &Z_OBJ_HANDLE_P(zcallable), sizeof(zend_uint)); +		memcpy(lc_name->val + func_name->len, &Z_OBJ_HANDLE_P(zcallable), sizeof(uint32_t));  		lc_name->val[lc_name->len] = '\0';  	} else {  		lc_name = zend_string_alloc(func_name->len, 0); @@ -661,8 +661,8 @@ PHP_FUNCTION(spl_autoload_unregister)  			/* remove specific */  			success = zend_hash_del(SPL_G(autoload_functions), lc_name);  			if (success != SUCCESS && obj_ptr) { -				lc_name = zend_string_realloc(lc_name, lc_name->len + sizeof(zend_uint), 0); -				memcpy(lc_name->val + lc_name->len - sizeof(zend_uint), &obj_ptr->handle, sizeof(zend_uint)); +				lc_name = zend_string_realloc(lc_name, lc_name->len + sizeof(uint32_t), 0); +				memcpy(lc_name->val + lc_name->len - sizeof(uint32_t), &obj_ptr->handle, sizeof(uint32_t));  				lc_name->val[lc_name->len] = '\0';  				success = zend_hash_del(SPL_G(autoload_functions), lc_name);  			} diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index 541cceb739..13440355ce 100644 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -95,7 +95,7 @@ void spl_add_class_name(zval *list, zend_class_entry *pce, int allow, int ce_fla  /* {{{ spl_add_interfaces */  void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)  { -	zend_uint num_interfaces; +	uint32_t num_interfaces;  	for (num_interfaces = 0; num_interfaces < pce->num_interfaces; num_interfaces++) {  		spl_add_class_name(list, pce->interfaces[num_interfaces], allow, ce_flags TSRMLS_CC); @@ -106,7 +106,7 @@ void spl_add_interfaces(zval *list, zend_class_entry * pce, int allow, int ce_fl  /* {{{ spl_add_traits */  void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)  { -	zend_uint num_traits; +	uint32_t num_traits;  	for (num_traits = 0; num_traits < pce->num_traits; num_traits++) {  		spl_add_class_name(list, pce->traits[num_traits], allow, ce_flags TSRMLS_CC); diff --git a/ext/standard/array.c b/ext/standard/array.c index 3ddb1c6218..4baaf83b20 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1673,7 +1673,7 @@ PHP_FUNCTION(range)  			}  			for (; low >= high; low -= (unsigned int)lstep) {  				if (CG(one_char_string)[low]) { -					ZVAL_LONG_STR(&tmp, CG(one_char_string)[low]); +					ZVAL_INTERNED_STR(&tmp, CG(one_char_string)[low]);  				} else {  					ZVAL_STRINGL(&tmp, (char*)&low, 1);  				} @@ -1689,7 +1689,7 @@ PHP_FUNCTION(range)  			}  			for (; low <= high; low += (unsigned int)lstep) {  				if (CG(one_char_string)[low]) { -					ZVAL_LONG_STR(&tmp, CG(one_char_string)[low]); +					ZVAL_INTERNED_STR(&tmp, CG(one_char_string)[low]);  				} else {  					ZVAL_STRINGL(&tmp, (char*)&low, 1);  				} @@ -1700,7 +1700,7 @@ PHP_FUNCTION(range)  			}  		} else {  			if (CG(one_char_string)[low]) { -				ZVAL_LONG_STR(&tmp, CG(one_char_string)[low]); +				ZVAL_INTERNED_STR(&tmp, CG(one_char_string)[low]);  			} else {  				ZVAL_STRINGL(&tmp, (char*)&low, 1);  			} @@ -4477,7 +4477,7 @@ PHP_FUNCTION(array_map)  			}  		} ZEND_HASH_FOREACH_END();  	} else {		 -		zend_uint *array_pos = (HashPosition *)ecalloc(n_arrays, sizeof(HashPosition)); +		uint32_t *array_pos = (HashPosition *)ecalloc(n_arrays, sizeof(HashPosition));  		for (i = 0; i < n_arrays; i++) {  			if (Z_TYPE(arrays[i]) != IS_ARRAY) { @@ -4505,7 +4505,7 @@ PHP_FUNCTION(array_map)  				for (i = 0; i < n_arrays; i++) {  					/* If this array still has elements, add the current one to the  					 * parameter list, otherwise use null value. */ -					zend_uint pos = array_pos[i]; +					uint32_t pos = array_pos[i];  					while (1) {  						if (pos >= Z_ARRVAL(arrays[i])->nNumUsed) {  							ZVAL_NULL(&zv); @@ -4531,7 +4531,7 @@ PHP_FUNCTION(array_map)  				for (i = 0; i < n_arrays; i++) {  					/* If this array still has elements, add the current one to the  					 * parameter list, otherwise use null value. */ -					zend_uint pos = array_pos[i]; +					uint32_t pos = array_pos[i];  					while (1) {  						if (pos >= Z_ARRVAL(arrays[i])->nNumUsed) {  							ZVAL_NULL(¶ms[i]); @@ -4688,7 +4688,7 @@ PHP_FUNCTION(array_chunk)  PHP_FUNCTION(array_combine)  {  	zval *values, *keys; -	zend_uint pos_values = 0; +	uint32_t pos_values = 0;  	zval *entry_keys, *entry_values;  	int num_keys, num_values; diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index c76451cef9..4a6a39d4ed 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -150,7 +150,7 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)  /* {{{ php_store_class_name   */ -PHPAPI void php_store_class_name(zval *object, const char *name, zend_uint len) +PHPAPI void php_store_class_name(zval *object, const char *name, uint32_t len)  {  	zval val;  	TSRMLS_FETCH(); diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index 6c64ae71ac..efca24acce 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -55,7 +55,7 @@ extern "C" {  PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);  PHPAPI zend_string *php_lookup_class_name(zval *object); -PHPAPI void  php_store_class_name(zval *object, const char *name, zend_uint len); +PHPAPI void  php_store_class_name(zval *object, const char *name, uint32_t len);  #ifdef __cplusplus  }; diff --git a/ext/standard/var.c b/ext/standard/var.c index b8d498fc8e..d18c754480 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -855,7 +855,7 @@ again:  				if (ce && ce->serialize != NULL) {  					/* has custom handler */  					unsigned char *serialized_data = NULL; -					zend_uint serialized_length; +					uint32_t serialized_length;  					if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) {  						smart_str_appendl(buf, "C:", 2); diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index f4ad99f293..15c085271a 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -70,7 +70,7 @@ typedef struct _ze_zip_read_rsrc {  	struct zip_stat sb;  } zip_read_rsrc; -#define ZIPARCHIVE_ME(name, arg_info, flags) {#name, c_ziparchive_ ##name, arg_info,(zend_uint) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags }, +#define ZIPARCHIVE_ME(name, arg_info, flags) {#name, c_ziparchive_ ##name, arg_info,(uint32_t) (sizeof(arg_info)/sizeof(struct _zend_arg_info)-1), flags },  #define ZIPARCHIVE_METHOD(name)	ZEND_NAMED_FUNCTION(c_ziparchive_ ##name)  /* Extends zend object */ diff --git a/main/main.c b/main/main.c index b961bbf5b3..fb84e1f8a6 100644 --- a/main/main.c +++ b/main/main.c @@ -1499,7 +1499,7 @@ static void php_message_handler_for_zend(long message, const void *data TSRMLS_D  			if (EG(error_reporting) & E_WARNING) {  				char memory_leak_buf[512]; -				snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data)); +				snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((uint32_t *) data));  #	if defined(PHP_WIN32)  				OutputDebugString(memory_leak_buf);  #	else diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h index eb4faf1f94..7d720f157b 100644 --- a/sapi/phpdbg/phpdbg.h +++ b/sapi/phpdbg/phpdbg.h @@ -180,7 +180,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)  	HashTable registered;                        /* registered */  	HashTable seek;                              /* seek oplines */  	phpdbg_frame_t frame;                        /* frame */ -	zend_uint last_line;                         /* last executed line */ +	uint32_t last_line;                         /* last executed line */  	phpdbg_lexer_data lexer;                     /* lexer data */  	phpdbg_param_t *parser_stack;                /* param stack during lexer / parser phase */ diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index a18316a228..86f32b092e 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -700,7 +700,7 @@ PHPDBG_API void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t opline TSRML  static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, const phpdbg_param_t *param, const char *expr, size_t expr_len, zend_ulong hash TSRMLS_DC) /* {{{ */  {  	phpdbg_breakcond_t new_break; -	zend_uint cops = CG(compiler_options); +	uint32_t cops = CG(compiler_options);  	zval pv;  	PHPDBG_BREAK_INIT(new_break, PHPDBG_BREAK_COND); @@ -1092,7 +1092,7 @@ PHPDBG_API void phpdbg_delete_breakpoint(zend_ulong num TSRMLS_DC) /* {{{ */  	if ((brake = phpdbg_find_breakbase_ex(num, &table, &position TSRMLS_CC))) {  		char *key; -		zend_uint klen; +		uint32_t klen;  		zend_ulong idx;  		int type = brake->type;  		char *name = NULL; @@ -1370,7 +1370,7 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */  			HashPosition position[2];  			HashTable *class_table;  			char *class_name = NULL; -			zend_uint class_len = 0; +			uint32_t class_len = 0;  			zend_ulong class_idx = 0L;  			phpdbg_writeln(SEPARATE); @@ -1449,7 +1449,7 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */  			HashPosition position[3];  			HashTable *class_table, *method_table;  			char *class_name = NULL, *method_name = NULL; -			zend_uint class_len = 0, method_len = 0; +			uint32_t class_len = 0, method_len = 0;  			zend_ulong class_idx = 0L, method_idx = 0L;  			phpdbg_writeln(SEPARATE); @@ -1488,7 +1488,7 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */  			HashPosition position[2];  			HashTable *function_table;  			char *function_name = NULL; -			zend_uint function_len = 0; +			uint32_t function_len = 0;  			zend_ulong function_idx = 0L;  			phpdbg_writeln(SEPARATE); @@ -1518,7 +1518,7 @@ PHPDBG_API void phpdbg_print_breakpoints(zend_ulong type TSRMLS_DC) /* {{{ */  			HashPosition position[2];  			HashTable *file_table;  			char *file_name = NULL; -			zend_uint file_len = 0; +			uint32_t file_len = 0;  			zend_ulong file_idx = 0L;  			phpdbg_writeln(SEPARATE); diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c index a45513bee6..72dc484098 100644 --- a/sapi/phpdbg/phpdbg_cmd.c +++ b/sapi/phpdbg/phpdbg_cmd.c @@ -699,7 +699,7 @@ PHPDBG_API const phpdbg_command_t* phpdbg_stack_resolve(const phpdbg_command_t *  		default: {  			char *list = NULL; -			zend_uint it = 0; +			uint32_t it = 0;  			size_t pos = 0;  			while (it < matches) { diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c index a235fe8cb0..5a6a37d5f9 100644 --- a/sapi/phpdbg/phpdbg_frame.c +++ b/sapi/phpdbg/phpdbg_frame.c @@ -114,7 +114,7 @@ static void phpdbg_dump_prototype(zval **tmp TSRMLS_DC) /* {{{ */  			(void **)&class);  	} else {  		zend_get_object_classname(*class, (const char **)&Z_STRVAL_PP(class), -			(zend_uint *)&Z_STRLEN_PP(class) TSRMLS_CC); +			(uint32_t *)&Z_STRLEN_PP(class) TSRMLS_CC);  	}  	if (is_class == SUCCESS) { diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c index 6b13625fc1..4e693c4414 100644 --- a/sapi/phpdbg/phpdbg_opcode.c +++ b/sapi/phpdbg/phpdbg_opcode.c @@ -26,7 +26,7 @@  ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -static inline zend_uint phpdbg_decode_literal(zend_op_array *ops, zend_literal *literal TSRMLS_DC) /* {{{ */ +static inline uint32_t phpdbg_decode_literal(zend_op_array *ops, zend_literal *literal TSRMLS_DC) /* {{{ */  {  	int iter = 0; @@ -40,7 +40,7 @@ static inline zend_uint phpdbg_decode_literal(zend_op_array *ops, zend_literal *  	return 0;  } /* }}} */ -static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, zend_uint type, HashTable *vars TSRMLS_DC) /* {{{ */ +static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type, HashTable *vars TSRMLS_DC) /* {{{ */  {  	char *decode = NULL; diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index 76321a5042..376373e4a1 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -59,7 +59,7 @@ static inline void phpdbg_print_function_helper(zend_function *method TSRMLS_DC)  			if (op_array) {  				zend_op *opline = &(op_array->opcodes[0]); -				zend_uint opcode = 0, +				uint32_t opcode = 0,  				end = op_array->last-1;  				if (method->common.scope) { diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index d91ef3f3f5..9695d911ab 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -430,7 +430,7 @@ PHPDBG_COMMAND(until) /* {{{ */  	PHPDBG_G(flags) |= PHPDBG_IN_UNTIL;  	{ -		zend_uint next = 0, +		uint32_t next = 0,  				  self = (EG(current_execute_data)->opline - EG(active_op_array)->opcodes);  		zend_op  *opline = &EG(active_op_array)->opcodes[self]; @@ -458,7 +458,7 @@ PHPDBG_COMMAND(finish) /* {{{ */  	PHPDBG_G(flags) |= PHPDBG_IN_FINISH;  	{ -		zend_uint next = 0, +		uint32_t next = 0,  				  self = (EG(current_execute_data)->opline - EG(active_op_array)->opcodes);  		for (next = self; next < EG(active_op_array)->last; next++) { @@ -491,7 +491,7 @@ PHPDBG_COMMAND(leave) /* {{{ */  	PHPDBG_G(flags) |= PHPDBG_IN_LEAVE;  	{ -		zend_uint next = 0, +		uint32_t next = 0,  				  self = (EG(current_execute_data)->opline - EG(active_op_array)->opcodes);  		for (next = self; next < EG(active_op_array)->last; next++) { @@ -534,7 +534,7 @@ static inline void phpdbg_handle_exception(TSRMLS_D) /* }}} */  	/* get filename and linenumber before unsetting exception */  	const char *filename = zend_get_executed_filename(TSRMLS_C); -	zend_uint lineno = zend_get_executed_lineno(TSRMLS_C); +	uint32_t lineno = zend_get_executed_lineno(TSRMLS_C);  	/* copy exception */  	exception = *EG(exception);  | 
