mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Cylinders: dynamically allocate cylinder arrays
When keeping track of cylinder related data, the code was using static arrays of MAX_CYLINDERS length. If we want to use dynamically sized cylinder arrays, these have to be dynamically allocated. In C++ code, this is trivial: simply replace the C-style arrays by std::vector<>. Don't use QVector, as no reference counting or COW semantics are needed here. These are purely local and unshared arrays. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
11467fa326
commit
ff653f721c
3 changed files with 15 additions and 15 deletions
|
@ -55,8 +55,8 @@ void TabDiveInformation::updateProfile()
|
|||
|
||||
volume_t *gases = get_gas_used(current_dive);
|
||||
QString volumes;
|
||||
int mean[MAX_CYLINDERS], duration[MAX_CYLINDERS];
|
||||
per_cylinder_mean_depth(current_dive, select_dc(current_dive), mean, duration);
|
||||
std::vector<int> mean(MAX_CYLINDERS), duration(MAX_CYLINDERS);
|
||||
per_cylinder_mean_depth(current_dive, select_dc(current_dive), &mean[0], &duration[0]);
|
||||
volume_t sac;
|
||||
QString gaslist, SACs, separator;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue