Add and fix some cppcheck suppress items

https://github.com/Hamlib/Hamlib/issues/1351
pull/1404/head
Mike Black W9MDB 2023-10-03 17:11:09 -05:00
rodzic c93440706f
commit 3b5f7a6dcf
97 zmienionych plików z 49 dodań i 104 usunięć

Wyświetl plik

@ -183,6 +183,7 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len)
* Get Info
* returns the model name string
*/
// cppcheck-suppress constParameterPointer
const char *kpa_get_info(AMP *amp)
{
const struct amp_caps *rc;

Wyświetl plik

@ -207,6 +207,7 @@ int expert_transaction(AMP *amp, const unsigned char *cmd, int cmd_len,
* Get Info
* returns the model name string
*/
// cppcheck-suppress constParameterCallback
const char *expert_get_info(AMP *amp)
{
const struct amp_caps *rc;

Wyświetl plik

@ -124,6 +124,7 @@ int gemini_transaction(AMP *amp, const char *cmd, char *response,
* Get Info
* returns the model name string
*/
// cppcheck-suppress constParameterPointer
const char *gemini_get_info(AMP *amp)
{
const struct amp_caps *rc;

Wyświetl plik

@ -91,6 +91,7 @@ if test $# -eq 0 ; then
$SUPPRESS \
$CHECK \
. \
--template='{file}:{line},{severity},{id},{message}'
>cppcheck.log 2>&1
else
cppcheck --inline-suppr \
@ -105,5 +106,6 @@ else
--std=c99 \
$SUPPRESS \
$CHECK \
--template='{file}:{line},{severity},{id},{message}'
"$@"
fi

Wyświetl plik

@ -870,7 +870,6 @@ int gnuradio_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
return ret;
}
// cppcheck-suppress *
DECLARE_INITRIG_BACKEND(gnuradio)
{
rig_debug(RIG_DEBUG_VERBOSE, "gnuradio: _init called\n");

Wyświetl plik

@ -52,6 +52,7 @@ int main(int argc, char *argv[])
}
// turn this into a macro
// cppcheck-suppress cstyleCast
priv = (struct gnuradio_priv_data*)my_rig->state.priv;
if (priv == NULL) {
printf("Internal error, can't retrieve priv data!\n");

Wyświetl plik

@ -298,6 +298,7 @@ inline void THROW(const RigException *e)
#elif defined(_MSC_VER)
throw* e;
#elif defined(__SUNPRO_CC)
// cppcheck-suppress cstyleCast
genericerror(1, ((e != 0) ? (char *)(e->message) : ""));
#else

Wyświetl plik

@ -1,7 +1,7 @@
/* Dummy function to make sure libmisc never become an empty library.
* Solaris linker does not like such libs.
*/
// cppcheck-suppress
void dummy(void)
{

Wyświetl plik

@ -1457,6 +1457,7 @@ int adat_get_single_cmd_result(RIG *pRig)
{
int nBufLength = 0;
// cppcheck-suppress knownConditionTrueFalse
if (*pcPos == 0) // Adjust for 00 byte at beginning ...
{
pcPos++; // No, please don't ask me why this happens ... ;-)
@ -2164,6 +2165,7 @@ int adat_cmd_fn_set_freq(RIG *pRig)
}
else
{
// cppcheck-suppress constVariablePointer
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
char acBuf[ ADAT_BUFSZ + 1 ];
@ -2219,7 +2221,8 @@ int adat_cmd_fn_set_vfo(RIG *pRig)
}
else
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
char acBuf[ ADAT_BUFSZ + 1 ];
// Switch on VFO
@ -2682,7 +2685,8 @@ const char *adat_get_info(RIG *pRig)
if (nRC == RIG_OK)
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
snprintf(acBuf,2048,
"ADAT ADT-200A, Callsign: %s, S/N: %s, ID Code: %s, Options: %s, FW: %s, GUI FW: %s, HW: %s",
@ -2765,7 +2769,8 @@ int adat_get_freq(RIG *pRig, vfo_t vfo, freq_t *freq)
}
else
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
nRC = adat_transaction(pRig, &adat_cmd_list_get_freq);
@ -2922,7 +2927,8 @@ int adat_get_mode(RIG *pRig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
}
else
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
nRC = adat_transaction(pRig, &adat_cmd_list_get_mode);
@ -2964,7 +2970,8 @@ int adat_get_vfo(RIG *pRig, vfo_t *vfo)
}
else
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
nRC = adat_transaction(pRig, &adat_cmd_list_get_vfo);
@ -3043,7 +3050,8 @@ int adat_get_ptt(RIG *pRig, vfo_t vfo, ptt_t *ptt)
}
else
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
nRC = adat_transaction(pRig, &adat_cmd_list_get_ptt);
@ -3302,7 +3310,8 @@ int adat_get_conf(RIG *pRig, token_t token, char *val)
}
else
{
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
// cppcheck-suppress constVariablePointer
const adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
switch (token)
{

Wyświetl plik

@ -497,7 +497,6 @@ int dx77_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
/* at least 6 digits */
// cppcheck-suppress *
SNPRINTF(freqbuf, sizeof(freqbuf), AL CMD_RXFREQ "%06"PRIll EOM, (int64_t)freq);
return dx77_transaction(rig, freqbuf, strlen(freqbuf), NULL, NULL);

Wyświetl plik

@ -344,7 +344,6 @@ int dxsr8_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return -RIG_EINVAL;
}
// cppcheck-suppress *
SNPRINTF(cmd, sizeof(cmd), AL "~RW_RXF%08"PRIll EOM, (int64_t)freq);
return dxsr8_transaction(rig, cmd, strlen(cmd), NULL, NULL);
}
@ -357,7 +356,7 @@ int dxsr8_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
int retval, data_len;
char cmd[] = AL "~RR_RXF" EOM;
const char cmd[] = AL "~RR_RXF" EOM;
char freqbuf[BUFSZ];
retval = dxsr8_transaction(rig, cmd, strlen(cmd), freqbuf, &data_len);

Wyświetl plik

@ -317,7 +317,7 @@ int anytone_get_vfo(RIG *rig, vfo_t *vfo)
rig_debug(RIG_DEBUG_ERR, "%s: unknown vfo=0x%02x\n", __func__, reply[113]);
}
*vfo = p->vfo_curr;
p->vfo_curr = *vfo;
RETURNFUNC(retval);
}

Wyświetl plik

@ -174,7 +174,6 @@ static int format_freq(char *buf, int buf_len, freq_t freq)
f = f * 100 + lowhz;
// cppcheck-suppress *
SNPRINTF(buf, buf_len, "RF%010"PRIll, f);
return strlen(buf);
}

Wyświetl plik

@ -796,7 +796,6 @@ int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
rig_passband_normal(rig, chan->mode);
// cppcheck-suppress *
chan->levels[LVL_ATT].i = infobuf[6] == '0' ? 0 :
rig->caps->attenuator[infobuf[4] - '1'];

Wyświetl plik

@ -802,7 +802,6 @@ const struct rig_caps ar7030_caps =
.has_get_parm = AR7030_PARM,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -1260,6 +1260,7 @@ static int ar7030p_set_vfo(RIG *rig, vfo_t vfo)
return (rc);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_get_vfo(RIG *rig, vfo_t *vfo)
{
int rc = RIG_OK;
@ -1272,6 +1273,7 @@ static int ar7030p_get_vfo(RIG *rig, vfo_t *vfo)
return (rc);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_set_parm(RIG *rig, setting_t parm, value_t val)
{
int rc = -RIG_ENIMPL;
@ -1296,6 +1298,7 @@ static int ar7030p_set_parm(RIG *rig, setting_t parm, value_t val)
return (rc);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_get_parm(RIG *rig, setting_t parm, value_t *val)
{
int rc = -RIG_ENIMPL;
@ -1346,7 +1349,7 @@ static int ar7030p_get_mem(RIG *rig, vfo_t vfo, int *ch)
int rc = RIG_OK;
struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *) rig->state.priv;
channel_t *curr = priv->curr;
const channel_t *curr = priv->curr;
assert(NULL != ch);
@ -1384,6 +1387,7 @@ static int ar7030p_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
return (rc);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
{
int rc = -RIG_ENIMPL;
@ -1599,6 +1603,7 @@ static int ar7030p_reset(RIG *rig, reset_t reset)
return (rc);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_set_func(RIG *rig, vfo_t vfo, setting_t func,
int status)
{
@ -1607,6 +1612,7 @@ static int ar7030p_set_func(RIG *rig, vfo_t vfo, setting_t func,
return (-RIG_ENIMPL);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_get_func(RIG *rig, vfo_t vfo, setting_t func,
int *status)
{
@ -1617,6 +1623,7 @@ static int ar7030p_get_func(RIG *rig, vfo_t vfo, setting_t func,
return (-RIG_ENIMPL);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_decode_event(RIG *rig)
{
assert(NULL != rig);
@ -1624,6 +1631,7 @@ static int ar7030p_decode_event(RIG *rig)
return (-RIG_ENIMPL);
}
// cppcheck-suppress constParameterCallback
static int ar7030p_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
assert(NULL != rig);
@ -1640,7 +1648,7 @@ static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
unsigned int f;
unsigned char *p = NULL;
int ch;
struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)rig->state.priv;
const struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)rig->state.priv;
const channel_t *curr = priv->curr;
assert(NULL != chan);
@ -1670,7 +1678,6 @@ static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan,
if (RIG_OK == rc)
{
// cppcheck-suppress *
chan->levels[ LVL_SQL ].f = (float) v / 255.0;
}

Wyświetl plik

@ -148,7 +148,7 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
freq_t freq_rx, freq_tx;
freq_t freq_MHz;
char *response = NULL;
struct barrett_priv_data *priv = rig->state.priv;
const struct barrett_priv_data *priv = rig->state.priv;
//struct barrett_priv_data *priv = rig->state.priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s freq=%.0f\n", __func__,

Wyświetl plik

@ -363,7 +363,7 @@ int codan_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
return retval;
}
char *p = strstr(response, "Ptt");
const char *p = strstr(response, "Ptt");
if (p)
{

Wyświetl plik

@ -100,7 +100,7 @@ static void dra818_subaudio(RIG *rig, char *subaudio, int subaudio_len,
static int dra818_setgroup(RIG *rig)
{
struct dra818_priv *priv = rig->state.priv;
const struct dra818_priv *priv = rig->state.priv;
char cmd[80];
char subtx[8] = { 0 };
char subrx[8] = { 0 };

Wyświetl plik

@ -1205,7 +1205,6 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
qrm = -50;
}
// cppcheck-suppress *
level1 = LVL_ATT;
level2 = LVL_PREAMP;
curr->levels[idx].i = qrm + (time(NULL) % 32) + (rand() % 4)

Wyświetl plik

@ -1215,7 +1215,6 @@ int elad_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return -RIG_EINVAL;
}
// cppcheck-suppress *
SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll, vfo_letter, (int64_t)freq);
err = elad_transaction(rig, freqbuf, NULL, 0);

Wyświetl plik

@ -78,7 +78,6 @@ const struct rig_caps icm700pro_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } },
},
.parm_gran = {},

Wyświetl plik

@ -86,7 +86,6 @@ const struct rig_caps icm710_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } },
},
.parm_gran = {},

