From: Kaj-Michael Lang Date: Fri, 10 Aug 2007 12:43:33 +0000 (+0300) Subject: Formating X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2220ee6f8e35fd012884c5222826fbbd239a811d;p=mapper Formating --- diff --git a/src/route.c b/src/route.c index e33920d..6247d3d 100644 --- a/src/route.c +++ b/src/route.c @@ -522,8 +522,7 @@ find_nearest_waypoint(guint unitx, guint unity) 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; @@ -602,11 +601,8 @@ route_update_nears(gboolean quick) * 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; @@ -614,16 +610,8 @@ route_update_nears(gboolean quick) 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; @@ -649,8 +637,7 @@ route_update_nears(gboolean quick) } 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);