From f143d8abd9ba2c388871410d11eb1d90a37503fb Mon Sep 17 00:00:00 2001 From: Michael Black Date: Thu, 23 Jan 2020 17:20:41 -0600 Subject: [PATCH 1/2] Fix cppcheck warnings --- rigs/icom/ic746.c | 13 ++++++------- src/debug.c | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 2023a3160..8a01c884b 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -130,7 +130,6 @@ typedef struct unsigned char tone_sql[3]; /* tone squelch frequency as tone */ struct { - unsigned char pol; /* DTCS polarity by nibbles Tx pol | Rx pol; 0 = normal; 1 = rev */ unsigned char code[2]; /* DTCS code bigendian */ } dcs; } channel_str_t; @@ -906,7 +905,6 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan) struct icom_priv_data *priv; struct rig_state *rs; unsigned char chanbuf[MAXFRAMELEN]; - mem_buf_t *membuf; int chan_len, freq_len, retval, data_len; rs = &rig->state; @@ -981,11 +979,12 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan) int band; int sc; unsigned char databuf[32]; + mem_buf_t *membuf; membuf = (mem_buf_t *)(chanbuf + 4); - chan->split = membuf->chan_flag & 0x10 ? RIG_SPLIT_ON : RIG_SPLIT_OFF; - chan->flags = membuf->chan_flag & 0x01 ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE; + chan->split = (membuf->chan_flag & 0x10) ? RIG_SPLIT_ON : RIG_SPLIT_OFF; + chan->flags = (membuf->chan_flag & 0x01) ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE; rig_debug(RIG_DEBUG_TRACE, "%s: chan->flags=0x%02x\n", __func__, chan->flags); /* data mode on */ rig_debug(RIG_DEBUG_TRACE, "%s: membuf->rx.data=0x%02x\n", __func__, membuf->rx.data); @@ -1070,7 +1069,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan) if (chan->split == RIG_SPLIT_ON) membuf.chan_flag |= 0x10; else - membuf.chan_flag |= chan->flags & RIG_CHFLAG_SKIP ? 0x01 : 0x00; + membuf.chan_flag |= (chan->flags & RIG_CHFLAG_SKIP) ? 0x01 : 0x00; // RX to_bcd(membuf.rx.freq, chan->freq, freq_len * 2); @@ -1086,7 +1085,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan) if(membuf.rx.pb == -1) membuf.rx.pb = PD_MEDIUM_3; - membuf.rx.data = chan->flags & RIG_CHFLAG_DATA ? 1 : 0; + membuf.rx.data = (chan->flags & RIG_CHFLAG_DATA) ? 1 : 0; membuf.rx.dup = chan->rptr_shift; // not empty otherwise the call fail @@ -1118,7 +1117,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan) if(membuf.tx.pb == -1) membuf.tx.pb = PD_MEDIUM_3; - membuf.tx.data = chan->flags | RIG_CHFLAG_DATA ? 1 : 0; + membuf.tx.data = (chan->flags | RIG_CHFLAG_DATA) ? 1 : 0; membuf.tx.dup = chan->rptr_shift; // not empty otherwise the call fail diff --git a/src/debug.c b/src/debug.c index 96c6834d6..f138a072e 100644 --- a/src/debug.c +++ b/src/debug.c @@ -61,13 +61,14 @@ static FILE *rig_debug_stream; static vprintf_cb_t rig_vprintf_cb; static rig_ptr_t rig_vprintf_arg; +extern HAMLIB_EXPORT(void) dump_hex(const unsigned char ptr[], size_t size); /** * \param ptr Pointer to memory area * \param size Number of chars to words to dump * \brief Do a hex dump of the unsigned char array. */ -HAMLIB_EXPORT(void) dump_hex(const unsigned char ptr[], size_t size) +void dump_hex(const unsigned char ptr[], size_t size) { /* example * 0000 4b 30 30 31 34 35 30 30 30 30 30 30 30 35 30 32 K001450000000502 From 3ea6aceb2e0998556e7fe5885c38c97e0532079c Mon Sep 17 00:00:00 2001 From: Michael Black Date: Thu, 23 Jan 2020 22:47:13 -0600 Subject: [PATCH 2/2] Fix rig dependency in src/Makefile.am --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 35dd67e68..b53926a4f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,6 +14,6 @@ libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $ libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la \ $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) -libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(BACKENDEPS) $(RIG_BACKEND_DEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) +libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) EXTRA_DIST = Android.mk