@@ -50,7 +50,7 @@ typedef struct _spl_ptr_heap {
5050 spl_ptr_heap_ctor_func ctor ;
5151 spl_ptr_heap_dtor_func dtor ;
5252 spl_ptr_heap_cmp_func cmp ;
53- int count ;
53+ size_t count ;
5454 int flags ;
5555 size_t max_size ;
5656 size_t elem_size ;
@@ -267,7 +267,7 @@ static spl_ptr_heap *spl_ptr_heap_init(spl_ptr_heap_cmp_func cmp, spl_ptr_heap_c
267267/* }}} */
268268
269269static void spl_ptr_heap_insert (spl_ptr_heap * heap , void * elem , void * cmp_userdata ) { /* {{{ */
270- int i ;
270+ size_t i ;
271271
272272 if (heap -> count + 1 > heap -> max_size ) {
273273 size_t alloc_size = heap -> max_size * heap -> elem_size ;
@@ -306,8 +306,8 @@ static void *spl_ptr_heap_top(spl_ptr_heap *heap) { /* {{{ */
306306/* }}} */
307307
308308static zend_result spl_ptr_heap_delete_top (spl_ptr_heap * heap , void * elem , void * cmp_userdata ) { /* {{{ */
309- int i , j ;
310- const int limit = (heap -> count - 1 )/2 ;
309+ size_t i , j ;
310+ const size_t limit = (heap -> count - 1 )/2 ;
311311 void * bottom ;
312312
313313 if (heap -> count == 0 ) {
@@ -355,8 +355,6 @@ static zend_result spl_ptr_heap_delete_top(spl_ptr_heap *heap, void *elem, void
355355/* }}} */
356356
357357static spl_ptr_heap * spl_ptr_heap_clone (spl_ptr_heap * from ) { /* {{{ */
358- int i ;
359-
360358 spl_ptr_heap * heap = emalloc (sizeof (spl_ptr_heap ));
361359
362360 heap -> dtor = from -> dtor ;
@@ -370,7 +368,7 @@ static spl_ptr_heap *spl_ptr_heap_clone(spl_ptr_heap *from) { /* {{{ */
370368 heap -> elements = safe_emalloc (from -> elem_size , from -> max_size , 0 );
371369 memcpy (heap -> elements , from -> elements , from -> elem_size * from -> max_size );
372370
373- for (i = 0 ; i < heap -> count ; ++ i ) {
371+ for (size_t i = 0 ; i < heap -> count ; ++ i ) {
374372 heap -> ctor (spl_heap_elem (heap , i ));
375373 }
376374
@@ -384,11 +382,9 @@ static void spl_ptr_heap_destroy(spl_ptr_heap *heap) { /* {{{ */
384382 return ;
385383 }
386384
387- int i ;
388-
389385 heap -> flags |= SPL_HEAP_WRITE_LOCKED ;
390386
391- for (i = 0 ; i < heap -> count ; ++ i ) {
387+ for (size_t i = 0 ; i < heap -> count ; ++ i ) {
392388 heap -> dtor (spl_heap_elem (heap , i ));
393389 }
394390
@@ -399,7 +395,7 @@ static void spl_ptr_heap_destroy(spl_ptr_heap *heap) { /* {{{ */
399395}
400396/* }}} */
401397
402- static int spl_ptr_heap_count (spl_ptr_heap * heap ) { /* {{{ */
398+ static size_t spl_ptr_heap_count (spl_ptr_heap * heap ) { /* {{{ */
403399 return heap -> count ;
404400}
405401/* }}} */
@@ -534,7 +530,7 @@ static HashTable* spl_heap_object_get_debug_info(const zend_class_entry *ce, zen
534530
535531 array_init (& heap_array );
536532
537- for (zend_ulong i = 0 ; i < intern -> heap -> count ; ++ i ) {
533+ for (size_t i = 0 ; i < intern -> heap -> count ; ++ i ) {
538534 if (ce == spl_ce_SplPriorityQueue ) {
539535 spl_pqueue_elem * pq_elem = spl_heap_elem (intern -> heap , i );
540536 zval elem ;
0 commit comments