core: convert weightsystem_t and weightsystem_table to C++

As for cylinders, this had to be done simultaneously,

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-29 07:03:03 +02:00 committed by bstoeger
parent 28520da655
commit 640ecb345b
28 changed files with 137 additions and 247 deletions

View file

@ -162,19 +162,14 @@ static void save_cylinder_info(struct membuffer *b, struct dive *dive)
}
}
static void save_weightsystem_info(struct membuffer *b, struct dive *dive)
static void save_weightsystem_info(struct membuffer *b, const struct dive *dive)
{
int i, nr;
nr = nr_weightsystems(dive);
for (i = 0; i < nr; i++) {
weightsystem_t ws = dive->weightsystems.weightsystems[i];
for (auto &ws: dive->weightsystems) {
int grams = ws.weight.grams;
const char *description = ws.description;
put_string(b, "weightsystem");
put_milli(b, " weight=", grams, "kg");
show_utf8(b, " description=", description, "");
show_utf8(b, " description=", ws.description.c_str(), "");
put_string(b, "\n");
}
}