summaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/dive.h b/dive.h
index 2c9ef3336..c38016bb5 100644
--- a/dive.h
+++ b/dive.h
@@ -8,6 +8,7 @@
#include <zip.h>
#include <sqlite3.h>
#include <string.h>
+#include "divesite.h"
/* Windows has no MIN/MAX macros - so let's just roll our own */
#define MIN(x, y) ({ \
@@ -387,11 +388,6 @@ extern void dive_set_geodata_from_picture(struct dive *d, struct picture *pic);
extern int explicit_first_cylinder(struct dive *dive, struct divecomputer *dc);
-static inline int dive_has_gps_location(struct dive *dive)
-{
- return dive->latitude.udeg || dive->longitude.udeg;
-}
-
static inline void copy_gps_location(struct dive *from, struct dive *to)
{
if (from && to) {
@@ -607,6 +603,16 @@ static inline int get_idx_by_uniq_id(int id)
return i;
}
+static inline bool dive_site_has_gps_location(struct dive_site *ds)
+{
+ return ds && (ds->latitude.udeg || ds->longitude.udeg);
+}
+
+static inline int dive_has_gps_location(struct dive *dive)
+{
+ return dive_site_has_gps_location(get_dive_site_by_uuid(dive->dive_site_uuid));
+}
+
#ifdef __cplusplus
extern "C" {
#endif