From: Paul R. Eggert Date: Mon, 26 Jul 2010 04:18:14 +0000 (-0700) Subject: sort: make struct heap private X-Git-Tag: v8.6~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=074566823ec313ad350e658c6765349d2ceef881;p=thirdparty%2Fcoreutils.git sort: make struct heap private * gl/lib/heap.c (struct heap): Move this here... * gl/lib/heap.h (struct heap): ... from here, as outside code no longer needs to access any of these members. --- diff --git a/gl/lib/heap.c b/gl/lib/heap.c index baf9a270c7..80ea70e598 100644 --- a/gl/lib/heap.c +++ b/gl/lib/heap.c @@ -30,6 +30,13 @@ static size_t heapify_down (void **, size_t, size_t, static void heapify_up (void **, size_t, int (*) (void const *, void const *)); +struct heap +{ + void **array; /* array[0] is not used */ + size_t capacity; /* Array size */ + size_t count; /* Used as index to last element. Also is num of items. */ + int (*compare) (void const *, void const *); +}; /* Allocate memory for the heap. */ diff --git a/gl/lib/heap.h b/gl/lib/heap.h index b61adf6192..cbfeb04943 100644 --- a/gl/lib/heap.h +++ b/gl/lib/heap.h @@ -20,14 +20,6 @@ #include -struct heap -{ - void **array; /* array[0] is not used */ - size_t capacity; /* Array size */ - size_t count; /* Used as index to last element. Also is num of items. */ - int (*compare) (void const *, void const *); -}; - struct heap *heap_alloc (int (*) (void const *, void const *), size_t); void heap_free (struct heap *); int heap_insert (struct heap *heap, void *item);