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,