From 604516ed8f839e4927ecca34340f9e1f88576a58 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Thu, 29 Apr 2021 17:16:51 -0500 Subject: [PATCH] Clean up mingw compiler warning for tones.h https://github.com/Hamlib/Hamlib/issues/659 --- rigs/kenwood/tmd710.c | 11 +++++++---- src/tones.h | 8 -------- tests/rigctl_parse.c | 3 +++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/rigs/kenwood/tmd710.c b/rigs/kenwood/tmd710.c index 846de3264..5e794e564 100644 --- a/rigs/kenwood/tmd710.c +++ b/rigs/kenwood/tmd710.c @@ -1219,7 +1219,8 @@ int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code) if (fo_struct.dcs) { - *code = common_dcs_list[fo_struct.dcs_val]; + tone_t *dcs_list = common_dcs_list; + *code = dcs_list[fo_struct.dcs_val]; } else { @@ -1234,9 +1235,10 @@ static int tmd710_find_dcs_index(tone_t code, uint32_t *dcs_index) int i = 0; // we only allow exact matches here - while (code != common_dcs_list[i]) + tone_t *dcs_list = common_dcs_list; + while (code != dcs_list[i]) { - if (common_dcs_list[i] == 0) + if (dcs_list[i] == 0) { return -RIG_EINVAL; } @@ -1889,7 +1891,8 @@ int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) if (me_struct.dcs) { - chan->dcs_sql = common_dcs_list[me_struct.dcs_val]; + tone_t *dcs_list = common_dcs_list; + chan->dcs_sql = dcs_list[me_struct.dcs_val]; } else { diff --git a/src/tones.h b/src/tones.h index 1e6288dda..76f10254d 100644 --- a/src/tones.h +++ b/src/tones.h @@ -37,12 +37,10 @@ 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, -#if 1 static const tone_t static_full_ctcss_list[] = { FULL_CTCSS_LIST }; -#endif #define FULL_CTCSS_LIST_COUNT 52 @@ -62,12 +60,10 @@ static const tone_t static_full_ctcss_list[] = 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, \ 0, -#if 1 static const tone_t static_common_ctcss_list[] = { COMMON_CTCSS_LIST }; -#endif #define COMMON_CTCSS_LIST_COUNT 50 @@ -87,12 +83,10 @@ static const tone_t static_common_ctcss_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, -#if 1 static const tone_t static_common_dcs_list[] = { COMMON_DCS_LIST }; -#endif #define COMMON_DCS_LIST_COUNT 104 @@ -111,12 +105,10 @@ static const tone_t static_common_dcs_list[] = 662, 664, 703, 712, 723, 731, 732, 734, 743, 754, \ 0, -#if 1 static const tone_t static_full_dcs_list[] = { FULL_DCS_LIST }; -#endif #define FULL_DCS_LIST_COUNT 106 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 018922115..a3f2064c0 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4344,6 +4344,9 @@ declare_proto_rig(dump_state) fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq != NULL); fprintf(fout, "has_set_conf=%d\n", rig->caps->set_conf != NULL); fprintf(fout, "has_get_conf=%d\n", rig->caps->get_conf != NULL); + fprintf(fout, "has_set_parm=%d\n", rig->caps->set_parm != NULL); + fprintf(fout, "has_get_parm=%d\n", rig->caps->get_parm != NULL); + fprintf(fout, "parm_gran=0x%x\n", rig->caps->parm_gran); // for the future // fprintf(fout, "has_set_trn=%d\n", rig->caps->set_trn != NULL); // fprintf(fout, "has_get_trn=%d\n", rig->caps->get_trn != NULL);