diff --git a/rigs/adat/adat.c b/rigs/adat/adat.c index 346d4cf63..49e5403cf 100644 --- a/rigs/adat/adat.c +++ b/rigs/adat/adat.c @@ -2636,7 +2636,8 @@ adat_priv_data_ptr adat_new_priv_data(RIG *pRig) { // Init Priv Data - pPriv = pRig->state.priv = (adat_priv_data_ptr) calloc(sizeof(adat_priv_data_t), 1); + pPriv = pRig->state.priv = (adat_priv_data_ptr) calloc(sizeof(adat_priv_data_t), + 1); if (pRig->state.priv != NULL) { diff --git a/rigs/elad/elad.c b/rigs/elad/elad.c index b50e42adf..369da6409 100644 --- a/rigs/elad/elad.c +++ b/rigs/elad/elad.c @@ -983,7 +983,8 @@ int elad_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) case RIG_VFO_MEM: vfo_function = '2'; break; default: - rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(txvfo)); + rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, + rig_strvfo(txvfo)); return -RIG_EINVAL; } @@ -1964,6 +1965,7 @@ int elad_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) else { int foundit = 0; + for (i = 0; i < MAXDBLSTSIZ && rig->state.preamp[i]; i++) { if (val.i == rig->state.preamp[i]) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 95fb17174..d967b63ea 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -241,6 +241,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, // And try again frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf)); } + // cppcheck-suppress * Unhold_Decode(rig); diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index 571eb6634..e3a0b9344 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -224,7 +224,9 @@ int ic10_get_vfo(RIG *rig, vfo_t *vfo) __func__, c); return -RIG_EPROTO; } - rig_debug(RIG_DEBUG_VERBOSE, "%s: returning VFO=%s\n", __func__, rig_strvfo(*vfo)); + + rig_debug(RIG_DEBUG_VERBOSE, "%s: returning VFO=%s\n", __func__, + rig_strvfo(*vfo)); return RIG_OK; } @@ -415,7 +417,7 @@ int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq) case RIG_VFO_A: case RIG_VFO_MAIN: vfo_letter = 'A'; break; - case RIG_VFO_B: + case RIG_VFO_B: case RIG_VFO_SUB: vfo_letter = 'B'; break; default: @@ -522,6 +524,7 @@ int ic10_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) unsigned char ptt_letter; rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); + switch (ptt) { case RIG_PTT_OFF: ptt_letter = 'R'; break; diff --git a/rigs/kenwood/ts870s.c b/rigs/kenwood/ts870s.c index b05ddbc99..adc313fb9 100644 --- a/rigs/kenwood/ts870s.c +++ b/rigs/kenwood/ts870s.c @@ -236,6 +236,7 @@ static int ts870s_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (RIG_MODE_USB == mode || RIG_MODE_LSB == mode || RIG_MODE_AM == mode) { pbwidth_t mode_default_hpf; + /* we assume the HPF is set to default and set the LPF to give the best approximaation of the requested width */ if (RIG_MODE_AM == mode) diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 9b74dd0fd..79a50c9ac 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -793,7 +793,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val) /* Valid only if PTT is on */ if ((p->tx_status & 0x80) == 0) { - rig_debug(RIG_DEBUG_TRACE,"%s: bars=%d\n", __func__, p->tx_status & 0x0F); + rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? val->i = (p->tx_status & 0x0F) / 10.0; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 64154128a..b3044bbb7 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1546,7 +1546,8 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) *split = RIG_SPLIT_OFF; } - rig_debug(RIG_DEBUG_TRACE, "SPLIT = %d, vfo = %s, TX_vfo = %s\n", *split, rig_strvfo(vfo), + rig_debug(RIG_DEBUG_TRACE, "SPLIT = %d, vfo = %s, TX_vfo = %s\n", *split, + rig_strvfo(vfo), rig_strvfo(*tx_vfo)); return RIG_OK; @@ -6005,7 +6006,8 @@ int newcat_get_rigid(RIG *rig) } } - rig_debug(RIG_DEBUG_TRACE, "rig_id = %d, *s = %s\n", priv->rig_id, s==NULL?"NULL":s); + rig_debug(RIG_DEBUG_TRACE, "rig_id = %d, *s = %s\n", priv->rig_id, + s == NULL ? "NULL" : s); return priv->rig_id; } @@ -6070,7 +6072,8 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t *vfo_mode) *vfo_mode = RIG_VFO_MEM; } - rig_debug(RIG_DEBUG_TRACE, "%s: vfo mode = %s\n", __func__, rig_strrmode(*vfo_mode)); + rig_debug(RIG_DEBUG_TRACE, "%s: vfo mode = %s\n", __func__, + rig_strrmode(*vfo_mode)); return err; } diff --git a/src/misc.c b/src/misc.c index 1e2c3f2d6..886258579 100644 --- a/src/misc.c +++ b/src/misc.c @@ -510,7 +510,7 @@ const char *HAMLIB_API rig_strvfo(vfo_t vfo) { if (vfo == vfo_str[i].vfo) { - rig_debug(RIG_DEBUG_TRACE, "%s returning %s\n", __func__, vfo_str[i].str); + rig_debug(RIG_DEBUG_TRACE, "%s returning %s\n", __func__, vfo_str[i].str); return vfo_str[i].str; } } diff --git a/src/rig.c b/src/rig.c index 34f6d5c68..90a73d6a0 100644 --- a/src/rig.c +++ b/src/rig.c @@ -456,6 +456,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) rs->vfo_list |= caps->tx_range_list1[i].vfo; rs->mode_list |= caps->tx_range_list1[i].modes; } + for (i = 0; i < FRQRANGESIZ && !RIG_IS_FRNG_END(caps->rx_range_list2[i]); i++) { rs->vfo_list |= caps->rx_range_list2[i].vfo; @@ -1840,6 +1841,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) else { vfo_t curr_vfo; + if (!caps->set_vfo) { return -RIG_ENTARGET; diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 1dc8aa953..abe597af9 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -900,23 +900,33 @@ void range_print(FILE *fout, const struct freq_range_list range_list[], int rx) char *label_hi = "W"; double low = range_list[i].low_power / 1000.0f; double hi = range_list[i].high_power / 1000.0f; - if (low < 0) { - label_lo = "mW"; - low *= 1000; + + if (low < 0) + { + label_lo = "mW"; + low *= 1000; } - if (low < 0) { - label_lo = "uW"; - low *= 1000; + + if (low < 0) + { + label_lo = "uW"; + low *= 1000; } - if (hi < 0) { - label_hi = "mW"; - hi *= 1000; + + if (hi < 0) + { + label_hi = "mW"; + hi *= 1000; } - if (hi < 0) { - label_hi = "uW"; - hi *= 1000; + + if (hi < 0) + { + label_hi = "uW"; + hi *= 1000; } - fprintf(fout, "\t\tLow power: %g %s, High power: %g %s\n", low, label_lo, hi, label_hi); + + fprintf(fout, "\t\tLow power: %g %s, High power: %g %s\n", low, label_lo, hi, + label_hi); } } } diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 6c568fdb5..df92a4b40 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -716,7 +716,8 @@ static int handle_ts2000(void *arg) int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq); char response[64]; // cppcheck-suppress * - char *fmt = "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; + char *fmt = + "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; if (retval != RIG_OK) {