Turn latitude and longitude into integer micro-degree values

This actually makes us internally use 'micro-degrees' for latitude and
longitude, and we never turn them into floating point either at parse
time or save time.

That said, the Uemis downloader internally does still use atof() when
converting things, which is likely a bug (locale issues and all that),
but I'll ask Dirk to check it out.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2012-12-05 09:59:52 -08:00 committed by Dirk Hohndel
parent 708df33539
commit 5e5e3460ac
7 changed files with 72 additions and 19 deletions

6
dive.h
View file

@ -75,6 +75,10 @@ typedef struct {
int grams;
} weight_t;
typedef struct {
int udeg;
} degrees_t;
struct gasmix {
fraction_t o2;
fraction_t he;
@ -300,7 +304,7 @@ struct dive {
char *notes;
char *divemaster, *buddy;
int rating;
double latitude, longitude;
degrees_t latitude, longitude;
depth_t maxdepth, meandepth;
int salinity; // kg per 10000 l
duration_t duration, surfacetime;