diff options
Diffstat (limited to 'core/equipment.c')
-rw-r--r-- | core/equipment.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/core/equipment.c b/core/equipment.c index 53e4c273f..39bf97af9 100644 --- a/core/equipment.c +++ b/core/equipment.c @@ -69,19 +69,18 @@ bool cylinder_nodata(const cylinder_t *cyl) !cyl->deco_gas_used.mliter; } -static bool cylinder_nosamples(cylinder_t *cyl) +static bool cylinder_nosamples(const cylinder_t *cyl) { return !cyl->sample_start.mbar && !cyl->sample_end.mbar; } -bool cylinder_none(void *_data) +bool cylinder_none(const cylinder_t *cyl) { - cylinder_t *cyl = _data; return cylinder_nodata(cyl) && cylinder_nosamples(cyl); } -void get_gas_string(const struct gasmix *gasmix, char *text, int len) +void get_gas_string(struct gasmix gasmix, char *text, int len) { if (gasmix_is_air(gasmix)) snprintf(text, len, "%s", translate("gettextFromC", "air")); @@ -94,27 +93,18 @@ void get_gas_string(const struct gasmix *gasmix, char *text, int len) } /* Returns a static char buffer - only good for immediate use by printf etc */ -const char *gasname(const struct gasmix *gasmix) +const char *gasname(struct gasmix gasmix) { static char gas[64]; get_gas_string(gasmix, gas, sizeof(gas)); return gas; } -bool weightsystem_none(void *_data) +bool weightsystem_none(const weightsystem_t *ws) { - weightsystem_t *ws = _data; return !ws->weight.grams && !ws->description; } -bool no_weightsystems(weightsystem_t *ws) -{ - for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) - if (!weightsystem_none(ws + i)) - return false; - return true; -} - /* * We hardcode the most common standard cylinders, * we should pick up any other names from the dive @@ -216,7 +206,7 @@ void reset_cylinders(struct dive *dive, bool track_gas) if (cylinder_none(cyl)) continue; if (cyl->depth.mm == 0) /* if the gas doesn't give a mod, calculate based on prefs */ - cyl->depth = gas_mod(&cyl->gasmix, decopo2, dive, M_OR_FT(3,10)); + cyl->depth = gas_mod(cyl->gasmix, decopo2, dive, M_OR_FT(3,10)); if (track_gas) cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar; cyl->gas_used.mliter = 0; |