From ce8b816c5d35882789b5ec0f2ca956541549edd0 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 26 Sep 2000 10:54:37 +0000 Subject: [PATCH] Sorting functions return void now instead of int. --- WINGs/WUtil.h | 4 ++-- WINGs/array.c | 4 +--- WINGs/bagtree.c | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/WINGs/WUtil.h b/WINGs/WUtil.h index f2800abf..0cbdec86 100644 --- a/WINGs/WUtil.h +++ b/WINGs/WUtil.h @@ -381,7 +381,7 @@ int WMCountInArray(WMArray *array, void *item); * > 0 if a > b * = 0 if a = b */ -int WMSortArray(WMArray *array, WMCompareDataProc *comparer); +void WMSortArray(WMArray *array, WMCompareDataProc *comparer); void WMMapArray(WMArray *array, void (*function)(void*, void*), void *data); @@ -441,7 +441,7 @@ void* WMReplaceInBag(WMBag *bag, int index, void *item); * > 0 if a > b * = 0 if a = b */ -int WMSortBag(WMBag *bag, WMCompareDataProc *comparer); +void WMSortBag(WMBag *bag, WMCompareDataProc *comparer); void WMEmptyBag(WMBag *bag); diff --git a/WINGs/array.c b/WINGs/array.c index c90de01c..c860b23e 100644 --- a/WINGs/array.c +++ b/WINGs/array.c @@ -249,12 +249,10 @@ WMCountInArray(WMArray *array, void *item) } -int +void WMSortArray(WMArray *array, WMCompareDataProc *comparer) { qsort(array->items, array->itemCount, sizeof(void*), comparer); - - return 1; } diff --git a/WINGs/bagtree.c b/WINGs/bagtree.c index 8ad7872b..c324eca3 100644 --- a/WINGs/bagtree.c +++ b/WINGs/bagtree.c @@ -657,7 +657,7 @@ WMReplaceInBag(WMBag *self, int index, void *item) } -int +void WMSortBag(WMBag *self, WMCompareDataProc *comparer) { void **items; @@ -665,7 +665,7 @@ WMSortBag(WMBag *self, WMCompareDataProc *comparer) int i; if (self->count == 0) - return 1; + return; items = wmalloc(sizeof(void*)*self->count); i = 0; @@ -687,8 +687,6 @@ WMSortBag(WMBag *self, WMCompareDataProc *comparer) } wfree(items); - - return 1; }