More cppcheck changes

pull/224/head
Michael Black 2020-03-20 07:51:32 -05:00
rodzic e332b62e7d
commit c489f97624
30 zmienionych plików z 151 dodań i 130 usunięć

Wyświetl plik

@ -2493,7 +2493,7 @@ extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS(());
extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS(());
extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(());
HAMLIB_EXPORT(void) rig_no_restore_ai();
extern HAMLIB_EXPORT(void) rig_no_restore_ai();
#include <unistd.h>
extern HAMLIB_EXPORT(int) hl_usleep(useconds_t msec);

Wyświetl plik

@ -1045,8 +1045,8 @@ int aor_set_channel(RIG *rig, const channel_t *chan)
cmd_len += priv->format_mode(rig, aorcmd + cmd_len, chan->mode, chan->width);
cmd_len += sprintf(aorcmd + cmd_len, (" AT%d TM%12s"EOM),
chan->levels[LVL_ATT].i ? 1 : 0, chan->channel_desc);
cmd_len += sprintf(aorcmd + cmd_len, " AT%d TM%12s%s",
chan->levels[LVL_ATT].i ? 1 : 0, chan->channel_desc, EOM);
return aor_transaction(rig, aorcmd, cmd_len, NULL, NULL);
}

Wyświetl plik

@ -127,6 +127,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
/*
* should check return code and that write wrote cmd_len chars!
*/
// cppcheck-suppress *
Hold_Decode(rig);
serial_flush(&rs->rigport);
@ -135,6 +136,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
if (retval != RIG_OK)
{
// cppcheck-suppress *
Unhold_Decode(rig);
return retval;
}
@ -387,7 +389,6 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
{
unsigned char icmode;
signed char icmode_ext;
pbwidth_t medium_width;
icmode_ext = -1;
@ -447,7 +448,7 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
if (width != RIG_PASSBAND_NOCHANGE)
{
medium_width = rig_passband_normal(rig, mode);
pbwidth_t medium_width = rig_passband_normal(rig, mode);
if (width == medium_width || width == RIG_PASSBAND_NORMAL)
{

Wyświetl plik

@ -1033,13 +1033,13 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
(int)chan->rptr_offs);
chan->ctcss_tone = from_bcd_be(membuf->rx.tone, 6);
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_tone=%d\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_tone=%u\n", __func__,
chan->ctcss_tone);
chan->ctcss_sql = from_bcd_be(membuf->rx.tone_sql, 6);
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_sql=%d\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_sql=%u\n", __func__,
chan->ctcss_sql);
chan->dcs_code = from_bcd_be(membuf->rx.dcs.code, 4);
rig_debug(RIG_DEBUG_TRACE, "%s: chan->dcs_code=%d\n", __func__, chan->dcs_code);
rig_debug(RIG_DEBUG_TRACE, "%s: chan->dcs_code=%u\n", __func__, chan->dcs_code);
/* The dcs information include in the channel includes polarity information
for both tx and receive. Both directions are enabled when in dcs mode */

Wyświetl plik

