]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: heap.c: make possible gnulib candidate c89 compatible
authorPádraig Brady <P@draigBrady.com>
Tue, 30 Aug 2011 14:09:23 +0000 (15:09 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 30 Aug 2011 14:09:23 +0000 (15:09 +0100)
* 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.

gl/lib/heap.c

index 027b5cd3c388fcea94e7f291fcb2ed26a2d31e2c..d7db440d7287c8b066fe8dd1c3019e7783b57c1b 100644 (file)
@@ -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);