From 3ca0313fb49de55ee99bf10a8998ad1913e5704b Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Wed, 3 Mar 2021 16:57:03 -0600 Subject: [PATCH] Implement RETURNFUNC in icom.c https://github.com/Hamlib/Hamlib/issues/514 --- rigs/icom/icom.c | 830 +++++++++++++++++++++++------------------------ rigs/icom/icom.h | 2 +- 2 files changed, 416 insertions(+), 416 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 57658d143..429e3865c 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -628,14 +628,14 @@ icom_init(RIG *rig) if (!rig->caps) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } caps = rig->caps; if (!caps->priv) { - return -RIG_ECONF; + RETURNFUNC(-RIG_ECONF); } priv_caps = (struct icom_priv_caps *) caps->priv; @@ -647,7 +647,7 @@ icom_init(RIG *rig) if (!rig->state.priv) { /* whoops! memory shortage! */ - return -RIG_ENOMEM; + RETURNFUNC(-RIG_ENOMEM); } priv = rig->state.priv; @@ -669,7 +669,7 @@ icom_init(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s: done\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -683,7 +683,7 @@ icom_cleanup(RIG *rig) if (!rig) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->state.priv) @@ -693,7 +693,7 @@ icom_cleanup(RIG *rig) rig->state.priv = NULL; - return RIG_OK; + RETURNFUNC(RIG_OK); } /** @@ -725,14 +725,14 @@ int icom_get_usb_echo_off(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: ack_len=%d\n", __func__, ack_len); - if (retval == -RIG_ETIMEOUT) { return retval; } + if (retval == -RIG_ETIMEOUT) { RETURNFUNC(retval); } if (retval == RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n", __func__); rs->rigport.retry = retry_save; - return RIG_OK; + RETURNFUNC(RIG_OK); } else { @@ -746,12 +746,12 @@ int icom_get_usb_echo_off(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo off detected\n", __func__); rs->rigport.retry = retry_save; - return RIG_OK; + RETURNFUNC(RIG_OK); } } rs->rigport.retry = retry_save; - return retval; + RETURNFUNC(retval); } @@ -788,7 +788,7 @@ icom_rig_open(RIG *rig) rig_debug(RIG_DEBUG_WARN, "%s: rig_set_powerstat failed: =%s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } // Now that we're powered up let's try again @@ -797,7 +797,7 @@ icom_rig_open(RIG *rig) if (retval < 0) { rig_debug(RIG_DEBUG_ERR, "%s: Unable to determine USB echo status\n", __func__); - return retval; + RETURNFUNC(retval); } } @@ -828,7 +828,7 @@ icom_rig_open(RIG *rig) icom_get_freq_range(rig); // try get to get rig range capability dyamically #endif - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -858,11 +858,11 @@ icom_rig_close(RIG *rig) rig_debug(RIG_DEBUG_WARN, "%s: rig_set_powerstat failed: =%s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -886,18 +886,18 @@ int icom_set_default_vfo(RIG *rig) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } retval = rig_set_vfo(rig, RIG_VFO_A); // we'll default to Main in this case if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } rig->state.current_vfo = RIG_VFO_MAIN; - return RIG_OK; + RETURNFUNC(RIG_OK); } if (VFO_HAS_MAIN_SUB_ONLY) @@ -927,13 +927,13 @@ int icom_set_default_vfo(RIG *rig) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } rig_debug(RIG_DEBUG_TRACE, "%s: curr_vfo now %s\n", __func__, rig_strvfo(rig->state.current_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } // return true if band is changing from last set_freq @@ -950,7 +950,7 @@ int icom_band_changing(RIG *rig, freq_t test_freq) if (retval != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: rig_get_freq failed??\n", __func__); - return 0; // I guess we need to say no change in this case + RETURNFUNC(0); // I guess we need to say no change in this case } // Make our HF=0, 2M = 1, 70cm = 4, and 23cm=12 @@ -963,11 +963,11 @@ int icom_band_changing(RIG *rig, freq_t test_freq) if (freq1 != freq2) { rig_debug(RIG_DEBUG_TRACE, "%s: Band change detected\n", __func__); - return 1; + RETURNFUNC(1); } rig_debug(RIG_DEBUG_TRACE, "%s: Band change not detected\n", __func__); - return 0; + RETURNFUNC(0); } /* @@ -1006,14 +1006,14 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } retval = rig_get_freq(rig, RIG_VFO_CURR, &curr_freq); if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } freq_len = priv->civ_731_mode ? 4 : 5; @@ -1042,7 +1042,7 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_ERR, "%s: vfo_op XCHG failed: %s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } // Try the command again @@ -1060,10 +1060,10 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_ERR, "%s: 2nd vfo_op XCHG failed: %s\n", __func__, rigerror(retval)); - return retval2; + RETURNFUNC(retval2); } - return retval; + RETURNFUNC(retval); } } } @@ -1072,7 +1072,7 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_ERR, "%s: set freq failed: %s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } } @@ -1080,7 +1080,7 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } if (vfo == RIG_VFO_MAIN) @@ -1115,7 +1115,7 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_strvfo(vfo)); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -1164,7 +1164,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (retval == RIG_OK) // then we're done!! { *freq = from_bcd(&ackbuf[2], (priv->civ_731_mode ? 4 : 5) * 2); - return retval; + RETURNFUNC(retval); } priv->x1cx03cmdfails = 1; @@ -1204,7 +1204,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } - return retval; + RETURNFUNC(retval); } #if 0 @@ -1257,7 +1257,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } - return retval; + RETURNFUNC(retval); } /* @@ -1274,7 +1274,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } - return RIG_OK; + RETURNFUNC(RIG_OK); } if (freq_len != 4 && freq_len != 5) @@ -1284,7 +1284,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } if (freq_len != (priv->civ_731_mode ? 4 : 5)) @@ -1323,7 +1323,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s exit vfo=%s, curr_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts) @@ -1336,7 +1336,7 @@ int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -1347,7 +1347,7 @@ int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (ts_len != 5) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, ts_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } *ts = (shortfreq_t) from_bcd(tsbuf + 2, 4); @@ -1357,7 +1357,7 @@ int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts) *ts *= -1; } - return RIG_OK; + RETURNFUNC(RIG_OK); } // The Icom rigs have only one register for both RIT and Delta TX @@ -1380,7 +1380,7 @@ static int icom_set_it_new(RIG *rig, vfo_t vfo, shortfreq_t ts, int set_xit) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } #if 0 // why is this here? We have another function to turn it on/off @@ -1394,7 +1394,7 @@ static int icom_set_it_new(RIG *rig, vfo_t vfo, shortfreq_t ts, int set_xit) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } } else // some rigs don't have XIT like the 9700 @@ -1413,17 +1413,17 @@ static int icom_set_it_new(RIG *rig, vfo_t vfo, shortfreq_t ts, int set_xit) #endif - return retval; + RETURNFUNC(retval); } int icom_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t ts) { - return icom_set_it_new(rig, vfo, ts, 0); + RETURNFUNC(icom_set_it_new(rig, vfo, ts, 0)); } int icom_set_xit_new(RIG *rig, vfo_t vfo, shortfreq_t ts) { - return icom_set_it_new(rig, vfo, ts, 1); + RETURNFUNC(icom_set_it_new(rig, vfo, ts, 1)); } /* icom_get_dsp_flt @@ -1457,11 +1457,11 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) if (retval != RIG_OK || rfwidth.i >= RTTY_FIL_NB) { - return 0; /* use default */ + RETURNFUNC(0); /* use default */ } else { - return rtty_fil[rfwidth.i]; + RETURNFUNC(rtty_fil[rfwidth.i]); } } } @@ -1473,7 +1473,7 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) if (priv->no_1a_03_cmd) { - return 0; + RETURNFUNC(0); } retval = icom_transaction(rig, C_CTL_MEM, fw_sub_cmd, 0, 0, @@ -1482,14 +1482,14 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) if (-RIG_ERJCTED == retval) { priv->no_1a_03_cmd = -1; /* do not keep asking */ - return 0; + RETURNFUNC(0); } if (retval != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: protocol error (%#.2x), " "len=%d\n", __func__, resbuf[0], res_len); - return 0; /* use default */ + RETURNFUNC(0); /* use default */ } if (res_len == 3 && resbuf[0] == C_CTL_MEM) @@ -1499,17 +1499,17 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) if (mode & RIG_MODE_AM) { - return (i + 1) * 200; /* Ic_7800 */ + RETURNFUNC((i + 1) * 200); /* Ic_7800 */ } else if (mode & (RIG_MODE_CW | RIG_MODE_USB | RIG_MODE_LSB | RIG_MODE_RTTY | RIG_MODE_RTTYR)) { - return i < 10 ? (i + 1) * 50 : (i - 4) * 100; + RETURNFUNC(i < 10 ? (i + 1) * 50 : (i - 4) * 100); } } - return 0; + RETURNFUNC(0); } int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) @@ -1524,7 +1524,7 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) if (RIG_PASSBAND_NOCHANGE == width) { - return RIG_OK; + RETURNFUNC(RIG_OK); } if (width == RIG_PASSBAND_NORMAL) @@ -1545,12 +1545,12 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) if (rtty_fil[i] == width) { rfwidth.i = i; - return rig_set_ext_parm(rig, TOK_RTTY_FLTR, rfwidth); + RETURNFUNC(rig_set_ext_parm(rig, TOK_RTTY_FLTR, rfwidth)); } } /* not found */ - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } @@ -1571,7 +1571,7 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) } else { - return RIG_OK; + RETURNFUNC(RIG_OK); } to_bcd(&flt_ext, flt_idx, 2); @@ -1583,17 +1583,17 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) { rig_debug(RIG_DEBUG_ERR, "%s: protocol error (%#.2x), " "len=%d\n", __func__, ackbuf[0], ack_len); - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: command not supported ? (%#.2x), " "len=%d\n", __func__, ackbuf[0], ack_len); - return retval; + RETURNFUNC(retval); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -1708,7 +1708,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, } } - return retval; + RETURNFUNC(retval); } /* @@ -1748,7 +1748,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err < 0) { rig_debug(RIG_DEBUG_ERR, "%s: Error on rig2icom err=%d\n", __func__, err); - return err; + RETURNFUNC(err); } rig_debug(RIG_DEBUG_VERBOSE, "%s: icmode=%d, icmode_ext=%d\n", __func__, icmode, @@ -1773,14 +1773,14 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* DSP filter setting ($1A$03), but not supported by every rig, @@ -1792,7 +1792,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icom_set_dsp_flt(rig, mode, width); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -1815,7 +1815,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } switch (*mode) @@ -1835,7 +1835,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, { rig_debug(RIG_DEBUG_ERR, "%s: protocol error (%#.2x), len=%d\n", __func__, databuf[0], data_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* @@ -1855,7 +1855,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, ignore it */ rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, data_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig_debug(RIG_DEBUG_VERBOSE, "%s databuf[2]=%d, mode=%d\n", __func__, @@ -1890,7 +1890,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, break; } - return retval; + RETURNFUNC(retval); } /* @@ -1931,7 +1931,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -1944,7 +1944,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, mode_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } if (priv_caps->i2r_mode != NULL) /* call priv code if defined */ @@ -1970,10 +1970,10 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) (rig->caps->rig_model == RIG_MODEL_IC706MKIIG) || (rig->caps->rig_model == RIG_MODEL_ICR30)) { - return RIG_OK; + RETURNFUNC(RIG_OK); } - /* Most rigs return 1-wide, 2-normal,3-narrow + /* Most rigs RETURNFUNC(1-wide, 2-normal,3-narrow * For DSP rigs these are presets, can be programmed for 30 - 41 bandwidths, depending on mode. * Lets check for dsp filters */ @@ -1991,7 +1991,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) rig_strvfo(vfo), rig_strrmode(*mode)); } - return RIG_OK; + RETURNFUNC(RIG_OK); } #ifdef XXREMOVEDXX @@ -2016,17 +2016,17 @@ int icom_get_vfo(RIG *rig, vfo_t *vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 3) { rig_debug(RIG_DEBUG_ERR, "%s wrong frame len=%d\n", __func__, ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } *vfo = ackbuf[2] == 0 ? RIG_VFO_A : RIG_VFO_B; - return RIG_OK; + RETURNFUNC(RIG_OK); } #endif @@ -2047,7 +2047,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: Asking for currVFO, currVFO=%s\n", __func__, rig_strvfo(rig->state.current_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } if (vfo == RIG_VFO_MAIN && VFO_HAS_A_B_ONLY) @@ -2092,7 +2092,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_ERR, "%s: Rig does not have VFO Main/Sub?\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (vfo != rig->state.current_vfo) @@ -2145,18 +2145,18 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig->state.current_vfo = vfo; - return RIG_OK; + RETURNFUNC(RIG_OK); case RIG_VFO_MEM: retval = icom_transaction(rig, C_SET_MEM, -1, NULL, 0, @@ -2164,18 +2164,18 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig->state.current_vfo = vfo; - return RIG_OK; + RETURNFUNC(RIG_OK); case RIG_VFO_MAIN_A: // we need to select Main before setting VFO case RIG_VFO_MAIN_B: @@ -2185,14 +2185,14 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } icvfo = vfo == RIG_VFO_MAIN_A ? S_VFOA : S_VFOB; @@ -2207,14 +2207,14 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } icvfo = vfo == RIG_VFO_SUB_A ? S_VFOA : S_VFOB; @@ -2224,7 +2224,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } rig_debug(RIG_DEBUG_TRACE, "%s: debug#3\n", __func__); @@ -2234,20 +2234,20 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig->state.current_vfo = vfo; rig_debug(RIG_DEBUG_TRACE, "%s: debug#5 curr_vfo=%s\n", __func__, rig_strvfo(rig->state.current_vfo)); - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) @@ -2259,7 +2259,7 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) unsigned char ackbuf[MAXFRAMELEN]; int acklen = 0; - if (!(par->submod & SC_MOD_WR)) { return -RIG_EINVAL; } + if (!(par->submod & SC_MOD_WR)) { RETURNFUNC(-RIG_EINVAL); } if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) { @@ -2313,8 +2313,8 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) } cmdlen += par->datlen; - return icom_transaction(rig, par->command, par->subcmd, cmdbuf, cmdlen, ackbuf, - &acklen); + RETURNFUNC(icom_transaction(rig, par->command, par->subcmd, cmdbuf, cmdlen, ackbuf, + &acklen)); } int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) @@ -2327,7 +2327,7 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) int reslen = sizeof(resbuf); int retval; - if (!(par->submod & SC_MOD_RD)) { return -RIG_EINVAL; } + if (!(par->submod & SC_MOD_RD)) { RETURNFUNC(-RIG_EINVAL); } if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) { @@ -2342,7 +2342,7 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } switch (par->dattyp) @@ -2364,7 +2364,7 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) case CMD_DAT_STR: if (strlen(val->s) < reslen) { - return -RIG_EINTERNAL; + RETURNFUNC(-RIG_EINTERNAL); } memcpy(val->s, resbuf, reslen); @@ -2374,7 +2374,7 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) case CMD_DAT_BUF: if (reslen > val->b.l) { - return -RIG_EINTERNAL; + RETURNFUNC(-RIG_EINTERNAL); } memcpy(val->b.d, resbuf, reslen); @@ -2406,7 +2406,7 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) break; } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -2432,7 +2432,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && extcmds[i].id.s == level) { - return icom_set_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], val); + RETURNFUNC(icom_set_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], val)); } } @@ -2542,7 +2542,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { rig_debug(RIG_DEBUG_ERR, "%s: unsupported preamp set_level %ddB", __func__, val.i); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } lvlbuf[0] = i + 1; /* 1=P.AMP1, 2=P.AMP2 */ @@ -2663,7 +2663,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (!found) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } else @@ -2690,7 +2690,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported LEVEL_AGC %d", __func__, val.i); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } @@ -2744,7 +2744,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported set_level %s", __func__, rig_strlevel(level)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } retval = icom_transaction(rig, lvl_cn, lvl_sc, lvlbuf, lvl_len, ackbuf, @@ -2752,17 +2752,17 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -2793,7 +2793,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && extcmds[i].id.s == level) { - return icom_get_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], val); + RETURNFUNC(icom_get_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], val)); } } @@ -2990,7 +2990,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_level %s", __func__, rig_strlevel(level)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* use lvl2buf and lvl2_len for 'set mode' subcommand */ @@ -2999,7 +2999,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -3020,7 +3020,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, lvlbuf[0], lvl_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* @@ -3060,7 +3060,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_ERR, "%s: unexpected AGC 0x%02x", __func__, icom_val); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } } else @@ -3086,7 +3086,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) default: rig_debug(RIG_DEBUG_ERR, "%s: unexpected AGC 0x%02x", __func__, icom_val); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } } @@ -3203,7 +3203,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_ERR, "%s: unsupported preamp get_level %ddB", __func__, icom_val); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } val->i = rs->preamp[icom_val - 1]; @@ -3251,7 +3251,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_TRACE, "%s: %d %d %d %f\n", __func__, lvl_len, icom_val, val->i, val->f); - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val) @@ -3271,12 +3271,12 @@ int icom_set_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t val) } else if (cfp[i].token == token) { - return icom_set_ext_cmd(rig, vfo, token, val); + RETURNFUNC(icom_set_ext_cmd(rig, vfo, token, val)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) @@ -3296,12 +3296,12 @@ int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, val); + RETURNFUNC(icom_get_ext_cmd(rig, vfo, token, val)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) @@ -3322,12 +3322,12 @@ int icom_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) else if (cfp[i].token == token) { value_t value = { .i = status }; - return icom_set_ext_cmd(rig, vfo, token, value); + RETURNFUNC(icom_set_ext_cmd(rig, vfo, token, value)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) @@ -3355,12 +3355,12 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) *status = value.i; } - return result; + RETURNFUNC(result); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_set_ext_parm(RIG *rig, token_t token, value_t val) @@ -3380,12 +3380,12 @@ int icom_set_ext_parm(RIG *rig, token_t token, value_t val) } else if (cfp[i].token == token) { - return icom_set_ext_cmd(rig, RIG_VFO_NONE, token, val); + RETURNFUNC(icom_set_ext_cmd(rig, RIG_VFO_NONE, token, val)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) @@ -3405,12 +3405,12 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, RIG_VFO_NONE, token, val); + RETURNFUNC(icom_get_ext_cmd(rig, RIG_VFO_NONE, token, val)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) @@ -3436,16 +3436,16 @@ int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_TOKEN && cmd[i].id.t == token) { - return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); + RETURNFUNC(icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val) @@ -3471,16 +3471,16 @@ int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val) } else if (cmd->cmdparamtype == CMD_PARAM_TYPE_TOKEN && cmd[i].id.t == token) { - return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); + RETURNFUNC(icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val)); } else { i++; } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* @@ -3518,10 +3518,10 @@ int icom_set_conf(RIG *rig, token_t token, const char *val) break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3550,10 +3550,10 @@ int icom_get_conf(RIG *rig, token_t token, char *val) case TOK_NOXCHG: sprintf(val, "%d", priv->no_xchg); break; - default: return -RIG_EINVAL; + default: RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -3574,17 +3574,17 @@ int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3602,7 +3602,7 @@ int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -3614,12 +3614,12 @@ int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, ptt_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } *ptt = pttbuf[2] == 1 ? RIG_PTT_ON : RIG_PTT_OFF; - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3637,7 +3637,7 @@ int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -3649,7 +3649,7 @@ int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, dcd_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* @@ -3658,7 +3658,7 @@ int icom_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) *dcd = dcdbuf[2] == 1 ? RIG_DCD_ON : RIG_DCD_OFF; - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3690,7 +3690,7 @@ int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported shift %d", __func__, rptr_shift); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } retval = icom_transaction(rig, C_CTL_SPLT, rptr_sc, NULL, 0, @@ -3698,17 +3698,17 @@ int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -3729,7 +3729,7 @@ int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -3741,7 +3741,7 @@ int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, rptr_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } switch (rptrbuf[1]) @@ -3768,10 +3768,10 @@ int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported shift %d", __func__, rptrbuf[1]); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3799,17 +3799,17 @@ int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -3832,7 +3832,7 @@ int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -3844,7 +3844,7 @@ int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, buf_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* @@ -3852,7 +3852,7 @@ int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) */ *rptr_offs = from_bcd(offsbuf + 1, buf_len * 2) * 100; - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3936,10 +3936,10 @@ int icom_get_split_vfos(RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo) else { rig_debug(RIG_DEBUG_ERR, "%s invalid vfo setup?\n", __func__); - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -3985,7 +3985,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) { rig_debug(RIG_DEBUG_ERR, "%s: set_default_vfo failed: %s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } } @@ -3996,7 +3996,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) { rig_debug(RIG_DEBUG_ERR, "%s: set_default_vfo failed: %s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } #endif @@ -4033,7 +4033,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (retval == RIG_OK) // then we're done!! { - return retval; + RETURNFUNC(retval); } } @@ -4047,20 +4047,20 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_set_freq(rig, RIG_VFO_CURR, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } - return retval; + RETURNFUNC(retval); } /* In the case of rigs with an A/B VFO arrangement we assume the @@ -4077,20 +4077,20 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } } if (RIG_OK != (retval = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { - return retval; + RETURNFUNC(retval); } rig_debug(RIG_DEBUG_TRACE, "%s: rx_vfo=%s, tx_vfo=%s\n", __func__, @@ -4098,12 +4098,12 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (RIG_OK != (retval = rig_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_freq(rig, tx_vfo, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_MAIN_SUB_A_B_ONLY) @@ -4115,12 +4115,12 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } } else if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_A_B_ONLY && priv->split_on) @@ -4131,7 +4131,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } } @@ -4145,7 +4145,7 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) priv->sub_freq = tx_freq; } - return retval; + RETURNFUNC(retval); } /* @@ -4178,7 +4178,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ptt) @@ -4186,7 +4186,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) rig_debug(RIG_DEBUG_TRACE, "%s: ptt is on so returning last known freq\n", __func__); *tx_freq = priv->vfob_freq; - return RIG_OK; + RETURNFUNC(RIG_OK); } } @@ -4227,7 +4227,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (retval == RIG_OK) // then we're done!! { *tx_freq = from_bcd(ackbuf + 2, (priv->civ_731_mode ? 4 : 5) * 2); - return retval; + RETURNFUNC(retval); } priv->x25cmdfails = 1; @@ -4245,7 +4245,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (retval == RIG_OK) // then we're done!! { *tx_freq = from_bcd(&ackbuf[2], (priv->civ_731_mode ? 4 : 5) * 2); - return retval; + RETURNFUNC(retval); } priv->x1cx03cmdfails = 1; @@ -4259,22 +4259,22 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) { if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_get_freq(rig, RIG_VFO_CURR, tx_freq))) { - return retval; + RETURNFUNC(retval); } priv->vfob_freq = *tx_freq; if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } - return retval; + RETURNFUNC(retval); } /* In the case of rigs with an A/B VFO arrangement we assume the @@ -4291,30 +4291,30 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } } if (RIG_OK != (retval = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_get_freq(rig, tx_vfo, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_MAIN_SUB_A_B_ONLY) @@ -4325,12 +4325,12 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } } else if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_A_B_ONLY && priv->split_on) @@ -4341,12 +4341,12 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } } priv->vfob_freq = *tx_freq; - return retval; + RETURNFUNC(retval); } /* @@ -4373,21 +4373,21 @@ int icom_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, { if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->set_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } - return retval; + RETURNFUNC(retval); } /* In the case of rigs with an A/B VFO arrangement we assume the @@ -4404,36 +4404,36 @@ int icom_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } } if (RIG_OK != (retval = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->set_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_A_B_ONLY && priv->split_on) @@ -4444,11 +4444,11 @@ int icom_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } } - return retval; + RETURNFUNC(retval); } /* @@ -4476,21 +4476,21 @@ int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, { if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->get_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } - return retval; + RETURNFUNC(retval); } /* In the case of rigs with an A/B VFO arrangement we assume the @@ -4507,36 +4507,36 @@ int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } } if (RIG_OK != (retval = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->get_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_A_B_ONLY && priv->split_on) @@ -4547,11 +4547,11 @@ int icom_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } } - return retval; + RETURNFUNC(retval); } /* @@ -4588,26 +4588,26 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, { if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_freq(rig, RIG_VFO_CURR, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->set_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } - return retval; + RETURNFUNC(retval); } /* In the case of rigs with an A/B VFO arrangement we assume the @@ -4624,14 +4624,14 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } } @@ -4641,7 +4641,7 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, if (RIG_OK != (retval = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { - return retval; + RETURNFUNC(retval); } // WSJT-X calls this function before setting split @@ -4668,23 +4668,23 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, if (RIG_OK != (retval = rig_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_freq(rig, RIG_VFO_CURR, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->set_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_A_B && priv->split_on) @@ -4695,11 +4695,11 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq, icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } } - return retval; + RETURNFUNC(retval); } /* @@ -4727,26 +4727,26 @@ int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq, { if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_get_freq(rig, RIG_VFO_CURR, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->get_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG))) { - return retval; + RETURNFUNC(retval); } - return retval; + RETURNFUNC(retval); } /* In the case of rigs with an A/B VFO arrangement we assume the @@ -4763,41 +4763,41 @@ int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq, icom_transaction(rig, C_CTL_SPLT, S_SPLT_OFF, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } } if (RIG_OK != (retval = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_get_freq(rig, RIG_VFO_CURR, tx_freq))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig->caps->get_mode(rig, RIG_VFO_CURR, tx_mode, tx_width))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = rig_set_vfo(rig, rx_vfo))) { - return retval; + RETURNFUNC(retval); } if (VFO_HAS_A_B_ONLY && priv->split_on) @@ -4808,11 +4808,11 @@ int icom_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *tx_freq, icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } } - return retval; + RETURNFUNC(retval); } @@ -4867,7 +4867,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) __func__); // we'll return OK anyways as this is a split mode // and gpredict wants to see the OK response here - return RIG_OK; // we'll return OK anyways as this is a split mode + RETURNFUNC(RIG_OK); // we'll return OK anyways as this is a split mode } } @@ -4956,12 +4956,12 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) // make sure we're on Main/VFOA if (RIG_OK != (retval = icom_set_vfo(rig, RIG_VFO_MAIN))) { - return retval; + RETURNFUNC(retval); } if (RIG_OK != (retval = icom_set_vfo(rig, RIG_VFO_A))) { - return retval; + RETURNFUNC(retval); } #endif @@ -4976,7 +4976,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (RIG_OK != (retval = icom_set_vfo(rig, tx_vfo))) { - return retval; + RETURNFUNC(retval); } #endif @@ -4991,27 +4991,27 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) { rig_debug(RIG_DEBUG_ERR, "%s: split on vfo=%s not known\n", __func__, rig_strvfo(vfo)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } break; default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported split %d", __func__, split); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (RIG_OK != (retval = icom_transaction(rig, C_CTL_SPLT, split_sc, NULL, 0, ackbuf, &ack_len))) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } priv->split_on = RIG_SPLIT_ON == split; @@ -5034,7 +5034,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) __func__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo), rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo), split); - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5057,7 +5057,7 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) if (retval != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: CTL_SPLT failed?\n", __func__); - return retval; + RETURNFUNC(retval); } /* @@ -5069,7 +5069,7 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, split_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } switch (splitbuf[1]) @@ -5092,7 +5092,7 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported split %d", __func__, splitbuf[1]); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } if (rig->caps->has_get_func & RIG_FUNC_SATMODE) @@ -5110,7 +5110,7 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s rx_vfo=%s tx_vfo=%s split=%d\n", __func__, rig_strvfo(vfo), rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo), *split); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -5132,7 +5132,7 @@ int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, !rig_has_vfo_op(rig, RIG_OP_XCHG)) { *split = rig->state.cache.split; // we set this but still return ENAVAIL - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG); @@ -5143,7 +5143,7 @@ int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, /* get it back to normal */ retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG); - if (retval != RIG_OK) { return retval; } + if (retval != RIG_OK) { RETURNFUNC(retval); } } else if (retval == -RIG_ERJCTED) { @@ -5152,10 +5152,10 @@ int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, else { /* this is really an error! */ - return retval; + RETURNFUNC(retval); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5183,24 +5183,24 @@ int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (i >= TSLSTSIZ) { - return -RIG_EINVAL; /* not found, unsupported */ + RETURNFUNC(-RIG_EINVAL); /* not found, unsupported */ } retval = icom_transaction(rig, C_SET_TS, ts_sc, NULL, 0, ackbuf, &ack_len); if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5221,7 +5221,7 @@ int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* @@ -5232,7 +5232,7 @@ int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (ts_len != 1) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, ts_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } for (i = 0; i < TSLSTSIZ; i++) @@ -5246,10 +5246,10 @@ int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (i >= TSLSTSIZ) { - return -RIG_EPROTO; /* not found, unsupported */ + RETURNFUNC(-RIG_EPROTO); /* not found, unsupported */ } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -5277,7 +5277,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_FUNC && extcmds[i].id.s == func) { - return icom_set_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], value); + RETURNFUNC(icom_set_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], value)); } } @@ -5474,7 +5474,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported set_func %s", __func__, rig_strfunc(func)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } retval = icom_transaction(rig, fct_cn, fct_sc, fctbuf, fct_len, ackbuf, @@ -5482,13 +5482,13 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (acklen != 1) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, acklen); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } // turning satmode on/off can change the tx/rx vfos @@ -5501,7 +5501,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) // update split status retval = icom_get_split_vfo(rig, RIG_VFO_CURR, &split, &tx_vfo); - if (retval != RIG_OK) { return retval; } + if (retval != RIG_OK) { RETURNFUNC(retval); } priv->tx_vfo = RIG_VFO_A; @@ -5515,7 +5515,7 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5550,7 +5550,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) *status = value.i; } - return result; + RETURNFUNC(result); } } @@ -5682,21 +5682,21 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_func %s\n", __func__, rig_strfunc(func)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } retval = icom_transaction(rig, fct_cn, fct_sc, NULL, 0, ackbuf, &ack_len); if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 3) { rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__, ack_len); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } if (func != RIG_FUNC_FBKIN) @@ -5708,7 +5708,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) *status = ackbuf[2] == 2 ? 1 : 0; } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5733,7 +5733,7 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) { if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_PARM && extcmds[i].id.s == parm) { - return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&extcmds[i], val); + RETURNFUNC(icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&extcmds[i], val)); } } @@ -5760,16 +5760,16 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported RIG_PARM_ANN %d\n", __func__, val.i); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return icom_set_raw(rig, C_CTL_ANN, ann_mode, 0, NULL, 0, 0); + RETURNFUNC(icom_set_raw(rig, C_CTL_ANN, ann_mode, 0, NULL, 0, 0)); } default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported set_parm %s\n", __func__, rig_strparm(parm)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } @@ -5795,7 +5795,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val) { if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { - return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); + RETURNFUNC(icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val)); } } @@ -5804,10 +5804,10 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported get_parm %s", __func__, rig_strparm(parm)); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5839,7 +5839,7 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if (caps->ctcss_list[i] != tone) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } @@ -5853,17 +5853,17 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5885,7 +5885,7 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* cn,sc,data*3 */ @@ -5893,7 +5893,7 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, tonebuf[0], tone_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } tone_len -= 2; @@ -5901,7 +5901,7 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) if (!caps->ctcss_list) { - return RIG_OK; + RETURNFUNC(RIG_OK); } /* check this tone exists. That's better than nothing. */ @@ -5909,12 +5909,12 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) { if (caps->ctcss_list[i] == *tone) { - return RIG_OK; + RETURNFUNC(RIG_OK); } } rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%#.2x)\n", __func__, tonebuf[2]); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } /* @@ -5941,7 +5941,7 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) if (caps->ctcss_list[i] != tone) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* Sent as frequency in tenth of Hz */ @@ -5954,17 +5954,17 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -5986,14 +5986,14 @@ int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (tone_len != 5) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, tonebuf[0], tone_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } tone_len -= 2; @@ -6004,12 +6004,12 @@ int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone) { if (caps->ctcss_list[i] == *tone) { - return RIG_OK; + RETURNFUNC(RIG_OK); } } rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%#.2x)\n", __func__, tonebuf[2]); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } /* @@ -6036,7 +6036,7 @@ int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) if (caps->dcs_list[i] != code) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* DCS Polarity ignored, by setting code_len to 3 it's foretval to 0 (= Tx:norm, Rx:norm). */ @@ -6048,17 +6048,17 @@ int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6080,7 +6080,7 @@ int icom_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* cn,sc,data*3 */ @@ -6088,7 +6088,7 @@ int icom_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, codebuf[0], code_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* buf is cn,sc, polarity, code_lo, code_hi, so code bytes start at 3, len is 2 @@ -6103,12 +6103,12 @@ int icom_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code) { if (caps->dcs_list[i] == *code) { - return RIG_OK; + RETURNFUNC(RIG_OK); } } rig_debug(RIG_DEBUG_ERR, "%s: DTCS NG (%#.2x)\n", __func__, codebuf[2]); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } /* @@ -6135,7 +6135,7 @@ int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) if (caps->dcs_list[i] != code) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } /* DCS Polarity ignored, by setting code_len to 3 it's forced to 0 (= Tx:norm, Rx:norm). */ @@ -6147,17 +6147,17 @@ int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6179,7 +6179,7 @@ int icom_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* cn,sc,data*3 */ @@ -6187,7 +6187,7 @@ int icom_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, codebuf[0], code_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } /* buf is cn,sc, polarity, code_lo, code_hi, so code bytes start at 3, len is 2 @@ -6202,12 +6202,12 @@ int icom_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code) { if (caps->dcs_list[i] == *code) { - return RIG_OK; + RETURNFUNC(RIG_OK); } } rig_debug(RIG_DEBUG_ERR, "%s: DTCS NG (%#.2x)\n", __func__, codebuf[2]); - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } /* @@ -6286,7 +6286,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) if (retval == RIG_OK) { - return retval; + RETURNFUNC(retval); } else { @@ -6310,17 +6310,17 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) { rig_debug(RIG_DEBUG_TRACE, "%s: retval != RIG_OK, =%s\n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } if (status == RIG_POWER_OFF && (ack_len != 1 || ackbuf[0] != ACK)) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6347,7 +6347,7 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } *status = ((ack_len == 6) && (ackbuf[0] == C_CTL_MEM)) ? @@ -6360,20 +6360,20 @@ int icom_get_powerstat(RIG *rig, powerstat_t *status) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } *status = ackbuf[1] == S_PWR_ON ? RIG_POWER_ON : RIG_POWER_OFF; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -6397,17 +6397,17 @@ int icom_set_mem(RIG *rig, vfo_t vfo, int ch) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6427,17 +6427,17 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6460,12 +6460,12 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) // query the antennas once and find out how many we have if (ant >= rig_idx2setting(priv_caps->ant_count)) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (ant > RIG_ANT_4) { - return -RIG_EDOM; + RETURNFUNC(-RIG_EDOM); } switch (ant) @@ -6488,7 +6488,7 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported ant %#x", __func__, ant); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } @@ -6503,7 +6503,7 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) { rig_debug(RIG_DEBUG_ERR, "%s: rig_get_ant error: %s \n", __func__, rigerror(retval)); - return retval; + RETURNFUNC(retval); } } @@ -6513,7 +6513,7 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (option.i != 0 && option.i != 1) { rig_debug(RIG_DEBUG_ERR, "%s: option.i != 0 or 1, ==%d?\n", __func__, option.i); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } antopt_len = 1; @@ -6525,7 +6525,7 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } antopt_len = 0; @@ -6556,17 +6556,17 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6594,7 +6594,7 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, { rig_debug(RIG_DEBUG_ERR, "%s: ant index=%u > ant_count=%d\n", __func__, ant, priv_caps->ant_count); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } } @@ -6615,7 +6615,7 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, if (retval == RIG_OK) { option->i = ackbuf[4]; - return RIG_OK; + RETURNFUNC(RIG_OK); } } else @@ -6624,12 +6624,12 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, "%s: asking for non-current antenna and ant_count==0?\n", __func__); rig_debug(RIG_DEBUG_ERR, "%s: need to implement ant control for this rig?\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } // ack_len should be either 2 or 3 @@ -6643,7 +6643,7 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d, ant=%d\n", __func__, ackbuf[0], ack_len, ackbuf[1]); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig_debug(RIG_DEBUG_ERR, "%s: ackbuf= 0x%02x 0x%02x 0x%02x\n", __func__, @@ -6658,7 +6658,7 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, option->i = ackbuf[2]; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -6693,7 +6693,7 @@ int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } break; @@ -6728,7 +6728,7 @@ int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported mem/vfo op %#x", __func__, op); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } retval = @@ -6736,7 +6736,7 @@ int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) @@ -6747,10 +6747,10 @@ int icom_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) ackbuf[0], ack_len); } - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6778,7 +6778,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } /* Looks like all the IC-R* have this command, @@ -6801,7 +6801,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } scan_sc = S_SCAN_START; @@ -6815,14 +6815,14 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } retval = rig_set_vfo(rig, RIG_VFO_VFO); if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } scan_sc = S_SCAN_START; @@ -6834,7 +6834,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported scan %#x", __func__, scan); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } retval = icom_transaction(rig, scan_cn, scan_sc, scanbuf, scan_len, @@ -6842,17 +6842,17 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6880,17 +6880,17 @@ int icom_send_morse(RIG *rig, vfo_t vfo, const char *msg) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -6912,17 +6912,17 @@ int icom_stop_morse(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, @@ -6943,7 +6943,7 @@ int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, break; } - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, @@ -6963,7 +6963,7 @@ int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, if (mwpower > 100000) { - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } switch (rig_id) @@ -6973,7 +6973,7 @@ int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, break; } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -7006,7 +7006,7 @@ int icom_decode_event(RIG *rig) if (frm_len < 1) { - return 0; + RETURNFUNC(0); } switch (buf[frm_len - 1]) @@ -7014,7 +7014,7 @@ int icom_decode_event(RIG *rig) case COL: rig_debug(RIG_DEBUG_VERBOSE, "%s: saw a collision\n", __func__); /* Collision */ - return -RIG_BUSBUSY; + RETURNFUNC(-RIG_BUSBUSY); case FI: /* Ok, normal frame */ @@ -7023,7 +7023,7 @@ int icom_decode_event(RIG *rig) default: /* Timeout after reading at least one character */ /* Problem on ci-v bus? */ - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } if (buf[3] != BCASTID && buf[3] != priv->re_civ_addr) @@ -7052,12 +7052,12 @@ int icom_decode_event(RIG *rig) { freq_t freq; freq = from_bcd(buf + 5, (priv->civ_731_mode ? 4 : 5) * 2); - return rig->callbacks.freq_event(rig, RIG_VFO_CURR, freq, - rig->callbacks.freq_arg); + RETURNFUNC(rig->callbacks.freq_event(rig, RIG_VFO_CURR, freq, + rig->callbacks.freq_arg)); } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } break; @@ -7066,13 +7066,13 @@ int icom_decode_event(RIG *rig) if (rig->callbacks.mode_event) { icom2rig_mode(rig, buf[5], buf[6], &mode, &width); - return rig->callbacks.mode_event(rig, RIG_VFO_CURR, + RETURNFUNC(rig->callbacks.mode_event(rig, RIG_VFO_CURR, mode, width, - rig->callbacks.mode_arg); + rig->callbacks.mode_arg)); } else { - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } break; @@ -7080,10 +7080,10 @@ int icom_decode_event(RIG *rig) default: rig_debug(RIG_DEBUG_VERBOSE, "%s: transceive cmd unsupported %#2.2x\n", __func__, buf[4]); - return -RIG_ENIMPL; + RETURNFUNC(-RIG_ENIMPL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, @@ -7100,7 +7100,7 @@ int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, { if (subcmdbuf == NULL) { - return -RIG_EINTERNAL; + RETURNFUNC(-RIG_EINTERNAL); } memcpy(cmdbuf, subcmdbuf, subcmdbuflen); @@ -7117,17 +7117,17 @@ int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (acklen != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], acklen); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_get_raw_buf(RIG *rig, int cmd, int subcmd, int subcmdbuflen, @@ -7147,7 +7147,7 @@ int icom_get_raw_buf(RIG *rig, int cmd, int subcmd, int subcmdbuflen, if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } cmdhead += (subcmd == -1) ? 1 : 2; @@ -7157,20 +7157,20 @@ int icom_get_raw_buf(RIG *rig, int cmd, int subcmd, int subcmdbuflen, { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], acklen); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } rig_debug(RIG_DEBUG_TRACE, "%s: %d\n", __func__, acklen); if (*reslen < acklen || res == NULL) { - return -RIG_EINTERNAL; + RETURNFUNC(-RIG_EINTERNAL); } memcpy(res, ackbuf + cmdhead, acklen); *reslen = acklen; - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_get_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, @@ -7188,14 +7188,14 @@ int icom_get_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } * val = from_bcd_be(resbuf, reslen * 2); rig_debug(RIG_DEBUG_TRACE, "%s: %d %d\n", __func__, reslen, *val); - return RIG_OK; + RETURNFUNC(RIG_OK); } int icom_set_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, @@ -7215,8 +7215,8 @@ int icom_set_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, icom_val = val.i; } - return icom_set_raw(rig, cmd, subcmd, subcmdbuflen, subcmdbuf, val_bytes, - icom_val); + RETURNFUNC(icom_set_raw(rig, cmd, subcmd, subcmdbuflen, subcmdbuf, val_bytes, + icom_val)); } int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, @@ -7233,7 +7233,7 @@ int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (RIG_LEVEL_IS_FLOAT(level)) @@ -7245,7 +7245,7 @@ int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd, val->i = icom_val; } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -7267,17 +7267,17 @@ int icom_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } if (ack_len != 1 || ackbuf[0] != ACK) { rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, ackbuf[0], ack_len); - return -RIG_ERJCTED; + RETURNFUNC(-RIG_ERJCTED); } - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -7306,7 +7306,7 @@ int icom_get_freq_range(RIG *rig) { rig_debug(RIG_DEBUG_TRACE, "%s: rig does not have 0x1e command so skipping this check\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } rig_debug(RIG_DEBUG_TRACE, "%s: ackbuf[0]=%02x, ackbuf[1]=%02x\n", __func__, @@ -7351,7 +7351,7 @@ int icom_get_freq_range(RIG *rig) (double)rig->caps->rx_range_list1[i].endf); } - return RIG_OK; + RETURNFUNC(RIG_OK); } // Sets rig vfo && rig->state.current_vfo to default VFOA, or current vfo, or the vfo requested @@ -7409,7 +7409,7 @@ static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } } } @@ -7419,7 +7419,7 @@ static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo) rig->state.current_vfo = vfo; - return RIG_OK; + RETURNFUNC(RIG_OK); } /* @@ -7441,12 +7441,12 @@ DECLARE_PROBERIG_BACKEND(icom) if (!port) { - return RIG_MODEL_NONE; + RETURNFUNC(RIG_MODEL_NONE); } if (port->type.rig != RIG_PORT_SERIAL) { - return RIG_MODEL_NONE; + RETURNFUNC(RIG_MODEL_NONE); } port->write_delay = port->post_write_delay = 0; @@ -7465,7 +7465,7 @@ DECLARE_PROBERIG_BACKEND(icom) if (retval != RIG_OK) { - return RIG_MODEL_NONE; + RETURNFUNC(RIG_MODEL_NONE); } /* @@ -7504,7 +7504,7 @@ DECLARE_PROBERIG_BACKEND(icom) * is this a CI-V device? */ close(port->fd); - return RIG_MODEL_NONE; + RETURNFUNC(RIG_MODEL_NONE); } else if (buf[4] == NAK) { @@ -7615,11 +7615,11 @@ DECLARE_PROBERIG_BACKEND(icom) */ if (model != RIG_MODEL_NONE) { - return model; + RETURNFUNC(model); } } - return model; + RETURNFUNC(model); } /* @@ -7713,5 +7713,5 @@ DECLARE_INITRIG_BACKEND(icom) rig_register(&x108g_caps); - return RIG_OK; + RETURNFUNC(RIG_OK); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index f7ac01fe8..56d993d42 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include #endif -#define BACKEND_VER "20210223" +#define BACKEND_VER "20210303" /* * defines used by comp_cal_str in rig.c