@ -6107,7 +6107,7 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
if (ant >= priv_caps->ant_count)
{
rig_debug(RIG_DEBUG_ERR, "%s: ant index=%d > ant_count=%d\n", __func__, ant,
rig_debug(RIG_DEBUG_ERR, "%s: ant index=%u > ant_count=%d\n", __func__, ant,
priv_caps->ant_count);
return -RIG_EINVAL;
}
@ -6437,7 +6437,7 @@ int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq,
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_id = rig->caps->rig_model;
rig_debug(RIG_DEBUG_TRACE, "%s: passed mwpower = %i\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: passed mwpower = %u\n", __func__,
mwpower);
rig_debug(RIG_DEBUG_TRACE, "%s: passed freq = %" PRIfreq " Hz\n",
__func__, freq);
@ -6471,7 +6471,6 @@ int icom_decode_event(RIG *rig)
struct rig_state *rs;
unsigned char buf[MAXFRAMELEN];
int frm_len;
freq_t freq;
rmode_t mode;
pbwidth_t width;
@ -6534,6 +6533,7 @@ int icom_decode_event(RIG *rig)
*/
if (rig->callbacks.freq_event)
{
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);

Wyświetl plik

@ -202,7 +202,7 @@ int optoscan_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
tone_len -= 2;
*tone = from_bcd_be(tonebuf + 2, tone_len * 2);
rig_debug(RIG_DEBUG_ERR, "optoscan_get_ctcss_tone: *tone=%d\n", *tone);
rig_debug(RIG_DEBUG_ERR, "optoscan_get_ctcss_tone: *tone=%u\n", *tone);
return RIG_OK;
}
@ -235,7 +235,7 @@ int optoscan_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
tone_len -= 2;
*code = from_bcd_be(tonebuf + 2, tone_len * 2);
rig_debug(RIG_DEBUG_ERR, "optoscan_get_dcs_code: *code=%d\n", *code);
rig_debug(RIG_DEBUG_ERR, "optoscan_get_dcs_code: *code=%u\n", *code);
return RIG_OK;
}
@ -646,7 +646,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
optoscan_send_freq(rig, state); /*Step 2*/
}
rc = !RIG_SCAN_STOP;
rc = 0;
while (rc != RIG_SCAN_STOP)
{

Wyświetl plik

@ -77,6 +77,7 @@ static int jrc_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
serial_flush(&rs->rigport);
// cppcheck-suppress *
Hold_Decode(rig);
retval = write_block(&rs->rigport, cmd, cmd_len);
@ -297,6 +298,8 @@ 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
freq_len = sprintf(freqbuf, "F%0*"PRIll EOM, priv->max_freq_len, (int64_t)freq);
return jrc_transaction(rig, freqbuf, freq_len, NULL, NULL);
@ -372,8 +375,8 @@ int jrc_set_vfo(RIG *rig, vfo_t vfo)
case RIG_VFO_MEM: vfo_function = 'C'; break;
default:
rig_debug(RIG_DEBUG_ERR, "jrc_set_vfo: unsupported VFO %d\n",
vfo);
rig_debug(RIG_DEBUG_ERR, "jrc_set_vfo: unsupported VFO %s\n",
rig_strvfo(vfo));
return -RIG_EINVAL;
}

Wyświetl plik

@ -115,7 +115,7 @@ int elecraft_open(RIG *rig)
priv->fw_rev = k3_fw_rev;
/* Use check for "ID017;" to verify rig is reachable */
rig_debug(RIG_DEBUG_TRACE, "%s: rig_model=%d,%d\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: rig_model=%u,%d\n", __func__,
rig->caps->rig_model, RIG_MODEL_XG3);
if (rig->caps->rig_model == RIG_MODEL_XG3) // XG3 doesn't have ID
@ -218,7 +218,7 @@ int elecraft_open(RIG *rig)
break;
default:
rig_debug(RIG_DEBUG_WARN, "%s: unrecognized rig model %d\n",
rig_debug(RIG_DEBUG_WARN, "%s: unrecognized rig model %u\n",
__func__, rig->caps->rig_model);
return -RIG_EINVAL;
}

Wyświetl plik

@ -132,7 +132,7 @@ int flexradio_open(RIG *rig)
break;
default:
rig_debug(RIG_DEBUG_WARN, "%s: unrecognized rig model %d\n",
rig_debug(RIG_DEBUG_WARN, "%s: unrecognized rig model %u\n",
__func__, rig->caps->rig_model);
return -RIG_EINVAL;
}

Wyświetl plik

@ -136,7 +136,7 @@ static int flex6k_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(vfo));
return -RIG_EINVAL;
}
@ -295,7 +295,7 @@ static int flex6k_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(vfo));
return -RIG_EINVAL;
}

Wyświetl plik

@ -120,7 +120,7 @@ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
static int get_ic10_if(RIG *rig, char *data)
{
struct kenwood_priv_caps *priv = (struct kenwood_priv_caps *)rig->caps->priv;
int i, data_len, retval = !RIG_OK;
int i, data_len, retval = RIG_EINVAL;
for (i = 0; retval != RIG_OK && i < rig->caps->retry; i++)
{
@ -168,8 +168,8 @@ int ic10_set_vfo(RIG *rig, vfo_t vfo)
case RIG_VFO_CURR: return RIG_OK;
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n",
__func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n",
__func__, rig_strvfo(vfo));
return -RIG_EINVAL;
}
@ -412,8 +412,8 @@ int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
case RIG_VFO_B: vfo_letter = 'B'; break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %d\n",
__func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n",
__func__, rig_strvfo(vfo));
return -RIG_EINVAL;
}

