aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/dive.c2
-rw-r--r--core/equipment.c4
-rw-r--r--core/equipment.h2
-rw-r--r--core/planner.c2
-rw-r--r--core/profile.c2
5 files changed, 5 insertions, 7 deletions
diff --git a/core/dive.c b/core/dive.c
index 624aa8d00..97d82821c 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -1431,7 +1431,7 @@ static bool validate_gaschange(struct dive *dive, struct event *event)
if (event->gas.index >= 0)
return true;
- index = find_best_gasmix_match(event->gas.mix, dive->cylinder, 0);
+ index = find_best_gasmix_match(event->gas.mix, dive->cylinder);
if (index < 0)
return false;
diff --git a/core/equipment.c b/core/equipment.c
index 09778dfa1..a0a09d372 100644
--- a/core/equipment.c
+++ b/core/equipment.c
@@ -109,7 +109,7 @@ int gas_volume(const cylinder_t *cyl, pressure_t p)
return lrint(cyl->type.size.mliter * bar_to_atm(bar) / z_factor);
}
-int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[], unsigned int used)
+int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[])
{
int i;
int best = -1, score = INT_MAX;
@@ -118,8 +118,6 @@ int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[], unsigned
const cylinder_t *match;
int distance;
- if (used & (1 << i))
- continue;
match = array + i;
if (cylinder_nodata(match))
continue;
diff --git a/core/equipment.h b/core/equipment.h
index e4c654689..1df765900 100644
--- a/core/equipment.h
+++ b/core/equipment.h
@@ -55,7 +55,7 @@ extern void remove_cylinder(struct dive *dive, int idx);
extern void remove_weightsystem(struct dive *dive, int idx);
extern void reset_cylinders(struct dive *dive, bool track_gas);
extern int gas_volume(const cylinder_t *cyl, pressure_t p); /* Volume in mliter of a cylinder at pressure 'p' */
-extern int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[], unsigned int used);
+extern int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[]);
#ifdef DEBUG_CYL
extern void dump_cylinders(struct dive *dive, bool verbose);
#endif
diff --git a/core/planner.c b/core/planner.c
index e0c2ec667..0abb62920 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -91,7 +91,7 @@ int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, duration_
int get_gasidx(struct dive *dive, struct gasmix mix)
{
- return find_best_gasmix_match(mix, dive->cylinder, 0);
+ return find_best_gasmix_match(mix, dive->cylinder);
}
void interpolate_transition(struct deco_state *ds, struct dive *dive, duration_t t0, duration_t t1, depth_t d0, depth_t d1, struct gasmix gasmix, o2pressure_t po2, enum divemode_t divemode)
diff --git a/core/profile.c b/core/profile.c
index d5973fcd1..3016f2af8 100644
--- a/core/profile.c
+++ b/core/profile.c
@@ -334,7 +334,7 @@ int get_cylinder_index(const struct dive *dive, const struct event *ev)
fprintf(stderr, "Still looking up cylinder based on gas mix in get_cylinder_index()!\n");
mix = get_gasmix_from_event(dive, ev);
- best = find_best_gasmix_match(mix, dive->cylinder, 0);
+ best = find_best_gasmix_match(mix, dive->cylinder);
return best < 0 ? 0 : best;
}