Wyświetl plik

@ -79,7 +79,6 @@ const struct rig_caps icm802_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } },
},
.parm_gran = {},

Wyświetl plik

@ -79,7 +79,6 @@ const struct rig_caps icm803_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } },
},
.parm_gran = {},

Wyświetl plik

@ -88,7 +88,6 @@ const struct rig_caps ic2730_caps =
.has_get_parm = IC2730_PARM_ALL,
.has_set_parm = IC2730_PARM_ALL,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -221,7 +221,6 @@ const struct rig_caps ic7000_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -112,7 +112,6 @@ const struct rig_caps ic703_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -338,7 +338,6 @@ const struct rig_caps ic7100_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -103,7 +103,6 @@ const struct rig_caps ic718_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -149,7 +149,6 @@ const struct rig_caps ic7200_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -714,7 +714,6 @@ const struct rig_caps ic7300_caps =
.has_set_parm = RIG_PARM_SET(IC7300_PARMS),
.level_gran = {
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 255}},
[LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}},
[LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}},

Wyświetl plik

@ -149,7 +149,6 @@ const struct rig_caps ic7410_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -207,7 +207,6 @@ const struct rig_caps ic746_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } },

Wyświetl plik

@ -111,7 +111,6 @@ const struct rig_caps ic751_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -166,7 +166,6 @@ const struct rig_caps ic756_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -303,7 +303,6 @@ struct rig_caps ic7600_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -383,7 +383,6 @@ struct rig_caps ic7610_caps =
.has_get_parm = IC7610_PARMS,
.has_set_parm = RIG_PARM_SET(IC7610_PARMS), /* FIXME: parms */
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -284,7 +284,6 @@ const struct rig_caps ic7700_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -93,7 +93,6 @@ const struct rig_caps ic78_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -181,7 +181,6 @@ const struct rig_caps ic7800_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -267,7 +267,6 @@ const struct rig_caps ic785x_caps =
.has_get_parm = IC785x_PARMS,
.has_set_parm = RIG_PARM_SET(IC785x_PARMS), /* FIXME: parms */
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
[LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } },

