diff --git a/src/point.c b/src/point.c index f4df15c..26ae5f5 100644 --- a/src/point.c +++ b/src/point.c @@ -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)); }