summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 14:44:14 +1100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-31 14:44:14 +1100
commit36b34bd5a5abdfabbd0f3ab0bb0d33e6e3477dd9 (patch)
treedaccb7c8d172fa8c87efd79de3620dedf4996772 /main.c
parentaef211030db06b5394384f3b22a1226263506a9b (diff)
parent635c28923d28335bb7d39f95c17c2edbf16ee2ac (diff)
downloadsubsurface-36b34bd5a5abdfabbd0f3ab0bb0d33e6e3477dd9.tar.gz
Merge branch 'integrate-from-webservice'
Bring in the better implementation of merging gps locations from the webservice
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index 4cacb0375..170481035 100644
--- a/main.c
+++ b/main.c
@@ -50,6 +50,11 @@ static int sortfn(const void *_a, const void *_b)
return 0;
}
+void sort_table(struct dive_table *table)
+{
+ qsort(table->dives, table->nr, sizeof(struct dive *), sortfn);
+}
+
const char *weekday(int wday)
{
static const char wday_array[7][7] = {
@@ -157,7 +162,7 @@ void report_dives(gboolean is_imported, gboolean prefer_imported)
/* This does the right thing for -1: NULL */
last = get_dive(preexisting-1);
- qsort(dive_table.dives, dive_table.nr, sizeof(struct dive *), sortfn);
+ sort_table(&dive_table);
for (i = 1; i < dive_table.nr; i++) {
struct dive **pp = &dive_table.dives[i-1];