summaryrefslogtreecommitdiffstats
path: root/core/equipment.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-18 12:53:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-23 05:21:08 -0700
commitecb64d7e3e3c6c875defc9dc4aab01c65ccddf8a (patch)
tree58a9142c79a10bca2935f0a29fa63c8b9e565711 /core/equipment.c
parent62672276d0457e8890aed57e4ca114e9daac16f2 (diff)
downloadsubsurface-ecb64d7e3e3c6c875defc9dc4aab01c65ccddf8a.tar.gz
Cleanup: user properly typed pointers
A trivial cleanup: replace void by properly typed pointers in cylinder_none() and weightsystem_none(). Moreover, remove the unused function no_weightsystems(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/equipment.c')
-rw-r--r--core/equipment.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/core/equipment.c b/core/equipment.c
index 62e8dcb70..39bf97af9 100644
--- a/core/equipment.c
+++ b/core/equipment.c
@@ -69,15 +69,14 @@ 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);
}
@@ -101,20 +100,11 @@ const char *gasname(struct gasmix gasmix)
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