aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/geo_ops.c
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2018-07-29 23:08:00 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2018-07-29 23:08:00 +0200
commitab87b8fedce3fa77ca0d684a42ecc055f189eb33 (patch)
treedc54d0522a6e26dd2f64a620ae38c7fe97bd002f /src/backend/utils/adt/geo_ops.c
parent74294c7301340eeb477343dd26d98d2f3e33bd20 (diff)
downloadpostgresql-ab87b8fedce3fa77ca0d684a42ecc055f189eb33.tar.gz
postgresql-ab87b8fedce3fa77ca0d684a42ecc055f189eb33.zip
Mark variable used only in assertion with PG_USED_FOR_ASSERTS_ONLY
Perpendicular lines always intersect, so the line_interpt_line() return value in line_closept_point() was used only in an assertion, triggering compiler warnings in non-assert builds.
Diffstat (limited to 'src/backend/utils/adt/geo_ops.c')
-rw-r--r--src/backend/utils/adt/geo_ops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 621b5c33ef1..4490f933ba9 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -2528,14 +2528,15 @@ lseg_interpt_line(Point *result, LSEG *lseg, LINE *line)
static float8
line_closept_point(Point *result, LINE *line, Point *point)
{
- bool retval;
+ bool retval PG_USED_FOR_ASSERTS_ONLY;
Point closept;
LINE tmp;
/* We drop a perpendicular to find the intersection point. */
line_construct(&tmp, point, line_invsl(line));
retval = line_interpt_line(&closept, line, &tmp);
- Assert(retval); /* XXX: We need something better. */
+
+ Assert(retval); /* perpendicular lines always intersect */
if (result != NULL)
*result = closept;