Wyświetl plik

@ -227,7 +227,6 @@ const struct rig_caps ic910_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
},

Wyświetl plik

@ -135,7 +135,6 @@ const struct rig_caps ic9100_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
},

Wyświetl plik

@ -124,7 +124,6 @@ const struct rig_caps ic92d_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -401,7 +401,6 @@ const struct rig_caps icf8101_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
},

Wyświetl plik

@ -82,7 +82,6 @@ const struct rig_caps icr10_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -82,7 +82,6 @@ const struct rig_caps icr20_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -153,7 +153,6 @@ const struct rig_caps icr30_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -80,7 +80,6 @@ const struct rig_caps icr6_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -204,7 +204,6 @@ const struct rig_caps icr7100_caps =
.has_get_parm = ICR7100_PARMS,
.has_set_parm = RIG_PARM_SET(ICR7100_PARMS),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -134,7 +134,6 @@ const struct rig_caps icr75_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_PBT_IN] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } },
[LVL_PBT_OUT] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } },

Wyświetl plik

@ -102,7 +102,6 @@ const struct rig_caps icr8500_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_IF] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } },
},

Wyświetl plik

@ -94,7 +94,6 @@ const struct rig_caps icr9000_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {

Wyświetl plik

@ -108,7 +108,6 @@ const struct rig_caps icr9500_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {

Wyświetl plik

@ -80,7 +80,6 @@ const struct rig_caps icrx7_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -98,7 +98,6 @@ const struct rig_caps id1_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -104,7 +104,6 @@ const struct rig_caps id31_caps =
.has_get_parm = ID31_PARM_ALL,
.has_set_parm = ID31_PARM_ALL,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.extparms = icom_ext_parms,

Wyświetl plik

@ -108,7 +108,6 @@ const struct rig_caps id4100_caps =
.has_get_parm = ID4100_PARM_ALL,
.has_set_parm = ID4100_PARM_ALL,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.extparms = icom_ext_parms,

Wyświetl plik

@ -111,7 +111,6 @@ const struct rig_caps id51_caps =
.has_get_parm = ID51_PARM_ALL,
.has_set_parm = ID51_PARM_ALL,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.ext_tokens = id51_tokens,

Wyświetl plik

@ -248,7 +248,6 @@ const struct rig_caps id5100_caps =
.level_gran =
{
#include "level_gran_icom.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.extparms = icom_ext_parms,

Wyświetl plik

@ -97,7 +97,6 @@ const struct rig_caps os456_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -90,7 +90,6 @@ const struct rig_caps os535_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -175,7 +175,6 @@ const struct rig_caps x108g_caps =
.has_set_parm = RIG_PARM_SET(X108G_PARMS),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
.ctcss_list = common_ctcss_list,
@ -351,7 +350,6 @@ const struct rig_caps x6100_caps =
.has_get_parm = X108G_PARMS,
.has_set_parm = RIG_PARM_SET(X108G_PARMS),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
@ -528,7 +526,6 @@ const struct rig_caps g90_caps =
.has_get_parm = X108G_PARMS,
.has_set_parm = RIG_PARM_SET(X108G_PARMS),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},
@ -705,7 +702,6 @@ const struct rig_caps x5105_caps =
.has_get_parm = X108G_PARMS,
.has_set_parm = RIG_PARM_SET(X108G_PARMS),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.parm_gran = {},

Wyświetl plik

@ -293,8 +293,6 @@ int jrc_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return -RIG_EINVAL;
}
// cppcheck-suppress *
// suppressing bogus cppcheck error in ver 1.90
SNPRINTF(freqbuf, sizeof(freqbuf), "F%0*"PRIll EOM, priv->max_freq_len,
(int64_t)freq);

Wyświetl plik

@ -119,7 +119,6 @@ const struct rig_caps nrd535_caps =
.has_get_parm = RIG_PARM_TIME,
.has_set_parm = RIG_PARM_SET(NRD535_PARM),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } },
[LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 } },

