1
1
/*
2
2
* Copied from NetBSD CVS, 2002-07-19, bjm
3
3
* 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 $
5
7
*/
6
8
7
9
/*$NetBSD: qsort.c,v 1.12 1999/09/20 04:39:40 lukem Exp $ */
39
41
* SUCH DAMAGE.
40
42
*/
41
43
42
- #include <sys/cdefs.h>
44
+ #include <stdlib.h>
45
+ #include <errno.h>
43
46
#include <sys/types.h>
44
47
45
- #include <assert.h>
46
- #include <errno.h>
47
- #include <stdlib.h>
48
48
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 );
52
52
53
- #define min (a ,b )(a) < (b) ?a :b
53
+ #define min (a ,b )(( a) < (b) ?(a) :(b))
54
54
55
55
/*
56
56
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
@@ -98,7 +98,7 @@ med3(a, b, c, cmp)
98
98
char * a ,
99
99
* b ,
100
100
* c ;
101
- int (* cmp )__P (( const void * ,const void * ) );
101
+ int (* cmp )( const void * ,const void * );
102
102
{
103
103
return cmp (a ,b )< 0 ?
104
104
(cmp (b ,c )< 0 ?b : (cmp (a ,c )< 0 ?c :a ))
@@ -110,7 +110,7 @@ qsort(a, n, es, cmp)
110
110
void * a ;
111
111
size_t n ,
112
112
es ;
113
- int (* cmp )__P (( const void * ,const void * ) );
113
+ int (* cmp )( const void * ,const void * );
114
114
{
115
115
char * pa ,
116
116
* pb ,