From: Etienne Kneuss Date: Sun, 3 Aug 2008 18:15:18 +0000 (+0000) Subject: Remove cast and fix mem errors X-Git-Tag: BEFORE_HEAD_NS_CHANGE~887 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7aa5e4ab3239b272b4f8ea175dbe16f02f4f5ca5;p=php Remove cast and fix mem errors --- diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index f6cb6cab78..a3249171f4 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);