Wyświetl plik

@ -117,7 +117,6 @@ const struct rig_caps nrd545_caps =
.has_get_parm = RIG_PARM_TIME,
.has_set_parm = RIG_PARM_SET(NRD545_PARM),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } },
[LVL_IF] = { .min = { .i = -2550 }, .max = { .i = 2550 }, .step = { .i = 10} },

Wyświetl plik

@ -464,7 +464,6 @@ int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return -RIG_EINVAL;
}
// cppcheck-suppress *
SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll";", vfo_letter,
(int64_t)freq);
retval = ic10_transaction(rig, freqbuf, strlen(freqbuf), NULL, 0);

Wyświetl plik

@ -1922,7 +1922,6 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
RETURNFUNC2(-RIG_EINVAL);
}
// cppcheck-suppress *
SNPRINTF(freqbuf, sizeof(freqbuf), "F%c%011"PRIll, vfo_letter, (int64_t)freq);
// we need to modify priv->verify_cmd if ID is not being used

Wyświetl plik

@ -237,7 +237,6 @@ th_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
step = freq_sent >= MHz(470) ? 4 : step;
freq_sent = freq_sent >= MHz(470) ? (round(freq_sent / 10000) * 10000) :
freq_sent;
// cppcheck-suppress *
SNPRINTF(buf, sizeof(buf), "FQ %011"PRIll",%X\r", (int64_t) freq_sent, step);
return kenwood_transaction(rig, buf, buf, strlen(buf));

