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

Commitea2d974

Browse files
committed
Use Max/Min macros, not MAX/MIN, to eliminate portability issues.
1 parent620abeb commitea2d974

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

‎contrib/seg/segparse.y

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
#defineYYERROR_VERBOSE
33
#defineYYPARSE_PARAM result/* need this to pass a pointer (void *) to yyparse*/
44

5-
#include<string.h>
6-
#include<stdlib.h>
5+
#include"postgres.h"
6+
77
#include<math.h>
8-
#include"segdata.h"
9-
#include"buffer.h"
108

11-
#include"postgres.h"
129
#include"utils/elog.h"
10+
11+
#include"segdata.h"
12+
#include"buffer.h"
1313

1414
#ifdef __CYGWIN__
1515
#defineHUGE HUGE_VAL
@@ -27,10 +27,6 @@
2727

2828
floatseg_atof(char *value );
2929

30-
#defineMAX(X,Y) ((X) > (Y) ? (X) : (Y))
31-
#defineMIN(X,Y) ((X) < (Y) ? (X) : (Y))
32-
#defineABS(X) ((X) <0 ? (-X) : (X))
33-
3430
long threshold;
3531
char strbuf[25] = {
3632
'0','0','0','0','0',
@@ -68,9 +64,9 @@ range:
6864
((SEG *)result)->lower =$1.val -$3.val;
6965
((SEG *)result)->upper =$1.val +$3.val;
7066
sprintf(strbuf,"%g", ((SEG *)result)->lower);
71-
((SEG *)result)->l_sigd =MAX(MIN(6, significant_digits(strbuf)),MAX($1.sigd,$3.sigd));
67+
((SEG *)result)->l_sigd =Max(Min(6, significant_digits(strbuf)),Max($1.sigd,$3.sigd));
7268
sprintf(strbuf,"%g", ((SEG *)result)->upper);
73-
((SEG *)result)->u_sigd =MAX(MIN(6, significant_digits(strbuf)),MAX($1.sigd,$3.sigd));
69+
((SEG *)result)->u_sigd =Max(Min(6, significant_digits(strbuf)),Max($1.sigd,$3.sigd));
7470
((SEG *)result)->l_ext ='\0';
7571
((SEG *)result)->u_ext ='\0';
7672
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp