Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c81d79

Browse files
committed
seg_size() has to be V1 calling convention, too.
1 parent6e88466 commit7c81d79

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

‎contrib/seg/seg.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ extern int seg_yydebug;
3535
*/
3636
PG_FUNCTION_INFO_V1(seg_in);
3737
PG_FUNCTION_INFO_V1(seg_out);
38+
PG_FUNCTION_INFO_V1(seg_size);
3839
PG_FUNCTION_INFO_V1(seg_lower);
3940
PG_FUNCTION_INFO_V1(seg_upper);
4041
PG_FUNCTION_INFO_V1(seg_center);
4142

4243
Datumseg_in(PG_FUNCTION_ARGS);
4344
Datumseg_out(PG_FUNCTION_ARGS);
45+
Datumseg_size(PG_FUNCTION_ARGS);
4446
Datumseg_lower(PG_FUNCTION_ARGS);
4547
Datumseg_upper(PG_FUNCTION_ARGS);
4648
Datumseg_center(PG_FUNCTION_ARGS);
@@ -81,7 +83,6 @@ boolseg_over_right(SEG * a, SEG * b);
8183
SEG*seg_union(SEG*a,SEG*b);
8284
SEG*seg_inter(SEG*a,SEG*b);
8385
voidrt_seg_size(SEG*a,float*sz);
84-
float*seg_size(SEG*a);
8586

8687
/*
8788
** Various operators
@@ -717,16 +718,12 @@ rt_seg_size(SEG * a, float *size)
717718
return;
718719
}
719720

720-
float*
721-
seg_size(SEG*a)
721+
Datum
722+
seg_size(PG_FUNCTION_ARGS)
722723
{
723-
float*result;
724-
725-
result= (float*)palloc(sizeof(float));
726-
727-
*result= (float)Abs(a->upper-a->lower);
724+
SEG*seg= (SEG*)PG_GETARG_POINTER(0);
728725

729-
return (result);
726+
PG_RETURN_FLOAT4((float)Abs(seg->upper-seg->lower));
730727
}
731728

732729

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp