Skip to content

Commit 9bb5c06

Browse files
committed
More whitespace changes. Improve error message for nulls detected in arrays.
1 parent 8255a75 commit 9bb5c06

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/polygon.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -920,17 +920,17 @@ spherepoly_rad(PG_FUNCTION_ARGS)
920920

921921
if (ARR_HASNULL(float_vector))
922922
{
923-
elog( ERROR,
924-
"spherepoly_rad: invalid array has null values"
925-
);
923+
elog(ERROR,
924+
"spherepoly_rad: input array is invalid because it has null values"
925+
);
926926
PG_RETURN_NULL();
927927
}
928928

929929
if (np < 6 || np % 2 != 0)
930930
{
931-
elog( ERROR,
932-
"spherepoly_rad: invalid number of arguments (must be even and >= 6)"
933-
);
931+
elog(ERROR,
932+
"spherepoly_rad: invalid number of arguments (must be even and >= 6)"
933+
);
934934
PG_RETURN_NULL();
935935
}
936936

@@ -939,20 +939,20 @@ spherepoly_rad(PG_FUNCTION_ARGS)
939939
points = (SPoint *) palloc(np * sizeof(SPoint));
940940
if (points == NULL)
941941
{
942-
elog( ERROR,
943-
"spherepoly_rad: failed to allocate memory for points array"
944-
);
942+
elog(ERROR,
943+
"spherepoly_rad: failed to allocate memory for points array"
944+
);
945945
PG_RETURN_NULL();
946946
}
947947

948948
array_data = (float8 *) ARR_DATA_PTR(float_vector);
949949

950950
for (i = 0; i < np; i++)
951951
{
952-
create_spherepoint_from_long_lat( &points[i],
953-
array_data[2 * i],
954-
array_data[2 * i + 1]
955-
);
952+
create_spherepoint_from_long_lat(&points[i],
953+
array_data[2 * i],
954+
array_data[2 * i + 1]
955+
);
956956
}
957957
PG_RETURN_POINTER(spherepoly_from_array(points, np));
958958
}
@@ -970,17 +970,17 @@ spherepoly_deg(PG_FUNCTION_ARGS)
970970

971971
if (ARR_HASNULL(float_vector))
972972
{
973-
elog( ERROR,
974-
"spherepoly_deg: invalid array has null values"
975-
);
973+
elog(ERROR,
974+
"spherepoly_deg: input array is invalid because it has null values"
975+
);
976976
PG_RETURN_NULL();
977977
}
978978

979979
if (np < 6 || np % 2 != 0)
980980
{
981-
elog( ERROR,
982-
"spherepoly_deg: invalid number of arguments (must be even and >= 6)"
983-
);
981+
elog(ERROR,
982+
"spherepoly_deg: invalid number of arguments (must be even and >= 6)"
983+
);
984984
PG_RETURN_NULL();
985985
}
986986

@@ -989,20 +989,20 @@ spherepoly_deg(PG_FUNCTION_ARGS)
989989
points = (SPoint *) palloc(np * sizeof(SPoint));
990990
if (points == NULL)
991991
{
992-
elog( ERROR,
993-
"spherepoly_deg: failed to allocate memory for points array"
994-
);
992+
elog(ERROR,
993+
"spherepoly_deg: failed to allocate memory for points array"
994+
);
995995
PG_RETURN_NULL();
996996
}
997997

998998
array_data = (float8 *) ARR_DATA_PTR(float_vector);
999999

10001000
for (i = 0; i < np; i++)
10011001
{
1002-
create_spherepoint_from_long_lat( &points[i],
1003-
deg_to_rad(array_data[2 * i]),
1004-
deg_to_rad(array_data[2 * i + 1])
1005-
);
1002+
create_spherepoint_from_long_lat(&points[i],
1003+
deg_to_rad(array_data[2 * i]),
1004+
deg_to_rad(array_data[2 * i + 1])
1005+
);
10061006
}
10071007
PG_RETURN_POINTER(spherepoly_from_array(points, np));
10081008
}

0 commit comments

Comments
 (0)