kopia lustrzana https://github.com/Hamlib/Hamlib
Fix cppcheck warnings
rodzic
b79fdc0587
commit
6e8b90aeec
|
@ -222,7 +222,7 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
sprintf((char *) cmd_buf, "PC%04dR%08.0lfT%08.0lf", chan, freq, freq);
|
||||
retval = barrett_transaction(rig, cmd_buf, 0, &response);
|
||||
|
||||
if (strncmp(response, "OK", 2) != 0)
|
||||
if (retval != RIG_OK || strncmp(response, "OK", 2) != 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Expected OK, got '%s'\n", __func__, response);
|
||||
return -RIG_EPROTO;
|
||||
|
|
|
@ -306,8 +306,8 @@ int icom_transaction(RIG *rig, int cmd, int subcmd,
|
|||
int retval, retry;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d, data_len=%d\n", __func__,
|
||||
cmd, subcmd, payload_len, *data_len);
|
||||
"%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d\n", __func__,
|
||||
cmd, subcmd, payload_len);
|
||||
|
||||
retry = rig->state.rigport.retry;
|
||||
|
||||
|
|
|
@ -272,11 +272,10 @@ int g3_cleanup(RIG *rig)
|
|||
{
|
||||
struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv;
|
||||
|
||||
/* Clean up the dll access */
|
||||
FreeLibrary(priv->dll);
|
||||
|
||||
if (rig->state.priv)
|
||||
if (priv)
|
||||
{
|
||||
/* Clean up the dll access */
|
||||
FreeLibrary(priv->dll);
|
||||
free(rig->state.priv);
|
||||
}
|
||||
|
||||
|
|
|
@ -306,10 +306,7 @@ int g313_cleanup(RIG *rig)
|
|||
dlclose(priv->hWRAPI);
|
||||
}
|
||||
|
||||
if (rig->state.priv)
|
||||
{
|
||||
free(rig->state.priv);
|
||||
}
|
||||
free(rig->state.priv);
|
||||
|
||||
rig->state.priv = NULL;
|
||||
return RIG_OK;
|
||||
|
|
|
@ -469,11 +469,7 @@ int g313_cleanup(RIG *rig)
|
|||
FreeLibrary(priv->WinMM);
|
||||
FreeLibrary(priv->hWRG313WO);
|
||||
|
||||
|
||||
if (rig->state.priv)
|
||||
{
|
||||
free(rig->state.priv);
|
||||
}
|
||||
free(rig->state.priv);
|
||||
|
||||
rig->state.priv = NULL;
|
||||
|
||||
|
|
|
@ -437,6 +437,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
|
|||
if (RIG_IS_FRNG_END(rs->rx_range_list[0]))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if 0 // this is no longer applicable -- replace it with something?
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#define SERIAL_PORT "/dev/ttyUSB0"
|
||||
#define SERIAL_PORT "/dev/pts/3"
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
@ -36,7 +36,7 @@ int main(int argc, char *argv[])
|
|||
printf("testrig: Hello, I am your main() !\n");
|
||||
|
||||
/* Turn off backend debugging output */
|
||||
rig_set_debug_level(RIG_DEBUG_NONE);
|
||||
rig_set_debug_level(RIG_DEBUG_ERR);
|
||||
|
||||
/*
|
||||
* allocate memory, setup & open port
|
||||
|
@ -66,10 +66,13 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!my_rig)
|
||||
{
|
||||
fprintf(stderr, "Unknown rig num: %d\n", myrig_model);
|
||||
fprintf(stderr, "Please check riglist.h\n");
|
||||
fprintf(stderr, "Rig Not OK!!!\n");
|
||||
//fprintf(stderr, "Unknown rig num: %d\n", myrig_model);
|
||||
//fprintf(stderr, "Please check riglist.h\n");
|
||||
exit(1); /* whoops! something went wrong (mem alloc?) */
|
||||
}
|
||||
fprintf(stderr, "Rig OK\n");
|
||||
exit(0);
|
||||
|
||||
strncpy(my_rig->state.rigport.pathname, SERIAL_PORT, FILPATHLEN - 1);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue