diff options
-rw-r--r-- | core/datatrak.c | 2 | ||||
-rw-r--r-- | core/dive.h | 2 | ||||
-rw-r--r-- | core/divelist.c | 24 | ||||
-rw-r--r-- | core/divelist.h | 2 | ||||
-rw-r--r-- | core/ostctools.c | 2 | ||||
-rw-r--r-- | desktop-widgets/command_divelist.cpp | 6 | ||||
-rw-r--r-- | desktop-widgets/subsurfacewebservices.cpp | 2 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 2 | ||||
-rw-r--r-- | smtk-import/smartrak.c | 2 |
9 files changed, 22 insertions, 22 deletions
diff --git a/core/datatrak.c b/core/datatrak.c index 1c6cd8bb1..931fcb811 100644 --- a/core/datatrak.c +++ b/core/datatrak.c @@ -610,7 +610,7 @@ int datatrak_import(struct memblock *mem, struct dive_table *table) } out: taglist_cleanup(&g_tag_list); - sort_table(table); + sort_dive_table(table); return rc; bail: return 1; diff --git a/core/dive.h b/core/dive.h index a93020507..a6210810d 100644 --- a/core/dive.h +++ b/core/dive.h @@ -542,7 +542,7 @@ extern int legacy_format_o2pressures(const struct dive *dive, const struct divec extern bool dive_less_than(const struct dive *a, const struct dive *b); extern bool trip_less_than(const struct dive_trip *a, const struct dive_trip *b); extern bool dive_or_trip_less_than(struct dive_or_trip a, struct dive_or_trip b); -extern void sort_table(struct dive_table *table); +extern void sort_dive_table(struct dive_table *table); extern struct dive *fixup_dive(struct dive *dive); extern void fixup_dc_duration(struct divecomputer *dc); extern int dive_getUniqID(); diff --git a/core/divelist.c b/core/divelist.c index c25a29c16..febc8adb7 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -37,7 +37,7 @@ * bool dive_less_than(const struct dive *a, const struct dive *b) * bool trip_less_than(const struct dive_trip *a, const struct dive_trip *b) * bool dive_or_trip_less_than(struct dive_or_trip a, struct dive_or_trip b) - * void sort_table(struct dive_table *table) + * void sort_dive_table(struct dive_table *table) * bool is_trip_before_after(const struct dive *dive, bool before) * void delete_dive_from_table(struct dive_table *table, int idx) * int find_next_visible_dive(timestamp_t when); @@ -498,7 +498,7 @@ static void add_dive_to_deco(struct deco_state *ds, struct dive *dive) } } -static int get_idx_in_table(const struct dive_table *table, const struct dive *dive) +static int get_idx_in_dive_table(const struct dive_table *table, const struct dive *dive) { for (int i = 0; i < table->nr; ++i) { if (table->dives[i] == dive) @@ -885,7 +885,7 @@ static void add_to_dive_table(struct dive_table *table, int idx, struct dive *di } } -static void unregister_dive_from_table(struct dive_table *table, int idx) +static void remove_from_dive_table(struct dive_table *table, int idx) { int i; for (i = idx; i < table->nr - 1; i++) @@ -905,9 +905,9 @@ struct dive_trip *unregister_dive_from_trip(struct dive *dive) if (!trip) return NULL; - idx = get_idx_in_table(&trip->dives, dive); + idx = get_idx_in_dive_table(&trip->dives, dive); if (idx >= 0) - unregister_dive_from_table(&trip->dives, idx); + remove_from_dive_table(&trip->dives, idx); dive->divetrip = NULL; return trip; } @@ -928,7 +928,7 @@ void add_dive_to_trip(struct dive *dive, dive_trip_t *trip) return; if (dive->divetrip) fprintf(stderr, "Warning: adding dive to trip that has trip set\n"); - idx = dive_get_insertion_index(&trip->dives, dive); + idx = dive_table_get_insertion_index(&trip->dives, dive); add_to_dive_table(&trip->dives, idx, dive); dive->divetrip = trip; } @@ -1086,7 +1086,7 @@ static void autogroup_dives(struct dive_table *table) void delete_dive_from_table(struct dive_table *table, int idx) { free_dive(table->dives[idx]); - unregister_dive_from_table(table, idx); + remove_from_dive_table(table, idx); } /* This removes a dive from the global dive table but doesn't free the @@ -1098,7 +1098,7 @@ struct dive *unregister_dive(int idx) struct dive *dive = get_dive(idx); if (!dive) return NULL; /* this should never happen */ - unregister_dive_from_table(&dive_table, idx); + remove_from_dive_table(&dive_table, idx); if (dive->selected) amount_selected--; dive->selected = false; @@ -1136,7 +1136,7 @@ struct dive **grow_dive_table(struct dive_table *table) /* get the index where we want to insert the dive so that everything stays * ordered according to dive_less_than() */ -int dive_get_insertion_index(struct dive_table *table, struct dive *dive) +int dive_table_get_insertion_index(struct dive_table *table, struct dive *dive) { /* we might want to use binary search here */ for (int i = 0; i < table->nr; i++) { @@ -1352,7 +1352,7 @@ void process_loaded_dives() for_each_dive(i, dive) set_dc_nickname(dive); - sort_table(&dive_table); + sort_dive_table(&dive_table); /* Autogroup dives if desired by user. */ autogroup_dives(&dive_table); @@ -1448,7 +1448,7 @@ void process_imported_dives(struct dive_table *import_table, bool prefer_importe set_dc_nickname(import_table->dives[i]); /* Sort the table of dives to be imported and combine mergable dives */ - sort_table(import_table); + sort_dive_table(import_table); merge_imported_dives(import_table); /* Merge newly imported dives into the dive table. @@ -1703,7 +1703,7 @@ static int sortfn(const void *_a, const void *_b) return comp_dives(a, b); } -void sort_table(struct dive_table *table) +void sort_dive_table(struct dive_table *table) { qsort(table->dives, table->nr, sizeof(struct dive *), sortfn); } diff --git a/core/divelist.h b/core/divelist.h index aca2ed21e..49e161191 100644 --- a/core/divelist.h +++ b/core/divelist.h @@ -22,7 +22,7 @@ extern void process_imported_dives(struct dive_table *import_table, bool prefer_ extern char *get_dive_gas_string(const struct dive *dive); extern struct dive **grow_dive_table(struct dive_table *table); -extern int dive_get_insertion_index(struct dive_table *table, struct dive *dive); +extern int dive_table_get_insertion_index(struct dive_table *table, struct dive *dive); extern void add_single_dive(int idx, struct dive *dive); extern void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2low_p); extern int get_divenr(const struct dive *dive); diff --git a/core/ostctools.c b/core/ostctools.c index 84ef23301..f0fa6a634 100644 --- a/core/ostctools.c +++ b/core/ostctools.c @@ -188,7 +188,7 @@ void ostctools_import(const char *file, struct dive_table *divetable) } record_dive_to_table(ostcdive, divetable); mark_divelist_changed(true); - sort_table(divetable); + sort_dive_table(divetable); close_out: fclose(archive); diff --git a/desktop-widgets/command_divelist.cpp b/desktop-widgets/command_divelist.cpp index b5cbc12ee..5e3f30ce2 100644 --- a/desktop-widgets/command_divelist.cpp +++ b/desktop-widgets/command_divelist.cpp @@ -511,7 +511,7 @@ AddDive::AddDive(dive *d, bool autogroup, bool newNumber) allocTrip.reset(trip); } - int idx = dive_get_insertion_index(&dive_table, divePtr.get()); + int idx = dive_table_get_insertion_index(&dive_table, divePtr.get()); if (newNumber) divePtr->number = get_dive_nr_at_idx(idx); @@ -603,7 +603,7 @@ void ShiftTime::redoit() d->when += timeChanged; // Changing times may have unsorted the dive table - sort_table(&dive_table); + sort_dive_table(&dive_table); // We send one time changed signal per trip (see comments in DiveListNotifier.h). // Therefore, collect all dives in an array and sort by trip. @@ -615,7 +615,7 @@ void ShiftTime::redoit() // Send signals and sort tables. processByTrip(dives, [&](dive_trip *trip, const QVector<dive *> &divesInTrip) { if (trip) - sort_table(&trip->dives); // Keep the trip-table in order + sort_dive_table(&trip->dives); // Keep the trip-table in order emit diveListNotifier.divesTimeChanged(trip, timeChanged, divesInTrip); }); diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index 643c0270f..2804d44d9 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -69,7 +69,7 @@ static bool merge_locations_into_dives(void) int i, j, tracer=0, changed=0; struct dive *gpsfix, *nextgpsfix, *dive; - sort_table(&gps_location_table); + sort_dive_table(&gps_location_table); for_each_dive (i, dive) { if (!dive_has_gps_location(dive)) { diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index d02f18cdd..cdcbedecf 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1130,7 +1130,7 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q if (needResort) { // we know that the only thing that might happen in a resort is that // this one dive moves to a different spot in the dive list - sort_table(&dive_table); + sort_dive_table(&dive_table); int newIdx = get_idx_by_uniq_id(d->id); if (newIdx != oldIdx) { DiveListModel::instance()->removeDive(modelIdx); diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c index d998ef544..63b3af799 100644 --- a/smtk-import/smartrak.c +++ b/smtk-import/smartrak.c @@ -1083,5 +1083,5 @@ void smartrak_import(const char *file, struct dive_table *divetable) mdb->catalog = NULL; mdb_close(mdb_clon); mdb_close(mdb); - sort_table(divetable); + sort_dive_table(divetable); } |