Skip to content

Commit

Permalink
spherepoint_hash32: float8 needs wrapping into a Datum (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
df7cb authored Nov 22, 2023
1 parent 94e498d commit f229b2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/point.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ Datum
spherepoint_hash32(PG_FUNCTION_ARGS)
{
SPoint *p1 = (SPoint *) PG_GETARG_POINTER(0);
Datum h1 = DirectFunctionCall1(hashfloat8, p1->lat);
Datum h2 = DirectFunctionCall1(hashfloat8, p1->lng);
Datum h1 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lat));
Datum h2 = DirectFunctionCall1(hashfloat8, Float8GetDatum(p1->lng));

PG_RETURN_INT32(DatumGetInt32(h1) ^ DatumGetInt32(h2));
}

0 comments on commit f229b2e

Please sign in to comment.