summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2014-09-16 13:45:06 +0100
committerAndrea Faulds <ajf@ajf.me>2014-09-16 13:45:06 +0100
commitdb72160e5ac2b267b9ffa23ad84e62e609382a44 (patch)
tree6e50c2826f98308d500cc826934a503751d4d566 /ext/spl/spl_array.c
parentbe88d0e5d4ab5fdf775f3e38cf054aa0451f0d36 (diff)
parentf469dc7429f2257aac6f46228302408608fbd62f (diff)
downloadphp-git-db72160e5ac2b267b9ffa23ad84e62e609382a44.tar.gz
Merge branch 'master' into integer_semantics
Conflicts: Zend/zend_operators.h
Diffstat (limited to 'ext/spl/spl_array.c')
-rw-r--r--ext/spl/spl_array.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 720a704e92..84c3714da2 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -66,7 +66,7 @@ typedef struct _spl_array_object {
zval array;
zval retval;
HashPosition pos;
- ulong pos_h;
+ zend_ulong pos_h;
int ar_flags;
int is_self;
zend_function *fptr_offset_get;
@@ -300,7 +300,7 @@ static zend_object *spl_array_object_clone(zval *zobject TSRMLS_DC)
static zval *spl_array_get_dimension_ptr(int check_inherited, zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
{
zval *retval;
- long index;
+ zend_long index;
zend_string *offset_key;
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
@@ -360,11 +360,11 @@ fetch_dim_string:
}
return retval;
case IS_RESOURCE:
- zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_RES_P(offset)->handle, Z_RES_P(offset)->handle);
+ zend_error(E_STRICT, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_P(offset)->handle, Z_RES_P(offset)->handle);
index = Z_RES_P(offset)->handle;
goto num_index;
case IS_DOUBLE:
- index = (long)Z_DVAL_P(offset);
+ index = (zend_long)Z_DVAL_P(offset);
goto num_index;
case IS_FALSE:
index = 0;
@@ -378,13 +378,13 @@ num_index:
if ((retval = zend_hash_index_find(ht, index)) == NULL) {
switch (type) {
case BP_VAR_R:
- zend_error(E_NOTICE, "Undefined offset: %ld", index);
+ zend_error(E_NOTICE, "Undefined offset: %pd", index);
case BP_VAR_UNSET:
case BP_VAR_IS:
retval = &EG(uninitialized_zval);
break;
case BP_VAR_RW:
- zend_error(E_NOTICE, "Undefined offset: %ld", index);
+ zend_error(E_NOTICE, "Undefined offset: %pd", index);
case BP_VAR_W: {
zval value;
ZVAL_UNDEF(&value);
@@ -450,7 +450,7 @@ static zval *spl_array_read_dimension(zval *object, zval *offset, int type, zval
static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval *offset, zval *value TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
- long index;
+ zend_long index;
HashTable *ht;
if (check_inherited && intern->fptr_offset_set) {
@@ -493,7 +493,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
zend_symtable_update_ind(ht, Z_STR_P(offset), value);
return;
case IS_DOUBLE:
- index = (long)Z_DVAL_P(offset);
+ index = (zend_long)Z_DVAL_P(offset);
goto num_index;
case IS_RESOURCE:
index = Z_RES_HANDLE_P(offset);
@@ -535,7 +535,7 @@ static void spl_array_write_dimension(zval *object, zval *offset, zval *value TS
static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval *offset TSRMLS_DC) /* {{{ */
{
- long index;
+ zend_long index;
HashTable *ht;
spl_array_object *intern = Z_SPLARRAY_P(object);
@@ -585,7 +585,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
}
break;
case IS_DOUBLE:
- index = (long)Z_DVAL_P(offset);
+ index = (zend_long)Z_DVAL_P(offset);
goto num_index;
case IS_RESOURCE:
index = Z_RES_HANDLE_P(offset);
@@ -605,7 +605,7 @@ num_index:
return;
}
if (zend_hash_index_del(ht, index) == FAILURE) {
- zend_error(E_NOTICE,"Undefined offset: %ld", index);
+ zend_error(E_NOTICE,"Undefined offset: %pd", index);
}
break;
default:
@@ -623,7 +623,7 @@ static void spl_array_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {
static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
- long index;
+ zend_long index;
zval rv, *value = NULL, *tmp;
if (check_inherited && intern->fptr_offset_has) {
@@ -664,7 +664,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
break;
case IS_DOUBLE:
- index = (long)Z_DVAL_P(offset);
+ index = (zend_long)Z_DVAL_P(offset);
goto num_index;
case IS_RESOURCE:
index = Z_RES_HANDLE_P(offset);
@@ -874,7 +874,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp TSRMLS_DC) /*
base = (Z_OBJ_HT_P(obj) == &spl_handler_ArrayIterator) ? spl_ce_ArrayIterator : spl_ce_ArrayObject;
zname = spl_gen_private_prop_name(base, "storage", sizeof("storage")-1 TSRMLS_CC);
zend_symtable_update(intern->debug_info, zname, storage);
- STR_RELEASE(zname);
+ zend_string_release(zname);
}
return intern->debug_info;
@@ -969,7 +969,7 @@ static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
{
zend_string *string_key;
- ulong num_key;
+ zend_ulong num_key;
zval *data;
if (Z_TYPE(intern->array) == IS_OBJECT) {
@@ -1141,7 +1141,7 @@ static void spl_array_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */
/* }}} */
/* {{{ spl_array_set_array */
-static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, long ar_flags, int just_array TSRMLS_DC) {
+static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array TSRMLS_DC) {
if (Z_TYPE_P(array) == IS_ARRAY) {
SEPARATE_ZVAL_IF_NOT_REF(array);
@@ -1223,7 +1223,7 @@ SPL_METHOD(Array, __construct)
zval *object = getThis();
spl_array_object *intern;
zval *array;
- long ar_flags = 0;
+ zend_long ar_flags = 0;
zend_class_entry *ce_get_iterator = spl_ce_Iterator;
zend_error_handling error_handling;
@@ -1286,7 +1286,7 @@ SPL_METHOD(Array, getIteratorClass)
return;
}
- STR_ADDREF(intern->ce_get_iterator->name);
+ zend_string_addref(intern->ce_get_iterator->name);
RETURN_STR(intern->ce_get_iterator->name);
}
/* }}} */
@@ -1312,7 +1312,7 @@ SPL_METHOD(Array, setFlags)
{
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
- long ar_flags = 0;
+ zend_long ar_flags = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &ar_flags) == FAILURE) {
return;
@@ -1381,7 +1381,7 @@ SPL_METHOD(Array, rewind)
Seek to position. */
SPL_METHOD(Array, seek)
{
- long opos, position;
+ zend_long opos, position;
zval *object = getThis();
spl_array_object *intern = Z_SPLARRAY_P(object);
HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
@@ -1408,10 +1408,10 @@ SPL_METHOD(Array, seek)
return; /* ok */
}
}
- zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %ld is out of range", opos);
+ zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %pd is out of range", opos);
} /* }}} */
-int static spl_array_object_count_elements_helper(spl_array_object *intern, long *count TSRMLS_DC) /* {{{ */
+int static spl_array_object_count_elements_helper(spl_array_object *intern, zend_long *count TSRMLS_DC) /* {{{ */
{
HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
HashPosition pos;
@@ -1439,7 +1439,7 @@ int static spl_array_object_count_elements_helper(spl_array_object *intern, long
}
} /* }}} */
-int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */
+int spl_array_object_count_elements(zval *object, zend_long *count TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = Z_SPLARRAY_P(object);
@@ -1450,7 +1450,7 @@ int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{
zval_ptr_dtor(&intern->retval);
ZVAL_ZVAL(&intern->retval, &rv, 0, 0);
convert_to_long(&intern->retval);
- *count = (long)Z_LVAL(intern->retval);
+ *count = (zend_long)Z_LVAL(intern->retval);
return SUCCESS;
}
*count = 0;
@@ -1464,7 +1464,7 @@ int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{
Return the number of elements in the Iterator. */
SPL_METHOD(Array, count)
{
- long count;
+ zend_long count;
spl_array_object *intern = Z_SPLARRAY_P(getThis());
if (zend_parse_parameters_none() == FAILURE) {
@@ -1776,12 +1776,12 @@ SPL_METHOD(Array, unserialize)
spl_array_object *intern = Z_SPLARRAY_P(getThis());
char *buf;
- int buf_len;
+ size_t buf_len;
const unsigned char *p, *s;
php_unserialize_data_t var_hash;
zval members, zflags;
HashTable *aht;
- long flags;
+ zend_long flags;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buf, &buf_len) == FAILURE) {
return;
@@ -1861,7 +1861,7 @@ SPL_METHOD(Array, unserialize)
outexcept:
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
- zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %ld of %d bytes", (long)((char*)p - buf), buf_len);
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, "Error at offset %pd of %d bytes", (zend_long)((char*)p - buf), buf_len);
return;
} /* }}} */