summaryrefslogtreecommitdiff
path: root/contrib/seg
diff options
context:
space:
mode:
authorTom Lane2004-09-14 04:21:38 +0000
committerTom Lane2004-09-14 04:21:38 +0000
commitdb64df4b1c569089338b08223e1df913799fa9b5 (patch)
tree23b19713d40a0f56d4fc952cf33248fdd930115a /contrib/seg
parent92244e8e545197485c0ac39ef223a524e5a1e366 (diff)
Fix contrib/cube and contrib/seg to compile on Windows.
Andreas Pflug
Diffstat (limited to 'contrib/seg')
-rw-r--r--contrib/seg/seg.c6
-rw-r--r--contrib/seg/segparse.y8
-rw-r--r--contrib/seg/segscan.l2
3 files changed, 7 insertions, 9 deletions
diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c
index e86772ab2b8..ce857aac479 100644
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -14,8 +14,6 @@
#include "segdata.h"
-#define max(a,b) ((a) > (b) ? (a) : (b))
-#define min(a,b) ((a) <= (b) ? (a) : (b))
#define abs(a) ((a) < (0) ? (-a) : (a))
/*
@@ -924,7 +922,7 @@ restore(char *result, float val, int n)
* put a cap on the number of siugnificant digits to avoid nonsense in
* the output
*/
- n = min(n, FLT_DIG);
+ n = Min(n, FLT_DIG);
/* remember the sign */
sign = (val < 0 ? 1 : 0);
@@ -946,7 +944,7 @@ restore(char *result, float val, int n)
if (exp == 0)
{
/* use the supplied mantyssa with sign */
- strcpy((char *) index(result, 'e'), "");
+ strcpy((char *) strchr(result, 'e'), "");
}
else
{
diff --git a/contrib/seg/segparse.y b/contrib/seg/segparse.y
index 86640d7e51d..d0c2f188bc4 100644
--- a/contrib/seg/segparse.y
+++ b/contrib/seg/segparse.y
@@ -38,7 +38,7 @@
} bnd;
char * text;
}
-%token <text> FLOAT
+%token <text> SEGFLOAT
%token <text> RANGE
%token <text> PLUMIN
%token <text> EXTENSION
@@ -105,13 +105,13 @@ range:
;
boundary:
- FLOAT {
+ SEGFLOAT {
$$.ext = '\0';
$$.sigd = significant_digits($1);
$$.val = seg_atof($1);
}
|
- EXTENSION FLOAT {
+ EXTENSION SEGFLOAT {
$$.ext = $1[0];
$$.sigd = significant_digits($2);
$$.val = seg_atof($2);
@@ -119,7 +119,7 @@ boundary:
;
deviation:
- FLOAT {
+ SEGFLOAT {
$$.ext = '\0';
$$.sigd = significant_digits($1);
$$.val = seg_atof($1);
diff --git a/contrib/seg/segscan.l b/contrib/seg/segscan.l
index b2a3bbe6845..24ad662910f 100644
--- a/contrib/seg/segscan.l
+++ b/contrib/seg/segscan.l
@@ -41,7 +41,7 @@ float ({integer}|{real})([eE]{integer})?
{range} yylval.text = yytext; return RANGE;
{plumin} yylval.text = yytext; return PLUMIN;
-{float} yylval.text = yytext; return FLOAT;
+{float} yylval.text = yytext; return SEGFLOAT;
\< yylval.text = "<"; return EXTENSION;
\> yylval.text = ">"; return EXTENSION;
\~ yylval.text = "~"; return EXTENSION;