Wyświetl plik

@ -293,7 +293,6 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
char f;
struct k2_filt_lst_s *flt;
struct kenwood_priv_data *priv = rig->state.priv;
shortfreq_t freq = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -329,6 +328,8 @@ int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width != RIG_PASSBAND_NOCHANGE)
{
shortfreq_t freq = 0;
if (width < 0)
{
width = labs(width);

Wyświetl plik

@ -1481,17 +1481,19 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
else
{
int i;
int foundit = 0;
for (i = 0; i < MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
{
if (val.i == rig->state.attenuator[i])
{
snprintf(levelbuf, sizeof(levelbuf), "RA%02d", i + 1);
foundit = 1;
break;
}
}
if (val.i != rig->state.attenuator[i])
if (!foundit)
{
return -RIG_EINVAL;
}

Wyświetl plik

@ -776,7 +776,7 @@ int kenwood_open(RIG *rig)
/* driver mismatch */
rig_debug(RIG_DEBUG_ERR,
"%s: wrong driver selected (%d instead of %d)\n",
"%s: wrong driver selected (%u instead of %d)\n",
__func__, rig->caps->rig_model,
kenwood_id_string_list[i].model);
@ -2068,6 +2068,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
else
{
int foundit = 0;
for (i = 0; i < MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
{
if (val.i == rig->state.attenuator[i])
@ -2096,6 +2097,7 @@ int kenwood_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])
@ -2862,7 +2864,7 @@ int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
{
if (caps->ctcss_list[i] == 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%04d)\n",
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%04u)\n",
__func__, tone_idx);
return -RIG_EPROTO;
}
@ -3000,7 +3002,7 @@ int kenwood_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
{
if (caps->ctcss_list[i] == 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%04d)\n",
rig_debug(RIG_DEBUG_ERR, "%s: CTCSS NG (%04u)\n",
__func__, tone_idx);
return -RIG_EPROTO;
}

Wyświetl plik

@ -823,16 +823,19 @@ int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
}
else
{
int foundit = 0;
for (i = 0; i < MAXDBLSTSIZ && rig->state.attenuator[i]; i++)
{
if (val.i == rig->state.attenuator[i])
{
sprintf(levelbuf, "RA%02d", i + 1);
foundit = 1;
break;
}
}
if (val.i != rig->state.attenuator[i])
if (!foundit)
{
return -RIG_EINVAL;
}
@ -849,16 +852,19 @@ int pihpsdr_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])
{
sprintf(levelbuf, "PA%01d", i + 1);
foundit = 1;
break;
}
}
if (val.i != rig->state.preamp[i])
if (!foundit)
{
return -RIG_EINVAL;
}

Wyświetl plik

@ -191,7 +191,8 @@ static int thd74_set_vfo(RIG *rig, vfo_t vfo)
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO: %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO: %s\n", __func__,
rig_strvfo(vfo));
return -RIG_ENTARGET;
}
@ -252,7 +253,8 @@ static int thd74_vfoc(RIG *rig, vfo_t vfo, char *vfoc)
case RIG_VFO_B: *vfoc = '1'; break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO: %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO: %s\n", __func__,
rig_strvfo(vfo));
return -RIG_ENTARGET;
}

Wyświetl plik

