4 Commits

Author SHA1 Message Date
Berthold Stoeger
21a28aeb62 core: turn string data in struct divecomputer into std::string
Simplifies memory management.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-10 13:05:58 +02:00
Berthold Stoeger
f65b656f23 core: convert divesite strings to std::string
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-10 13:05:57 +02:00
Berthold Stoeger
54c25c97b8 uemis: replace C-strings by std::string and std::string_view
The string code of uemis-downloader.cpp was broken in more ways
than can be listed here. Notably, it brazenly refused to free any
memory allocated for the parameters buffer.

Using std::string and std::string_view should plug all those
memory holes. That made it necessary to do some major refactoring.

This was done blind and therefore will break.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-09 11:20:37 +02:00
Berthold Stoeger
2613e11b81 core: convert uemis.c to C++
The uemis code is wild. It simply doesn't deallocate memory
and uses global variables. To get this under control, create
a "struct uemis" and make the functions exported by "uemis.h"
members of "struct uemis". Thus, we don't have to carry around
a parameter for the state of the importing process.

Turn a linked list of "helper" structures (one per imported dive)
into a std::unordered_map, to fix leaking of the helper structures.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-09 11:20:37 +02:00