Skip to content

Commit c024fa4

Browse files
committed
Remove use of __P so that <sys/cdefs.h> is not needed. Per suggestion
from Martin Renters.
1 parent 1ccc245 commit c024fa4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/port/qsort.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
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 $ */
@@ -39,18 +41,16 @@
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)
9898
char *a,
9999
*b,
100100
*c;
101-
int (*cmp) __P((const void *, const void *));
101+
int (*cmp) (const void *, const void *);
102102
{
103103
return 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)
110110
void *a;
111111
size_t n,
112112
es;
113-
int (*cmp) __P((const void *, const void *));
113+
int (*cmp) (const void *, const void *);
114114
{
115115
char *pa,
116116
*pb,

0 commit comments

Comments
 (0)