X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/9385eb3d10ebe5eb398c52040ec3dbfba9b0cdcf..a9aaacca3a68bb8d74fec09d8d8681a0efda2581:/stdlib/FreeBSD/merge.c diff --git a/stdlib/FreeBSD/merge.c b/stdlib/FreeBSD/merge.c index 711b9cd..6a93bc1 100644 --- a/stdlib/FreeBSD/merge.c +++ b/stdlib/FreeBSD/merge.c @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -34,11 +30,14 @@ * SUCH DAMAGE. */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcomma" + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)merge.c 8.2 (Berkeley) 2/14/94"; #endif /* LIBC_SCCS and not lint */ #include -__FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.6 2002/03/21 22:48:42 obrien Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.8 2007/01/09 00:28:10 imp Exp $"); /* * Hybrid exponential search/linear search merge sort with hybrid @@ -60,8 +59,10 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.6 2002/03/21 22:48:42 obrien #include #include -static void setup(u_char *, u_char *, size_t, size_t, int (*)()); -static void insertionsort(u_char *, size_t, size_t, int (*)()); +static void setup(u_char *, u_char *, size_t, size_t, + int (*)(const void *, const void *)); +static void insertionsort(u_char *, size_t, size_t, + int (*)(const void *, const void *)); #define ISIZE sizeof(int) #define PSIZE sizeof(u_char *) @@ -103,7 +104,8 @@ mergesort(base, nmemb, size, cmp) size_t size; int (*cmp)(const void *, const void *); { - int i, sense; + size_t i; + int sense; int big, iflag; u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2; u_char *list2, *list1, *p2, *p, *last, **p1; @@ -265,7 +267,8 @@ setup(list1, list2, n, size, cmp) int (*cmp)(const void *, const void *); u_char *list1, *list2; { - int i, length, size2, tmp, sense; + size_t i, size2; + int length, tmp, sense; u_char *f1, *f2, *s, *l2, *last, *p2; size2 = size*2; @@ -350,3 +353,4 @@ insertionsort(a, n, size, cmp) swap(u, t); } } +#pragma clang diagnostic pop