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.
The needed value is already in the variable.
Test case /to check that the changes don't break the code):
tests/rigctl --set-conf=rig_pathname=test,write_delay=1,timeout=2 --show-conf Q | grep --no-group-separator -A1 -E "(rig_pathname|^write_delay|^timeout):"
tests/rotctl --set-conf=rot_pathname=test,write_delay=1,timeout=2 --show-conf Q | grep --no-group-separator -A1 -E "(rot_pathname|^write_delay|^timeout):"
The output before and after this patch is:
rig_pathname: "Path name to the device file of the rig"
Default: /dev/rig, Value: test
write_delay: "Delay in ms between each byte sent out"
Default: 0, Value: 1
timeout: "Timeout in ms"
Default: 0, Value: 2
Command 'Q' not found!
rot_pathname: "Path name to the device file of the rotator"
Default: /dev/rotator, Value: test
write_delay: "Delay in ms between each byte sent out"
Default: 0, Value: 1
timeout: "Timeout in ms"
Default: 0, Value: 2
This fixes the following commands that always printed debug messages
at the trace level:
tests/ampctld -l >/dev/null
tests/ampctl -h >/dev/null
tests/rigctld -l >/dev/null
tests/rigctltcp -l >/dev/null
tests/rotctld -l >/dev/null
It doesn't affect other software which worked around this issue,
but changes all software to avoid regressions in future.
Test case (should print nothing in bash):
{
tests/ampctl -l -h
tests/ampctld -l -h
tests/rigctl -l -h
tests/rigctlcom -l -h
tests/rigctld -l -h
tests/rigctlsync -l -h
tests/rigctltcp -l -h
tests/rotctl -l -h
tests/rotctld -l -h
} >/dev/null
Adds the needed const qualifier.
Fixes:
rigmatrix.c:699:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:706:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:728:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:762:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:771:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:805:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:814:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:848:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:857:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
rigmatrix.c:891:22: error: passing argument 1 of ‘rig_list_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]
This commit has been left as documentation should these files be moved
to /doc or some such. However, never of these files are built or
distributed.
----------------
From example.c the following warning was generated by MinGW:
CC example.o
example.c: In function ‘main’:
example.c:93:32: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘rmode_t’ {aka ‘long long unsigned int’} [-Wformat=]
93 | printf("Current mode = 0x%lX = %s, width = %ld\n", mode, rig_strrmode(mode),
| ~~^ ~~~~
| | |
| long unsigned int rmode_t {aka long long unsigned int}
| %llX
The 'l' was added as suggested to the format specifier but that resulted
in the following warning from Linux:
CC example.o
../../hamlib/tests/example.c:93:57: warning: format specifies type 'unsigned long long' but the argument has type 'rmode_t' (aka 'unsigned long') [-Wformat]
printf("Current mode = 0x%llX = %s, width = %ld\n", mode, rig_strrmode(mode),
~~~~ ^~~~
%lX
CC rigctl-dumpcaps.o
1 warning generated.
So casting `mode` to `unsigned long long` quelled both warnings!
From testsecurity.c came this warning:
CC testsecurity-testsecurity.o
In file included from ../include/hamlib/rig.h:49,
from ../src/misc.h:26,
from testsecurity.c:29:
/usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
15 | #warning Please include winsock2.h before windows.h
| ^~~~~~~
Apparently winsock2.h being included through misc.h didn't work.
Finally, the Mingw linker gave the following error:
CCLD testsecurity.exe
/usr/bin/x86_64-w64-mingw32-ld: testsecurity-testsecurity.o: in function `main':
/home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:97:(.text.startup+0x87): undefined reference to `AESStringCrypt'
/usr/bin/x86_64-w64-mingw32-ld: /home/nate/builds/hamlib-4.7~git/tests/testsecurity.c:116:(.text.startup+0x128): undefined reference to `AESStringDecrypt'
collect2: error: ld returned 1 exit status
Specifcally add the libsecurity.la file path as a specific library.
Even though the libhamlib.la seems to have the AESStringCrypt symbol
already.