nearest_squared = DISTANCE_SQUARED(pos, *(wcurr->point));
while (wcurr++ != _route.wtail) {
- guint64 test_squared =
- DISTANCE_SQUARED(pos, *(wcurr->point));
+ guint64 test_squared = DISTANCE_SQUARED(pos, *(wcurr->point));
if (test_squared < nearest_squared) {
wnear = wcurr;
nearest_squared = test_squared;
* should skip it. Note that if there is no _next_wpt, then
* there is no next waypoint, so we do not skip it in that case. */
|| (wcurr->point == near && quick
- && (_next_wpt
- && (DISTANCE_SQUARED(_pos, *near) >
- _next_way_dist_squared
- && DISTANCE_SQUARED(_pos, *_next_wpt)
- < _next_wpt_dist_squared))))
+ && (_next_wpt && (DISTANCE_SQUARED(_pos, *near) > _next_way_dist_squared
+ && DISTANCE_SQUARED(_pos, *_next_wpt) < _next_wpt_dist_squared))))
wnext = wcurr + 1;
else
break;
if (wnext == _route.wtail && (wnext->point < near
|| (wnext->point == near && quick
- && (_next_wpt
- &&
- (DISTANCE_SQUARED
- (_pos,
- *near) >
- _next_way_dist_squared
- && DISTANCE_SQUARED(_pos,
- *_next_wpt)
- <
- _next_wpt_dist_squared)))))
+ && (_next_wpt && (DISTANCE_SQUARED (_pos, *near) > _next_way_dist_squared
+ && DISTANCE_SQUARED(_pos, *_next_wpt) < _next_wpt_dist_squared)))))
{
_next_way = NULL;
_next_wpt = NULL;
}
ret = TRUE;
}
- _next_way_dist_squared =
- DISTANCE_SQUARED(_pos, *wnext->point);
+ _next_way_dist_squared = DISTANCE_SQUARED(_pos, *wnext->point);
if (_next_wpt)
_next_wpt_dist_squared =
DISTANCE_SQUARED(_pos, *_next_wpt);