@ -300,7 +300,7 @@ int thg71_decode_event(RIG *rig)
vfo_t bandmode;
retval = sscanf(asyncbuf, "VMC 0,%d", &bandmode);
retval = sscanf(asyncbuf, "VMC 0,%u", &bandmode);
if (retval != 1)
{
@ -319,7 +319,7 @@ int thg71_decode_event(RIG *rig)
default: bandmode = RIG_VFO_CURR; break;
}
rig_debug(RIG_DEBUG_TRACE, "%s: Mode of Band event - %d\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: Mode of Band event - %u\n", __func__,
bandmode);
/* TODO: This event does not have a callback! */
@ -354,7 +354,7 @@ int thg71_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
case RIG_VFO_A: break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %s\n", __func__, rig_strvfo(vfo));
return -RIG_EVFO;
}
@ -402,7 +402,7 @@ int thg71_set_vfo(RIG *rig, vfo_t vfo)
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %s\n", __func__, rig_strvfo(vfo));
return -RIG_EVFO;
}
@ -505,7 +505,7 @@ int thg71_open(RIG *rig)
strtok(ackbuf, " ");
for (i = 0; i < FRQRANGESIZ; i++)
for (i = 0; i < FRQRANGESIZ - 1; i++)
{
freq_range_t frng;
char *strl, *stru;
@ -534,6 +534,7 @@ int thg71_open(RIG *rig)
frng.high_power = -1;
frng.low_power = -1;
frng.label = "";
rig->state.rx_range_list[i] = frng;
if (frng.startf > MHz(200))

Wyświetl plik

@ -250,7 +250,7 @@ const struct rig_caps tmd710_caps =
RIG_MODEL(RIG_MODEL_TMD710),
.model_name = "TM-D710(G)",
.mfg_name = "Kenwood",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_MOBILE | RIG_FLAG_APRS | RIG_FLAG_TNC,
@ -400,14 +400,14 @@ const struct rig_caps tmd710_caps =
/* structure for handling FO radio command */
typedef struct
{
int vfo; // P1
uint32_t vfo; // P1
freq_t freq; // P2
int step; // P3
int shift; // P4
int reverse; // P5
int tone; // P6
int ct; // P7
int dcs; // P8
uint32_t step; // P3
uint32_t shift; // P4
uint32_t reverse; // P5
uint32_t tone; // P6
uint32_t ct; // P7
uint32_t dcs; // P8
int tone_freq; // P9
int ct_freq; // P10
int dcs_val; // P11
@ -418,22 +418,22 @@ typedef struct
/* structure for handling ME radio command */
typedef struct
{
int channel; // P1
uint32_t channel; // P1
freq_t freq; // P2
int step; // P3
int shift; // P4
int reverse; // P5
int tone; // P6
int ct; // P7
int dcs; // P8
int tone_freq; // P9
int ct_freq; // P10
int dcs_val; // P11
int offset; // P12
int mode; // P13
uint32_t step; // P3
uint32_t shift; // P4
uint32_t reverse; // P5
uint32_t tone; // P6
uint32_t ct; // P7
uint32_t dcs; // P8
uint32_t tone_freq; // P9
uint32_t ct_freq; // P10
uint32_t dcs_val; // P11
uint32_t offset; // P12
uint32_t mode; // P13
freq_t tx_freq; // P14
int p15_unknown; // P15
int lockout; // P16
uint32_t p15_unknown; // P15
uint32_t lockout; // P16
} tmd710_me;
/* structure for handling MU (menu) radio command */
@ -467,12 +467,12 @@ typedef struct
int brightness_level; // P26 (0-8)
int auto_brightness; // P27 0/1
int backlight_color; // P28
int pf1_key; // P29
int pf2_key; // P30
int mic_pf1_key; // P31
int mic_pf2_key; // P32
int mic_pf3_key; // P33
int mic_pf4_key; // P34
uint32_t pf1_key; // P29
uint32_t pf2_key; // P30
uint32_t mic_pf1_key; // P31
uint32_t mic_pf2_key; // P32
uint32_t mic_pf3_key; // P33
uint32_t mic_pf4_key; // P34
int mic_key_lock; // P35 0/1
int scan_resume; // P36
int auto_power_off; // P37
@ -713,7 +713,7 @@ int tmd710_get_memory_name(RIG *rig, int ch, char *name)
return retval;
}
retval = num_sscanf(buf, "MN %d,%s", &ch, name);
retval = num_sscanf(buf, "MN %d,%29s", &ch, name);
if (retval != 2)
{
@ -1060,7 +1060,7 @@ int tmd710_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
return retval;
}
static int tmd710_find_ctcss_index(RIG *rig, tone_t tone, int *ctcss_index)
static int tmd710_find_ctcss_index(RIG *rig, tone_t tone, uint32_t *ctcss_index)
{
int k, stepind = -1;
@ -1079,7 +1079,7 @@ static int tmd710_find_ctcss_index(RIG *rig, tone_t tone, int *ctcss_index)
return -RIG_EINVAL;
}
*ctcss_index = stepind;
*ctcss_index = (uint32_t)stepind;
return RIG_OK;
}
@ -1090,7 +1090,8 @@ static int tmd710_find_ctcss_index(RIG *rig, tone_t tone, int *ctcss_index)
*/
static int tmd710_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
{
int retval, stepind;
int retval;
uint32_t stepind;
tmd710_fo fo_struct;
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1144,7 +1145,8 @@ int tmd710_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
*/
static int tmd710_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
{
int retval, stepind;
int retval;
uint32_t stepind;
tmd710_fo fo_struct;
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1224,7 +1226,7 @@ int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code)
return RIG_OK;
}
static int tmd710_find_dcs_index(tone_t code, int *dcs_index)
static int tmd710_find_dcs_index(tone_t code, uint32_t *dcs_index)
{
int i = 0;
@ -1249,7 +1251,8 @@ static int tmd710_find_dcs_index(tone_t code, int *dcs_index)
*/
int tmd710_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
{
int retval, dcs_index, dcs_enable;
int retval;
uint32_t dcs_index, dcs_enable;
tmd710_fo fo_struct;
if (code == 0)
@ -1339,7 +1342,7 @@ int tmd710_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
return RIG_OK;
}
static int tmd710_get_mode_tmd710_value(rmode_t mode, int *tmd710_mode)
static int tmd710_get_mode_tmd710_value(rmode_t mode, uint32_t *tmd710_mode)
{
if (mode == RIG_MODE_FM)
{
@ -1369,7 +1372,8 @@ static int tmd710_get_mode_tmd710_value(rmode_t mode, int *tmd710_mode)
*/
static int tmd710_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
int retval, tmd710_mode = 0;
int retval;
uint32_t tmd710_mode = 0;
tmd710_fo fo_struct;
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1394,7 +1398,7 @@ static int tmd710_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
static int tmd710_find_tuning_step_index(RIG *rig, shortfreq_t ts,
int *step_index)
uint32_t *step_index)
{
int k, stepind = -1;
@ -1430,7 +1434,8 @@ static int tmd710_find_tuning_step_index(RIG *rig, shortfreq_t ts,
*/
static int tmd710_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
{
int retval, stepind;
int retval;
uint32_t stepind;
tmd710_fo fo_struct;
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1474,7 +1479,8 @@ static int tmd710_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
return retval;
}
int tmd710_get_rptr_shift_tmd710_value(rptr_shift_t shift, int *tmd710_shift)
int tmd710_get_rptr_shift_tmd710_value(rptr_shift_t shift,
uint32_t *tmd710_shift)
{
switch (shift)
{

Wyświetl plik

@ -330,7 +330,7 @@ int tmv7_decode_event(RIG *rig)
vfo_t bandmode;
retval = sscanf(asyncbuf, "VMC 0,%d", &bandmode);
retval = sscanf(asyncbuf, "VMC 0,%u", &bandmode);
if (retval != 1)
{
@ -349,7 +349,7 @@ int tmv7_decode_event(RIG *rig)
default: bandmode = RIG_VFO_CURR; break;
}
rig_debug(RIG_DEBUG_TRACE, "%s: Mode of Band event - %d\n", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: Mode of Band event - %u\n", __func__,
bandmode);
/* TODO: This event does not have a callback! */
@ -374,7 +374,7 @@ int tmv7_set_vfo(RIG *rig, vfo_t vfo)
char vfobuf[16], ackbuf[ACKBUF_LEN];
int retval;
rig_debug(RIG_DEBUG_TRACE, "%s: called %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_TRACE, "%s: called %s\n", __func__, rig_strvfo(vfo));
switch (vfo)
{
@ -397,7 +397,8 @@ int tmv7_set_vfo(RIG *rig, vfo_t vfo)
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %s\n", __func__,
rig_strvfo(vfo));
return -RIG_EVFO;
}
@ -409,7 +410,7 @@ int tmv7_set_vfo(RIG *rig, vfo_t vfo)
return retval;
}
rig_debug(RIG_DEBUG_TRACE, "%s: next %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_TRACE, "%s: next %s\n", __func__, rig_strvfo(vfo));
switch (vfo)
{
@ -457,7 +458,7 @@ int tmv7_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
case RIG_VFO_A: break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %d\n", __func__, vfo);
rig_debug(RIG_DEBUG_ERR, "%s: Unsupported VFO %s\n", __func__, rig_strvfo(vfo));
return -RIG_EVFO;
}

Wyświetl plik

@ -66,8 +66,8 @@ static int ts140_set_vfo(RIG *rig, vfo_t vfo)
case RIG_VFO_CURR: return RIG_OK;
default:
rig_debug(RIG_DEBUG_ERR, "ts140_set_vfo: unsupported VFO %d\n",
vfo);
rig_debug(RIG_DEBUG_ERR, "ts140_set_vfo: unsupported VFO %s\n",
rig_strvfo(vfo));
return -RIG_EINVAL;
}

Wyświetl plik

@ -576,8 +576,8 @@ int ts570_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, "ts570_set_split_vfo: unsupported VFO %d\n",
vfo);
rig_debug(RIG_DEBUG_ERR, "ts570_set_split_vfo: unsupported VFO %s\n",
rig_strvfo(vfo));
return -RIG_EINVAL;
}
@ -623,7 +623,8 @@ int ts570_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
break;
default:
rig_debug(RIG_DEBUG_ERR, "ts570_set_split_vfo: unsupported VFO %d\n", txvfo);
rig_debug(RIG_DEBUG_ERR, "ts570_set_split_vfo: unsupported VFO %s\n",
rig_strvfo(txvfo));
return -RIG_EINVAL;
}

Wyświetl plik

@ -66,8 +66,8 @@ static int ts680_set_vfo(RIG *rig, vfo_t vfo)
case RIG_VFO_CURR: return RIG_OK;
default:
rig_debug(RIG_DEBUG_ERR, "ts680_set_vfo: unsupported VFO %d\n",
vfo);
rig_debug(RIG_DEBUG_ERR, "ts680_set_vfo: unsupported VFO %s\n",
rig_strvfo(vfo));
return -RIG_EINVAL;
}

Wyświetl plik

@ -2679,8 +2679,8 @@ int ft990_get_channel(RIG *rig, channel_t *chan)
return -RIG_EINVAL;
}
rig_debug(RIG_DEBUG_TRACE, "%s: passed chan->vfo = %i\n",
__func__, chan->vfo);
rig_debug(RIG_DEBUG_TRACE, "%s: passed chan->vfo = %s\n",
__func__, rig_strvfo(chan->vfo));
rig_debug(RIG_DEBUG_TRACE, "%s: passed chan->channel_num = %i\n",
__func__, chan->channel_num);