Wyświetl plik

@ -450,7 +450,6 @@ static int thd72_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_VERBOSE, "%s: tsindex=%d, stepsize=%d\n", __func__, tsindex,
(int)ts);
freq = roundl(freq / ts) * ts;
// cppcheck-suppress *
SNPRINTF(fbuf, sizeof(fbuf), "%010"PRIll, (int64_t)freq);
memcpy(buf + 5, fbuf, 10);
retval = kenwood_simple_transaction(rig, buf, 52);

Wyświetl plik

@ -798,7 +798,6 @@ int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
if (chan->tx_freq != RIG_FREQ_NONE)
{
req[5] = '1';
// cppcheck-suppress *
SNPRINTF(membuf, sizeof(membuf), "%s,%011"PRIll",%01d", req,
(int64_t)chan->tx_freq, step);
retval = kenwood_transaction(rig, membuf, NULL, 0);

Wyświetl plik

@ -756,7 +756,6 @@ pcr_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
priv = (struct pcr_priv_data *) rig->state.priv;
rcvr = is_sub_rcvr(rig, vfo) ? &priv->sub_rcvr : &priv->main_rcvr;
// cppcheck-suppress *
SNPRINTF((char *) buf, sizeof(buf), "K%c%010" PRIll "0%c0%c00",
is_sub_rcvr(rig, vfo) ? '1' : '0',
(int64_t) freq,

Wyświetl plik

@ -87,7 +87,6 @@ const struct rig_caps pcr100_caps =
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
/* XXX check this */
[LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } },

Wyświetl plik

@ -80,7 +80,6 @@ const struct rig_caps pcr1000_caps =
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
/* XXX check this */
[LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } },

Wyświetl plik

@ -83,7 +83,6 @@ const struct rig_caps pcr1500_caps =
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } },
[LVL_NR] = { .min = { .f = 0 }, .max = { .f = 16.0 }, .step = { .f = 1.0 } },
/* XXX check this */

