1 --- merge_b.c.orig 2008-05-21 02:51:18.000000000 -0700
2 +++ merge_b.c 2008-05-21 02:54:59.000000000 -0700
3 @@ -57,9 +57,9 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/
6 static void setup(u_char *, u_char *, size_t, size_t,
7 - int (*)(const void *, const void *));
8 + int (^)(const void *, const void *));
9 static void insertionsort(u_char *, size_t, size_t,
10 - int (*)(const void *, const void *));
11 + int (^)(const void *, const void *));
13 #define ISIZE sizeof(int)
14 #define PSIZE sizeof(u_char *)
15 @@ -95,11 +95,11 @@ static void insertionsort(u_char *, size
16 * Arguments are as for qsort.
19 -mergesort(base, nmemb, size, cmp)
20 +mergesort_b(base, nmemb, size, cmp)
24 - int (*cmp)(const void *, const void *);
25 + int (^cmp)(const void *, const void *);
29 @@ -141,7 +141,7 @@ mergesort(base, nmemb, size, cmp)
31 l2 = list1 + (p2 - list2);
32 while (f1 < l1 && f2 < l2) {
33 - if ((*cmp)(f1, f2) <= 0) {
34 + if (cmp(f1, f2) <= 0) {
38 @@ -160,12 +160,12 @@ mergesort(base, nmemb, size, cmp)
39 EXPONENTIAL: for (i = size; ; i <<= 1)
40 if ((p = (b + i)) >= t) {
41 if ((p = t - size) > b &&
42 - (*cmp)(q, p) <= sense)
48 - } else if ((*cmp)(q, p) <= sense) {
49 + } else if (cmp(q, p) <= sense) {
53 @@ -174,14 +174,14 @@ EXPONENTIAL: for (i = size; ; i <<
56 i = (((t - b) / size) >> 1) * size;
57 - if ((*cmp)(q, p = b + i) <= sense)
58 + if (cmp(q, p = b + i) <= sense)
64 FASTCASE: while (i > size)
67 p = b + (i >>= 1)) <= sense)
70 @@ -261,10 +261,11 @@ COPY: b = t;
72 setup(list1, list2, n, size, cmp)
74 - int (*cmp)(const void *, const void *);
75 + int (^cmp)(const void *, const void *);
76 u_char *list1, *list2;
78 - int i, length, size2, tmp, sense;
80 + int length, tmp, sense;
81 u_char *f1, *f2, *s, *l2, *last, *p2;
84 @@ -336,7 +337,7 @@ static void
85 insertionsort(a, n, size, cmp)
88 - int (*cmp)(const void *, const void *);
89 + int (^cmp)(const void *, const void *);
91 u_char *ai, *s, *t, *u, tmp;