diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-08-30 15:09:23 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-08-30 15:09:23 +0100 |
commit | 683ee76ad23371a3fc0543ab35445f237820572c (patch) | |
tree | 368839f66b09b1d0f64c3d08fc3e6d673eae41d8 /gl | |
parent | 24a1a8c473c93d5b059d5afed245422b3a8a54ef (diff) | |
download | coreutils-683ee76ad23371a3fc0543ab35445f237820572c.tar.xz |
build: heap.c: make possible gnulib candidate c89 compatible
* gl/lib/heap.c: Move declaration to the top of scope.
Reported by Rob McMahon and Wolfgang Steinwender
in relation to "Sun WorkShop 6 update 2 C 5.3 Patch 111679-12
2003/05/18" and "GCC 2.95.3" respectively.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/lib/heap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gl/lib/heap.c b/gl/lib/heap.c index 027b5cd3c..d7db440d7 100644 --- a/gl/lib/heap.c +++ b/gl/lib/heap.c @@ -93,10 +93,12 @@ heap_insert (struct heap *heap, void *item) void * heap_remove_top (struct heap *heap) { + void *top; + if (heap->count == 0) return NULL; - void *top = heap->array[1]; + top = heap->array[1]; heap->array[1] = heap->array[heap->count--]; heapify_down (heap->array, heap->count, 1, heap->compare); |