More cppcheck stuff in amplifiers/ and rotators/

pull/1834/head
George Baltz N3GB 2025-07-30 15:11:53 -04:00
rodzic 8ce51d13aa
commit c1e6dcf010
7 zmienionych plików z 14 dodań i 12 usunięć

Wyświetl plik

@ -566,7 +566,7 @@ int kpa_get_powerstat(AMP *amp, powerstat_t *status)
int kpa_set_powerstat(AMP *amp, powerstat_t status)
{
int retval;
char *cmd = NULL;
const char *cmd = NULL;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);

Wyświetl plik

@ -134,7 +134,7 @@ const char *gemini_get_info(AMP *amp)
return rc->model_name;
}
int gemini_status_parse(AMP *amp)
static int gemini_status_parse(AMP *amp)
{
int retval, n = 0;
char *p;
@ -204,7 +204,7 @@ int gemini_get_freq(AMP *amp, freq_t *freq)
int gemini_set_freq(AMP *amp, freq_t freq)
{
int retval;
char *cmd;
const char *cmd;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -268,7 +268,7 @@ int gemini_get_level(AMP *amp, setting_t level, value_t *val)
int gemini_set_level(AMP *amp, setting_t level, value_t val)
{
char *cmd = "?";
const char *cmd = "?";
int retval;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -340,7 +340,7 @@ int gemini_get_powerstat(AMP *amp, powerstat_t *status)
int gemini_set_powerstat(AMP *amp, powerstat_t status)
{
int retval;
char *cmd = NULL;
const char *cmd = NULL;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);

Wyświetl plik

@ -43,12 +43,12 @@ static int apex_get_string(ROT *rot, char *s, int maxlen)
static void *apex_read(void *arg)
{
ROT *rot = arg;
int retval = 0;
char data[64];
int expected_return_length = 63;
while (1)
{
int retval;
retval = apex_get_string(rot, data, expected_return_length);
if (strstr(data, "<VER>"))

Wyświetl plik

@ -50,9 +50,9 @@
static int
easycomm_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
{
hamlib_port_t *rotp = ROTPORT(rot);
hamlib_port_t *rotp;
int retval;
int retry = rot->caps->retry;
int retry;
rig_debug(RIG_DEBUG_TRACE, "%s called: %s\n", __func__, cmdstr);
@ -61,6 +61,9 @@ easycomm_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
return -RIG_EINVAL;
}
rotp = ROTPORT(rot);
retry = rot->caps->retry;
do
{
rig_flush(rotp);

Wyświetl plik

@ -225,7 +225,6 @@ gs232_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
{
rig_debug(RIG_DEBUG_WARN,
"%s: rotor didn't send CR...assuming it won't in the future\n", __func__);
retval = RIG_OK;
expected = 11; // we won't expect the CR
ROTPORT(rot)->retry = 3;
}

Wyświetl plik

@ -276,7 +276,7 @@ static int gs232a_rot_set_level(ROT *rot, setting_t level, value_t val)
}
/* between 1 (slowest) and 4 (fastest) */
SNPRINTF(cmdstr, sizeof(cmdstr), "X%u" EOM, speed);
SNPRINTF(cmdstr, sizeof(cmdstr), "X%d" EOM, speed);
retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1);
if (retval != RIG_OK)

Wyświetl plik

@ -294,10 +294,10 @@ static int gs232b_rot_set_level(ROT *rot, setting_t level, value_t val)
switch (level)
{
int retval;
case ROT_LEVEL_SPEED:
{
int retval;
int speed = val.i;
if (speed < 1)
@ -310,7 +310,7 @@ static int gs232b_rot_set_level(ROT *rot, setting_t level, value_t val)
}
/* between 1 (slowest) and 4 (fastest) */
SNPRINTF(cmdstr, sizeof(cmdstr), "X%u" EOM, speed);
SNPRINTF(cmdstr, sizeof(cmdstr), "X%d" EOM, speed);
retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1);
if (retval != RIG_OK)