summaryrefslogtreecommitdiff
path: root/contrib/cube/cube.c
diff options
context:
space:
mode:
authorTom Lane2004-10-21 19:28:36 +0000
committerTom Lane2004-10-21 19:28:36 +0000
commit380bd04c1658795c77b3b808ee766347188fab5f (patch)
treecb654e3e510cb1974120cd4d3ea1984b30f3eb32 /contrib/cube/cube.c
parenta171fc1a4f37e37c1e80fe3e92a96b2bd37c8f98 (diff)
Standardize on using the Min, Max, and Abs macros that are in our c.h file,
getting rid of numerous ad-hoc versions that have popped up in various places. Shortens code and avoids conflict with Windows min() and max() macros.
Diffstat (limited to 'contrib/cube/cube.c')
-rw-r--r--contrib/cube/cube.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c
index 82a0972917..6b61d9e3f6 100644
--- a/contrib/cube/cube.c
+++ b/contrib/cube/cube.c
@@ -15,8 +15,6 @@
#include "cubedata.h"
-#define abs(a) ((a) < (0) ? (-a) : (a))
-
extern int cube_yyparse();
extern void cube_yyerror(const char *message);
extern void cube_scanner_init(const char *str);
@@ -683,7 +681,7 @@ cube_size(NDBOX * a)
*result = 1.0;
for (i = 0, j = a->dim; i < a->dim; i++, j++)
- *result = (*result) * abs((a->x[j] - a->x[i]));
+ *result = (*result) * Abs((a->x[j] - a->x[i]));
return (result);
}
@@ -700,7 +698,7 @@ rt_cube_size(NDBOX * a, double *size)
{
*size = 1.0;
for (i = 0, j = a->dim; i < a->dim; i++, j++)
- *size = (*size) * abs((a->x[j] - a->x[i]));
+ *size = (*size) * Abs((a->x[j] - a->x[i]));
}
return;
}