From 52d41236a72512fc25a2aad289b87691bafb9788 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Thu, 16 Mar 2023 19:59:51 +0100 Subject: [PATCH 1/8] Enable --show-conf for ampctl and ampctld --- src/amp_conf.c | 3 --- src/neverused.c | 1 - tests/ampctl.c | 4 ---- tests/ampctl_parse.c | 3 +-- tests/ampctld.c | 4 ---- 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/amp_conf.c b/src/amp_conf.c index cfd71e6e8..9651f5238 100644 --- a/src/amp_conf.c +++ b/src/amp_conf.c @@ -472,8 +472,6 @@ int frontamp_get_conf2(AMP *amp, token_t token, char *val, int val_len) */ -#ifdef XXREMOVEDXXC -// Not referenced anywhere /** * \brief Executes cfunc on all the elements stored in the configuration * parameters table. @@ -534,7 +532,6 @@ int HAMLIB_API amp_token_foreach(AMP *amp, return RIG_OK; } -#endif /** diff --git a/src/neverused.c b/src/neverused.c index 891e52bc9..004c589c0 100644 --- a/src/neverused.c +++ b/src/neverused.c @@ -23,7 +23,6 @@ void never_used() amp_ext_token_lookup(); amp_probe_all(); amp_set_powerstat(); - amp_token_foreach(); amp_unregister(); cm108_dcd_get(); CtrlHandler(); diff --git a/tests/ampctl.c b/tests/ampctl.c index a4cac10c0..ee0a79d42 100644 --- a/tests/ampctl.c +++ b/tests/ampctl.c @@ -320,8 +320,6 @@ int main(int argc, char *argv[]) my_amp->state.ampport_deprecated.parm.serial.rate = serial_rate; } -#if 0 - /* * print out conf parameters */ @@ -330,8 +328,6 @@ int main(int argc, char *argv[]) amp_token_foreach(my_amp, print_conf_list, (rig_ptr_t)my_amp); } -#endif - /* * Print out capabilities, and exits immediately as we may be interested * only in caps, and rig_open may fail. diff --git a/tests/ampctl_parse.c b/tests/ampctl_parse.c index 757d3b5f4..73ae8023d 100644 --- a/tests/ampctl_parse.c +++ b/tests/ampctl_parse.c @@ -1493,7 +1493,6 @@ void usage_amp(FILE *fout) } -#if 0 int print_conf_list(const struct confparams *cfp, rig_ptr_t data) { AMP *amp = (AMP *) data; @@ -1538,7 +1537,7 @@ int print_conf_list(const struct confparams *cfp, rig_ptr_t data) return 1; /* != 0, we want them all ! */ } -#endif + static int hash_model_list(const struct amp_caps *caps, void *data) { diff --git a/tests/ampctld.c b/tests/ampctld.c index 3874c968a..dcfe65a45 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -345,8 +345,6 @@ int main(int argc, char *argv[]) my_amp->state.ampport.parm.serial.rate = serial_rate; } -#if 0 - /* * print out conf parameters */ @@ -355,8 +353,6 @@ int main(int argc, char *argv[]) amp_token_foreach(my_amp, print_conf_list, (rig_ptr_t)my_amp); } -#endif - /* * Print out conf parameters, and exits immediately as we may be * interested only in only caps, and rig_open may fail. From c3265dc905058ac7133897121d77f634b6d05853 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Wed, 15 Mar 2023 21:50:30 +0100 Subject: [PATCH 2/8] Fix typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: rigctld.c:1233:5: warning: implicit declaration of function ‘mutext_rigctld’; did you mean ‘mutex_rigctld’? [-Wimplicit-function-declaration] rigctltcp.c:1217:5: warning: implicit declaration of function ‘mutext_rigctld’; did you mean ‘mutex_rigctld’? [-Wimplicit-function-declaration] --- tests/rigctld.c | 4 ++-- tests/rigctltcp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/rigctld.c b/tests/rigctld.c index 0a94e2d7b..b9c6dbc64 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -1230,9 +1230,9 @@ void *handle_socket(void *arg) mutex_rigctld(0); #else - mutext_rigctld(1); + mutex_rigctld(1); retcode = rig_open(my_rig); - mutext_rigctld(1); + mutex_rigctld(1); if (RIG_OK == retcode && verbose > RIG_DEBUG_ERR) { diff --git a/tests/rigctltcp.c b/tests/rigctltcp.c index 5d3b42977..3ee212bc4 100644 --- a/tests/rigctltcp.c +++ b/tests/rigctltcp.c @@ -1214,9 +1214,9 @@ void *handle_socket(void *arg) mutex_rigctld(0); #else - mutext_rigctld(1); + mutex_rigctld(1); retcode = rig_open(my_rig); - mutext_rigctld(1); + mutex_rigctld(1); if (RIG_OK == retcode && verbose > RIG_DEBUG_ERR) { From c9e2c5f6972cfbd058ba7d03a405c867c72bdf13 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Fri, 17 Mar 2023 22:35:17 +0100 Subject: [PATCH 3/8] Fix include not found by cppcheck.sh also in the other branch of the "if" Fixes: nofile:0:0: error: Can not open include file 'include/config.h' that is explicitly included. [preprocessorErrorDirective] --- cppcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cppcheck.sh b/cppcheck.sh index f023965f5..85cddf1aa 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -97,7 +97,7 @@ else --inline-suppr \ -I src \ -I include \ - --include=include/config.h \ + --include=include/hamlib/config.h \ --include=include/hamlib/rig.h \ -q \ --force \ From b02ff9daa13a578879d5c41ff0e78e88795a7a02 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Fri, 17 Mar 2023 22:46:26 +0100 Subject: [PATCH 4/8] Fix passing one or more paths to ./cppcheck.sh The --check-config arguments can be passed explicitly if desired. --- cppcheck.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cppcheck.sh b/cppcheck.sh index 85cddf1aa..afa63c5ff 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -93,8 +93,7 @@ if test $# -eq 0 ; then . \ >cppcheck.log 2>&1 else - cppcheck --check-config \ - --inline-suppr \ + cppcheck --inline-suppr \ -I src \ -I include \ --include=include/hamlib/config.h \ @@ -105,5 +104,5 @@ else --std=c99 \ $SUPPRESS \ $CHECK \ - $1 + "$@" fi From e9979846623935c217c023b26f2057838b3a153d Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sat, 18 Mar 2023 00:35:28 +0100 Subject: [PATCH 5/8] Fix several cppcheck "missingInclude" informational messages The following STILL reamin: scripts/MSVC/2022/x64/hamlibTest/hamlibTest.h:3:0: information: Include file: "resource.h" not found. [missingInclude] scripts/MSVC/2022/x86/hamlibTest/hamlibTest.h:3:0: information: Include file: "resource.h" not found. [missingInclude] src/network.c:83:0: information: Include file: "io.h" not found. [missingInclude] tests/rigtestlibusb.c:30:0: information: Include file: "libusb.h" not found. [missingInclude] --- cppcheck.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cppcheck.sh b/cppcheck.sh index afa63c5ff..8e74302d1 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -82,8 +82,9 @@ if test $# -eq 0 ; then cppcheck --inline-suppr \ -I src \ -I include \ - --include=include/hamlib/config.h \ - --include=include/hamlib/rig.h \ + -I include/hamlib/ \ + -I lib \ + -I security \ -q \ --force \ --enable=all \ @@ -96,8 +97,9 @@ else cppcheck --inline-suppr \ -I src \ -I include \ - --include=include/hamlib/config.h \ - --include=include/hamlib/rig.h \ + -I include/hamlib/ \ + -I lib \ + -I security \ -q \ --force \ --enable=all \ From c3e7021c61fbdad5b83360c0bcdfc26945c825fc Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sat, 18 Mar 2023 00:44:49 +0100 Subject: [PATCH 6/8] Fix cppcheck "unmatchedSuppression" informational messages Fixes: tests/ampctl.c:-1:0: information: Unmatched suppression: knownConditionTrueFalse [unmatchedSuppression] tests/ampctl_parse.c:-1:0: information: Unmatched suppression: knownConditionTrueFalse [unmatchedSuppression] tests/rigctl.c:-1:0: information: Unmatched suppression: knownConditionTrueFalse [unmatchedSuppression] tests/rigctl_parse.c:-1:0: information: Unmatched suppression: knownConditionTrueFalse [unmatchedSuppression] tests/rotctl.c:-1:0: information: Unmatched suppression: knownConditionTrueFalse [unmatchedSuppression] tests/rotctl_parse.c:-1:0: information: Unmatched suppression: knownConditionTrueFalse [unmatchedSuppression] --- cppcheck.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cppcheck.sh b/cppcheck.sh index 8e74302d1..13c282ad1 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -21,13 +21,7 @@ SUPPRESS="\ --suppress=*:extra/gnuradio/ssb.h \ --suppress=*:extra/gnuradio/wfm.h \ --suppress=*:extra/gnuradio/wfm.h \ ---suppress=*:extra/gnuradio/HrAGC.h \ ---suppress=knownConditionTrueFalse:tests/rotctl.c \ ---suppress=knownConditionTrueFalse:tests/rigctl.c \ ---suppress=knownConditionTrueFalse:tests/ampctl.c \ ---suppress=knownConditionTrueFalse:tests/rotctl_parse.c \ ---suppress=knownConditionTrueFalse:tests/rigctl_parse.c \ ---suppress=knownConditionTrueFalse:tests/ampctl_parse.c" +--suppress=*:extra/gnuradio/HrAGC.h #CHECK="\ #-D RIG_LEVEL_LINEOUT=1 \ From 51c88e0a6d0d6e3a3d3b73f4217f7adcee6939c6 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sat, 18 Mar 2023 11:02:13 +0100 Subject: [PATCH 7/8] Add to .gitignore some files created during "make check" --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 0cae6e1a5..5e0088e90 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ *.lo *.la *.orig +*.sh.log +*.sh.trs *.swp $depbase.Tpo Makefile From 01a2dd23ed256eeeb190bbf813232a658b28ffc7 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sat, 18 Mar 2023 11:17:18 +0100 Subject: [PATCH 8/8] Fix cppcheck "missingInclude" informational message Fixes: tests/rigtestlibusb.c:30:0: information: Include file: "libusb.h" not found. [missingInclude] --- tests/rigtestlibusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/rigtestlibusb.c b/tests/rigtestlibusb.c index c0d3d92e5..28cb8047e 100644 --- a/tests/rigtestlibusb.c +++ b/tests/rigtestlibusb.c @@ -27,7 +27,7 @@ #include #include "config.h" #if defined(HAVE_LIBUSB_H) -#include "libusb.h" +#include #elif defined(HAVE_LIBUSB_1_0_LIBUSB_H) #include #endif