aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-19 22:55:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-19 22:55:03 +0000
commit7c81d7953c27da65efc600657be647f7ed1398cf (patch)
treeab14810157c7fcede5ccb8a27bc069972b92abf9
parent6e884662a1e2bde138898117c72fd2f9cd661b60 (diff)
downloadpostgresql-7c81d7953c27da65efc600657be647f7ed1398cf.tar.gz
postgresql-7c81d7953c27da65efc600657be647f7ed1398cf.zip
seg_size() has to be V1 calling convention, too.
-rw-r--r--contrib/seg/seg.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c
index 5d224b951d8..cb0ce4f5cab 100644
--- a/contrib/seg/seg.c
+++ b/contrib/seg/seg.c
@@ -35,12 +35,14 @@ extern int seg_yydebug;
*/
PG_FUNCTION_INFO_V1(seg_in);
PG_FUNCTION_INFO_V1(seg_out);
+PG_FUNCTION_INFO_V1(seg_size);
PG_FUNCTION_INFO_V1(seg_lower);
PG_FUNCTION_INFO_V1(seg_upper);
PG_FUNCTION_INFO_V1(seg_center);
Datum seg_in(PG_FUNCTION_ARGS);
Datum seg_out(PG_FUNCTION_ARGS);
+Datum seg_size(PG_FUNCTION_ARGS);
Datum seg_lower(PG_FUNCTION_ARGS);
Datum seg_upper(PG_FUNCTION_ARGS);
Datum seg_center(PG_FUNCTION_ARGS);
@@ -81,7 +83,6 @@ bool seg_over_right(SEG * a, SEG * b);
SEG *seg_union(SEG * a, SEG * b);
SEG *seg_inter(SEG * a, SEG * b);
void rt_seg_size(SEG * a, float *sz);
-float *seg_size(SEG * a);
/*
** Various operators
@@ -717,16 +718,12 @@ rt_seg_size(SEG * a, float *size)
return;
}
-float *
-seg_size(SEG * a)
+Datum
+seg_size(PG_FUNCTION_ARGS)
{
- float *result;
-
- result = (float *) palloc(sizeof(float));
-
- *result = (float) Abs(a->upper - a->lower);
+ SEG *seg = (SEG *) PG_GETARG_POINTER(0);
- return (result);
+ PG_RETURN_FLOAT4((float) Abs(seg->upper - seg->lower));
}