use c++ style attribute syntax with gnu namespace. (#1069)
* use c++ style attribute syntax with gnu namespace.
cppcheck 2.10.3 seems to have difficulty combining c++ style
attributes like [[noreturn]] with gnu __attribute__ syntax.
this leads to lots of false positive [nullPointerRedundantCheck]
warings.
I have a feeling I did this before and it failed somewhere. Perhaps
our compilers are all ready for it now.
* fix 7 real nullPointerRedundantCheck warnings.
and
7 nullPointerArithmeticRedundantCheck warnings
1 redundantInitialization warning
1 unreadVariable warning
* fix 1 nullPointerRedundantCheck.
A more involved fix would be to pass a reference to a non-const
parameter to mkshort_del_handle to be used as an in-out parameter.
Detected system locale encoding (ANSI_X3.4-1968, locale "C") is not UTF-8.
Qt shall use a UTF-8 locale ("C.UTF-8") instead. If this causes problems,
reconfigure your locale. See the locale(1) manual for more information.
tsteven4 [Tue, 7 Mar 2023 20:32:44 +0000 (13:32 -0700)]
don't create fictious course and speed values. (#1031)
We compute coures and speed in track_recompute, which is used
by the kml and gtrnctr writers. We also compute these in the track
filter with the course speed options.
Both of these algorithums compute the course and speed for a point
based on the time and position of that point and a previous point.
Given that no information from the future is used, the course and
speed of the first point cannot be determined. This PR introduces
a change so a fictious value for the first point is not generated.
tsteven4 [Tue, 7 Mar 2023 00:27:02 +0000 (17:27 -0700)]
wrap long lines in verbatim elements, such as screen. (#1027)
The use of inline.boldmonoseq on verbatim elements such as screen
results in a lose of the line endings. This makes it impossible to
differentiate items in what might have better been a list. However,
if the line in the screen element is too long it will be trucated.
Use the monospace.verbatim.property wrap-option to wrap any such lines.
An example that illustrates the problems is the list of keywords in the
unicsv format.
tsteven4 [Mon, 20 Feb 2023 15:05:24 +0000 (08:05 -0700)]
add support for dynamic formats (#1005)
* de-duplicate format setup in find_vec
* create a class to pass format info pack and forth from vecs.
This simplifies re-initialization of a format, which main already
did in a few cases.
The operator overloads for the format info class make the transition
simplier.
* return empty braced init list from find_vecs when not found.
* dynamic format checkpoint.
* delete static GeoFormat instance.
* support dynamic xcsv format.
allow dynamic formats to use rd_init, rd_deinit, wr_init, wr_denint.
This makes conversion to dynamic formats easier as we can, but aren't
forced to move the old init/deinit code.
Often rd/wr_init is intertwined with rd/wr_posn_init.
use dynamic xcsv format.
fix undiscovered bug releated to option order. We assumed an order
of -i -f -o -F, but -i -o -f -F can cause errors if both formats
are style based.
test for above bug added to iblue747.test.
* add missing reference
* use template for format factories.
* correct vecs includes
* fix another filename parameter for positional args issue.
* make Vecs::prepare_format static.
* move prepare_format call to just before xxx_init
GPSBabel [Sat, 18 Feb 2023 17:39:15 +0000 (11:39 -0600)]
Remove remaining callers and definition of rtrim. (#1001)
Remove remaining callers and definition of rtrim.
* Minor CV-qualifier battle in jeeps for const correctness.
* Adds a (hacky) bash script to compile mkshort as a standalone binary for
development and testing for upcoming overhaul.
---------
Co-authored-by: Robert Lipe <robertlipe@gmail.com>
積丹尼 Dan Jacobson [Mon, 13 Feb 2023 14:00:20 +0000 (22:00 +0800)]
Update gpsbabel_man.xml (#1003)
Fix critical mistake, overlooked for years.
(Sure hope I am editing the real source file.
There is no warning at the top of this file that it is machine generated.)
tsteven4 [Fri, 27 Jan 2023 13:48:04 +0000 (06:48 -0700)]
convert geo to Format class. (#998)
This also adds the encoding attribute to the xml declaration.
This also starts the loc element at the beginning of a line.
Previously we jumped through some hoops to avoid the above two
changes so we could exaclty match the original reference file.
We also pass the writer to the waypt_disp_all callback via a lambda.
This allows the output File and QXmlStreamWriter to be local which
simplified cleanup.
1. Hide wp_flags from formats by using WAYPT_SET.
2. Don't print values corresponding to Waypoint fields that aren't
valid.
a) if the field uses wp_flags, then the flag must be set.
b) power, cadence heartrate must not be zero.
This is in anticipation of use of std::optional instead of wp_flags
to indicate an optional value is present.
The use of invalid power, cadence, and heartrate values was found
fortuitously.
Note this changes kml output, using empty gx:value elements to
correspond to missing data. gx:value elements are of type
string, the empty string do not violate the schema (unlike empty
when elements). However, it is unclear who is using this extra
SchemaData so we cannot check to make sure they acutally handle
empty string values.
* don't use WAYPT_HAS with wp_flags that aren't optionals.
* fix some bugs with our home grown optionals.
mostly not using WAYPT_SET resulting in the value being lost.
Robert Lipe [Wed, 28 Dec 2022 06:22:37 +0000 (00:22 -0600)]
[WIP] Modernize garmin_txt Take the few remaining good ideas from https://github.com/GPSBabel/gpsbabel/pull/442 and merge them manually into the trunk. (#959)
* Modernize garmin_txt
Take the few remaining good ideas from
https://github.com/GPSBabel/gpsbabel/pull/442
and merge them manually into the trunk.
Robert Lipe [Thu, 22 Dec 2022 23:12:31 +0000 (17:12 -0600)]
Remove all uses of sprintf (#958)
Deprecate sprintf in favor of snprintf or QString::asprintf... This buys time until we have {fmt}
* remove unused bgr in tpo.cc
* more pruning of C-style constructs
* Remove unused lap code in Garmin
Unrelated, but required to build on Mac
* Apply Mac runner updates per active topics from runner images bugreports.
It's my belief there are transient problems in the GitHub-provided images (linked in this CL) but this bulletproofs our installation, so I'm rolling with it.
tsteven4 [Sun, 30 Oct 2022 17:17:28 +0000 (11:17 -0600)]
update documentation to DocBook 5.0 (#940)
* convert to docbook 5.0.
* get jing running.
* use uri to find docbook rng.
* brew install jing-trang. use oasis for rngs.
* add insertion markers to autogen doc files.
* use db5-upgrade.xsl from docbook 5.1 release.
we are still converting to docbook 5.0.
this fixes issues with missing Appendix labels
(e.g. "Appendix A. Supported Datums" was "Suppored Datums")
and Glossary Indexes (e.g. "G" was omitted)
in the html output.
unfortunately it causes issues with translating ulinks inside term
elements. We patch the dropped links back in.