Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ab87b8f

Browse files
committed
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.
1 parent 74294c7 commit ab87b8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/utils/adt/geo_ops.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,14 +2528,15 @@ lseg_interpt_line(Point *result, LSEG *lseg, LINE *line)
25282528
static float8
25292529
line_closept_point(Point *result, LINE *line, Point *point)
25302530
{
2531-
bool retval;
2531+
bool retval PG_USED_FOR_ASSERTS_ONLY;
25322532
Point closept;
25332533
LINE tmp;
25342534

25352535
/* We drop a perpendicular to find the intersection point. */
25362536
line_construct(&tmp, point, line_invsl(line));
25372537
retval = line_interpt_line(&closept, line, &tmp);
2538-
Assert(retval); /* XXX: We need something better. */
2538+
2539+
Assert(retval); /* perpendicular lines always intersect */
25392540

25402541
if (result != NULL)
25412542
*result = closept;

0 commit comments

Comments
 (0)