Wyświetl plik

@ -1545,8 +1545,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 = %d, TX_vfo = %d\n", *split, vfo,
*tx_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;
}
@ -1930,7 +1930,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
break;
}
rig_debug(RIG_DEBUG_TRACE, "%s: tone = %d, tone_match = %d, i = %d", __func__,
rig_debug(RIG_DEBUG_TRACE, "%s: tone = %u, tone_match = %d, i = %d", __func__,
tone, tone_match, i);
if (tone_match == FALSE && tone != 0)
@ -2099,7 +2099,7 @@ int newcat_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
case NC_RIGID_FT450:
/* 100 Watts */
*mwpower = power * 100000;
rig_debug(RIG_DEBUG_TRACE, "case FT450 - rig_id = %d, *mwpower = %d\n", rig_id,
rig_debug(RIG_DEBUG_TRACE, "case FT450 - rig_id = %d, *mwpower = %u\n", rig_id,
*mwpower);
break;
@ -2107,35 +2107,35 @@ int newcat_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
/* 100 Watts */
*mwpower = power * 100000; /* 0..100 Linear scale */
rig_debug(RIG_DEBUG_TRACE,
"case FT950 - rig_id = %d, power = %f, *mwpower = %d\n", rig_id, power,
"case FT950 - rig_id = %d, power = %f, *mwpower = %u\n", rig_id, power,
*mwpower);
break;
case NC_RIGID_FT2000:
/* 100 Watts */
*mwpower = power * 100000;
rig_debug(RIG_DEBUG_TRACE, "case FT2000 - rig_id = %d, *mwpower = %d\n", rig_id,
rig_debug(RIG_DEBUG_TRACE, "case FT2000 - rig_id = %d, *mwpower = %u\n", rig_id,
*mwpower);
break;
case NC_RIGID_FT2000D:
/* 200 Watts */
*mwpower = power * 200000;
rig_debug(RIG_DEBUG_TRACE, "case FT2000D - rig_id = %d, *mwpower = %d\n",
rig_debug(RIG_DEBUG_TRACE, "case FT2000D - rig_id = %d, *mwpower = %u\n",
rig_id, *mwpower);
break;
case NC_RIGID_FTDX5000:
/* 200 Watts */
*mwpower = power * 200000;
rig_debug(RIG_DEBUG_TRACE, "case FTDX5000 - rig_id = %d, *mwpower = %d\n",
rig_debug(RIG_DEBUG_TRACE, "case FTDX5000 - rig_id = %d, *mwpower = %u\n",
rig_id, *mwpower);
break;
case NC_RIGID_FTDX9000D:
/* 200 Watts */
*mwpower = power * 200000;
rig_debug(RIG_DEBUG_TRACE, "case FTDX9000D - rig_id = %d, *mwpower = %d\n",
rig_debug(RIG_DEBUG_TRACE, "case FTDX9000D - rig_id = %d, *mwpower = %u\n",
rig_id, *mwpower);
break;
@ -2143,13 +2143,13 @@ int newcat_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
/* 200 Watts */
*mwpower = power * 200000;
rig_debug(RIG_DEBUG_TRACE,
"case FTDX9000Contest - rig_id = %d, *mwpower = %d\n", rig_id, *mwpower);
"case FTDX9000Contest - rig_id = %d, *mwpower = %u\n", rig_id, *mwpower);
break;
case NC_RIGID_FTDX9000MP:
/* 400 Watts */
*mwpower = power * 400000;
rig_debug(RIG_DEBUG_TRACE, "case FTDX9000MP - rig_id = %d, *mwpower = %d\n",
rig_debug(RIG_DEBUG_TRACE, "case FTDX9000MP - rig_id = %d, *mwpower = %u\n",
rig_id, *mwpower);
break;
@ -2163,7 +2163,7 @@ int newcat_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
default:
/* 100 Watts */
*mwpower = power * 100000;
rig_debug(RIG_DEBUG_TRACE, "default - rig_id = %d, *mwpower = %d\n", rig_id,
rig_debug(RIG_DEBUG_TRACE, "default - rig_id = %d, *mwpower = %u\n", rig_id,
*mwpower);
}
@ -2193,7 +2193,7 @@ int newcat_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq,
/* 100 Watts */
*power = mwpower / 100000.0; /* 0..100 Linear scale */
rig_debug(RIG_DEBUG_TRACE,
"case FT950 - rig_id = %d, mwpower = %d, *power = %f\n", rig_id, mwpower,
"case FT950 - rig_id = %d, mwpower = %u, *power = %f\n", rig_id, mwpower,
*power);
break;
@ -4039,7 +4039,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch)
}
/* Set Memory Channel Number ************** */
rig_debug(RIG_DEBUG_TRACE, "channel_num = %d, vfo = %d\n", ch, vfo);
rig_debug(RIG_DEBUG_TRACE, "channel_num = %d, vfo = %s\n", ch, rig_strvfo(vfo));
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MC%03d%c", ch, cat_term);
@ -4433,7 +4433,7 @@ int newcat_set_channel(RIG *rig, const channel_t *chan)
}
snprintf(priv->cmd_str, sizeof(priv->cmd_str),
"MW%03d%08d%+.4d%c%c%c%c%c%02d%c%c",
"MW%03d%08d%+.4d%c%c%c%c%c%02u%c%c",
chan->channel_num, (int)chan->freq, rxit, c_rit, c_xit, c_mode, c_vfo,
c_tone, tone, c_rptr_shift, cat_term);
@ -4988,7 +4988,7 @@ int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo)
break;
default:
rig_debug(RIG_DEBUG_TRACE, "Unrecognized. vfo= %d\n", *vfo);
rig_debug(RIG_DEBUG_TRACE, "Unrecognized. vfo= %s\n", rig_strvfo(*vfo));
return -RIG_EINVAL;
}
@ -6004,7 +6004,7 @@ int newcat_get_rigid(RIG *rig)
}
}
rig_debug(RIG_DEBUG_TRACE, "rig_id = %d, *s = %s\n", priv->rig_id, s);
rig_debug(RIG_DEBUG_TRACE, "rig_id = %d, *s = %s\n", priv->rig_id, s==NULL?"NULL":s);
return priv->rig_id;
}
@ -6069,7 +6069,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t *vfo_mode)
*vfo_mode = RIG_VFO_MEM;
}
rig_debug(RIG_DEBUG_TRACE, "%s: vfo mode = %d\n", __func__, *vfo_mode);
rig_debug(RIG_DEBUG_TRACE, "%s: vfo mode = %s\n", __func__, rig_strrmode(*vfo_mode));
return err;
}

