From e03dd0af47e507e9347b123ce2195f0d9a74482d Mon Sep 17 00:00:00 2001 From: Michael Black Date: Mon, 24 Feb 2020 10:24:34 -0600 Subject: [PATCH 1/2] Fix cppcheck warning in icom.c --- rigs/icom/icom.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 61d6922f2..59ad15978 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1713,16 +1713,11 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); - if (vfo == RIG_VFO_CURR) - { - return RIG_OK; - } - if (vfo == RIG_VFO_CURR) { rig_debug(RIG_DEBUG_TRACE, "%s: Asking for currVFO, currVFO=%s\n", __func__, rig_strvfo(priv->curr_vfo)); - vfo = priv->curr_vfo; + return RIG_OK; } if (vfo == RIG_VFO_MAIN && VFO_HAS_A_B_ONLY) From 18cc1184430e00275032f383953036d1d5a71230 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Mon, 24 Feb 2020 22:56:18 -0600 Subject: [PATCH 2/2] Change -W switch to -X --- tests/rigctld.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/rigctld.c b/tests/rigctld.c index 1a22f5ed5..5c493ce50 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -85,7 +85,7 @@ * NB: do NOT use -W since it's reserved by POSIX. * TODO: add an option to read from a file */ -#define SHORT_OPTIONS "m:r:p:d:P:D:s:c:T:t:C:lLuovhVWZ" +#define SHORT_OPTIONS "m:r:p:d:P:D:s:c:T:t:C:X:lLuovhVZ" static struct option long_options[] = { {"model", 1, 0, 'm'}, @@ -106,7 +106,7 @@ static struct option long_options[] = {"verbose", 0, 0, 'v'}, {"help", 0, 0, 'h'}, {"version", 0, 0, 'V'}, - {"twiddle_timeout", 0, 0, 'W'}, + {"twiddle_timeout", 1, 0, 'X'}, {"debug-time-stamps", 0, 0, 'Z'}, {0, 0, 0, 0} }; @@ -247,6 +247,7 @@ int main(int argc, char *argv[]) int sock_listen; int sockopt; int reuseaddr = 1; + int twiddle = 0; char host[NI_MAXHOST]; char serv[NI_MAXSERV]; #if HAVE_SIGACTION @@ -499,14 +500,14 @@ int main(int argc, char *argv[]) dump_caps_opt++; break; - case 'W': + case 'X': if (!optarg) { usage(); /* wrong arg count */ exit(1); } - my_rig->state.twiddle_timeout = atoi(optarg); + twiddle = atoi(optarg); break; case 'Z': @@ -556,6 +557,8 @@ int main(int argc, char *argv[]) strncpy(my_rig->state.rigport.pathname, rig_file, FILPATHLEN - 1); } + my_rig->state.twiddle_timeout = twiddle; + /* * ex: RIG_PTT_PARALLEL and /dev/parport0 */