1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-13 14:22:43 +03:00

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.
This commit is contained in:
Tom Lane
2004-10-21 19:28:36 +00:00
parent a171fc1a4f
commit 380bd04c16
22 changed files with 34 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/src/test/regress/regress.c,v 1.61 2004/10/07 15:21:58 momjian Exp $
* $PostgreSQL: pgsql/src/test/regress/regress.c,v 1.62 2004/10/21 19:28:36 tgl Exp $
*/
#include "postgres.h"
@@ -272,8 +272,6 @@ pt_in_widget(PG_FUNCTION_ARGS)
PG_RETURN_BOOL(point_dt(point, &widget->center) < widget->radius);
}
#define ABS(X) ((X) >= 0 ? (X) : -(X))
PG_FUNCTION_INFO_V1(boxarea);
Datum
@@ -283,8 +281,8 @@ boxarea(PG_FUNCTION_ARGS)
double width,
height;
width = ABS(box->high.x - box->low.x);
height = ABS(box->high.y - box->low.y);
width = Abs(box->high.x - box->low.x);
height = Abs(box->high.y - box->low.y);
PG_RETURN_FLOAT8(width * height);
}