summaryrefslogtreecommitdiffstats
path: root/core/units.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-16 21:40:03 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:35:11 -0700
commit6586ba5579dbe4eb360bc646572e58350d12bffb (patch)
tree996d1a6fb867f17d52d284b404522cf5d7f2fe40 /core/units.h
parentae6f17af0c15ec3d9907a4ba9ca8846dbb0e2721 (diff)
downloadsubsurface-6586ba5579dbe4eb360bc646572e58350d12bffb.tar.gz
Cleanup: move parse_location() declaration into header file
The parse_location() function was used in three places. In two of them, the declaration was in the translation unit. Instead, move the declaration into a header file, to avoid duplication and the possibility of inconsistencies. The "units.h" header was chosen as this is where location_t is defined. Moreover, make the string argument to parse_location() "const char *", so that it can be used on non-owned buffers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/units.h')
-rw-r--r--core/units.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/units.h b/core/units.h
index cea19f785..c9920ac14 100644
--- a/core/units.h
+++ b/core/units.h
@@ -137,6 +137,8 @@ typedef struct pos {
degrees_t lat, lon;
} location_t;
+extern void parse_location(const char *, location_t *);
+
static inline bool has_location(const location_t *loc)
{
return loc->lat.udeg || loc->lon.udeg;