Fix cppcheck warning in ar7030p.c

pull/174/head
Michael Black 2020-01-13 22:56:03 -06:00
rodzic 893524ea03
commit 51739f4596
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
1 zmienionych plików z 31 dodań i 33 usunięć

Wyświetl plik

@ -408,7 +408,8 @@ static int ar7030p_open(RIG *rig)
if (rc < 0) if (rc < 0)
{ {
rig_debug(RIG_DEBUG_ERR,"%s: err in getFilterBW: %s\n",__func__, strerror(rc)); rig_debug(RIG_DEBUG_ERR, "%s: err in getFilterBW: %s\n", __func__,
strerror(rc));
return rc; return rc;
} }
else else
@ -517,7 +518,8 @@ static int ar7030p_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
// this RIG_OK check added to clear cppcheck warnings // this RIG_OK check added to clear cppcheck warnings
// not sure if it's needed but seem like RIG_OK should be expected // not sure if it's needed but seem like RIG_OK should be expected
// if this debug prints out when things are working need to reexamine // if this debug prints out when things are working need to reexamine
if (rc != RIG_OK) { if (rc != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc)); rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc));
} }
@ -574,7 +576,8 @@ static int ar7030p_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
// this RIG_OK check added to clear cppcheck warnings // this RIG_OK check added to clear cppcheck warnings
// not sure if it's needed but seem like RIG_OK should be expected // not sure if it's needed but seem like RIG_OK should be expected
// if this debug prints out when things are working need to reexamine // if this debug prints out when things are working need to reexamine
if (rc != RIG_OK) { if (rc != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc)); rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc));
} }
@ -597,7 +600,7 @@ static int ar7030p_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
pbwidth_t width) pbwidth_t width)
{ {
int rc = RIG_OK; int rc = RIG_OK;
unsigned char ar_mode = (unsigned char) USB; unsigned char ar_mode;
unsigned char ar_filter = (unsigned char) FILTER_3; unsigned char ar_filter = (unsigned char) FILTER_3;
rc = lockRx(rig, LOCK_1); rc = lockRx(rig, LOCK_1);
@ -610,12 +613,6 @@ static int ar7030p_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
rc = writeByte(rig, WORKING, MODE, ar_mode); rc = writeByte(rig, WORKING, MODE, ar_mode);
if (RIG_OK == rc && width != RIG_PASSBAND_NOCHANGE) if (RIG_OK == rc && width != RIG_PASSBAND_NOCHANGE)
{
if (RIG_PASSBAND_NORMAL == width)
{
width = rig_passband_normal(rig, mode);
}
else
{ {
int i; int i;
@ -635,7 +632,6 @@ static int ar7030p_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
rig_debug(RIG_DEBUG_VERBOSE, "%s: width %d ar_filter %d filterTab[%d] %d\n", rig_debug(RIG_DEBUG_VERBOSE, "%s: width %d ar_filter %d filterTab[%d] %d\n",
__func__, (int)width, ar_filter, i, filterTab[i]); __func__, (int)width, ar_filter, i, filterTab[i]);
} }
}
rc = writeByte(rig, WORKING, FILTER, ar_filter); rc = writeByte(rig, WORKING, FILTER, ar_filter);
@ -648,7 +644,8 @@ static int ar7030p_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
// this RIG_OK check added to clear cppcheck warnings // this RIG_OK check added to clear cppcheck warnings
// not sure if it's needed but seem like RIG_OK should be expected // not sure if it's needed but seem like RIG_OK should be expected
// if this debug prints out when things are working need to reexamine // if this debug prints out when things are working need to reexamine
if (rc != RIG_OK) { if (rc != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc)); rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc));
} }
@ -992,7 +989,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
// this RIG_OK check added to clear cppcheck warnings // this RIG_OK check added to clear cppcheck warnings
// not sure if it's needed but seem like RIG_OK should be expected // not sure if it's needed but seem like RIG_OK should be expected
// if this debug prints out when things are working need to reexamine // if this debug prints out when things are working need to reexamine
if (rc != RIG_OK) { if (rc != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc)); rig_debug(RIG_DEBUG_ERR, "%s: unexpected error?? %s\n", __func__, rigerror(rc));
} }
@ -1538,7 +1536,7 @@ static int ar7030p_set_powerstat(RIG *rig, powerstat_t status)
break; break;
} }
rc = lockRx(rig, LOCK_0); lockRx(rig, LOCK_0);
} }
return (-RIG_ENIMPL); return (-RIG_ENIMPL);