From 75aef35d7e88770e461f8f683f970192012583e3 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 3 Nov 2008 23:39:03 +0100 Subject: [PATCH] Bring interface of sorter/array-simple.h in line with sorter/array.h. ASORT_ELT is no longer mandatory; if it is not used, the sorting function gets a pointer of an array to be sorted as its first argument. --- ucw/sorter/array-simple.h | 23 ++++++++++++++++++----- ucw/sorter/sort-test.c | 4 +--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ucw/sorter/array-simple.h b/ucw/sorter/array-simple.h index d5a9c787..393ebd93 100644 --- a/ucw/sorter/array-simple.h +++ b/ucw/sorter/array-simple.h @@ -1,7 +1,7 @@ /* - * UCW Library -- Universal Array Sorter + * UCW Library -- Universal Simple Array Sorter * - * (c) 2003 Martin Mares + * (c) 2003--2008 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -25,7 +25,8 @@ * ASORT_PREFIX(x) [*] add a name prefix (used on all global names * defined by the sorter) * ASORT_KEY_TYPE [*] data type of a single array entry key - * ASORT_ELT(i) [*] returns the key of i-th element + * ASORT_ELT(i) returns the key of i-th element; if this macro is not + * defined, the function gets a pointer to an array to be sorted * ASORT_LT(x,y) x < y for ASORT_TYPE (default: "xcnt); m += keys[i]->cnt; } - s5m_sort(m, a); + s5m_sort(a, m); keys[0]->cnt = m; bwrite(f, keys[0], sizeof(struct key5)); bwrite(f, a, 4*m); -- 2.39.2