From 360fb5198018f0ec66918aff63566c7e50eb7379 Mon Sep 17 00:00:00 2001 From: Etienne Kneuss Date: Sun, 3 Aug 2008 18:16:10 +0000 Subject: [PATCH] MFH: Remove cast and fix mem errors --- ext/spl/spl_heap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index 3c94eac853..25ed63dcd6 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -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); -- 2.40.0