Wyświetl plik

@ -92,7 +92,6 @@ const struct rig_caps pcr2500_caps =
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
/* XXX check this */
[LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } },

Wyświetl plik

@ -74,7 +74,6 @@ const struct rig_caps ra3702_caps =
.has_get_parm = RA3702_PARM_ALL,
.has_set_parm = RIG_PARM_SET(RA3702_PARM_ALL),
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
},
.vfo_ops = RA3702_VFO_OPS,

Wyświetl plik

@ -97,7 +97,6 @@ int rs_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
char freqbuf[32];
int retval;
// cppcheck-suppress *
SNPRINTF(freqbuf, sizeof(freqbuf), BOM "FREQ %"PRIll EOM, (int64_t)freq);
retval = rs_transaction(rig, freqbuf, strlen(freqbuf), NULL, NULL);

Wyświetl plik

@ -394,7 +394,6 @@ int tt565_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
#ifdef TT565_ASCII_FREQ
/* Use ASCII mode to set frequencies */
// cppcheck-suppress *
SNPRINTF(cmdbuf, sizeof(cmdbuf), "*%cF%"PRIll EOM,
which_vfo(rig, vfo),
(int64_t)freq);

Wyświetl plik

@ -90,7 +90,6 @@ const struct rig_caps tt550_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 65535}},
},
.parm_gran = {},

Wyświetl plik

@ -100,7 +100,6 @@ const struct rig_caps rx320_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 10000 } },
[LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0 / 64 } },
[LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 }, .step = { .i = 10} },

Wyświetl plik

@ -88,7 +88,6 @@ const struct rig_caps v4l_caps =
.has_set_parm = RIG_PARM_SET(V4L_PARM_ALL),
.vfo_ops = RIG_OP_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } },
},
.preamp = { RIG_DBLST_END },

Wyświetl plik

@ -88,7 +88,6 @@ const struct rig_caps v4l2_caps =
.has_set_parm = RIG_PARM_SET(V4L2_PARM_ALL),
.vfo_ops = RIG_OP_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } },
},
.preamp = { RIG_DBLST_END },

Wyświetl plik

@ -629,7 +629,6 @@ int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
/* TODO: Trunk, Delay, Recording */
chan->flags = (membuf[22] == 'N') ? RIG_CHFLAG_SKIP : 0;
// cppcheck-suppress *
chan->levels[LVL_ATT].i = (membuf[25] == 'N') ? rig->state.attenuator[0] : 0;
sscanf(membuf + 41, "%d", &tone);

Wyświetl plik

@ -82,7 +82,6 @@ const struct rig_caps wj8888_caps =
.preamp = { RIG_DBLST_END },
.attenuator = { RIG_DBLST_END },
.level_gran = {
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 0x7f } },
},
.max_rit = Hz(0),

Wyświetl plik

@ -173,7 +173,6 @@ const struct rig_caps ftdx1200_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
[LVL_MONITOR_GAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },

Wyświetl plik

@ -157,7 +157,6 @@ const struct rig_caps ft2000_caps =
.has_set_parm = RIG_PARM_BANDSELECT,
.level_gran = {
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },

Wyświetl plik

@ -65,7 +65,6 @@ const struct rig_caps ft450_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_CWPITCH] = { .min = { .i = 400 }, .max = { .i = 800 }, .step = { .i = 100 } },
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },

Wyświetl plik

@ -164,7 +164,6 @@ const struct rig_caps ftdx5000_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 4000 }, .step = { .i = 10 } },
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
[LVL_VOXGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },

Wyświetl plik

@ -156,7 +156,6 @@ const struct rig_caps ft891_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_RF] = { .min = { .f = 0 }, .max = { .f = 1.0f }, .step = { .f = 1.0f/30.0f } },
[LVL_MICGAIN] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },
[LVL_SQL] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/100.0f } },

Wyświetl plik

@ -72,7 +72,6 @@ const struct rig_caps ft9000_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } },
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },
@ -249,7 +248,6 @@ const struct rig_caps ft9000Old_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
[LVL_NOTCHF] = { .min = { .i = 1 }, .max = { .i = 3000 }, .step = { .i = 10 } },
[LVL_COMP] = { .min = { .f = 0 }, .max = { .f = 1.0 }, .step = { .f = 1.0f/255.0f } },

