Loading...
stdlib/FreeBSD/merge.c Libc-1725.40.4 Libc-320
--- Libc/Libc-1725.40.4/stdlib/FreeBSD/merge.c
+++ Libc/Libc-320/stdlib/FreeBSD/merge.c
@@ -13,6 +13,10 @@
  * 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.
@@ -30,14 +34,11 @@
  * 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 <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.8 2007/01/09 00:28:10 imp Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/merge.c,v 1.6 2002/03/21 22:48:42 obrien Exp $");
 
 /*
  * Hybrid exponential search/linear search merge sort with hybrid
@@ -59,10 +60,8 @@
 #include <stdlib.h>
 #include <string.h>
 
-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 *));
+static void setup(u_char *, u_char *, size_t, size_t, int (*)());
+static void insertionsort(u_char *, size_t, size_t, int (*)());
 
 #define ISIZE sizeof(int)
 #define PSIZE sizeof(u_char *)
@@ -98,11 +97,13 @@
  * Arguments are as for qsort.
  */
 int
-mergesort(void *base, size_t nmemb, size_t size,
-    int (*cmp)(const void *, const void *))
+mergesort(base, nmemb, size, cmp)
+	void *base;
+	size_t nmemb;
+	size_t size;
+	int (*cmp)(const void *, const void *);
 {
-	size_t i;
-	int sense;
+	int i, sense;
 	int big, iflag;
 	u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
 	u_char *list2, *list1, *p2, *p, *last, **p1;
@@ -259,11 +260,12 @@
  * is defined.  Otherwise simple pairwise merging is used.)
  */
 void
-setup(u_char *list1, u_char *list2, size_t n, size_t size,
-    int (*cmp)(const void *, const void *))
+setup(list1, list2, n, size, cmp)
+	size_t n, size;
+	int (*cmp)(const void *, const void *);
+	u_char *list1, *list2;
 {
-	size_t i, size2;
-	int length, tmp, sense;
+	int i, length, size2, tmp, sense;
 	u_char *f1, *f2, *s, *l2, *last, *p2;
 
 	size2 = size*2;
@@ -332,8 +334,10 @@
  * last 4 elements.
  */
 static void
-insertionsort(u_char *a, size_t n, size_t size,
-    int (*cmp)(const void *, const void *))
+insertionsort(a, n, size, cmp)
+	u_char *a;
+	size_t n, size;
+	int (*cmp)(const void *, const void *);
 {
 	u_char *ai, *s, *t, *u, tmp;
 	int i;
@@ -346,4 +350,3 @@
 			swap(u, t);
 		}
 }
-#pragma clang diagnostic pop