Fix cppcheck warning in trp8255.c

pull/574/head
Michael Black W9MDB 2021-02-28 12:22:33 -06:00
rodzic 2976239f3a
commit 5df06c4cbf
1 zmienionych plików z 12 dodań i 12 usunięć
rigs/skanti

Wyświetl plik

@ -302,21 +302,21 @@ int cu_set_split_freq(RIG *rig, vfo_t vfo, freq_t freq)
int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{ {
char cmd; char *cmd;
int ret; int ret;
switch (mode) switch (mode)
{ {
case RIG_MODE_USB: cmd = 'X'; break; case RIG_MODE_USB: cmd = "X"; break;
case RIG_MODE_LSB: cmd = 'Y'; break; case RIG_MODE_LSB: cmd = "Y"; break;
case RIG_MODE_AM: cmd = 'Z'; break; case RIG_MODE_AM: cmd = "Z"; break;
case RIG_MODE_RTTY: cmd = '['; break; case RIG_MODE_RTTY: cmd = "["; break;
/* case RIG_MODE_R3E: cmd = '\\'; break; */ /* case RIG_MODE_R3E: cmd = "\\"; break; */
case RIG_MODE_CW: cmd = ']'; break; case RIG_MODE_CW: cmd = "]"; break;
/* case RIG_MODE_MCW: cmd = '^'; break; */ /* case RIG_MODE_MCW: cmd = '^'; break; */
@ -324,7 +324,7 @@ int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
return -RIG_EINVAL; return -RIG_EINVAL;
} }
ret = cu_transaction(rig, &cmd, 1); ret = cu_transaction(rig, cmd, 1);
if (ret != RIG_OK) if (ret != RIG_OK)
{ {
@ -340,18 +340,18 @@ int cu_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (width < rig_passband_normal(rig, mode)) if (width < rig_passband_normal(rig, mode))
{ {
cmd = 'D'; cmd = "D";
} }
else if (width > rig_passband_normal(rig, mode)) else if (width > rig_passband_normal(rig, mode))
{ {
cmd = 'B'; cmd = "B";
} }
else else
{ {
cmd = 'C'; cmd = "C";
} }
return cu_transaction(rig, &cmd, 1); return cu_transaction(rig, cmd, 1);
} }
int cu_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int cu_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)