Fix build on opensolaris with Sun Studio compiler

This commit is contained in:
tedbullock 2008-10-03 23:18:08 +00:00
parent 50a30da590
commit 297492792b
3 changed files with 23 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2008-10-03 Ted Bullock <tbullock@canada.com>
* src/timer.c: Fix build on opensolaris with Sun Studio compiler
* src/lib/heap.c: Fix build on opensolaris with Sun Studio compiler
2008-07-14 Adrian Chadd <adrian@creative.net.au> 2008-07-14 Adrian Chadd <adrian@creative.net.au>
* Assorted .c and .h files: Use libevent for the communications backend * Assorted .c and .h files: Use libevent for the communications backend

View File

@ -135,8 +135,10 @@ percolate(struct Heap *h, u_long hole)
Any_Type Any_Type
remove_min(struct Heap *h) remove_min(struct Heap *h)
{ {
if (is_heap_empty(h)) if (is_heap_empty(h)) {
return (Any_Type) 0; Any_Type temp = {0};
return temp;
}
else { else {
Any_Type min = h->storage[1]; Any_Type min = h->storage[1];
h->storage[1] = h->storage[h->num_elements--]; h->storage[1] = h->storage[h->num_elements--];
@ -149,8 +151,10 @@ remove_min(struct Heap *h)
Any_Type Any_Type
poll_min(struct Heap * h) poll_min(struct Heap * h)
{ {
if (is_heap_empty(h)) if (is_heap_empty(h)) {
return (Any_Type) 0; Any_Type temp = {0};
return temp;
}
else else
return h->storage[1]; return h->storage[1];
} }

View File

@ -241,9 +241,17 @@ timer_schedule(void (*timeout) (struct Timer * t, Any_Type arg),
t->timeout_delay = delay; t->timeout_delay = delay;
if (delay > 0) if (delay > 0)
list_push(active_timers, (Any_Type) (void *) t); {
Any_Type temp;
temp.vp = (void *)t;
list_push(active_timers, temp);
}
else else
list_push(persistent_timers, (Any_Type) (void *) t); {
Any_Type temp;
temp.vp = (void *)t;
list_push(persistent_timers, temp);
}
if (DBG > 2) if (DBG > 2)
fprintf(stderr, fprintf(stderr,