This removes a constant describing the length of the array.
The enumerated_range code had to be adapted, because the
interaction of C-type arrays with the C++ typesystem is mad.
With C-type arrays, one has to pass a reference to std::declval.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The parser API was very annoying, as a number of tables
to-be-filled were passed in as pointers. The goal of this
commit is to collect all these tables in a single struct.
This should make it (more or less) clear what is actually
written into the divelog files.
Moreover, it should now be rather easy to search for
instances, where the global logfile is accessed (and it
turns out that there are many!).
The divelog struct does not contain the tables as substructs,
but only collects pointers. The idea is that the "divelog.h"
file can be included without all the other files describing
the numerous tables.
To make it easier to use from C++ parts of the code, the
struct implements a constructor and a destructor. Sadly,
we can't use smart pointers, since the pointers are accessed
from C code. Therfore the constructor and destructor are
quite complex.
The whole commit is large, but was mostly an automatic
conversion.
One oddity of note: the divelog structure also contains
the "autogroup" flag, since that is saved in the divelog.
This actually fixes a bug: Before, when importing dives
from a different log, the autogroup flag was overwritten.
This was probably not intended and does not happen anymore.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Strangely enough, half of the infrastructure was
already there, it just wasn't hooked up to a UI
element
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Some DCs only report water type, without salinity level. Subsurface
fixes most of these cases using default levels, but when the type of water
is Sea/Salt, this fix was not saved.
This causes a bit confusion, mainly if the user defines own salinity level.
Signed-off-by: Rafael M. Salvioni <rafael.salvioni@gmail.com>
Fix a bug causing the bluetooth address not being used when downloading
from a 'remembered' dive computer if the device selection is populated.
This specifically excludes MacOS, as 'remembering' bluetooth connections
does not seem to be working there as per
https://github.com/subsurface/subsurface/pull/2158#issuecomment-508933672.
I am not super sure why we are _not_ trying to use the 'remembered'
device if the device selection is populated (`ui.device->currentIndex()
== -1`) - maybe this should be clarified in a comment?
Signed-off-by: Michael Keller <github@ike.ch>
Since the only caller was C++ code, this can be done in
C++ code, which removes memory-management headaches.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Make the time edit respect the configured time format. Also make the
date and time format change when the preferences are changed.
Fixes#3849.
Signed-off-by: Michael Keller <github@ike.ch>
Add titles for the individual topics covered in CONTRIBUTING.md. One
advantage of this is that it makes it possible to link to individual
topics when providing feedback on pull requests.
Signed-off-by: Michael Keller <github@ike.ch>
Format keywords, classes, string examples, etc. in prose of
CODINGSTYLE.md using `inline formatting` with single backticks.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Similarly to commit 062533d0a (CONTRIBUTING.md: use dashes instead of
hyphens, 2023-01-14), replace hyphens in prose of CODINGSTYLE.md with
dashes to make the rendered Markdown a bit nicer.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
The `for` loop in the sample iterates over `serviceUuids`, but the only
other statement in the sample assigns variable named `l`. Fix the name
of the variable in the assignment to be the same as in the loop.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Without an blank line, the pseudo-headers of list items are not
separated from the next paragraph. An example is rendered as:
* variable declarations In C code we really ...
instead of intended:
* variable declarations
In C code we really ...
Add missing blank lines between paragraphs inside list items and in
between list items to fix the intended rendering.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Samples of code in CODINGSTYLE.md are wrapped in triple-backticks to
render them as blocks of code. For code blocks that are indented within
a list item, Markdown renderer of GitHub treats the leading tab as if it
was four spaces. Rendered code blocks are formatted in a way that
contradicts the code style written down in prose.
Replace leading tabs in indentation with spaces in blocks of sample code
to render them correctly in Markdown lists.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
In order to support development of the open source firmware of the
OSTC4.
Requires changes in libdivecomputer.
Signed-off-by: Michael Keller <github@ike.ch>
Fix a bug causing the wrong units (m) to be shown on the Dive site
management view if imperial units are as the system default.
Signed-off-by: Michael Keller <github@ike.ch>
Disable the 'search dive computer' ([...]]) button in the 'Import from
dive computer' window if searching is not supported by the currently
selected vendor.
Signed-off-by: Michael Keller <github@ike.ch>
Fixes a bug reported in
https://groups.google.com/g/subsurface-divelog/c/8N3cTz2Zv5E:
When planning a CCR dive with multiple segments, the textual dive plan
was showing a non-existent gas change with bogus data. The first part
of the fix is uncluttering of the message printed: Since this change is
_after_ the current diveplanpoint the data needs to come from `nextdp`
and not `dp`. The second part is that the message is not printed any
more if the current and the following segments have been manually added:
According to comments in the code the change should only be printed on
the segment _before_ the change if this segment is an ascent segment
that is followed by a manually entered segment.
Signed-off-by: Michael Keller <github@ike.ch>
Fix a bug that results in dive plans outside of the configured risk
profile being produced when planning a CCR dive with the first segment
set to open circuit.
`d->dc.divemode` is already set in `setRebreatherMode`, which is
sufficient, and congruent with the setting of other dive parameters,
like `diveplan.gflow`.
Signed-off-by: Michael Keller <github@ike.ch>
Merge upstream updates from Jef Driesen:
- Deepblu Cosmiq+ support has been merged upstream
- Oceans S1 support has been merged upstream
- Various new models supported: Cressi Donatello, Scubapro G2 TEK, new
Excursion v6+ firmware.
- misc core changes, most notably supporting a new annoying specialized
binary format for decomode, because Jef still can't deal with
strings.
- lots of small details
(all the work done by Linus - I'm just adding this to Surface)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>