From 3b5f7a6dcf6dc191d906f8a15d4b204ad8d51d93 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Tue, 3 Oct 2023 17:11:09 -0500 Subject: [PATCH] Add and fix some cppcheck suppress items https://github.com/Hamlib/Hamlib/issues/1351 --- amplifiers/elecraft/kpa.c | 1 + amplifiers/expert/expert.c | 1 + amplifiers/gemini/gemini.c | 1 + cppcheck.sh | 2 ++ extra/gnuradio/gnuradio.cc | 1 - extra/gnuradio/testgr.cc | 1 + include/hamlib/rigclass.h | 1 + lib/dummy.c | 2 +- rigs/adat/adat.c | 23 ++++++++++++++++------- rigs/alinco/dx77.c | 1 - rigs/alinco/dxsr8.c | 3 +-- rigs/anytone/anytone.c | 2 +- rigs/aor/aor.c | 1 - rigs/aor/ar3030.c | 1 - rigs/aor/ar7030.c | 1 - rigs/aor/ar7030p.c | 13 ++++++++++--- rigs/barrett/950.c | 2 +- rigs/codan/codan.c | 2 +- rigs/dorji/dra818.c | 2 +- rigs/dummy/dummy.c | 1 - rigs/elad/elad.c | 1 - rigs/icmarine/icm700pro.c | 1 - rigs/icmarine/icm710.c | 1 - rigs/icmarine/icm802.c | 1 - rigs/icmarine/icm803.c | 1 - rigs/icom/ic2730.c | 1 - rigs/icom/ic7000.c | 1 - rigs/icom/ic703.c | 1 - rigs/icom/ic7100.c | 1 - rigs/icom/ic718.c | 1 - rigs/icom/ic7200.c | 1 - rigs/icom/ic7300.c | 1 - rigs/icom/ic7410.c | 1 - rigs/icom/ic746.c | 1 - rigs/icom/ic751.c | 1 - rigs/icom/ic756.c | 1 - rigs/icom/ic7600.c | 1 - rigs/icom/ic7610.c | 1 - rigs/icom/ic7700.c | 1 - rigs/icom/ic78.c | 1 - rigs/icom/ic7800.c | 1 - rigs/icom/ic785x.c | 1 - rigs/icom/ic910.c | 1 - rigs/icom/ic9100.c | 1 - rigs/icom/ic92d.c | 1 - rigs/icom/icf8101.c | 1 - rigs/icom/icr10.c | 1 - rigs/icom/icr20.c | 1 - rigs/icom/icr30.c | 1 - rigs/icom/icr6.c | 1 - rigs/icom/icr7000.c | 1 - rigs/icom/icr75.c | 1 - rigs/icom/icr8500.c | 1 - rigs/icom/icr9000.c | 1 - rigs/icom/icr9500.c | 1 - rigs/icom/icrx7.c | 1 - rigs/icom/id1.c | 1 - rigs/icom/id31.c | 1 - rigs/icom/id4100.c | 1 - rigs/icom/id51.c | 1 - rigs/icom/id5100.c | 1 - rigs/icom/os456.c | 1 - rigs/icom/os535.c | 1 - rigs/icom/xiegu.c | 4 ---- rigs/jrc/jrc.c | 2 -- rigs/jrc/nrd535.c | 1 - rigs/jrc/nrd545.c | 1 - rigs/kenwood/ic10.c | 1 - rigs/kenwood/kenwood.c | 1 - rigs/kenwood/th.c | 1 - rigs/kenwood/thd72.c | 1 - rigs/kenwood/tmv7.c | 1 - rigs/pcr/pcr.c | 1 - rigs/pcr/pcr100.c | 1 - rigs/pcr/pcr1000.c | 1 - rigs/pcr/pcr1500.c | 1 - rigs/pcr/pcr2500.c | 1 - rigs/racal/ra3702.c | 1 - rigs/rs/rs.c | 1 - rigs/tentec/orion.c | 1 - rigs/tentec/pegasus.c | 1 - rigs/tentec/rx320.c | 1 - rigs/tuner/v4l.c | 1 - rigs/tuner/v4l2.c | 1 - rigs/uniden/uniden.c | 1 - rigs/wj/wj8888.c | 1 - rigs/yaesu/ft1200.c | 1 - rigs/yaesu/ft2000.c | 1 - rigs/yaesu/ft450.c | 1 - rigs/yaesu/ft5000.c | 1 - rigs/yaesu/ft891.c | 1 - rigs/yaesu/ft9000.c | 2 -- rigs/yaesu/ft950.c | 1 - rigs/yaesu/vx1700.c | 1 - src/iofunc.c | 10 ++++++++++ src/mem.c | 1 - tests/testrig.c | 1 - 97 files changed, 49 insertions(+), 104 deletions(-) diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index a28c9d2e2..cb474d25e 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -183,6 +183,7 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len) * Get Info * returns the model name string */ +// cppcheck-suppress constParameterPointer const char *kpa_get_info(AMP *amp) { const struct amp_caps *rc; diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index e70c1cb24..35fdde367 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -207,6 +207,7 @@ int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len, * Get Info * returns the model name string */ +// cppcheck-suppress constParameterCallback const char *expert_get_info(AMP *amp) { const struct amp_caps *rc; diff --git a/amplifiers/gemini/gemini.c b/amplifiers/gemini/gemini.c index 5e8a8735c..6f69b0678 100644 --- a/amplifiers/gemini/gemini.c +++ b/amplifiers/gemini/gemini.c @@ -124,6 +124,7 @@ int gemini_transaction(AMP *amp, const char *cmd, char *response, * Get Info * returns the model name string */ +// cppcheck-suppress constParameterPointer const char *gemini_get_info(AMP *amp) { const struct amp_caps *rc; diff --git a/cppcheck.sh b/cppcheck.sh index e11452f98..a18cdb184 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -91,6 +91,7 @@ if test $# -eq 0 ; then $SUPPRESS \ $CHECK \ . \ + --template='{file}:{line},{severity},{id},{message}' >cppcheck.log 2>&1 else cppcheck --inline-suppr \ @@ -105,5 +106,6 @@ else --std=c99 \ $SUPPRESS \ $CHECK \ + --template='{file}:{line},{severity},{id},{message}' "$@" fi diff --git a/extra/gnuradio/gnuradio.cc b/extra/gnuradio/gnuradio.cc index 64bd13765..e1b62aeb8 100644 --- a/extra/gnuradio/gnuradio.cc +++ b/extra/gnuradio/gnuradio.cc @@ -870,7 +870,6 @@ int gnuradio_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) return ret; } -// cppcheck-suppress * DECLARE_INITRIG_BACKEND(gnuradio) { rig_debug(RIG_DEBUG_VERBOSE, "gnuradio: _init called\n"); diff --git a/extra/gnuradio/testgr.cc b/extra/gnuradio/testgr.cc index 971a9f51d..25e53c3e8 100644 --- a/extra/gnuradio/testgr.cc +++ b/extra/gnuradio/testgr.cc @@ -52,6 +52,7 @@ int main(int argc, char *argv[]) } // turn this into a macro +// cppcheck-suppress cstyleCast priv = (struct gnuradio_priv_data*)my_rig->state.priv; if (priv == NULL) { printf("Internal error, can't retrieve priv data!\n"); diff --git a/include/hamlib/rigclass.h b/include/hamlib/rigclass.h index 23f6a17e5..78645aa50 100644 --- a/include/hamlib/rigclass.h +++ b/include/hamlib/rigclass.h @@ -298,6 +298,7 @@ inline void THROW(const RigException *e) #elif defined(_MSC_VER) throw* e; #elif defined(__SUNPRO_CC) +// cppcheck-suppress cstyleCast genericerror(1, ((e != 0) ? (char *)(e->message) : "")); #else diff --git a/lib/dummy.c b/lib/dummy.c index ebaeb8856..d2400f6c9 100644 --- a/lib/dummy.c +++ b/lib/dummy.c @@ -1,7 +1,7 @@ /* Dummy function to make sure libmisc never become an empty library. * Solaris linker does not like such libs. */ - +// cppcheck-suppress void dummy(void) { diff --git a/rigs/adat/adat.c b/rigs/adat/adat.c index bc5a20373..c990af7fc 100644 --- a/rigs/adat/adat.c +++ b/rigs/adat/adat.c @@ -1457,6 +1457,7 @@ int adat_get_single_cmd_result(RIG *pRig) { int nBufLength = 0; +// cppcheck-suppress knownConditionTrueFalse if (*pcPos == 0) // Adjust for 00 byte at beginning ... { pcPos++; // No, please don't ask me why this happens ... ;-) @@ -2164,6 +2165,7 @@ int adat_cmd_fn_set_freq(RIG *pRig) } else { +// cppcheck-suppress constVariablePointer adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; char acBuf[ ADAT_BUFSZ + 1 ]; @@ -2219,7 +2221,8 @@ int adat_cmd_fn_set_vfo(RIG *pRig) } else { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; char acBuf[ ADAT_BUFSZ + 1 ]; // Switch on VFO @@ -2682,7 +2685,8 @@ const char *adat_get_info(RIG *pRig) if (nRC == RIG_OK) { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; snprintf(acBuf,2048, "ADAT ADT-200A, Callsign: %s, S/N: %s, ID Code: %s, Options: %s, FW: %s, GUI FW: %s, HW: %s", @@ -2765,7 +2769,8 @@ int adat_get_freq(RIG *pRig, vfo_t vfo, freq_t *freq) } else { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; nRC = adat_transaction(pRig, &adat_cmd_list_get_freq); @@ -2922,7 +2927,8 @@ int adat_get_mode(RIG *pRig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } else { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; nRC = adat_transaction(pRig, &adat_cmd_list_get_mode); @@ -2964,7 +2970,8 @@ int adat_get_vfo(RIG *pRig, vfo_t *vfo) } else { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; nRC = adat_transaction(pRig, &adat_cmd_list_get_vfo); @@ -3043,7 +3050,8 @@ int adat_get_ptt(RIG *pRig, vfo_t vfo, ptt_t *ptt) } else { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; nRC = adat_transaction(pRig, &adat_cmd_list_get_ptt); @@ -3302,7 +3310,8 @@ int adat_get_conf(RIG *pRig, token_t token, char *val) } else { - adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; +// cppcheck-suppress constVariablePointer + const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv; switch (token) { diff --git a/rigs/alinco/dx77.c b/rigs/alinco/dx77.c index c75e8a7cf..75287f59f 100644 --- a/rigs/alinco/dx77.c +++ b/rigs/alinco/dx77.c @@ -497,7 +497,6 @@ int dx77_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } /* at least 6 digits */ - // cppcheck-suppress * SNPRINTF(freqbuf, sizeof(freqbuf), AL CMD_RXFREQ "%06"PRIll EOM, (int64_t)freq); return dx77_transaction(rig, freqbuf, strlen(freqbuf), NULL, NULL); diff --git a/rigs/alinco/dxsr8.c b/rigs/alinco/dxsr8.c index 9b28c5a3b..b6e6dd57d 100644 --- a/rigs/alinco/dxsr8.c +++ b/rigs/alinco/dxsr8.c @@ -344,7 +344,6 @@ int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return -RIG_EINVAL; } - // cppcheck-suppress * SNPRINTF(cmd, sizeof(cmd), AL "~RW_RXF%08"PRIll EOM, (int64_t)freq); return dxsr8_transaction(rig, cmd, strlen(cmd), NULL, NULL); } @@ -357,7 +356,7 @@ int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { int retval, data_len; - char cmd[] = AL "~RR_RXF" EOM; + const char cmd[] = AL "~RR_RXF" EOM; char freqbuf[BUFSZ]; retval = dxsr8_transaction(rig, cmd, strlen(cmd), freqbuf, &data_len); diff --git a/rigs/anytone/anytone.c b/rigs/anytone/anytone.c index 55f57aee6..9703cc72a 100644 --- a/rigs/anytone/anytone.c +++ b/rigs/anytone/anytone.c @@ -317,7 +317,7 @@ int anytone_get_vfo(RIG *rig, vfo_t *vfo) rig_debug(RIG_DEBUG_ERR, "%s: unknown vfo=0x%02x\n", __func__, reply[113]); } - *vfo = p->vfo_curr; + p->vfo_curr = *vfo; RETURNFUNC(retval); } diff --git a/rigs/aor/aor.c b/rigs/aor/aor.c index b6dd65d0a..cdcd6d5dd 100644 --- a/rigs/aor/aor.c +++ b/rigs/aor/aor.c @@ -174,7 +174,6 @@ static int format_freq(char *buf, int buf_len, freq_t freq) f = f * 100 + lowhz; - // cppcheck-suppress * SNPRINTF(buf, buf_len, "RF%010"PRIll, f); return strlen(buf); } diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index f46a1b1b4..b21cf4259 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -796,7 +796,6 @@ int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) rig_passband_normal(rig, chan->mode); - // cppcheck-suppress * chan->levels[LVL_ATT].i = infobuf[6] == '0' ? 0 : rig->caps->attenuator[infobuf[4] - '1']; diff --git a/rigs/aor/ar7030.c b/rigs/aor/ar7030.c index cd16a1120..cd4183a74 100644 --- a/rigs/aor/ar7030.c +++ b/rigs/aor/ar7030.c @@ -802,7 +802,6 @@ const struct rig_caps ar7030_caps = .has_get_parm = AR7030_PARM, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/aor/ar7030p.c b/rigs/aor/ar7030p.c index 34be22776..25dd3e905 100644 --- a/rigs/aor/ar7030p.c +++ b/rigs/aor/ar7030p.c @@ -1260,6 +1260,7 @@ static int ar7030p_set_vfo(RIG *rig, vfo_t vfo) return (rc); } +// cppcheck-suppress constParameterCallback static int ar7030p_get_vfo(RIG *rig, vfo_t *vfo) { int rc = RIG_OK; @@ -1272,6 +1273,7 @@ static int ar7030p_get_vfo(RIG *rig, vfo_t *vfo) return (rc); } +// cppcheck-suppress constParameterCallback static int ar7030p_set_parm(RIG *rig, setting_t parm, value_t val) { int rc = -RIG_ENIMPL; @@ -1296,6 +1298,7 @@ static int ar7030p_set_parm(RIG *rig, setting_t parm, value_t val) return (rc); } +// cppcheck-suppress constParameterCallback static int ar7030p_get_parm(RIG *rig, setting_t parm, value_t *val) { int rc = -RIG_ENIMPL; @@ -1346,7 +1349,7 @@ static int ar7030p_get_mem(RIG *rig, vfo_t vfo, int *ch) int rc = RIG_OK; struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *) rig->state.priv; - channel_t *curr = priv->curr; + const channel_t *curr = priv->curr; assert(NULL != ch); @@ -1384,6 +1387,7 @@ static int ar7030p_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) return (rc); } +// cppcheck-suppress constParameterCallback static int ar7030p_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { int rc = -RIG_ENIMPL; @@ -1599,6 +1603,7 @@ static int ar7030p_reset(RIG *rig, reset_t reset) return (rc); } +// cppcheck-suppress constParameterCallback static int ar7030p_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { @@ -1607,6 +1612,7 @@ static int ar7030p_set_func(RIG *rig, vfo_t vfo, setting_t func, return (-RIG_ENIMPL); } +// cppcheck-suppress constParameterCallback static int ar7030p_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { @@ -1617,6 +1623,7 @@ static int ar7030p_get_func(RIG *rig, vfo_t vfo, setting_t func, return (-RIG_ENIMPL); } +// cppcheck-suppress constParameterCallback static int ar7030p_decode_event(RIG *rig) { assert(NULL != rig); @@ -1624,6 +1631,7 @@ static int ar7030p_decode_event(RIG *rig) return (-RIG_ENIMPL); } +// cppcheck-suppress constParameterCallback static int ar7030p_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) { assert(NULL != rig); @@ -1640,7 +1648,7 @@ static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, unsigned int f; unsigned char *p = NULL; int ch; - struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)rig->state.priv; + const struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)rig->state.priv; const channel_t *curr = priv->curr; assert(NULL != chan); @@ -1670,7 +1678,6 @@ static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, if (RIG_OK == rc) { - // cppcheck-suppress * chan->levels[ LVL_SQL ].f = (float) v / 255.0; } diff --git a/rigs/barrett/950.c b/rigs/barrett/950.c index a1c263b95..250b7966d 100644 --- a/rigs/barrett/950.c +++ b/rigs/barrett/950.c @@ -148,7 +148,7 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq) freq_t freq_rx, freq_tx; freq_t freq_MHz; char *response = NULL; - struct barrett_priv_data *priv = rig->state.priv; + const struct barrett_priv_data *priv = rig->state.priv; //struct barrett_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s freq=%.0f\n", __func__, diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index 8bca6d221..ba3eabf82 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -363,7 +363,7 @@ int codan_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return retval; } - char *p = strstr(response, "Ptt"); + const char *p = strstr(response, "Ptt"); if (p) { diff --git a/rigs/dorji/dra818.c b/rigs/dorji/dra818.c index 0b73bb71c..a856a5fab 100644 --- a/rigs/dorji/dra818.c +++ b/rigs/dorji/dra818.c @@ -100,7 +100,7 @@ static void dra818_subaudio(RIG *rig, char *subaudio, int subaudio_len, static int dra818_setgroup(RIG *rig) { - struct dra818_priv *priv = rig->state.priv; + const struct dra818_priv *priv = rig->state.priv; char cmd[80]; char subtx[8] = { 0 }; char subrx[8] = { 0 }; diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 2ca7fd4ad..765231670 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1205,7 +1205,6 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) qrm = -50; } - // cppcheck-suppress * level1 = LVL_ATT; level2 = LVL_PREAMP; curr->levels[idx].i = qrm + (time(NULL) % 32) + (rand() % 4) diff --git a/rigs/elad/elad.c b/rigs/elad/elad.c index e6c0bb97b..afb45a29e 100644 --- a/rigs/elad/elad.c +++ b/rigs/elad/elad.c @@ -1215,7 +1215,6 @@ int elad_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return -RIG_EINVAL; } - // cppcheck-suppress * SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll, vfo_letter, (int64_t)freq); err = elad_transaction(rig, freqbuf, NULL, 0); diff --git a/rigs/icmarine/icm700pro.c b/rigs/icmarine/icm700pro.c index c7c96923a..d8b5a6304 100644 --- a/rigs/icmarine/icm700pro.c +++ b/rigs/icmarine/icm700pro.c @@ -78,7 +78,6 @@ const struct rig_caps icm700pro_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm710.c b/rigs/icmarine/icm710.c index b1815c118..f576c4c17 100644 --- a/rigs/icmarine/icm710.c +++ b/rigs/icmarine/icm710.c @@ -86,7 +86,6 @@ const struct rig_caps icm710_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm802.c b/rigs/icmarine/icm802.c index 3e469ed6a..9165a5b3e 100644 --- a/rigs/icmarine/icm802.c +++ b/rigs/icmarine/icm802.c @@ -79,7 +79,6 @@ const struct rig_caps icm802_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm803.c b/rigs/icmarine/icm803.c index da0a3cec0..b9d3d4f68 100644 --- a/rigs/icmarine/icm803.c +++ b/rigs/icmarine/icm803.c @@ -79,7 +79,6 @@ const struct rig_caps icm803_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic2730.c b/rigs/icom/ic2730.c index f21935a68..acec5bc32 100644 --- a/rigs/icom/ic2730.c +++ b/rigs/icom/ic2730.c @@ -88,7 +88,6 @@ const struct rig_caps ic2730_caps = .has_get_parm = IC2730_PARM_ALL, .has_set_parm = IC2730_PARM_ALL, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7000.c b/rigs/icom/ic7000.c index f8e0d0546..19304ddd8 100644 --- a/rigs/icom/ic7000.c +++ b/rigs/icom/ic7000.c @@ -221,7 +221,6 @@ const struct rig_caps ic7000_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic703.c b/rigs/icom/ic703.c index 1fce2a41a..56f1ff134 100644 --- a/rigs/icom/ic703.c +++ b/rigs/icom/ic703.c @@ -112,7 +112,6 @@ const struct rig_caps ic703_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index d626c6810..4a376a232 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -338,7 +338,6 @@ const struct rig_caps ic7100_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic718.c b/rigs/icom/ic718.c index cca211556..b4f1d11e2 100644 --- a/rigs/icom/ic718.c +++ b/rigs/icom/ic718.c @@ -103,7 +103,6 @@ const struct rig_caps ic718_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7200.c b/rigs/icom/ic7200.c index 01a451827..094401cb5 100644 --- a/rigs/icom/ic7200.c +++ b/rigs/icom/ic7200.c @@ -149,7 +149,6 @@ const struct rig_caps ic7200_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 5fda8e240..3168a87d0 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -714,7 +714,6 @@ const struct rig_caps ic7300_caps = .has_set_parm = RIG_PARM_SET(IC7300_PARMS), .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 255}}, [LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}}, [LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}}, diff --git a/rigs/icom/ic7410.c b/rigs/icom/ic7410.c index 33a786af9..1ebc4707c 100644 --- a/rigs/icom/ic7410.c +++ b/rigs/icom/ic7410.c @@ -149,7 +149,6 @@ const struct rig_caps ic7410_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 81c092b6f..2858908c9 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -207,7 +207,6 @@ const struct rig_caps ic746_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic751.c b/rigs/icom/ic751.c index ec386a798..7cefc4bcf 100644 --- a/rigs/icom/ic751.c +++ b/rigs/icom/ic751.c @@ -111,7 +111,6 @@ const struct rig_caps ic751_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index afeda348a..199a74cc0 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -166,7 +166,6 @@ const struct rig_caps ic756_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index 97b8c4139..89c0328d1 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -303,7 +303,6 @@ struct rig_caps ic7600_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index 4c8cfa6bd..1ba953daa 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -383,7 +383,6 @@ struct rig_caps ic7610_caps = .has_get_parm = IC7610_PARMS, .has_set_parm = RIG_PARM_SET(IC7610_PARMS), /* FIXME: parms */ .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index 962dba037..debd3644f 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -284,7 +284,6 @@ const struct rig_caps ic7700_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic78.c b/rigs/icom/ic78.c index beab5386a..79ea1b95d 100644 --- a/rigs/icom/ic78.c +++ b/rigs/icom/ic78.c @@ -93,7 +93,6 @@ const struct rig_caps ic78_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index af4eba6ec..318f7b758 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -181,7 +181,6 @@ const struct rig_caps ic7800_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index ec814a0be..5745b92be 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -267,7 +267,6 @@ const struct rig_caps ic785x_caps = .has_get_parm = IC785x_PARMS, .has_set_parm = RIG_PARM_SET(IC785x_PARMS), /* FIXME: parms */ .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c index 0005b3df7..aa2a703f5 100644 --- a/rigs/icom/ic910.c +++ b/rigs/icom/ic910.c @@ -227,7 +227,6 @@ const struct rig_caps ic910_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/ic9100.c b/rigs/icom/ic9100.c index 2a8ef9dcc..f7d70b751 100644 --- a/rigs/icom/ic9100.c +++ b/rigs/icom/ic9100.c @@ -135,7 +135,6 @@ const struct rig_caps ic9100_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/ic92d.c b/rigs/icom/ic92d.c index 8e0e8093c..0c9480bf2 100644 --- a/rigs/icom/ic92d.c +++ b/rigs/icom/ic92d.c @@ -124,7 +124,6 @@ const struct rig_caps ic92d_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icf8101.c b/rigs/icom/icf8101.c index cf2a2769d..4cbadb027 100644 --- a/rigs/icom/icf8101.c +++ b/rigs/icom/icf8101.c @@ -401,7 +401,6 @@ const struct rig_caps icf8101_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/icr10.c b/rigs/icom/icr10.c index a5e020be6..b67f9ccb9 100644 --- a/rigs/icom/icr10.c +++ b/rigs/icom/icr10.c @@ -82,7 +82,6 @@ const struct rig_caps icr10_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr20.c b/rigs/icom/icr20.c index d5be3d387..4952c49f8 100644 --- a/rigs/icom/icr20.c +++ b/rigs/icom/icr20.c @@ -82,7 +82,6 @@ const struct rig_caps icr20_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 1cb05558f..9c61121ac 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -153,7 +153,6 @@ const struct rig_caps icr30_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr6.c b/rigs/icom/icr6.c index 1db529d01..2f44357c2 100644 --- a/rigs/icom/icr6.c +++ b/rigs/icom/icr6.c @@ -80,7 +80,6 @@ const struct rig_caps icr6_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr7000.c b/rigs/icom/icr7000.c index 8ce3eb66b..028c45d0f 100644 --- a/rigs/icom/icr7000.c +++ b/rigs/icom/icr7000.c @@ -204,7 +204,6 @@ const struct rig_caps icr7100_caps = .has_get_parm = ICR7100_PARMS, .has_set_parm = RIG_PARM_SET(ICR7100_PARMS), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index 1359a4aba..9c044b87b 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -134,7 +134,6 @@ const struct rig_caps icr75_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_PBT_IN] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } }, [LVL_PBT_OUT] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } }, diff --git a/rigs/icom/icr8500.c b/rigs/icom/icr8500.c index 93c7249c2..187062db6 100644 --- a/rigs/icom/icr8500.c +++ b/rigs/icom/icr8500.c @@ -102,7 +102,6 @@ const struct rig_caps icr8500_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_IF] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/icr9000.c b/rigs/icom/icr9000.c index d3bf3fab6..ecb88d523 100644 --- a/rigs/icom/icr9000.c +++ b/rigs/icom/icr9000.c @@ -94,7 +94,6 @@ const struct rig_caps icr9000_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = { diff --git a/rigs/icom/icr9500.c b/rigs/icom/icr9500.c index 33ccd193c..741306019 100644 --- a/rigs/icom/icr9500.c +++ b/rigs/icom/icr9500.c @@ -108,7 +108,6 @@ const struct rig_caps icr9500_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = { diff --git a/rigs/icom/icrx7.c b/rigs/icom/icrx7.c index 713300619..42af41238 100644 --- a/rigs/icom/icrx7.c +++ b/rigs/icom/icrx7.c @@ -80,7 +80,6 @@ const struct rig_caps icrx7_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/id1.c b/rigs/icom/id1.c index 5fe1d3d43..414541154 100644 --- a/rigs/icom/id1.c +++ b/rigs/icom/id1.c @@ -98,7 +98,6 @@ const struct rig_caps id1_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/id31.c b/rigs/icom/id31.c index 475b871cd..d243b4af3 100644 --- a/rigs/icom/id31.c +++ b/rigs/icom/id31.c @@ -104,7 +104,6 @@ const struct rig_caps id31_caps = .has_get_parm = ID31_PARM_ALL, .has_set_parm = ID31_PARM_ALL, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c index 4983e6d68..a126a909b 100644 --- a/rigs/icom/id4100.c +++ b/rigs/icom/id4100.c @@ -108,7 +108,6 @@ const struct rig_caps id4100_caps = .has_get_parm = ID4100_PARM_ALL, .has_set_parm = ID4100_PARM_ALL, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/id51.c b/rigs/icom/id51.c index e22076f40..13fe98e01 100644 --- a/rigs/icom/id51.c +++ b/rigs/icom/id51.c @@ -111,7 +111,6 @@ const struct rig_caps id51_caps = .has_get_parm = ID51_PARM_ALL, .has_set_parm = ID51_PARM_ALL, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .ext_tokens = id51_tokens, diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index 9998a87e7..d7d66bbd1 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -248,7 +248,6 @@ const struct rig_caps id5100_caps = .level_gran = { #include "level_gran_icom.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/os456.c b/rigs/icom/os456.c index f0c0e9f14..21bcfb3bd 100644 --- a/rigs/icom/os456.c +++ b/rigs/icom/os456.c @@ -97,7 +97,6 @@ const struct rig_caps os456_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/os535.c b/rigs/icom/os535.c index d26d4cbc4..df4bd61cb 100644 --- a/rigs/icom/os535.c +++ b/rigs/icom/os535.c @@ -90,7 +90,6 @@ const struct rig_caps os535_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 4d55d8fb7..fc984c2b2 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -175,7 +175,6 @@ const struct rig_caps x108g_caps = .has_set_parm = RIG_PARM_SET(X108G_PARMS), .level_gran = { // cppcheck-suppress * - [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, .ctcss_list = common_ctcss_list, @@ -351,7 +350,6 @@ const struct rig_caps x6100_caps = .has_get_parm = X108G_PARMS, .has_set_parm = RIG_PARM_SET(X108G_PARMS), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, @@ -528,7 +526,6 @@ const struct rig_caps g90_caps = .has_get_parm = X108G_PARMS, .has_set_parm = RIG_PARM_SET(X108G_PARMS), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, @@ -705,7 +702,6 @@ const struct rig_caps x5105_caps = .has_get_parm = X108G_PARMS, .has_set_parm = RIG_PARM_SET(X108G_PARMS), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/jrc/jrc.c b/rigs/jrc/jrc.c index 49335b369..f2a69542d 100644 --- a/rigs/jrc/jrc.c +++ b/rigs/jrc/jrc.c @@ -293,8 +293,6 @@ int jrc_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return -RIG_EINVAL; } - // cppcheck-suppress * - // suppressing bogus cppcheck error in ver 1.90 SNPRINTF(freqbuf, sizeof(freqbuf), "F%0*"PRIll EOM, priv->max_freq_len, (int64_t)freq); diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c index 140bdba4b..aae04ff9e 100644 --- a/rigs/jrc/nrd535.c +++ b/rigs/jrc/nrd535.c @@ -119,7 +119,6 @@ const struct rig_caps nrd535_caps = .has_get_parm = RIG_PARM_TIME, .has_set_parm = RIG_PARM_SET(NRD535_PARM), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } }, [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 } }, diff --git a/rigs/jrc/nrd545.c b/rigs/jrc/nrd545.c index 10a4c0970..5e3a35dda 100644 --- a/rigs/jrc/nrd545.c +++ b/rigs/jrc/nrd545.c @@ -117,7 +117,6 @@ const struct rig_caps nrd545_caps = .has_get_parm = RIG_PARM_TIME, .has_set_parm = RIG_PARM_SET(NRD545_PARM), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } }, [LVL_IF] = { .min = { .i = -2550 }, .max = { .i = 2550 }, .step = { .i = 10} }, diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index 6551dccdf..a4d815c06 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -464,7 +464,6 @@ int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return -RIG_EINVAL; } - // cppcheck-suppress * SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll";", vfo_letter, (int64_t)freq); retval = ic10_transaction(rig, freqbuf, strlen(freqbuf), NULL, 0); diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3f005afd1..907d69f45 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1922,7 +1922,6 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC2(-RIG_EINVAL); } - // cppcheck-suppress * SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll, vfo_letter, (int64_t)freq); // we need to modify priv->verify_cmd if ID is not being used diff --git a/rigs/kenwood/th.c b/rigs/kenwood/th.c index d24ff55cd..a08a50a43 100644 --- a/rigs/kenwood/th.c +++ b/rigs/kenwood/th.c @@ -237,7 +237,6 @@ th_set_freq(RIG *rig, vfo_t vfo, freq_t freq) step = freq_sent >= MHz(470) ? 4 : step; freq_sent = freq_sent >= MHz(470) ? (round(freq_sent / 10000) * 10000) : freq_sent; - // cppcheck-suppress * SNPRINTF(buf, sizeof(buf), "FQ %011"PRIll",%X\r", (int64_t) freq_sent, step); return kenwood_transaction(rig, buf, buf, strlen(buf)); diff --git a/rigs/kenwood/thd72.c b/rigs/kenwood/thd72.c index 7f2b9acae..dd87c5b96 100644 --- a/rigs/kenwood/thd72.c +++ b/rigs/kenwood/thd72.c @@ -450,7 +450,6 @@ static int thd72_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: tsindex=%d, stepsize=%d\n", __func__, tsindex, (int)ts); freq = roundl(freq / ts) * ts; - // cppcheck-suppress * SNPRINTF(fbuf, sizeof(fbuf), "%010"PRIll, (int64_t)freq); memcpy(buf + 5, fbuf, 10); retval = kenwood_simple_transaction(rig, buf, 52); diff --git a/rigs/kenwood/tmv7.c b/rigs/kenwood/tmv7.c index d1237b4c4..92fc8272e 100644 --- a/rigs/kenwood/tmv7.c +++ b/rigs/kenwood/tmv7.c @@ -798,7 +798,6 @@ int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) if (chan->tx_freq != RIG_FREQ_NONE) { req[5] = '1'; - // cppcheck-suppress * SNPRINTF(membuf, sizeof(membuf), "%s,%011"PRIll",%01d", req, (int64_t)chan->tx_freq, step); retval = kenwood_transaction(rig, membuf, NULL, 0); diff --git a/rigs/pcr/pcr.c b/rigs/pcr/pcr.c index 90bce29e2..146781e19 100644 --- a/rigs/pcr/pcr.c +++ b/rigs/pcr/pcr.c @@ -756,7 +756,6 @@ pcr_set_freq(RIG *rig, vfo_t vfo, freq_t freq) priv = (struct pcr_priv_data *) rig->state.priv; rcvr = is_sub_rcvr(rig, vfo) ? &priv->sub_rcvr : &priv->main_rcvr; - // cppcheck-suppress * SNPRINTF((char *) buf, sizeof(buf), "K%c%010" PRIll "0%c0%c00", is_sub_rcvr(rig, vfo) ? '1' : '0', (int64_t) freq, diff --git a/rigs/pcr/pcr100.c b/rigs/pcr/pcr100.c index a0c390b29..2bcd2c245 100644 --- a/rigs/pcr/pcr100.c +++ b/rigs/pcr/pcr100.c @@ -87,7 +87,6 @@ const struct rig_caps pcr100_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/pcr/pcr1000.c b/rigs/pcr/pcr1000.c index 4f2c6280d..db680eec1 100644 --- a/rigs/pcr/pcr1000.c +++ b/rigs/pcr/pcr1000.c @@ -80,7 +80,6 @@ const struct rig_caps pcr1000_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/pcr/pcr1500.c b/rigs/pcr/pcr1500.c index 279785600..4cb08a94f 100644 --- a/rigs/pcr/pcr1500.c +++ b/rigs/pcr/pcr1500.c @@ -83,7 +83,6 @@ const struct rig_caps pcr1500_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, [LVL_NR] = { .min = { .f = 0 }, .max = { .f = 16.0 }, .step = { .f = 1.0 } }, /* XXX check this */ diff --git a/rigs/pcr/pcr2500.c b/rigs/pcr/pcr2500.c index ad931d65f..520ab89db 100644 --- a/rigs/pcr/pcr2500.c +++ b/rigs/pcr/pcr2500.c @@ -92,7 +92,6 @@ const struct rig_caps pcr2500_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/racal/ra3702.c b/rigs/racal/ra3702.c index 103b98b9c..3fbdb78e4 100644 --- a/rigs/racal/ra3702.c +++ b/rigs/racal/ra3702.c @@ -74,7 +74,6 @@ const struct rig_caps ra3702_caps = .has_get_parm = RA3702_PARM_ALL, .has_set_parm = RIG_PARM_SET(RA3702_PARM_ALL), .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .vfo_ops = RA3702_VFO_OPS, diff --git a/rigs/rs/rs.c b/rigs/rs/rs.c index 25ac55639..9d0bf73c6 100644 --- a/rigs/rs/rs.c +++ b/rigs/rs/rs.c @@ -97,7 +97,6 @@ int rs_set_freq(RIG *rig, vfo_t vfo, freq_t freq) char freqbuf[32]; int retval; - // cppcheck-suppress * SNPRINTF(freqbuf, sizeof(freqbuf), BOM "FREQ %"PRIll EOM, (int64_t)freq); retval = rs_transaction(rig, freqbuf, strlen(freqbuf), NULL, NULL); diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c index e332829e9..c496b8480 100644 --- a/rigs/tentec/orion.c +++ b/rigs/tentec/orion.c @@ -394,7 +394,6 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq) #ifdef TT565_ASCII_FREQ /* Use ASCII mode to set frequencies */ - // cppcheck-suppress * SNPRINTF(cmdbuf, sizeof(cmdbuf), "*%cF%"PRIll EOM, which_vfo(rig, vfo), (int64_t)freq); diff --git a/rigs/tentec/pegasus.c b/rigs/tentec/pegasus.c index af44dc6a8..d3f8753c2 100644 --- a/rigs/tentec/pegasus.c +++ b/rigs/tentec/pegasus.c @@ -90,7 +90,6 @@ const struct rig_caps tt550_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 65535}}, }, .parm_gran = {}, diff --git a/rigs/tentec/rx320.c b/rigs/tentec/rx320.c index 4bae4bf7f..060e86190 100644 --- a/rigs/tentec/rx320.c +++ b/rigs/tentec/rx320.c @@ -100,7 +100,6 @@ const struct rig_caps rx320_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 10000 } }, [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0 / 64 } }, [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 }, .step = { .i = 10} }, diff --git a/rigs/tuner/v4l.c b/rigs/tuner/v4l.c index c459bad3b..462b3eee6 100644 --- a/rigs/tuner/v4l.c +++ b/rigs/tuner/v4l.c @@ -88,7 +88,6 @@ const struct rig_caps v4l_caps = .has_set_parm = RIG_PARM_SET(V4L_PARM_ALL), .vfo_ops = RIG_OP_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } }, }, .preamp = { RIG_DBLST_END }, diff --git a/rigs/tuner/v4l2.c b/rigs/tuner/v4l2.c index c44fab05a..e3c1a5f8a 100644 --- a/rigs/tuner/v4l2.c +++ b/rigs/tuner/v4l2.c @@ -88,7 +88,6 @@ const struct rig_caps v4l2_caps = .has_set_parm = RIG_PARM_SET(V4L2_PARM_ALL), .vfo_ops = RIG_OP_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } }, }, .preamp = { RIG_DBLST_END }, diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 7ee7b61f5..de1bfb1f9 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -629,7 +629,6 @@ int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) /* TODO: Trunk, Delay, Recording */ chan->flags = (membuf[22] == 'N') ? RIG_CHFLAG_SKIP : 0; - // cppcheck-suppress * chan->levels[LVL_ATT].i = (membuf[25] == 'N') ? rig->state.attenuator[0] : 0; sscanf(membuf + 41, "%d", &tone); diff --git a/rigs/wj/wj8888.c b/rigs/wj/wj8888.c index 3ae7f48d2..879dfe995 100644 --- a/rigs/wj/wj8888.c +++ b/rigs/wj/wj8888.c @@ -82,7 +82,6 @@ const struct rig_caps wj8888_caps = .preamp = { RIG_DBLST_END }, .attenuator = { RIG_DBLST_END }, .level_gran = { - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 0x7f } }, }, .max_rit = Hz(0), diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 712e64aa2..eca6c098f 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -173,7 +173,6 @@ const struct rig_caps ftdx1200_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } }, [LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 416b239b0..c8fc41cbd 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -157,7 +157,6 @@ const struct rig_caps ft2000_caps = .has_set_parm = RIG_PARM_BANDSELECT, .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } }, [LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index a2c245be9..5377211b9 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -65,7 +65,6 @@ const struct rig_caps ft450_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_CWPITCH] = { .min = { .i = 400 }, .max = { .i = 800 }, .step = { .i = 100 } }, [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } }, [LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index f1a06608f..d7421b280 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -164,7 +164,6 @@ const struct rig_caps ftdx5000_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } }, [LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, [LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 9a2eabc99..2d5309344 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -156,7 +156,6 @@ const struct rig_caps ft891_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0f/30.0f } }, [LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, [LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } }, diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 964bc38a6..7f5b61f85 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -72,7 +72,6 @@ const struct rig_caps ft9000_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } }, [LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, @@ -249,7 +248,6 @@ const struct rig_caps ft9000Old_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, [LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } }, [LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } }, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 9802033c5..2ee973d55 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -108,7 +108,6 @@ const struct rig_caps ft950_caps = .level_gran = { #include "level_gran_yaesu.h" - // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, [LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } }, diff --git a/rigs/yaesu/vx1700.c b/rigs/yaesu/vx1700.c index b9db196ec..a887bc085 100644 --- a/rigs/yaesu/vx1700.c +++ b/rigs/yaesu/vx1700.c @@ -237,7 +237,6 @@ const struct rig_caps vx1700_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { - // cppcheck-suppress * [LVL_RFPOWER] = { .min = { .i = 0 }, .max = { .i = 2 } }, }, .parm_gran = {}, diff --git a/src/iofunc.c b/src/iofunc.c index b8844ea41..89adea4b1 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -31,6 +31,7 @@ * @{ */ +#include #include #include /* Standard input/output definitions */ @@ -52,9 +53,12 @@ #include "cm108.h" #include "asyncpipe.h" +#define HAMLIB_TRACE2 rig_debug(RIG_DEBUG_TRACE,"%s trace(%d)\n", __FILE__, __LINE__) + #if defined(WIN32) && defined(HAVE_WINDOWS_H) #include + static void init_sync_data_pipe(hamlib_port_t *p) { p->sync_data_pipe = NULL; @@ -1335,6 +1339,7 @@ static int read_string_generic(hamlib_port_t *p, memset(rxbuffer, 0, rxmax); short timeout_retries = p->timeout_retry; + HAMLIB_TRACE2; while (total_count < rxmax - 1) // allow 1 byte for end-of-string { ssize_t rd_count = 0; @@ -1342,6 +1347,7 @@ static int read_string_generic(hamlib_port_t *p, int timeout_save = p->timeout; // p->timeout = 2; result = port_wait_for_data(p, direct); + HAMLIB_TRACE2; p->timeout = timeout_save; if (result == -RIG_ETIMEOUT) @@ -1352,6 +1358,7 @@ static int read_string_generic(hamlib_port_t *p, rig_debug(RIG_DEBUG_CACHE, "%s(%d): retrying read timeout %d/%d timeout=%d\n", __func__, __LINE__, p->timeout_retry - timeout_retries, p->timeout_retry, p->timeout); hl_usleep(10 * 1000); + HAMLIB_TRACE2; continue; } @@ -1409,8 +1416,10 @@ static int read_string_generic(hamlib_port_t *p, //rig_debug(RIG_DEBUG_ERR, "xs: avail=%d expected_len=%d, minlen=%d, direct=%d\n", __func__, avail, expected_len, minlen, direct); #endif #endif + HAMLIB_TRACE2; rd_count = port_read_generic(p, &rxbuffer[total_count], expected_len == 1 ? 1 : minlen, direct); + HAMLIB_TRACE2; // rig_debug(RIG_DEBUG_VERBOSE, "%s: read %d bytes tot=%d\n", __func__, (int)rd_count, total_count); minlen -= rd_count; @@ -1423,6 +1432,7 @@ static int read_string_generic(hamlib_port_t *p, } while (++i < 10 && errno == EBUSY); // 50ms should be enough + HAMLIB_TRACE2; /* if we get 0 bytes or an error something is wrong */ if (rd_count <= 0) diff --git a/src/mem.c b/src/mem.c index 90aac90f9..7f460eb33 100644 --- a/src/mem.c +++ b/src/mem.c @@ -1616,7 +1616,6 @@ const chan_t *HAMLIB_API rig_lookup_mem_caps(RIG *rig, int ch) */ for (j = 0; j < sizeof(channel_cap_t); j++) { - // cppcheck-suppress * p1[j] |= p2[j]; } diff --git a/tests/testrig.c b/tests/testrig.c index 8a6c8fce5..edce42db9 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -440,7 +440,6 @@ int main(int argc, char *argv[]) if (retcode == RIG_OK) { - // cppcheck-suppress * printf("rig_get_mode: mode = %s\n", rig_strrmode(rmode)); } else