core: convert cylinder_t and cylinder_table to C++

This had to be done simultaneously, because the table macros
do not work properly with C++ objects.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-28 21:31:11 +02:00 committed by bstoeger
parent 284582d2e8
commit 28520da655
48 changed files with 593 additions and 710 deletions

View file

@ -151,12 +151,9 @@ static void calculateDive(struct dive *dive, Stats &stats)
}
// EAN dive ?
for (int j = 0; j < dive->cylinders.nr; ++j) {
if (get_cylinder(dive, j)->gasmix.o2.permille > 210) {
stats.divesEAN++;
break;
}
}
if (std::any_of(dive->cylinders.begin(), dive->cylinders.end(), [] (auto &cyl)
{ return cyl.gasmix.o2.permille > 210; }))
stats.divesEAN++;
}
// Returns a (first_dive, last_dive) pair