core: add default initialization to sruct deco_state

Don't memset() to clear deco_state, use assignment of
default constructed object (or better yet: just default
construct).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-29 18:01:26 +02:00 committed by bstoeger
parent f18acf6fb9
commit 2b3d2f1020
3 changed files with 25 additions and 26 deletions

View file

@ -503,7 +503,7 @@ void clear_deco(struct deco_state *ds, double surface_pressure, bool in_planner)
{
int ci;
memset(ds, 0, sizeof(*ds));
*ds = deco_state();
clear_vpmb_state(ds);
for (ci = 0; ci < 16; ci++) {
ds->tissue_n2_sat[ci] = (surface_pressure - ((in_planner && (decoMode(true) == VPMB)) ? WV_PRESSURE_SCHREINER : WV_PRESSURE)) * N2_IN_AIR / 1000;