diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-01-07 00:27:05 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-01-07 00:27:05 +0000 |
commit | 784252a5b0d307073b9df64ed5782a3e2306d872 (patch) | |
tree | c9435953c678f8dc2ccca7760af4013871087751 /libgpsd_core.c | |
parent | 67e6c68a32bbb0c991512c16d44efcbd5abd034e (diff) | |
download | gpsd-784252a5b0d307073b9df64ed5782a3e2306d872.tar.gz |
Document a helper function better.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index dc818d5a..e86de589 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -344,16 +344,15 @@ char /*@observer@*/ *gpsd_id(/*@in@*/struct gps_device_t *session) * and seconds have also been filled in, (c) that if the private member * mag_var is not NAN it is a magnetic variation in degrees that should be * passed on, and (d) if the private member separation does not have the - * value NAN, it is a valid WGS84 geoidal separation in - * meters for the fix. + * value NAN, it is a valid WGS84 geoidal separation in meters for the fix. */ -static double degtodm(double a) +static double degtodm(double angle) +/* decimal degrees to GPS-style, degrees first followed by minutes */ { - double m, t; - m = modf(a, &t); - t = floor(a) * 100 + m * 60; - return t; + double fraction, integer; + fraction = modf(angle, &integer); + return floor(angle) * 100 + fraction * 60; } /*@ -mustdefine @*/ |