Fix cppcheck warnings in pcr

pull/155/head
Michael Black 2019-12-08 10:21:17 -06:00
rodzic ff4a8acb9c
commit 41c4a43e7f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
2 zmienionych plików z 11 dodań i 12 usunięć

Wyświetl plik

@ -167,7 +167,6 @@ static int is_sub_rcvr(RIG *rig, vfo_t vfo);
static int
pcr_read_block(RIG *rig, char *rxbuffer, size_t count)
{
int err;
int read = 0, tries = 4;
struct rig_state *rs = &rig->state;
@ -188,7 +187,7 @@ pcr_read_block(RIG *rig, char *rxbuffer, size_t count)
char *p = &rxbuffer[0];
/* read first char */
err = read_block(&rs->rigport, p, 1);
int err = read_block(&rs->rigport, p, 1);
if (err < 0)
{
@ -813,7 +812,7 @@ pcr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
unsigned char buf[20];
int buf_len, err;
int pcrmode, pcrfilter;
int pcrmode;
rig_debug(RIG_DEBUG_VERBOSE, "%s: mode = %s, width = %d\n",
__func__, rig_strrmode(mode), (int)width);
@ -862,6 +861,7 @@ pcr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width != RIG_PASSBAND_NOCHANGE)
{
int pcrfilter;
if (width == RIG_PASSBAND_NORMAL)
{
width = rig_passband_normal(rig, mode);
@ -1076,8 +1076,8 @@ pcr_get_info(RIG *rig)
"Optional devices:%s%s%s, Country: %s",
priv->firmware / 10, priv->firmware % 10,
priv->protocol / 10, priv->protocol % 10,
priv->options & OPT_UT106 ? " DSP" : "",
priv->options & OPT_UT107 ? " DARC" : "",
(priv->options & OPT_UT106) ? " DSP" : "",
(priv->options & OPT_UT107) ? " DARC" : "",
priv->options ? "" : " none",
country);
@ -1086,8 +1086,8 @@ pcr_get_info(RIG *rig)
__func__,
priv->firmware / 10, priv->firmware % 10,
priv->protocol / 10, priv->protocol % 10,
priv->options & OPT_UT106 ? " DSP" : "",
priv->options & OPT_UT107 ? " DARC" : "",
(priv->options & OPT_UT106) ? " DSP" : "",
(priv->options & OPT_UT107) ? " DARC" : "",
priv->options ? "" : " none",
country);
@ -1974,11 +1974,10 @@ int pcr_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
struct pcr_priv_data *priv = (struct pcr_priv_data *) rig->state.priv;
struct pcr_rcvr *rcvr = is_sub_rcvr(rig,
vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
int err;
if (priv->auto_update == 0)
{
err = pcr_transaction(rig, is_sub_rcvr(rig, vfo) ? "I4?" : "I0?");
int err = pcr_transaction(rig, is_sub_rcvr(rig, vfo) ? "I4?" : "I0?");
if (err != RIG_OK)
{
@ -1993,7 +1992,7 @@ int pcr_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
* Bit 2: VSC open
* Bit 3: RX error (not ready to receive)
*/
*dcd = rcvr->squelch_status & 0x02 ? RIG_DCD_ON : RIG_DCD_OFF;
*dcd = (rcvr->squelch_status & 0x02) ? RIG_DCD_ON : RIG_DCD_OFF;
return RIG_OK;
}

Wyświetl plik

@ -49,8 +49,8 @@ struct pcr_priv_data
float volume;
float squelch;
int raw_level;
int squelch_status;
unsigned int raw_level;
unsigned int squelch_status;
} main_rcvr, sub_rcvr;