Robert Lipe [Thu, 6 Jan 2022 03:31:34 +0000 (22:31 -0500)]
Move destinator to QDateTime from ctime (#796)
* Move destinator from ctime to QDateTime.
This feels a bit like rearranging Titanic chairs, but I needed to reduce
callers of strptime. This is another format I think we've rewritten a
couple of times without evidence of users. Most of the traffic in the last
ten years has been complaints of it not working
Destinator, consider yourself warned. You're on the death watch...
tsteven4 [Tue, 4 Jan 2022 20:19:56 +0000 (13:19 -0700)]
add support for cmake build options (#809)
* add initial support for cmake build options.
including basic library configuration.
Unlike our qmake build it generates and links with static libraries if
we are using our internally supplied copies. The configuration options
are not as sophisticated as in our qmake build. The configuration of
zlib will likely be acceptable as cmake provides support via findZLIB.
The configuration of shapelib and libusb-1.0 likely will likely need to
be enhanced.
* fix typo
* mimic qmake library searches.
too much energy went into verification with packagers that the
qmake options were sufficient for their needs.
tsteven4 [Sun, 2 Jan 2022 23:51:03 +0000 (16:51 -0700)]
use hierarchy with cmake. (#807)
* use hierarchy with cmake.
* adjust cmake test script for hierarchy.
the default target with cmake builds both the CLI and the GUI.
alternatively, "cmake --build . --target gpsbabel" to build just the
CLI or "cmake --build . --target GPSBabelFE|gpsbabelfe to build just
the GUI.
* detect attempts to generate a build system from a subdirectory.
tsteven4 [Thu, 30 Dec 2021 01:35:18 +0000 (18:35 -0700)]
fix bad merge in mtk_logger. (#805)
1. Jan 01, 2017 269c55eb5 Robert fixes ftruncate issue.
2. Jan 23, 2017 604178aa8 HarelM fixes same a different way.
3. Jan 25, 2017 8456d1d21 Robert merges resulting in duplicate fixes.
tsteven4 [Mon, 13 Dec 2021 16:27:55 +0000 (09:27 -0700)]
retire some csv char based routines. (#790)
* retire some csv char based routines.
The last csv_lineparse user, garmin_txt, is converted to csv_linesplit.
xcsv_parse_val converted to use csv_stringtrim(QString,QString,int),
eliminating the other overloads.
xcsv_parse_style_line parsing of FIELD_DELIMITER, FIELD_ENCLOSER,
RECORD_DELIMITER and BADCHARS updated to use the above overload of
csv_stringtrim. FIELD_DELIMITER, FIELD_ENCLOSER and RECORD_DELIMITER
changed to trim, with a double quote enclosure, before character substitution.
There was a subtle bug in csvs_stringtrim(char, char, int). When trimming
a source that was all white space the first white space character would
be retained, while others would be trimmed. This did occur with CRNEWLINE,
but the bug allowed other substitutions to work, e.g. SPACE, NEWLINE, TAB, CR.
A small bug in csv_stringclean was fixed. If the to_nuke was empty an invalid
regular expression was created.
* save a few string conversions.
* and a few more conversions saved.
* review comments incorporated in garmin_txt reader.
tsteven4 [Fri, 10 Dec 2021 17:26:36 +0000 (10:26 -0700)]
organize source files in GPSBabel.pro, CMakeLists.text` (#787)
* organize files in GPSBabel.pro and CMakeLists.tst
This makes it easier to compare the two, and easier to see what
changed when nuking things.
* fix for lack of continuation line
* update nuke_format for sources on their own lines.
delete MSVC project and solution files. The project files should
be generated with "qmake -tp vc GPSBabel.pro". MSVC will create
the solution file if needed.
Apparently it hasn't ever been used. Our sample has coordinates in UTM,
but we have been interpretting them as degrees/100000. "Le pic du midi"
referred to in the sample is The Pic du Midi de Bigorre.
Hangs were detected with afl and the gdb reader and gbfgetcstr. One such
hang reads a fuzzed 32 bit url count with FREAD_i32, and then proceeds
to fetch that many strings with FREAD_CSTR_AS_QSTR. This results in
fetches from beyond EOF that are undetected. gbfgetcstr_old is modified
to throw a fatal error if reading is attempted beyond EOF.
A similar failure was not detected with gbfgetpstr, but it is also
modified to throw a fatal error if reading is attempted beyond EOF.
hopefully the real fix for garmin_xt tool issues. (#781)
Fix LGTM detected "Comparison between i of type uint8_t and Count of
wider type int."
This latest find by LGTM is one in a long series of issue detections by
various tools. However, close analysis reveals the previous solutions
to these deteced issues didn't find or fix the real root issues:
commit 233f3c8b0bf69397403b6c1f29af8e10a65a8928, 10/22/2013, Pad
internal buffer to appease -fsanitize=address. While the fix appeased
the sanitizer, it didn't fix the root problem. The root problem was
a bug in the original translation of format_garmin_xt_decrypt_trk_blk
when converting to zero-based array indexing.
commit dcf0dd85a71c6fa5fc3dac72520c2070ba051108, 7/8/2015, A bunch of
busy work to satisfy hyperactive warnings in newer GCC builds. Again,
the fix didn't fix the root problem. The root problem was a bug in the
original translation of format_garmin_xt_proc_strk. This bug resulted
in a mismatch between our test output and that of the original project.
In our output the timestamp of the last two points in a track was
identical.
This fix results in our output matching the reference file of the original
project (with allowances for precision).
Eliminiate redundant route_head data member (#764)
eliminate redundant route_head data member rte_waypt_ct, replacing it with a member function rte_waypt_ct() that gets the count from the waypoint_list container.
Robert Lipe [Thu, 9 Dec 2021 06:59:15 +0000 (01:59 -0500)]
Update nuke_format so that it's safe (enough) to handle the bulk deletion
to get rid of most of our older and unused formats. Some hand tuning may
still be needed
tsteven4 [Mon, 6 Dec 2021 14:13:44 +0000 (07:13 -0700)]
Kill CarteSurTable format. (#783)
Apparently it hasn't ever been used. Our sample has coordinates in UTM,
but we have been interpretting them as degrees/100000. "Le pic du midi"
referred to in the sample is The Pic du Midi de Bigorre.
tsteven4 [Sun, 5 Dec 2021 22:30:05 +0000 (15:30 -0700)]
harden gbfgetcstr, gbfgetpstr. (#782)
Hangs were detected with afl and the gdb reader and gbfgetcstr. One such
hang reads a fuzzed 32 bit url count with FREAD_i32, and then proceeds
to fetch that many strings with FREAD_CSTR_AS_QSTR. This results in
fetches from beyond EOF that are undetected. gbfgetcstr_old is modified
to throw a fatal error if reading is attempted beyond EOF.
A similar failure was not detected with gbfgetpstr, but it is also
modified to throw a fatal error if reading is attempted beyond EOF.
tsteven4 [Fri, 3 Dec 2021 14:16:02 +0000 (07:16 -0700)]
hopefully the real fix for garmin_xt tool issues. (#781)
Fix LGTM detected "Comparison between i of type uint8_t and Count of
wider type int."
This latest find by LGTM is one in a long series of issue detections by
various tools. However, close analysis reveals the previous solutions
to these deteced issues didn't find or fix the real root issues:
commit 233f3c8b0bf69397403b6c1f29af8e10a65a8928, 10/22/2013, Pad
internal buffer to appease -fsanitize=address. While the fix appeased
the sanitizer, it didn't fix the root problem. The root problem was
a bug in the original translation of format_garmin_xt_decrypt_trk_blk
when converting to zero-based array indexing.
commit dcf0dd85a71c6fa5fc3dac72520c2070ba051108, 7/8/2015, A bunch of
busy work to satisfy hyperactive warnings in newer GCC builds. Again,
the fix didn't fix the root problem. The root problem was a bug in the
original translation of format_garmin_xt_proc_strk. This bug resulted
in a mismatch between our test output and that of the original project.
In our output the timestamp of the last two points in a track was
identical.
This fix results in our output matching the reference file of the original
project (with allowances for precision).
tsteven4 [Wed, 17 Nov 2021 15:52:08 +0000 (08:52 -0700)]
Eliminiate redundant route_head data member (#764)
eliminate redundant route_head data member rte_waypt_ct, replacing it with a member function rte_waypt_ct() that gets the count from the waypoint_list container.
Robert Lipe [Mon, 1 Nov 2021 05:49:57 +0000 (00:49 -0500)]
C++ improvements in VCard. Add tests. (#750)
* C++ improvements inside Vcard. Add test.
* Eternal impedance mismatch on C vs C++ pointer ownership.
* VCF: Incorporate review feedback: auote ','. Match HTML tage regardless of case.
* Quote commas in ASCII source, not just UTH8-encoded text.
tsteven4 [Fri, 29 Oct 2021 00:24:00 +0000 (18:24 -0600)]
fix windows release with Qt6. (#748)
* fix windows release with Qt6.
windeployqt failed to deploy Qt6Core5Compat.dll because it was
not used by the gui and we didn't tell windeployqt there was
another executable to scan for dependencies.
* fiddle with github cache conditionals.
cache was restored, but we tried to install qt anyway.