cvs: php-src /ext/spl spl_heap.c
| From: | Etienne Kneuss | Date: | Sun, 03 Aug 2008 18:15:18 +0000 |
| Subject: | cvs: php-src /ext/spl spl_heap.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-51938@lists.php.net to get a copy of this message | ||
colder Sun Aug 3 18:15:18 2008 UTC
Modified files:
/php-src/ext/spl spl_heap.c
Log:
Remove cast and fix mem errors
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_heap.c?r1=1.7&r2=1.8&diff_format=u
Index: php-src/ext/spl/spl_heap.c
diff -u php-src/ext/spl/spl_heap.c:1.7 php-src/ext/spl/spl_heap.c:1.8
--- php-src/ext/spl/spl_heap.c:1.7 Sun Jul 6 23:45:38 2008
+++ php-src/ext/spl/spl_heap.c Sun Aug 3 18:15:18 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_heap.c,v 1.7 2008/07/06 23:45:38 colder Exp $ */
+/* $Id: spl_heap.c,v 1.8 2008/08/03 18:15:18 colder Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -227,7 +227,7 @@
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 @@
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 @@
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);