more fixes to ext/spl

This commit is contained in:
Anatol Belski 2014-08-20 18:06:01 +02:00
parent 8e8a30654e
commit 4498f93c0e
4 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;
} /* }}} */

View File

@ -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;