Wyświetl plik

@ -108,7 +108,6 @@ const struct rig_caps ft950_caps =
.level_gran =
{
#include "level_gran_yaesu.h"
// cppcheck-suppress *
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
[LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } },
[LVL_KEYSPD] = { .min = { .i = 4 }, .max = { .i = 60 }, .step = { .i = 1 } },

Wyświetl plik

@ -237,7 +237,6 @@ const struct rig_caps vx1700_caps =
.has_get_parm = RIG_PARM_NONE,
.has_set_parm = RIG_PARM_NONE,
.level_gran = {
// cppcheck-suppress *
[LVL_RFPOWER] = { .min = { .i = 0 }, .max = { .i = 2 } },
},
.parm_gran = {},

Wyświetl plik

@ -31,6 +31,7 @@
* @{
*/
#include <hamlib/rig.h>
#include <hamlib/config.h>
#include <stdio.h> /* Standard input/output definitions */
@ -52,9 +53,12 @@
#include "cm108.h"
#include "asyncpipe.h"
#define HAMLIB_TRACE2 rig_debug(RIG_DEBUG_TRACE,"%s trace(%d)\n", __FILE__, __LINE__)
#if defined(WIN32) && defined(HAVE_WINDOWS_H)
#include <windows.h>
static void init_sync_data_pipe(hamlib_port_t *p)
{
p->sync_data_pipe = NULL;
@ -1335,6 +1339,7 @@ static int read_string_generic(hamlib_port_t *p,
memset(rxbuffer, 0, rxmax);
short timeout_retries = p->timeout_retry;
HAMLIB_TRACE2;
while (total_count < rxmax - 1) // allow 1 byte for end-of-string
{
ssize_t rd_count = 0;
@ -1342,6 +1347,7 @@ static int read_string_generic(hamlib_port_t *p,
int timeout_save = p->timeout;
// p->timeout = 2;
result = port_wait_for_data(p, direct);
HAMLIB_TRACE2;
p->timeout = timeout_save;
if (result == -RIG_ETIMEOUT)
@ -1352,6 +1358,7 @@ static int read_string_generic(hamlib_port_t *p,
rig_debug(RIG_DEBUG_CACHE, "%s(%d): retrying read timeout %d/%d timeout=%d\n", __func__, __LINE__,
p->timeout_retry - timeout_retries, p->timeout_retry, p->timeout);
hl_usleep(10 * 1000);
HAMLIB_TRACE2;
continue;
}
@ -1409,8 +1416,10 @@ static int read_string_generic(hamlib_port_t *p,
//rig_debug(RIG_DEBUG_ERR, "xs: avail=%d expected_len=%d, minlen=%d, direct=%d\n", __func__, avail, expected_len, minlen, direct);
#endif
#endif
HAMLIB_TRACE2;
rd_count = port_read_generic(p, &rxbuffer[total_count],
expected_len == 1 ? 1 : minlen, direct);
HAMLIB_TRACE2;
// rig_debug(RIG_DEBUG_VERBOSE, "%s: read %d bytes tot=%d\n", __func__, (int)rd_count, total_count);
minlen -= rd_count;
@ -1423,6 +1432,7 @@ static int read_string_generic(hamlib_port_t *p,
}
while (++i < 10 && errno == EBUSY); // 50ms should be enough
HAMLIB_TRACE2;
/* if we get 0 bytes or an error something is wrong */
if (rd_count <= 0)

Wyświetl plik

@ -1616,7 +1616,6 @@ const chan_t *HAMLIB_API rig_lookup_mem_caps(RIG *rig, int ch)
*/
for (j = 0; j < sizeof(channel_cap_t); j++)
{
// cppcheck-suppress *
p1[j] |= p2[j];
}

Wyświetl plik

@ -440,7 +440,6 @@ int main(int argc, char *argv[])
if (retcode == RIG_OK)
{
// cppcheck-suppress *
printf("rig_get_mode: mode = %s\n", rig_strrmode(rmode));
}
else