kopia lustrzana https://github.com/Hamlib/Hamlib
More cppcheck changes
rodzic
f13ffaf202
commit
bda5feb1bd
|
@ -6,7 +6,7 @@ echo "As of cppcheck v1.90 should be one message about missing include files"
|
|||
echo "This takes several hours to run"
|
||||
# We do suppress some errors which are expected or other code
|
||||
# There are quite a few C++ items to take care of still if anybody cares
|
||||
SUPPRESS="-i bindings -i lib/getopt.c -i lib/getopt_long.c --suppress=*:extra/gnuradio/demod.h --suppress=*:extra/gnuradio/HrAGC.h --suppress=*:extra/gnuradio/nfm.h --suppress=*:extra/gnuradio/am.h --suppress=*:extra/gnuradio/ssb.h --suppress=*:extra/gnuradio/wfm.h --suppress=*:extra/gnuradio/wfm.h --suppress=*:extra/gnuradio/HrAGC.h --suppress=knownConditionTrueFalse:tests/rotctl.c --suppress=knownConditionTrueFalse:tests/rigctl.c --suppress=knownConditionTrueFalse:tests/ampctl.c --suppress=knownConditionTrueFalse:tests/rotctl_parse.c --suppress=knownConditionTrueFalse:tests/rigctl_parse.c --suppress=knownConditionTrueFalse:tests/ampctl_parse.c"
|
||||
SUPPRESS="-i c++/rigclass.cc -i c++/rotclass.cc -i c++/ampclass.cc -i bindings -i lib/getopt.c -i lib/getopt_long.c --suppress=*:extra/gnuradio/demod.h --suppress=*:extra/gnuradio/HrAGC.h --suppress=*:extra/gnuradio/nfm.h --suppress=*:extra/gnuradio/am.h --suppress=*:extra/gnuradio/ssb.h --suppress=*:extra/gnuradio/wfm.h --suppress=*:extra/gnuradio/wfm.h --suppress=*:extra/gnuradio/HrAGC.h --suppress=knownConditionTrueFalse:tests/rotctl.c --suppress=knownConditionTrueFalse:tests/rigctl.c --suppress=knownConditionTrueFalse:tests/ampctl.c --suppress=knownConditionTrueFalse:tests/rotctl_parse.c --suppress=knownConditionTrueFalse:tests/rigctl_parse.c --suppress=knownConditionTrueFalse:tests/ampctl_parse.c"
|
||||
#CHECK="-D RIG_LEVEL_LINEOUT=1 -D SIGPIPE -D SIGINT -D IPV6_V6ONLY -D RIG_MODE_WFM -D ABI_VERSION=4 -D F_SETSIG=1 -U O_ASYNC -U SA_SIGINFO -U HASH_BLOOM -U HASH_EMIT_KEYS -U HASH_FUNCTION -U __USEP5P6__"
|
||||
CHECK="-Duint64_t -D HAVE_CONFIG_H -D HAMLIB_EXPORT -D HAMLIB_EXPORT_VAR -D __WORDSIZE -D BACKEND_EXPORT -D PRId64 -D DECLARE_INITRIG_BACKEND -D DECLARE_INITRROT_BACKEND -D DECLARE_INITAMP_BACKEND -U RIG_LEVEL_LINEOUT -U O_ASYNC -U F_SETSIG -U SA_SIGINFO -U SIGPIPE -U gai_strerror -U CMSPAR -U TIOCCBRK -U TIOCSBRK -U TIOCMBIC -U TIOCMBIS -U HASH_BLOOM -U HASH_EMIT_KEYS -U HASH_FUNCTION -U IPV6_V6ONLY"
|
||||
cppcheck --inline-suppr -I src -I include --include=include/config.h --include=include/hamlib/rig.h -q --force --enable=all --std=c99 $SUPPRESS $CHECK . &>cppcheck.log
|
||||
CHECK="-Duint64_t -D HAVE_CONFIG_H -D HAMLIB_EXPORT -D HAMLIB_EXPORT_VAR -D __WORDSIZE -D BACKEND_EXPORT -D PRId64 -D DECLARE_INITRIG_BACKEND -D DECLARE_INITRROT_BACKEND -D DECLARE_INITAMP_BACKEND -U RIG_LEVEL_LINEOUT -U O_ASYNC -U F_SETSIG -U SA_SIGINFO -U SIGPIPE -U gai_strerror -U CMSPAR -U TIOCCBRK -U TIOCSBRK -U TIOCMBIC -U TIOCMBIS -U HASH_BLOOM -U HASH_EMIT_KEYS -U HASH_FUNCTION -U IPV6_V6ONLY -D SIGINT -D WIN32 -D HAVE_SIGNAL"
|
||||
cppcheck --check-config --inline-suppr -I src -I include --include=include/config.h --include=include/hamlib/rig.h -q --force --enable=all --std=c99 $SUPPRESS $CHECK . &>cppcheck.log
|
||||
|
|
|
@ -370,7 +370,7 @@ typedef unsigned int vfo_t;
|
|||
|
||||
/** \brief '' -- used in caps */
|
||||
|
||||
#define RIG_VFO_N(n) (1<<(n))
|
||||
#define RIG_VFO_N(n) (1u<<(n))
|
||||
|
||||
#define RIG_VFO_NONE 0
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ struct channel {
|
|||
tone_t dcs_code; /*!< DCS code */
|
||||
tone_t dcs_sql; /*!< DCS squelch code */
|
||||
int scan_group; /*!< Scan group */
|
||||
int flags; /*!< Channel flags, see RIG_CHFLAG's */
|
||||
unsigned int flags; /*!< Channel flags, see RIG_CHFLAG's */
|
||||
char channel_desc[MAXCHANDESC]; /*!< Name */
|
||||
struct ext_list
|
||||
*ext_levels; /*!< Extension level value list, NULL ended. ext_levels can be NULL */
|
||||
|
|
|
@ -1360,6 +1360,7 @@ int kenwood_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 = kenwood_transaction(rig, freqbuf, NULL, 0);
|
||||
|
|
|
@ -382,6 +382,8 @@ static int thd74_round_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
int64_t f;
|
||||
long double r;
|
||||
shortfreq_t ts;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: rounded %"PRIll" to %"PRIll" because stepsize:%d\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
|
||||
|
@ -391,10 +393,7 @@ static int thd74_round_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
r = round((double)f / (double)ts);
|
||||
r = ts * r;
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: rounded %"PRIll" to %"PRIll" because stepsize:%d\n",
|
||||
__func__, f, (int64_t)r, (int)ts);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, f, (int64_t)r, (int)ts);
|
||||
|
||||
return (freq_t)r;
|
||||
}
|
||||
|
|
|
@ -762,7 +762,7 @@ 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-supress *
|
||||
// cppcheck-suppress *
|
||||
freq_len = sprintf((char *) buf, "K%c%010" PRIll "0%c0%c00",
|
||||
is_sub_rcvr(rig, vfo) ? '1' : '0',
|
||||
(int64_t) freq,
|
||||
|
|
|
@ -110,13 +110,14 @@ gp2000_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
{
|
||||
char freqbuf[32];
|
||||
int freq_len, retval;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = BOM "F%" PRIll ",%" PRIll EOM;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s,freq=%.0f\n", __func__,
|
||||
rig_strvfo(vfo), freq);
|
||||
|
||||
// cppcheck-suppress *
|
||||
freq_len =
|
||||
snprintf(freqbuf, sizeof(freqbuf), BOM "F%" PRIll ",%" PRIll EOM,
|
||||
snprintf(freqbuf, sizeof(freqbuf), fmt,
|
||||
(int64_t) freq,
|
||||
(int64_t) freq);
|
||||
retval = gp2000_transaction(rig, freqbuf, freq_len, NULL, NULL);
|
||||
|
|
|
@ -3426,6 +3426,8 @@ int ft1000d_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft1000d_priv_data *priv;
|
||||
int err;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -3454,10 +3456,8 @@ int ft1000d_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
/* store bcd format in in p_cmd */
|
||||
to_bcd(priv->p_cmd, freq / 10, FT1000D_BCD_DIAL);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(priv->p_cmd, FT1000D_BCD_DIAL) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
|
||||
FT1000D_BCD_DIAL) * 10);
|
||||
|
||||
err = write_block(&rig_s->rigport, (char *) &priv->p_cmd,
|
||||
YAESU_CMD_LENGTH);
|
||||
|
|
|
@ -693,6 +693,8 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
struct ft1000mp_priv_data *p;
|
||||
unsigned char *cmd; /* points to sequence to send */
|
||||
int cmd_index = 0;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ft1000mp_set_freq called\n", __func__);
|
||||
|
||||
|
@ -736,10 +738,7 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
to_bcd(p->p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */
|
||||
/* TODO -- fix 10Hz resolution -- FS */
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(p->p_cmd, 8) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(p->p_cmd, 8) * 10);
|
||||
|
||||
cmd = p->p_cmd; /* get native sequence */
|
||||
write_block(&rig_s->rigport, (char *) cmd, YAESU_CMD_LENGTH);
|
||||
|
|
|
@ -410,6 +410,8 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft747_priv_data *p;
|
||||
unsigned char *cmd; /* points to sequence to send */
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz \n";
|
||||
|
||||
p = (struct ft747_priv_data *)rig->state.priv;
|
||||
|
||||
|
@ -427,10 +429,8 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
though the rig will internally then round to 25 Hz steps */
|
||||
to_bcd(p->p_cmd, (freq + 5) / 10, 8);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz \n", __func__,
|
||||
(int64_t)from_bcd(p->p_cmd, 8) * 10);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, fmt, __func__, (int64_t)from_bcd(p->p_cmd,
|
||||
8) * 10);
|
||||
|
||||
rig_force_cache_timeout(&p->status_tv);
|
||||
|
||||
|
|
|
@ -308,6 +308,7 @@ int ft817_init(RIG *rig)
|
|||
// cppcheck-suppress *
|
||||
if ((rig->state.priv = calloc(1, sizeof(struct ft817_priv_data))) == NULL)
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -316,6 +317,7 @@ int ft817_init(RIG *rig)
|
|||
/* Copy complete native cmd set to private cmd storage area */
|
||||
memcpy(priv->pcs, ncmd, sizeof(ncmd));
|
||||
|
||||
// cppcheck-suppress *
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1866,6 +1866,8 @@ static int ft840_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft840_priv_data *priv;
|
||||
int err;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -1894,10 +1896,8 @@ static int ft840_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
/* store bcd format in in p_cmd */
|
||||
to_bcd(priv->p_cmd, freq / 10, FT840_BCD_DIAL);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(priv->p_cmd, FT840_BCD_DIAL) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
|
||||
FT840_BCD_DIAL) * 10);
|
||||
|
||||
err = write_block(&rig_s->rigport, (char *) &priv->p_cmd,
|
||||
YAESU_CMD_LENGTH);
|
||||
|
|
|
@ -699,6 +699,8 @@ int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
unsigned char p_cmd[YAESU_CMD_LENGTH]; /* sequence to send */
|
||||
int ret;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz \n";
|
||||
|
||||
if (!rig)
|
||||
{
|
||||
|
@ -719,9 +721,7 @@ int ft847_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
to_bcd_be(p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz \n", __func__,
|
||||
rig_debug(RIG_DEBUG_VERBOSE, fmt, __func__,
|
||||
(int64_t)from_bcd_be(p_cmd, 8) * 10);
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_FT847UNI)
|
||||
|
|
|
@ -298,6 +298,7 @@ int ft857_init(RIG *rig)
|
|||
// cppcheck-suppress *
|
||||
if ((rig->state.priv = calloc(1, sizeof(struct ft857_priv_data))) == NULL)
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -306,6 +307,7 @@ int ft857_init(RIG *rig)
|
|||
/* Copy complete native cmd set to private cmd storage area */
|
||||
memcpy(priv->pcs, ncmd, sizeof(ncmd));
|
||||
|
||||
// cppcheck-suppress *
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1805,6 +1805,8 @@ static int ft890_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft890_priv_data *priv;
|
||||
int err;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -1833,10 +1835,8 @@ static int ft890_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
/* store bcd format in in p_cmd */
|
||||
to_bcd(priv->p_cmd, freq / 10, FT890_BCD_DIAL);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(priv->p_cmd, FT890_BCD_DIAL) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
|
||||
FT890_BCD_DIAL) * 10);
|
||||
|
||||
err = write_block(&rig_s->rigport, (char *) &priv->p_cmd,
|
||||
YAESU_CMD_LENGTH);
|
||||
|
|
|
@ -331,6 +331,7 @@ int ft897_init(RIG *rig)
|
|||
// cppcheck-suppress *
|
||||
if ((rig->state.priv = calloc(1, sizeof(struct ft897_priv_data))) == NULL)
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -339,6 +340,7 @@ int ft897_init(RIG *rig)
|
|||
/* Copy complete native cmd set to private cmd storage area */
|
||||
memcpy(priv->pcs, ncmd, sizeof(ncmd));
|
||||
|
||||
// cppcheck-suppress *
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1807,6 +1807,8 @@ static int ft900_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft900_priv_data *priv;
|
||||
int err;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -1835,10 +1837,8 @@ static int ft900_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
/* store bcd format in in p_cmd */
|
||||
to_bcd(priv->p_cmd, freq / 10, FT900_BCD_DIAL);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(priv->p_cmd, FT900_BCD_DIAL) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
|
||||
FT900_BCD_DIAL) * 10);
|
||||
|
||||
err = write_block(&rig_s->rigport, (char *) &priv->p_cmd,
|
||||
YAESU_CMD_LENGTH);
|
||||
|
|
|
@ -2524,6 +2524,8 @@ static int ft920_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft920_priv_data *priv;
|
||||
int err;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -2556,10 +2558,8 @@ static int ft920_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
/* store bcd format in in p_cmd */
|
||||
to_bcd(priv->p_cmd, freq / 10, FT920_BCD_DIAL);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(priv->p_cmd, FT920_BCD_DIAL) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
|
||||
FT920_BCD_DIAL) * 10);
|
||||
|
||||
err = write_block(&rig_s->rigport, (char *) &priv->p_cmd, YAESU_CMD_LENGTH);
|
||||
|
||||
|
|
|
@ -3346,6 +3346,8 @@ int ft990_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
struct rig_state *rig_s;
|
||||
struct ft990_priv_data *priv;
|
||||
int err;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%s: requested freq after conversion = %"PRIll" Hz\n";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -3374,10 +3376,8 @@ int ft990_send_dial_freq(RIG *rig, unsigned char ci, freq_t freq)
|
|||
/* store bcd format in in p_cmd */
|
||||
to_bcd(priv->p_cmd, freq / 10, FT990_BCD_DIAL);
|
||||
|
||||
// cppcheck-suppress *
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: requested freq after conversion = %"PRIll" Hz\n",
|
||||
__func__, (int64_t)from_bcd(priv->p_cmd, FT990_BCD_DIAL) * 10);
|
||||
rig_debug(RIG_DEBUG_TRACE, fmt, __func__, (int64_t)from_bcd(priv->p_cmd,
|
||||
FT990_BCD_DIAL) * 10);
|
||||
|
||||
err = write_block(&rig_s->rigport, (char *) &priv->p_cmd,
|
||||
YAESU_CMD_LENGTH);
|
||||
|
|
|
@ -251,6 +251,7 @@ static void close_microham()
|
|||
#define NUMUHTYPES 9
|
||||
static struct uhtypes
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
const char *name;
|
||||
const char *device;
|
||||
} uhtypes[NUMUHTYPES] =
|
||||
|
|
|
@ -126,6 +126,9 @@ void never_used()
|
|||
rot_probe_all();
|
||||
rot_unregister();
|
||||
set_parm_all_cb_generic();
|
||||
sprintf_level();
|
||||
sprintf_level_ext();
|
||||
sprintf_parm();
|
||||
tentec_trx_open();
|
||||
thd72_get_chan_all_cb();
|
||||
thd74_get_chan_all_cb();
|
||||
|
|
|
@ -1635,6 +1635,8 @@ declare_proto_amp(get_freq)
|
|||
{
|
||||
int status;
|
||||
freq_t freq;
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%"PRIll"%c";
|
||||
|
||||
status = amp_get_freq(amp, &freq);
|
||||
|
||||
|
@ -1648,7 +1650,7 @@ declare_proto_amp(get_freq)
|
|||
fprintf(fout, "%s: ", cmd->arg1); /* i.e. "Frequency" */
|
||||
}
|
||||
|
||||
fprintf(fout, "%"PRIll"%c", (int64_t)freq, resp_sep);
|
||||
fprintf(fout, fmt, (int64_t)freq, resp_sep);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
int print_caps_sum(const struct rig_caps *caps, void *data)
|
||||
{
|
||||
char *fmt1 = "%-13s";
|
||||
printf("%6d \t%-22s \t%-23s\t%-8s \t",
|
||||
printf("%6u \t%-22s \t%-23s\t%-8s \t",
|
||||
caps->rig_model,
|
||||
caps->mfg_name,
|
||||
caps->model_name,
|
||||
|
|
|
@ -162,7 +162,9 @@ int dump_xml_chan(RIG *rig,
|
|||
|
||||
if (mem_caps->freq && chan.freq != RIG_FREQ_NONE)
|
||||
{
|
||||
sprintf(attrbuf, "%"PRIll, (int64_t)chan.freq);
|
||||
// cppcheck-suppress *
|
||||
char *fmt = "%"PRIll;
|
||||
sprintf(attrbuf, fmt, (int64_t)chan.freq);
|
||||
xmlNewProp(node, (unsigned char *) "freq", (unsigned char *) attrbuf);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,12 +54,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (!my_rig)
|
||||
{
|
||||
fprintf(stderr, "Unknown rig num: %d\n", myrig_model);
|
||||
fprintf(stderr, "Unknown rig num: %u\n", myrig_model);
|
||||
fprintf(stderr, "Please check riglist.h\n");
|
||||
exit(1); /* whoops! something went wrong (mem alloc?) */
|
||||
}
|
||||
|
||||
printf("Opened rig model %d, '%s'\n",
|
||||
printf("Opened rig model %u, '%s'\n",
|
||||
my_rig->caps->rig_model,
|
||||
my_rig->caps->model_name);
|
||||
|
||||
|
|
|
@ -439,7 +439,7 @@ int main(int argc, char *argv[])
|
|||
if (!my_rig)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Unknown rig num %d, or initialization error.\n",
|
||||
"Unknown rig num %u, or initialization error.\n",
|
||||
my_model);
|
||||
fprintf(stderr, "Please check with --list option.\n");
|
||||
exit(2);
|
||||
|
@ -533,7 +533,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (verbose > 0)
|
||||
{
|
||||
printf("Opened rig model %d, '%s'\n",
|
||||
printf("Opened rig model %u, '%s'\n",
|
||||
my_rig->caps->rig_model,
|
||||
my_rig->caps->model_name);
|
||||
}
|
||||
|
|
|
@ -1879,6 +1879,8 @@ declare_proto_rig(get_freq)
|
|||
{
|
||||
int status;
|
||||
freq_t freq;
|
||||
// cppcheck-suppress
|
||||
char *fmt = "%"PRIll"%c";
|
||||
|
||||
status = rig_get_freq(rig, vfo, &freq);
|
||||
|
||||
|
@ -1892,7 +1894,7 @@ declare_proto_rig(get_freq)
|
|||
fprintf(fout, "%s: ", cmd->arg1); /* i.e. "Frequency" */
|
||||
}
|
||||
|
||||
fprintf(fout, "%"PRIll"%c", (int64_t)freq, resp_sep);
|
||||
fprintf(fout, fmt, (int64_t)freq, resp_sep);
|
||||
|
||||
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
||||
{
|
||||
|
|
|
@ -715,6 +715,7 @@ static int handle_ts2000(void *arg)
|
|||
int p15 = 0; // P15 Shift status dummy value for now
|
||||
int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq);
|
||||
char response[64];
|
||||
char *fmt = "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;";
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
|
@ -759,7 +760,7 @@ static int handle_ts2000(void *arg)
|
|||
|
||||
snprintf(response,
|
||||
sizeof(response),
|
||||
"IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;",
|
||||
fmt,
|
||||
(uint64_t)freq,
|
||||
freq_step,
|
||||
rit_xit_freq,
|
||||
|
|
|
@ -537,7 +537,7 @@ int main(int argc, char *argv[])
|
|||
if (!my_rig)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Unknown rig num %d, or initialization error.\n",
|
||||
"Unknown rig num %u, or initialization error.\n",
|
||||
my_model);
|
||||
|
||||
fprintf(stderr, "Please check with --list option.\n");
|
||||
|
@ -623,7 +623,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (verbose > RIG_DEBUG_ERR)
|
||||
{
|
||||
printf("Opened rig model %d, '%s'\n",
|
||||
printf("Opened rig model %u, '%s'\n",
|
||||
my_rig->caps->rig_model,
|
||||
my_rig->caps->model_name);
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (client_count)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_WARN, "%d outstanding client(s)\n", client_count);
|
||||
rig_debug(RIG_DEBUG_WARN, "%u outstanding client(s)\n", client_count);
|
||||
}
|
||||
|
||||
rig_close(my_rig);
|
||||
|
|
|
@ -40,7 +40,7 @@ int create_png_range(const freq_range_t rx_range_list[],
|
|||
int print_caps_sum(const struct rig_caps *caps, void *data)
|
||||
{
|
||||
|
||||
printf("<TR><TD><A HREF=\"support/model%d.txt\">%s</A></TD><TD>%s</TD>"
|
||||
printf("<TR><TD><A HREF=\"support/model%u.txt\">%s</A></TD><TD>%s</TD>"
|
||||
"<TD>%s</TD><TD>%s</TD><TD>",
|
||||
caps->rig_model,
|
||||
caps->model_name,
|
||||
|
@ -90,15 +90,15 @@ int print_caps_sum(const struct rig_caps *caps, void *data)
|
|||
printf("Unknown");
|
||||
}
|
||||
|
||||
printf("</TD><TD><A HREF=\"#rng%d\">range</A></TD>"
|
||||
"<TD><A HREF=\"#parms%d\">parms</A></TD>"
|
||||
"<TD><A HREF=\"#caps%d\">caps</A></TD>"
|
||||
"<TD><A HREF=\"#getfunc%d\">funcs</A></TD>"
|
||||
"<TD><A HREF=\"#setfunc%d\">funcs</A></TD>"
|
||||
"<TD><A HREF=\"#getlevel%d\">levels</A></TD>"
|
||||
"<TD><A HREF=\"#setlevel%d\">levels</A></TD>"
|
||||
"<TD><A HREF=\"#getparm%d\">parms</A></TD>"
|
||||
"<TD><A HREF=\"#setparm%d\">parms</A></TD>"
|
||||
printf("</TD><TD><A HREF=\"#rng%u\">range</A></TD>"
|
||||
"<TD><A HREF=\"#parms%u\">parms</A></TD>"
|
||||
"<TD><A HREF=\"#caps%u\">caps</A></TD>"
|
||||
"<TD><A HREF=\"#getfunc%u\">funcs</A></TD>"
|
||||
"<TD><A HREF=\"#setfunc%u\">funcs</A></TD>"
|
||||
"<TD><A HREF=\"#getlevel%u\">levels</A></TD>"
|
||||
"<TD><A HREF=\"#setlevel%u\">levels</A></TD>"
|
||||
"<TD><A HREF=\"#getparm%u\">parms</A></TD>"
|
||||
"<TD><A HREF=\"#setparm%u\">parms</A></TD>"
|
||||
"</TR>\n",
|
||||
caps->rig_model, caps->rig_model, caps->rig_model,
|
||||
caps->rig_model, caps->rig_model, caps->rig_model,
|
||||
|
@ -113,7 +113,7 @@ int print_caps_sum(const struct rig_caps *caps, void *data)
|
|||
*/
|
||||
int print_caps_parameters(const struct rig_caps *caps, void *data)
|
||||
{
|
||||
printf("<A NAME=\"parms%d\"><TR><TD>%s</TD><TD>",
|
||||
printf("<A NAME=\"parms%u\"><TR><TD>%s</TD><TD>",
|
||||
caps->rig_model,
|
||||
caps->model_name);
|
||||
|
||||
|
@ -224,7 +224,7 @@ int print_caps_parameters(const struct rig_caps *caps, void *data)
|
|||
*/
|
||||
int print_caps_caps(const struct rig_caps *caps, void *data)
|
||||
{
|
||||
printf("<A NAME=\"caps%d\"><TR><TD>%s</TD>",
|
||||
printf("<A NAME=\"caps%u\"><TR><TD>%s</TD>",
|
||||
caps->rig_model,
|
||||
caps->model_name);
|
||||
|
||||
|
@ -282,7 +282,7 @@ int print_caps_parm(const struct rig_caps *caps, void *data)
|
|||
|
||||
parm = (*(int *)data) ? caps->has_set_parm : caps->has_get_parm;
|
||||
|
||||
printf("<A NAME=\"%sparm%d\"><TR><TD>%s</TD>",
|
||||
printf("<A NAME=\"%sparm%u\"><TR><TD>%s</TD>",
|
||||
(*(int *)data) ? "set" : "get",
|
||||
caps->rig_model,
|
||||
caps->model_name);
|
||||
|
@ -319,7 +319,7 @@ int print_caps_level(const struct rig_caps *caps, void *data)
|
|||
|
||||
level = (*(int *)data) ? caps->has_set_level : caps->has_get_level;
|
||||
|
||||
printf("<A NAME=\"%slevel%d\"><TR><TD>%s</TD>",
|
||||
printf("<A NAME=\"%slevel%u\"><TR><TD>%s</TD>",
|
||||
(*(int *)data) ? "set" : "get",
|
||||
caps->rig_model,
|
||||
caps->model_name);
|
||||
|
@ -356,7 +356,7 @@ int print_caps_func(const struct rig_caps *caps, void *data)
|
|||
|
||||
func = (*(int *)data) ? caps->has_set_func : caps->has_get_func;
|
||||
|
||||
printf("<A NAME=\"%sfunc%d\"><TR><TD>%s</TD>",
|
||||
printf("<A NAME=\"%sfunc%u\"><TR><TD>%s</TD>",
|
||||
(*(int *)data) ? "set" : "get",
|
||||
caps->rig_model,
|
||||
caps->model_name);
|
||||
|
@ -388,8 +388,8 @@ int print_caps_range(const struct rig_caps *caps, void *data)
|
|||
create_png_range(caps->rx_range_list2, caps->tx_range_list2,
|
||||
caps->rig_model);
|
||||
|
||||
printf("<A NAME=\"rng%d\"><TR><TD>%s</TD>"
|
||||
"<TD><IMG SRC=\"range%d.png\"></TD></TR></A>",
|
||||
printf("<A NAME=\"rng%u\"><TR><TD>%s</TD>"
|
||||
"<TD><IMG SRC=\"range%u.png\"></TD></TR></A>",
|
||||
caps->rig_model,
|
||||
caps->model_name,
|
||||
caps->rig_model);
|
||||
|
|
|
@ -236,7 +236,7 @@ int main(int argc, char *argv[])
|
|||
if (!rig)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Unknown rig num %d, or initialization error.\n",
|
||||
"Unknown rig num %u, or initialization error.\n",
|
||||
my_model);
|
||||
|
||||
fprintf(stderr, "Please check with --list option.\n");
|
||||
|
@ -260,7 +260,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
|
||||
fprintf(stderr,
|
||||
"Error: rig num %d has no memory support implemented/available.\n",
|
||||
"Error: rig num %u has no memory support implemented/available.\n",
|
||||
my_model);
|
||||
exit(3);
|
||||
}
|
||||
|
@ -268,7 +268,7 @@ int main(int argc, char *argv[])
|
|||
/* check channel description */
|
||||
if (rig->caps->chan_list[0].type == 0)
|
||||
{
|
||||
fprintf(stderr, "Error: rig num %d has no channel list.\n",
|
||||
fprintf(stderr, "Error: rig num %u has no channel list.\n",
|
||||
my_model);
|
||||
exit(3);
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (verbose > 0)
|
||||
{
|
||||
printf("Opened rig model %d, '%s'\n",
|
||||
printf("Opened rig model %u, '%s'\n",
|
||||
rig->caps->rig_model,
|
||||
rig->caps->model_name);
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ int main(int argc, char *argv[])
|
|||
if (!rig)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Unknown rig num %d, or initialization error.\n",
|
||||
"Unknown rig num %u, or initialization error.\n",
|
||||
rig_model);
|
||||
|
||||
fprintf(stderr, "Please check with --list option.\n");
|
||||
|
@ -292,7 +292,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (verbose > 0)
|
||||
{
|
||||
printf("Opened rig model %d, '%s'\n",
|
||||
printf("Opened rig model %u, '%s'\n",
|
||||
rig->caps->rig_model,
|
||||
rig->caps->model_name);
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ int main(int argc, char *argv[])
|
|||
if (!rig)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Unknown rig num %d, or initialization error.\n",
|
||||
"Unknown rig num %u, or initialization error.\n",
|
||||
my_model);
|
||||
|
||||
fprintf(stderr, "Please check with --list option.\n");
|
||||
|
@ -297,7 +297,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (verbose > 0)
|
||||
{
|
||||
printf("Opened rig model %d, '%s'\n",
|
||||
printf("Opened rig model %u, '%s'\n",
|
||||
rig->caps->rig_model,
|
||||
rig->caps->model_name);
|
||||
}
|
||||
|
|
|
@ -298,6 +298,7 @@ int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b)
|
|||
|
||||
void hash_sort_by_model_id()
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
HASH_SORT(models, hash_model_id_sort);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ int sprintf_mode(char *str, rmode_t mode)
|
|||
|
||||
for (i = 0; i < 63; i++)
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
const char *ms = rig_strrmode(mode & (1ULL << i));
|
||||
|
||||
if (!ms || !ms[0])
|
||||
|
|
|
@ -50,6 +50,7 @@ int main(int argc, char *argv[])
|
|||
printf(",%2.2x", b[i]);
|
||||
}
|
||||
|
||||
// cppcheck-suppress *
|
||||
printf("\nResult after recoding: %"PRIll"\n", (int64_t)from_bcd(b, digits));
|
||||
|
||||
printf("\nBig Endian mode\n");
|
||||
|
|
|
@ -38,26 +38,32 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* freq on 31bits test */
|
||||
f = GHz(2);
|
||||
// cppcheck-suppress *
|
||||
printf("GHz(2) = %"PRIll"\n", (int64_t)f);
|
||||
|
||||
/* freq on 32bits test */
|
||||
f = GHz(4);
|
||||
// cppcheck-suppress *
|
||||
printf("GHz(4) = %"PRIll"\n", (int64_t)f);
|
||||
|
||||
/* freq on >32bits test */
|
||||
f = GHz(5);
|
||||
// cppcheck-suppress *
|
||||
printf("GHz(5) = %"PRIll"\n", (int64_t)f);
|
||||
|
||||
/* floating point to freq conversion test */
|
||||
f = GHz(1.3);
|
||||
// cppcheck-suppress *
|
||||
printf("GHz(1.3) = %"PRIll"\n", (int64_t)f);
|
||||
|
||||
/* floating point to freq conversion precision test */
|
||||
f = GHz(1.234567890);
|
||||
// cppcheck-suppress *
|
||||
printf("GHz(1.234567890) = %"PRIll"\n", (int64_t)f);
|
||||
|
||||
/* floating point to freq conversion precision test, with freq >32bits */
|
||||
f = GHz(123.456789012);
|
||||
// cppcheck-suppress *
|
||||
printf("GHz(123.456789012) = %"PRIll"\n", (int64_t)f);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -428,6 +428,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
if (retcode == RIG_OK)
|
||||
{
|
||||
// cppcheck-suppress *
|
||||
printf("rig_get_mode: mode = %"PRIll"\n", rmode);
|
||||
}
|
||||
else
|
||||
|
|
Ładowanie…
Reference in New Issue