diff options
author | Paul R. Eggert <eggert@cs.ucla.edu> | 2010-07-25 19:24:33 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2010-07-25 19:25:09 -0700 |
commit | 48faad374819668b483683d2c444f6b2e93a008e (patch) | |
tree | 8fed771fbb7e058f51c877bd9b5690a979d8fd23 /gl | |
parent | 01ca128807be89f7a2709e7a12e2cd1498f3d96b (diff) | |
download | coreutils-48faad374819668b483683d2c444f6b2e93a008e.tar.xz |
sort: use more-consistent style with const
* src/sort.c (proctab_hasher, proctab_comparator, stream_open, xfopen):
(open_temp, zaptemp, struct_month_cmp, begfield, limfield):
(find_unit_order, human_numcompare, numcompare, general_numcompare):
(count_tabs, keycompare, compare, compare_nodes, lock_node):
(unlock_node, queue_destroy, queue_init, queue_insert, queue_pop):
(write_unique, mergelines_node, check_insert, update_parent):
(merge_loop, sortlines, struct thread_args, set_ordering):
Prefer the style "T const" to "const T".
* gl/lib/heap.h (struct heap, heap_alloc): Likewise.
* gl/lib/heap.c (heap_default_compare, heapify_down, heapify_up):
(heap_alloc): Likewise.
Diffstat (limited to 'gl')
-rw-r--r-- | gl/lib/heap.c | 14 | ||||
-rw-r--r-- | gl/lib/heap.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/gl/lib/heap.c b/gl/lib/heap.c index 4672b6d5b..baf9a270c 100644 --- a/gl/lib/heap.c +++ b/gl/lib/heap.c @@ -24,17 +24,17 @@ #include "stdlib--.h" #include "xalloc.h" -static int heap_default_compare (const void *, const void *); +static int heap_default_compare (void const *, void const *); static size_t heapify_down (void **, size_t, size_t, - int (*)(const void *, const void *)); + int (*) (void const *, void const *)); static void heapify_up (void **, size_t, - int (*)(const void *, const void *)); + int (*) (void const *, void const *)); /* Allocate memory for the heap. */ struct heap * -heap_alloc (int (*compare)(const void *, const void *), size_t n_reserve) +heap_alloc (int (*compare) (void const *, void const *), size_t n_reserve) { struct heap *heap = xmalloc (sizeof *heap); @@ -53,7 +53,7 @@ heap_alloc (int (*compare)(const void *, const void *), size_t n_reserve) static int -heap_default_compare (const void *a, const void *b) +heap_default_compare (void const *a, void const *b) { return 0; } @@ -100,7 +100,7 @@ heap_remove_top (struct heap *heap) static size_t heapify_down (void **array, size_t count, size_t initial, - int (*compare)(const void *, const void *)) + int (*compare) (void const *, void const *)) { void *element = array[initial]; @@ -127,7 +127,7 @@ heapify_down (void **array, size_t count, size_t initial, static void heapify_up (void **array, size_t count, - int (*compare)(const void *, const void *)) + int (*compare) (void const *, void const *)) { size_t k = count; void *new_element = array[k]; diff --git a/gl/lib/heap.h b/gl/lib/heap.h index 0ea516a79..b61adf619 100644 --- a/gl/lib/heap.h +++ b/gl/lib/heap.h @@ -25,10 +25,10 @@ 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)(const void *, const void *); + int (*compare) (void const *, void const *); }; -struct heap *heap_alloc (int (*)(const void *, const void *), size_t); +struct heap *heap_alloc (int (*) (void const *, void const *), size_t); void heap_free (struct heap *); int heap_insert (struct heap *heap, void *item); void *heap_remove_top (struct heap *heap); |