Fix rounding of GPS coordinates

Linus Torvalds torvalds at linux-foundation.org
Sun Feb 10 11:14:50 PST 2013


The whole "+ 0.5" to round to integers only works for positive values,
and GPS coordinates are signed.

So use the proper "round to int" function (rint()), which does this correctly.

Also, remove the redundant check against the master gps values: we
already checked that if we do have a master dive, the gps values must
match the currently edited dive, so comparing against the master is
entirely redundant.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 801 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130210/a458883f/attachment.obj>


More information about the subsurface mailing list