From 0790f4d72e4947a9ba5c7c4d8747f7eecb6d0cd9 Mon Sep 17 00:00:00 2001 From: George Baltz N3GB Date: Wed, 26 Jun 2024 16:44:04 -0400 Subject: [PATCH] Fix ENTERFUNC/RETURNFUNC imbalances found by repaired func_chk --- rigs/dummy/dummy.c | 2 +- rigs/icom/icom.c | 22 +++++++++++----------- rigs/kenwood/ts2000.c | 2 +- rigs/kenwood/ts480.c | 2 +- rigs/kenwood/ts590.c | 4 ++-- rigs/motorola/micom.c | 2 +- rigs/yaesu/newcat.c | 18 +++++++++--------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 3c2d8c662..044d7c972 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -435,7 +435,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (rig == NULL) { rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL!!!\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } priv = (struct dummy_priv_data *)STATE(rig)->priv; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index f3fe13e9a..eea6eae27 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2134,12 +2134,12 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (priv->no_1a_03_cmd == ENUM_1A_03_UNK) { priv->no_1a_03_cmd = ENUM_1A_03_NO; /* do not keep asking */ - return (RIG_OK); + RETURNFUNC(RIG_OK); } else { rig_debug(RIG_DEBUG_ERR, "%s: 1A 03 %02x failed\n", __func__, flt_ext); - return (retval); + RETURNFUNC(retval); } } @@ -5219,7 +5219,7 @@ int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -5347,7 +5347,7 @@ int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -5446,7 +5446,7 @@ int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -7549,7 +7549,7 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -7740,7 +7740,7 @@ int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -7837,7 +7837,7 @@ int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -8248,7 +8248,7 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -8671,7 +8671,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -8719,7 +8719,7 @@ morse_retry: } } - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index feed1ecf1..6936b7a68 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -620,7 +620,7 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = levelint / (float) 255; - return RIG_OK; + RETURNFUNC(RIG_OK); case RIG_LEVEL_SQL: SNPRINTF(cmdbuf, sizeof(cmdbuf), "SQ%c", vfo_num); diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 0ecefc1af..2a72bbab0 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -742,7 +742,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } default: - return kenwood_get_level(rig, vfo, level, val); + RETURNFUNC(kenwood_get_level(rig, vfo, level, val)); } RETURNFUNC(RIG_OK); diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index b647f9554..6acc9f17f 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -610,7 +610,7 @@ static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } SNPRINTF(levelbuf, sizeof(levelbuf), "GT%02d", kenwood_val); @@ -1004,7 +1004,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; default: - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } break; diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 7d26a30f4..9734316e6 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -170,7 +170,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) write_block(rp, ack, sizeof(ack)); set_transaction_inactive(rig); *freq = (reply[4] << 24) | (reply[5] << 16) | (reply[6] << 8) | reply[7]; - RETURNFUNC(RIG_OK); + RETURNFUNC2(RIG_OK); } static int micom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3c7e9b067..e87ac16ae 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1037,12 +1037,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) __func__, rig_strvfo(vfo), rig_strvfo(rig_s->tx_vfo)); // when in split we can change VFOB but not VFOA - if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; } + if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { RETURNFUNC(-RIG_ENTARGET); } // when not in split we can't change VFOA at all - if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; } + if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { RETURNFUNC(-RIG_ENTARGET); } - if (vfo != rig_s->tx_vfo) { return -RIG_ENTARGET; } + if (vfo != rig_s->tx_vfo) { RETURNFUNC(-RIG_ENTARGET); } } if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200) @@ -1069,7 +1069,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } while (err == RIG_OK && ptt == RIG_PTT_ON && retry-- > 0); - if (ptt) { return -RIG_ENTARGET; } + if (ptt) { RETURNFUNC(-RIG_ENTARGET); } } if (RIG_MODEL_FT450 == caps->rig_model) @@ -5129,7 +5129,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot read MG in CW/RTTY modes\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } if (is_ft991 || is_ft710 || is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 @@ -6961,7 +6961,7 @@ int newcat_set_parm(RIG *rig, setting_t parm, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: Unknown band %s=%d\n", __func__, val.s, rigband); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", band, cat_term); @@ -7646,7 +7646,7 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) ENTERFUNC; - if (scan != RIG_SCAN_VFO) { RETURNFUNC2(-RIG_EINVAL); } + if (scan != RIG_SCAN_VFO) { RETURNFUNC(-RIG_EINVAL); } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SC%d%c", scan == RIG_SCAN_STOP ? 0 : ch, cat_term); @@ -7655,10 +7655,10 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { rig_debug(RIG_DEBUG_VERBOSE, "%s:%d command err = %d\n", __func__, __LINE__, retval); - RETURNFUNC2(retval); + RETURNFUNC(retval); } - RETURNFUNC2(retval); + RETURNFUNC(retval); }