Fix build on opensolaris with Sun Studio compiler

This commit is contained in:
tedbullock 2008-10-03 23:18:08 +00:00
джерело 50a30da590
коміт 297492792b
3 змінених файлів з 23 додано та 6 видалено

@ -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>
* Assorted .c and .h files: Use libevent for the communications backend

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

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