Wyświetl plik

@ -472,14 +472,8 @@ int vr5000_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
int mode2rig(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
struct vr5000_priv_data *priv = rig->state.priv;
int md;
if (priv->curr_vfo == RIG_VFO_CURR)
{
vfo = priv->curr_vfo;
}
/*
* translate mode from generic to vr5000 specific
*/

Wyświetl plik

@ -652,7 +652,7 @@ static int vx1700_set_vfo(RIG *rig, vfo_t vfo)
{
struct vx1700_priv_data *priv = (struct vx1700_priv_data *)rig->state.priv;
rig_debug(RIG_DEBUG_TRACE, "%s, vfo=%d\n", __func__, vfo);
rig_debug(RIG_DEBUG_TRACE, "%s, vfo=%s\n", __func__, rig_strvfo(vfo));
switch (vfo)
{

Wyświetl plik

@ -44,6 +44,7 @@
#define STX "\x02"
#if 0
struct prosistel_rot_priv_data
{
azimuth_t az;
@ -52,6 +53,7 @@ struct prosistel_rot_priv_data
azimuth_t target_az;
elevation_t target_el;
};
#endif

Wyświetl plik

@ -728,7 +728,6 @@ static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth,
{
struct rot_state *rs;
char az[8]; /* read azimuth string */
azimuth_t tmp;
int err;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -767,7 +766,7 @@ static int rt21_rot_get_position(ROT *rot, azimuth_t *azimuth,
*/
if ((isdigit(az[0])) || (isspace(az[0])))
{
tmp = strtof(az, NULL);
azimuth_t tmp = strtof(az, NULL);
rig_debug(RIG_DEBUG_TRACE, "%s: \"%s\" after conversion = %.1f\n",
__func__, az, tmp);

Wyświetl plik

@ -188,7 +188,7 @@ int HAMLIB_API rig_register(const struct rig_caps *caps)
}
rig_debug(RIG_DEBUG_VERBOSE,
"%s: rig_register (%d)\n",
"%s: rig_register (%u)\n",
__func__,
caps->rig_model);
@ -284,7 +284,7 @@ int HAMLIB_API rig_check_backend(rig_model_t rig_model)
if (be_idx == -1)
{
rig_debug(RIG_DEBUG_VERBOSE,
"rig_check_backend: unsupported backend %d for model %d\n",
"rig_check_backend: unsupported backend %d for model %u\n",
RIG_BACKEND_NUM(rig_model),
rig_model);
return -RIG_ENAVAIL;
@ -367,7 +367,7 @@ static int dummy_rig_probe(const hamlib_port_t *p,
rig_model_t model,
rig_ptr_t data)
{
rig_debug(RIG_DEBUG_TRACE, "Found rig, model %d\n", model);
rig_debug(RIG_DEBUG_TRACE, "Found rig, model %u\n", model);
return RIG_OK;
}

Wyświetl plik

@ -1180,7 +1180,6 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
const struct rig_caps *caps;
int retcode;
vfo_t curr_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -1222,6 +1221,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
else
{
int rc2;
vfo_t curr_vfo;
if (!caps->set_vfo)
{
@ -1286,7 +1286,6 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
const struct rig_caps *caps;
int retcode;
vfo_t curr_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -1310,6 +1309,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
else
{
int rc2;
vfo_t curr_vfo;
if (!caps->set_vfo)
{
@ -1379,7 +1379,6 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
const struct rig_caps *caps;
int retcode;
vfo_t curr_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -1404,6 +1403,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
else
{
int rc2;
vfo_t curr_vfo;
if (!caps->set_vfo)
{
@ -1466,7 +1466,6 @@ int HAMLIB_API rig_get_mode(RIG *rig,
{
const struct rig_caps *caps;
int retcode;
vfo_t curr_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -1491,6 +1490,7 @@ int HAMLIB_API rig_get_mode(RIG *rig,
else
{
int rc2;
vfo_t curr_vfo;
if (!caps->set_vfo)
{
@ -1794,7 +1794,6 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
const struct rig_caps *caps;
struct rig_state *rs = &rig->state;
int retcode = RIG_OK;
vfo_t curr_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -1829,6 +1828,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;