Discussion:
[Viking-devel] Handling of VIK_UNITS_DISTANCE_NAUTICAL_MILES
Kamil Ignacak
2016-08-15 17:16:42 UTC
Permalink
Hello,

I have noticed that there is a number of places in source code that
don't handle VIK_UNITS_DISTANCE_NAUTICAL_MILES value returned by
a_vik_get_units_distance(). In such places a switch statements handles
KILOMETRES and MILES, but not NAUTICAL_MILES. One such example from
viktrwlayer_tracklist.c:428:

switch ( dist_units ) {
case VIK_UNITS_DISTANCE_MILES:
trk_dist = VIK_METERS_TO_MILES(trk_dist);
break;
default:
trk_dist = trk_dist/1000.0;
break;
}

Other places that I've spotted are:
- viktrwlayer_tpwin.c:519
- viktrwlayer_tracklist.c:625


Is it intentional?

Best regards,
Kamil
Robert Norris
2016-08-16 22:29:10 UTC
Permalink
Not intentional, just honest mistakes.


Fix uploaded.


Thanks for spotting these issues and keep reporting any more you come across.


--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.
________________________________
From: Kamil Ignacak <***@wp.pl>
Sent: 15 August 2016 18:16:42
To: viking-***@lists.sourceforge.net
Subject: [Viking-devel] Handling of VIK_UNITS_DISTANCE_NAUTICAL_MILES

Hello,

I have noticed that there is a number of places in source code that
don't handle VIK_UNITS_DISTANCE_NAUTICAL_MILES value returned by
a_vik_get_units_distance(). In such places a switch statements handles
KILOMETRES and MILES, but not NAUTICAL_MILES. One such example from
viktrwlayer_tracklist.c:428:

switch ( dist_units ) {
case VIK_UNITS_DISTANCE_MILES:
trk_dist = VIK_METERS_TO_MILES(trk_dist);
break;
default:
trk_dist = trk_dist/1000.0;
break;
}

Other places that I've spotted are:
- viktrwlayer_tpwin.c:519
- viktrwlayer_tracklist.c:625


Is it intentional?

Best regards,
Kamil

Loading...