aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/geo_ops.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-06-13 07:35:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-06-13 07:35:40 +0000
commitf2d120532207b8873a5e74e7350dd2904f377289 (patch)
tree992c89e023c4b29b42bf4fd6563de91f8d6ec8ca /src/backend/utils/adt/geo_ops.c
parent8f057d971d663fff9bbb2ae7d053bf71cf09b4a2 (diff)
downloadpostgresql-f2d120532207b8873a5e74e7350dd2904f377289.tar.gz
postgresql-f2d120532207b8873a5e74e7350dd2904f377289.zip
Another batch of fmgr updates. I think I have gotten all old-style
functions that take pass-by-value datatypes. Should be ready for port testing ...
Diffstat (limited to 'src/backend/utils/adt/geo_ops.c')
-rw-r--r--src/backend/utils/adt/geo_ops.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 0e8bb4405b2..dc6e077d6bf 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.50 2000/04/12 17:15:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/geo_ops.c,v 1.51 2000/06/13 07:35:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4361,22 +4361,21 @@ box_circle(BOX *box)
} /* box_circle() */
-POLYGON *
-circle_poly(int npts, CIRCLE *circle)
+Datum
+circle_poly(PG_FUNCTION_ARGS)
{
+ int32 npts = PG_GETARG_INT32(0);
+ CIRCLE *circle = PG_GETARG_CIRCLE_P(1);
POLYGON *poly;
int size;
int i;
double angle;
- if (!PointerIsValid(circle))
- return NULL;
-
if (FPzero(circle->radius) || (npts < 2))
elog(ERROR, "Unable to convert circle to polygon");
size = offsetof(POLYGON, p[0]) +(sizeof(poly->p[0]) * npts);
- poly = palloc(size);
+ poly = (POLYGON *) palloc(size);
MemSet((char *) poly, 0, size); /* zero any holes */
poly->size = size;
@@ -4391,7 +4390,7 @@ circle_poly(int npts, CIRCLE *circle)
make_bound_box(poly);
- return poly;
+ PG_RETURN_POLYGON_P(poly);
}
/* poly_circle - convert polygon to circle