Will allow rigctl_parse() routines access to connection data, without
reworking all of the internal and external interfaces.
(cherry picked from commit b56f8d8f8a)
glibc implements some new parts of the C23 standard:
(Taken from https://download.opensuse.org/tumbleweed/iso/Changes.20260430.txt)
* For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is
a pointer to a const-qualified type
and
* The aforementioned change in ISO C23 of the declaration of bsearch,
memchr, strchr, strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr,
wcsstr, and wmemchr as const-preserving macros can lead to compilation
issues in code not set up for it
This lead to some warnings about assigning returns from strchr(const, target)
to non-const pointers, and then discovering that Hamlib was modifying
those const parameters.
This commit aligns the const-ness of the offending parameters. Only affects
internal functions in ampctl_parse.c, rigctl_parse.c and rotctl_parse.c,
so API/ABI should not change.
(cherry picked from commit 7df5ae1a00)
gcc-16 adds warnings about using strncpy() to copy into a buffer with
size equal to the max count, possibly creating an unterminated string.
Since we don't care about the contents here and both buffers are the
same size, just do a byte copy.
(cherry picked from commit b6a25c8a83)
The utility requires eight arguments but #3, baud, is ignored which
seems to leave it broken and has been ignored for about as long as the
code has been in the repository. There is also no documentation on the
intended usage of this utility.
Will restore when these issues are resolved.
(cherry picked from commit 6b9bd14d24)
Just started playing with valgrind, and already We have a Winner!
rigctld was leaking ~100 bytes every 5 seconds; rearrange code so
arg is not allocated until it is needed and will be passed to the
routine that will free() it.
Also fix uninitialized variable warning.
(cherry picked from commit 08a013b87b)
All letters are used now, rig_set/rig_get are added and -W is
reserved by POSIX.2 for implementation extensions of get_opt,
but it doesn't apply here because this code is using strcmp()
and the W command which is implemented is not prefixed by a '-'.
Prints usage text to stdout when requested with -h/--help
or to stderr otherwise.
Test cases:
tests/rigctl --help # prints to stdout
tests/rigctl -Q # prints to stderr
As reported in GitHub issue #1892, configure on FreeBSD failed to search
for the name of the library correctly which is libusb. As pkg-config
correctly holds the library name for linking, modify the search for
libusb-1.0 to use the pkg-config capability. If pkg-config (now largely
replaced by pkgconf) is not installed or found, the modules depending on
it will be gracefull disabled, i.e. the configure script will complete
with those modules disabled.
Modify the output summary to use spaces instead of tabs as things were
not lining up nicely in my FreeBSD terminal.
Rename the Automake substituted variable 'HAVE_LIBUSB' to
'TESTS_HAVE_LIBUSB' to avoid confusion with identically named variable
written to include/hamlib/config.h.
Likewise, rename the AutoConf substituted name 'LIBUSB' to
'HAMLIB_PC_LIBUSB' to avoid confusion with the 'LIBUSB' string passed to
PKG_CHECK_MODULES.
Update hamlib.pc.in and tests/Makefile.am to use the new variable names.
Make sure all source files no longer reference HAVE_LIBUSB_H or
HAVE_LIBUSB_1_0_LIBUSB_H as these variables no longer exist.
Fix src/Makefile.am to provide include path for usb_port.c.
This makes no difference in the current code, but other usages
of dumpconf_list() are different:
$ grep dumpconf_list *parse.c
rigctl_parse.c: dumpconf_list(rig, stdout);
rigctl_parse.c: dumpconf_list(rig, fout);
rotctl_parse.c: dumpconf_list(rot, fout);
rotctl_parse.c: dumpconf_list(rot, fout);
rotctl_parse.c: dumpconf_list(rot, fout);
At some time, the commented out line check_PROGRAMS removed by this commit was
identical to the line following it, plus testsecurity appended, then they went
out of sync.
The commented out line check_PROGRAMS added by this commit appends testsecurity
in an explicit way.