Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb38900c

Browse files
committed
Use Min() instead of min() in qsort, for consistency and to avoid
redefined-macro warnings on some platforms. Per gripe from Hiroshi Saito.
1 parenta50606d commitb38900c

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

‎src/port/qsort.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*CAUTION: if you change this file, see also qsort_arg.c
1111
*
12-
*$PostgreSQL: pgsql/src/port/qsort.c,v 1.10 2006/10/03 22:18:23 tgl Exp $
12+
*$PostgreSQL: pgsql/src/port/qsort.c,v 1.11 2006/10/12 15:04:55 tgl Exp $
1313
*/
1414

1515
/*$NetBSD: qsort.c,v 1.13 2003/08/07 16:43:42 agc Exp $*/
@@ -50,8 +50,6 @@ static char *med3(char *, char *, char *,
5050
int (*) (constvoid*,constvoid*));
5151
staticvoidswapfunc(char*,char*,size_t,int);
5252

53-
#definemin(a,b)((a) < (b) ? (a) : (b))
54-
5553
/*
5654
* Qsort routine based on J. L. Bentley and M. D. McIlroy,
5755
* "Engineering a sort function",
@@ -192,9 +190,9 @@ loop:SWAPINIT(a, es);
192190
pc-=es;
193191
}
194192
pn= (char*)a+n*es;
195-
r=min(pa- (char*)a,pb-pa);
193+
r=Min(pa- (char*)a,pb-pa);
196194
vecswap(a,pb-r,r);
197-
r=min(pd-pc,pn-pd-es);
195+
r=Min(pd-pc,pn-pd-es);
198196
vecswap(pb,pn-r,r);
199197
if ((r=pb-pa)>es)
200198
qsort(a,r /es,es,cmp);

‎src/port/qsort_arg.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*CAUTION: if you change this file, see also qsort.c
1111
*
12-
*$PostgreSQL: pgsql/src/port/qsort_arg.c,v 1.2 2006/10/04 00:30:14 momjian Exp $
12+
*$PostgreSQL: pgsql/src/port/qsort_arg.c,v 1.3 2006/10/12 15:04:55 tgl Exp $
1313
*/
1414

1515
/*$NetBSD: qsort.c,v 1.13 2003/08/07 16:43:42 agc Exp $*/
@@ -50,8 +50,6 @@ static char *med3(char *a, char *b, char *c,
5050
qsort_arg_comparatorcmp,void*arg);
5151
staticvoidswapfunc(char*,char*,size_t,int);
5252

53-
#definemin(a,b)((a) < (b) ? (a) : (b))
54-
5553
/*
5654
* Qsort routine based on J. L. Bentley and M. D. McIlroy,
5755
* "Engineering a sort function",
@@ -184,9 +182,9 @@ loop:SWAPINIT(a, es);
184182
pc-=es;
185183
}
186184
pn= (char*)a+n*es;
187-
r=min(pa- (char*)a,pb-pa);
185+
r=Min(pa- (char*)a,pb-pa);
188186
vecswap(a,pb-r,r);
189-
r=min(pd-pc,pn-pd-es);
187+
r=Min(pd-pc,pn-pd-es);
190188
vecswap(pb,pn-r,r);
191189
if ((r=pb-pa)>es)
192190
qsort_arg(a,r /es,es,cmp,arg);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp