X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fsorter%2Fsorter.h;h=98dd8f776e3aa0bacc0e4423217c26a440ec328a;hb=e65a1a48088af1a5731f64b50ba933f4c29d5040;hp=d9ae7a00db4572bbd09d92810e53d7c6458b1856;hpb=557dc31fa097cfe3b8fdbc087e27da6db7317819;p=libucw.git diff --git a/lib/sorter/sorter.h b/lib/sorter/sorter.h index d9ae7a00..98dd8f77 100644 --- a/lib/sorter/sorter.h +++ b/lib/sorter/sorter.h @@ -52,7 +52,7 @@ * SORT_HASH_BITS signals that a monotone hashing function returning a given number of * bits is available. Monotone hash is a function f such that f(x) < f(y) * implies x < y and which is approximately uniformly distributed. - * uns PREFIX_hash(SORT_KEY *a, SORT_KEY *b) + * uns PREFIX_hash(SORT_KEY *a) * * Unification: * @@ -175,6 +175,10 @@ static inline void P(copy_data)(P(key) *key, struct fastbuf *in, struct fastbuf #include "lib/sorter/s-internal.h" #include "lib/sorter/s-twoway.h" +#if defined(SORT_HASH_BITS) || defined(SORT_INT) +#include "lib/sorter/s-radix.h" +#endif + static struct fastbuf *P(sort)( #ifdef SORT_INPUT_FILE byte *in, @@ -223,10 +227,12 @@ static struct fastbuf *P(sort)( #ifdef SORT_HASH_BITS ctx.hash_bits = SORT_HASH_BITS; + ctx.radix_split = P(radix_split); #elif defined(SORT_INT) ctx.hash_bits = 0; while (ctx.hash_bits < 32 && (int_range >> ctx.hash_bits)) ctx.hash_bits++; + ctx.radix_split = P(radix_split); #endif ctx.internal_sort = P(internal);