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

@ -335,7 +335,7 @@ void uemis::parse_divelog_binary(std::string_view base64, struct dive *dive)
u_sample = (uemis_sample *)(data.data() + i);
while ((i <= data.size()) && (data[i] != 0 || data[i + 1] != 0)) {
if (u_sample->active_tank != active) {
if (u_sample->active_tank >= dive->cylinders.nr) {
if (u_sample->active_tank >= static_cast<int>(dive->cylinders.size())) {
report_info("got invalid sensor #%d was #%d", u_sample->active_tank, active);
} else {
active = u_sample->active_tank;