ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/maxheap.c
(Generate patch)

Comparing ray/src/common/maxheap.c (file contents):
Revision 2.1 by greg, Wed Aug 12 23:07:59 2015 UTC vs.
Revision 2.3 by greg, Thu Apr 19 15:31:27 2018 UTC

# Line 1 | Line 1
1 + #ifndef lint
2 + static const char RCSid[] = "$Id$";
3 + #endif
4   #include <stdio.h>
5   #include <stdlib.h>
6  
# Line 15 | Line 18 | static int     resize_heap(maxHeap* hp,int sz)
18                  return 0;
19          for(i=hp->size;i<sz;i++) {
20                  hp->heap[i].entity = NULL;
21 <                hp->heap[i].key = -HUGE;
21 >                hp->heap[i].key = -FHUGE;
22          }
23          hp->cap = sz;
24          if (sz < hp->size) {
# Line 116 | Line 119 | heapElem       mheap_remove_max(maxHeap* hp)
119   {
120          heapElem res;
121          if (hp->size < 1) {
122 <                res.key = -HUGE;
122 >                res.key = -FHUGE;
123                  res.entity = NULL;
124                  return res;
125          }      
# Line 151 | Line 154 | int            mheap_insert(maxHeap* hp,g3Float key,void* entity
154                  }
155          }
156          hp->heap[hp->size].entity = entity;
157 <        hp->heap[hp->size].key = -HUGE;
157 >        hp->heap[hp->size].key = -FHUGE;
158          hp->size++;
159          return inc_key(hp,(hp->size - 1),key);
160   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines