summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-05 00:29:09 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-06 10:41:44 -0700
commit4b12f28ca453b038fdeca8e6ada106e0c157296b (patch)
treeae6c72da921baf80870ea57a5ec4ea9126fe201c /dive.c
parent3e0ecb5ff6a95e1be8f22359048e4dfa85d165bc (diff)
downloadsubsurface-4b12f28ca453b038fdeca8e6ada106e0c157296b.tar.gz
First steps towards removing glib dependencies
- remove the build flags and libraries from the Makefile / Configure.mk - remove the glib types (gboolean, gchar, gint64, gint) - comment out / hack around gettext - replace the glib file helper functions - replace g_ascii_strtod - replace g_build_filename - use environment variables instead of g_get_home_dir() & g_get_user_name() - comment out GPS string parsing (uses glib utf8 macros) This needs massive cleanup, but it's a snapshot of what I have right now, in case people want to look at it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dive.c b/dive.c
index 1d8986ab9..935e932e3 100644
--- a/dive.c
+++ b/dive.c
@@ -2,7 +2,9 @@
/* maintains the internal dive list structure */
#include <string.h>
#include <stdio.h>
+#if 0
#include <glib/gi18n.h>
+#endif
#include "dive.h"
@@ -481,7 +483,7 @@ static void sanitize_cylinder_info(struct dive *dive)
}
/* some events should never be thrown away */
-static gboolean is_potentially_redundant(struct event *event)
+static bool is_potentially_redundant(struct event *event)
{
if (!strcmp(event->name, "gaschange"))
return FALSE;
@@ -1585,7 +1587,7 @@ static int likely_same_dive(struct dive *a, struct dive *b)
* merges almost exact duplicates - something that happens easily
* with overlapping dive downloads.
*/
-struct dive *try_to_merge(struct dive *a, struct dive *b, gboolean prefer_downloaded)
+struct dive *try_to_merge(struct dive *a, struct dive *b, bool prefer_downloaded)
{
if (likely_same_dive(a, b))
return merge_dives(a, b, 0, prefer_downloaded);
@@ -1810,7 +1812,7 @@ static void join_dive_computers(struct divecomputer *res, struct divecomputer *a
remove_redundant_dc(res, prefer_downloaded);
}
-struct dive *merge_dives(struct dive *a, struct dive *b, int offset, gboolean prefer_downloaded)
+struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer_downloaded)
{
struct dive *res = alloc_dive();
struct dive *dl = NULL;
@@ -1877,7 +1879,7 @@ struct dive *find_dive_including(timestamp_t when)
return NULL;
}
-gboolean dive_within_time_range(struct dive *dive, timestamp_t when, timestamp_t offset)
+bool dive_within_time_range(struct dive *dive, timestamp_t when, timestamp_t offset)
{
return when - offset <= dive->when && dive->when + dive->duration.seconds <= when + offset;
}