aboutsummaryrefslogtreecommitdiffstats
path: root/core/datatrak.c
AgeCommit message (Collapse)Author
2017-06-11datatrak.c: don't use POSIX %m format for sscanf() in dtrak_prepare_data()Gravatar Lubomir I. Ivanov
The format option "%m" doesn't work for MINGW/Windows and is reported as an unknown conversation type and this sscanf() call would not work. The alternative is to malloc() enough space manually - e.g. strlen(input) + 1. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-27Fix some warningsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-07Datatrak import rework: main functionsGravatar Salvador Cuñat
datatrak_import() is the main function called from parse_file(), but dt_dive_parser() is where the hard work is done, for both, drop file seeking/reading and use memory pointers instead. datatrak_import() now returns 0 on success or 1 on failure and abort import if parser function fails instead of keeping on trying. dt_dive_parser() emits a warning if libdc_model is zero (manual dives). Do not parse profiles if libdc_model is zero, for unknown models we set a fake 0xEE value coverted to Aladin Air X/Z libdc model number. Func now takes a pointer to a buffer and moves along the dive, when done returns a pointer to the actual memory position or NULL if something went wrong. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-05-07Datatrak import rework: changes on helper funcsGravatar Salvador Cuñat
Remove dtrak_profile() profile parsing func as this work is left to libdivecomputer. Simplifies read_file_header() to return the number of dives in the log file as we don't use the rest of header data. Add dtrak_prepare_data() to achieve a device_data_t structure and get the correct libdc model number for the device. Remove checking macro substituted with JUMP in header file. Add dt_libdc_buffer() to get a buffer parseable with libdivecomputer. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2017-05-04Fix calculation of how many samples profile are in datatrack dive log fileGravatar Olivier Verstraet
2017-04-29Add SPDX header to core C filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-12Only enable -Wmissing-field-initializers for ClangGravatar Lubomir I. Ivanov
The following pragma is Clang specific: It produces a warning: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] Only enable it for Clang by checking the __clang__ macro. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-03-11Merge branch 'master' of https://github.com/dje29/subsurfaceGravatar Dirk Hohndel
2017-03-11divelog > dive logGravatar Martin Měřinský
2017-03-09Fix potential double/float to int rounding errorsGravatar Jeremie Guichard
Not using lrint(f) when converting double/float to int creates rounding errors. This error was detected by TestParse::testParseDM4 failure on Windows. It was creating rounding inconsistencies on Linux too, see change in TestDiveDM4.xml. Enable -Wfloat-conversion for gcc version greater than 4.9.0 Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-03-04Consistent 'salt water' versus 'fresh water'.Gravatar Martin Měřinský
2017-02-21Translate names of additional dive events and nicer format info box textGravatar Stefan Fuchs
Enable translation for a few additional internal dive events. Ensure that all event names in datatrak.c are collected for translation. Ensure that for gaschange in profile info box the "cyl." string is also translated. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
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>