Fix cppcheck warnings in si570avrusb.c

pull/155/head
Michael Black 2019-12-07 23:47:41 -06:00
rodzic ba168e2c75
commit 56d096fd1a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6599353EC683404D
1 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -869,7 +869,7 @@ int si570xxxusb_set_conf(RIG *rig, token_t token, const char *val)
struct si570xxxusb_priv_data *priv;
freq_t freq;
double multiplier;
int i2c_addr;
unsigned int i2c_addr;
priv = (struct si570xxxusb_priv_data *)rig->state.priv;
@ -964,7 +964,7 @@ static int setBPF(RIG *rig, int enable)
libusb_device_handle *udh = rig->state.rigport.handle;
/* allocate enough space for up to 16 filters */
unsigned short FilterCrossOver[16];
int nBytes, i;
int nBytes;
// Does FilterCrossOver needs endianess ordering ?
@ -982,18 +982,21 @@ static int setBPF(RIG *rig, int enable)
if (nBytes > 2)
{
nBytes = libusb_control_transfer(udh, REQUEST_TYPE_IN,
int retval = libusb_control_transfer(udh, REQUEST_TYPE_IN,
REQUEST_FILTERS, enable, (nBytes / 2) - 1,
(unsigned char *) FilterCrossOver, sizeof(FilterCrossOver),
rig->state.rigport.timeout);
if (nBytes < 0)
if (retval < 0)
{
return -RIG_EIO;
}
nBytes = retval;
rig_debug(RIG_DEBUG_TRACE, "%s: Filter Bank 1:\n", __func__);
int i;
for (i = 0; i < (nBytes / 2) - 1; i++)
{
rig_debug(RIG_DEBUG_TRACE, " CrossOver[%d] = %f\n",