Commit graph

14 commits

Author SHA1 Message Date
Berthold Stoeger
37146c5742 Parser: parse into custom dive site table
To extend the undo system to dive sites, the importers and downloaders
must not parse directly into the global dive site table. Instead,
pass a dive_site_table argument to parse into.

For now, always pass the global dive_site_table so that this commit
should not cause any functional change.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12 18:19:07 +03:00
Berthold Stoeger
d1971a64f9 Core: Rename functions to more generic names
Rename
 - dive_get_insertion_index() -> dive_table_get_insertion_index()
 - unregister_dive_from_table() -> remove_from_dive_table()
 - get_idx_in_table() -> get_idx_in_dive_table()
 - sort_table() -> sort_dive_table()
This will make it more straight-forward to generate these functions
from macros.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-09 20:58:04 -08:00
Dirk Hohndel
d577467f97 Core: introduce new subsurface-string header
First small step to shrinking dive.h.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14 10:13:39 -07:00
Jan Mulder
dc714e582f cleanup: Unchecked return value from library
CID 60227

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29 09:14:20 -08:00
Dirk Hohndel
d3118bedd4 Cleanup: correctly prevent memory leak
The previous attempt to fix this in commit 652e382e68 ("Cleanup: avoid a
few memory leaks") was clearly bogus. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-27 13:18:41 -08:00
Dirk Hohndel
652e382e68 Cleanup: avoid a few memory leaks
Coverity CID 215199
Coverity CID 215195
Coverity CID 215196
Coverity CID 215198

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-26 13:41:58 -08:00
Berthold Stoeger
3c346bb341 Check return of fread() in core/ostctools.c
Since the corresponding error message appears thrice, it is translated
once at the beginning of the function (even in the non-error case).

A single-byte fread() was transformed into getc().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-21 00:04:30 +01:00
Dirk Hohndel
b368ecd5aa Add SPDX header to remaining core files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29 13:32:55 -07:00
Anton Lundin
48b2b3d0b3 ostctools: Add support for profile version 0x24
Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-01-12 14:15:53 -08:00
Anton Lundin
70e2404492 Stop accessing the internals of dc_descriptor_t
This removes our own declaration of dc_descriptor_t and all our accesses
to its internals, and switches to use the libdivecomputer functions to
access those instead.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-01-12 14:15:53 -08:00
Anton Lundin
d11dfd2f45 ostctools: Correct argument order to get_descriptor
This corrects the argument order, which was changed back in
00629c861c, but not on this place. Whups.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2017-01-12 14:15:53 -08:00
Anton Lundin
00629c861c Rename ostc_get_data_descriptor to get_descriptor
This renames and cleans up ostc_get_data_descriptor into get_descriptor,
for more generic use.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-28 22:40:18 -08:00
Anton Lundin
db8e786f85 Lift ostc_get_data_descriptor out from ostctools.c
This is for later reuse of that function in other source files.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-12-28 22:40:18 -08:00
Dirk Hohndel
7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00
Renamed from subsurface-core/ostctools.c (Browse further)