mirror of
https://github.com/postgres/postgres.git
synced 2025-06-07 00:02:00 -04:00
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.
This commit is contained in:
parent
74294c7301
commit
ab87b8fedc
@ -2528,14 +2528,15 @@ lseg_interpt_line(Point *result, LSEG *lseg, LINE *line)
|
|||||||
static float8
|
static float8
|
||||||
line_closept_point(Point *result, LINE *line, Point *point)
|
line_closept_point(Point *result, LINE *line, Point *point)
|
||||||
{
|
{
|
||||||
bool retval;
|
bool retval PG_USED_FOR_ASSERTS_ONLY;
|
||||||
Point closept;
|
Point closept;
|
||||||
LINE tmp;
|
LINE tmp;
|
||||||
|
|
||||||
/* We drop a perpendicular to find the intersection point. */
|
/* We drop a perpendicular to find the intersection point. */
|
||||||
line_construct(&tmp, point, line_invsl(line));
|
line_construct(&tmp, point, line_invsl(line));
|
||||||
retval = line_interpt_line(&closept, line, &tmp);
|
retval = line_interpt_line(&closept, line, &tmp);
|
||||||
Assert(retval); /* XXX: We need something better. */
|
|
||||||
|
Assert(retval); /* perpendicular lines always intersect */
|
||||||
|
|
||||||
if (result != NULL)
|
if (result != NULL)
|
||||||
*result = closept;
|
*result = closept;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user