From 4498f93c0ec2c69ac8584f08c49c8ac6257a865a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 20 Aug 2014 18:06:01 +0200 Subject: [PATCH] more fixes to ext/spl --- ext/spl/spl_array.c | 2 +- ext/spl/spl_directory.c | 8 ++++---- ext/spl/spl_dllist.c | 2 +- ext/spl/spl_heap.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 23f48c802f..46875cd471 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -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 = (php_int_t)Z_DVAL_P(offset); goto num_index; case IS_RESOURCE: index = Z_RES_HANDLE_P(offset); diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 9c940433df..5e3edd65d1 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2511,11 +2511,11 @@ SPL_METHOD(SplFileObject, getFlags) Set maximum line length */ SPL_METHOD(SplFileObject, setMaxLineLen) { - long max_len; + php_int_t max_len; spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &max_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &max_len) == FAILURE) { return; } @@ -2893,9 +2893,9 @@ SPL_METHOD(SplFileObject, fwrite) SPL_METHOD(SplFileObject, fread) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); - long length = 0; + php_int_t length = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "i", &length) == FAILURE) { return; } diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 49b7271c22..c2eb5c0486 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -1209,7 +1209,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize) error: 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", (php_int_t)((char*)p - buf), buf_len); return; } /* }}} */ diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 1dbfe935ff..916ed919f8 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -483,7 +483,7 @@ static zend_object *spl_heap_object_clone(zval *zobject TSRMLS_DC) /* {{{ */ } /* }}} */ -static int spl_heap_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */ +static int spl_heap_object_count_elements(zval *object, php_int_t *count TSRMLS_DC) /* {{{ */ { spl_heap_object *intern = Z_SPLHEAP_P(object); @@ -494,7 +494,7 @@ static int spl_heap_object_count_elements(zval *object, long *count TSRMLS_DC) / zval_ptr_dtor(&intern->retval); ZVAL_ZVAL(&intern->retval, &rv, 0, 0); convert_to_int(&intern->retval); - *count = (long) Z_IVAL(intern->retval); + *count = (php_int_t) Z_IVAL(intern->retval); return SUCCESS; } *count = 0; -- 2.40.0