11/*
22 * Copied from NetBSD CVS, 2002-07-19, bjm
33 * Add do ... while() macro fix
4- * Remove __inline, _DIAGASSERTs
4+ * Remove __inline, _DIAGASSERTs, __P
5+ *
6+ * $Header: /cvsroot/pgsql/src/port/qsort.c,v 1.2 2002/08/12 15:24:07 tgl Exp $
57 */
68
79/*$NetBSD: qsort.c,v 1.12 1999/09/20 04:39:40 lukem Exp $ */
3941 * SUCH DAMAGE.
4042 */
4143
42- #include <sys/cdefs.h>
44+ #include <stdlib.h>
45+ #include <errno.h>
4346#include <sys/types.h>
4447
45- #include <assert.h>
46- #include <errno.h>
47- #include <stdlib.h>
4848
49- static char * med3 __P ( (char * ,char * ,char * ,
50- int (* ) (const void * ,const void * ) ) );
51- static void swapfunc __P (( char * ,char * ,size_t ,int ) );
49+ static char * med3 (char * ,char * ,char * ,
50+ int (* ) (const void * ,const void * ));
51+ static void swapfunc ( char * ,char * ,size_t ,int );
5252
53- #define min (a ,b )(a) < (b) ?a :b
53+ #define min (a ,b )(( a) < (b) ?(a) :(b))
5454
5555/*
5656 * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
@@ -98,7 +98,7 @@ med3(a, b, c, cmp)
9898char * a ,
9999* b ,
100100* c ;
101- int (* cmp )__P (( const void * ,const void * ) );
101+ int (* cmp )( const void * ,const void * );
102102{
103103return cmp (a ,b )< 0 ?
104104(cmp (b ,c )< 0 ?b : (cmp (a ,c )< 0 ?c :a ))
@@ -110,7 +110,7 @@ qsort(a, n, es, cmp)
110110void * a ;
111111size_t n ,
112112es ;
113- int (* cmp )__P (( const void * ,const void * ) );
113+ int (* cmp )( const void * ,const void * );
114114{
115115char * pa ,
116116* pb ,