1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00

Remove cast and fix mem errors

This commit is contained in:
Etienne Kneuss
2008-08-03 18:15:18 +00:00
parent 6f78f32cc2
commit 7aa5e4ab32
+3 -2
View File
@@ -227,7 +227,7 @@ static spl_ptr_heap *spl_ptr_heap_init(spl_ptr_heap_cmp_func cmp, spl_ptr_heap_c
heap->dtor = dtor;
heap->ctor = ctor;
heap->cmp = cmp;
heap->elements = (void **) safe_emalloc(sizeof(spl_ptr_heap_element), PTR_HEAP_BLOCK_SIZE, 0);
heap->elements = safe_emalloc(sizeof(spl_ptr_heap_element), PTR_HEAP_BLOCK_SIZE, 0);
heap->max_size = PTR_HEAP_BLOCK_SIZE;
heap->count = 0;
heap->flags = 0;
@@ -323,7 +323,7 @@ static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from TSRMLS_DC) { /* {{{ *
heap->count = from->count;
heap->flags = from->flags;
heap->elements = (void **) safe_emalloc(sizeof(spl_ptr_heap_element),from->max_size,0);
heap->elements = safe_emalloc(sizeof(spl_ptr_heap_element),from->max_size,0);
memcpy(heap->elements, from->elements, sizeof(spl_ptr_heap_element)*from->max_size);
for (i=0; i < heap->count; ++i) {
@@ -383,6 +383,7 @@ static zend_object_value spl_heap_object_new_ex(zend_class_entry *class_type, sp
int inherited = 0;
intern = ecalloc(1, sizeof(spl_heap_object));
*obj = intern;
ALLOC_INIT_ZVAL(intern->retval);
zend_object_std_init(&intern->std, class_type TSRMLS_CC);