diff options
author | Thomas Beierlein <tomjbe@gentoo.org> | 2022-11-17 08:06:09 +0100 |
---|---|---|
committer | Thomas Beierlein <tomjbe@gentoo.org> | 2022-11-17 08:09:17 +0100 |
commit | 573dae0ef553e180e7f5c85a333adce34237f59b (patch) | |
tree | cc8869f00938353863b9c5ff94a4680116303228 /media-libs/hamlib | |
parent | media-libs/hamlib: drop 4.3.1 (diff) | |
download | gentoo-573dae0ef553e180e7f5c85a333adce34237f59b.tar.gz gentoo-573dae0ef553e180e7f5c85a333adce34237f59b.tar.bz2 gentoo-573dae0ef553e180e7f5c85a333adce34237f59b.zip |
media-libs/hamlib: fix CLANG warnings
Backported from Hamlib repo i
(see https://github.com/Hamlib/Hamlib/issues/1149)
Closes: https://bugs.gentoo.org/880961
Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org>
Diffstat (limited to 'media-libs/hamlib')
-rw-r--r-- | media-libs/hamlib/files/hamlib-4.4-fix-clang-warnings.patch | 191 | ||||
-rw-r--r-- | media-libs/hamlib/hamlib-4.4.ebuild | 1 |
2 files changed, 192 insertions, 0 deletions
diff --git a/media-libs/hamlib/files/hamlib-4.4-fix-clang-warnings.patch b/media-libs/hamlib/files/hamlib-4.4-fix-clang-warnings.patch new file mode 100644 index 000000000000..832af50e0e6c --- /dev/null +++ b/media-libs/hamlib/files/hamlib-4.4-fix-clang-warnings.patch @@ -0,0 +1,191 @@ +From 1aebee2da9d29ff1d1a16e19f23bbff4e0f319a8 Mon Sep 17 00:00:00 2001 +From: Mike Black W9MDB <mdblack98@yahoo.com> +Date: Mon, 14 Nov 2022 16:37:20 -0600 +Subject: [PATCH 1/2] Fix clang warning on callback functions + https://github.com/Hamlib/Hamlib/issues/1149 + +--- + include/hamlib/rig.h | 4 +++- + rigs/aor/aor.c | 4 ++-- + src/mem.c | 15 ++++++++------- + tests/testcaps.sh | 12 ++++++++++++ + 4 files changed, 25 insertions(+), 10 deletions(-) + create mode 100755 tests/testcaps.sh + +diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h +index 574c21bd..5dbb5a7b 100644 +--- a/include/hamlib/rig.h ++++ b/include/hamlib/rig.h +@@ -1675,7 +1675,7 @@ typedef struct cal_table_float cal_table_float_t; + //! @cond Doxygen_Suppress + #define EMPTY_FLOAT_CAL { 0, { { 0, 0f }, } } + +-typedef int (* chan_cb_t)(RIG *, channel_t **, int, const chan_t *, rig_ptr_t); ++typedef int (* chan_cb_t)(RIG *, vfo_t vfo, channel_t **, int, const chan_t *, rig_ptr_t); + typedef int (* confval_cb_t)(RIG *, + const struct confparams *, + value_t *, +@@ -2024,10 +2024,12 @@ struct rig_caps { + int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t); + + int (*set_mem_all_cb)(RIG *rig, ++ vfo_t vfo, + chan_cb_t chan_cb, + confval_cb_t parm_cb, + rig_ptr_t); + int (*get_mem_all_cb)(RIG *rig, ++ vfo_t vfo, + chan_cb_t chan_cb, + confval_cb_t parm_cb, + rig_ptr_t); +diff --git a/rigs/aor/aor.c b/rigs/aor/aor.c +index ad4331d9..3f69d723 100644 +--- a/rigs/aor/aor.c ++++ b/rigs/aor/aor.c +@@ -1364,7 +1364,7 @@ int aor_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) + * future data for channel channel_num + */ + chan = NULL; +- retval = chan_cb(rig, &chan, chan_next, chan_list, arg); ++ retval = chan_cb(rig, vfo, &chan, chan_next, chan_list, arg); + + if (retval != RIG_OK) + { +@@ -1414,7 +1414,7 @@ int aor_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) + * provide application with channel data, + * and ask for a new channel structure + */ +- chan_cb(rig, &chan, chan_next, chan_list, arg); ++ chan_cb(rig, vfo, &chan, chan_next, chan_list, arg); + + if (j >= LINES_PER_MA - 1) + { +diff --git a/src/mem.c b/src/mem.c +index 8aa51e57..a6d72e59 100644 +--- a/src/mem.c ++++ b/src/mem.c +@@ -954,7 +954,7 @@ int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + * future data for channel channel_num + */ + chan = NULL; +- retval = chan_cb(rig, &chan, chan_list[i].startc, chan_list, arg); ++ retval = chan_cb(rig, vfo, &chan, chan_list[i].startc, chan_list, arg); + + if (retval != RIG_OK) + { +@@ -995,7 +995,7 @@ int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + + chan_next = j < chan_list[i].endc ? j + 1 : j; + +- chan_cb(rig, &chan, chan_next, chan_list, arg); ++ chan_cb(rig, vfo, &chan, chan_next, chan_list, arg); + } + } + +@@ -1016,7 +1016,7 @@ int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + for (j = chan_list[i].startc; j <= chan_list[i].endc; j++) + { + +- chan_cb(rig, &chan, j, chan_list, arg); ++ chan_cb(rig, vfo, &chan, j, chan_list, arg); + chan->vfo = RIG_VFO_MEM; + + retval = rig_set_channel(rig, vfo, chan); +@@ -1044,6 +1044,7 @@ struct map_all_s + * chan_cb_t to be used for non cb get/set_all + */ + static int map_chan(RIG *rig, ++ vfo_t vfo, + channel_t **chan, + int channel_num, + const chan_t *chan_list, +@@ -1343,7 +1344,7 @@ int HAMLIB_API rig_set_mem_all_cb(RIG *rig, + + if (rc->set_mem_all_cb) + { +- return rc->set_mem_all_cb(rig, chan_cb, parm_cb, arg); ++ return rc->set_mem_all_cb(rig, vfo, chan_cb, parm_cb, arg); + } + + +@@ -1411,7 +1412,7 @@ int HAMLIB_API rig_get_mem_all_cb(RIG *rig, + + if (rc->get_mem_all_cb) + { +- return rc->get_mem_all_cb(rig, chan_cb, parm_cb, arg); ++ return rc->get_mem_all_cb(rig, vfo, chan_cb, parm_cb, arg); + } + + /* if not available, emulate it */ +@@ -1480,7 +1481,7 @@ int HAMLIB_API rig_set_mem_all(RIG *rig, + mem_all_arg.vals = (value_t *) vals; + + if (rc->set_mem_all_cb) +- return rc->set_mem_all_cb(rig, map_chan, map_parm, ++ return rc->set_mem_all_cb(rig, vfo, map_chan, map_parm, + (rig_ptr_t)&mem_all_arg); + + /* if not available, emulate it */ +@@ -1548,7 +1549,7 @@ int HAMLIB_API rig_get_mem_all(RIG *rig, + mem_all_arg.vals = vals; + + if (rc->get_mem_all_cb) +- return rc->get_mem_all_cb(rig, map_chan, map_parm, ++ return rc->get_mem_all_cb(rig, vfo, map_chan, map_parm, + (rig_ptr_t)&mem_all_arg); + + /* +diff --git a/tests/testcaps.sh b/tests/testcaps.sh +new file mode 100755 +index 00000000..7032a2ce +--- /dev/null ++++ b/tests/testcaps.sh +@@ -0,0 +1,12 @@ ++#!/bin/sh ++model=1 ++riglist=`rigctl -l | cut -c1-8 | grep -v Rig | tr -d '\n'` ++for model in $riglist ++do ++ result=`rigctl -m $model -u 2>/dev/null | grep warnings` ++# if [[ "$result" == *"warnings: 0"* ]];then ++ echo $model " " $result ++# fi ++ ++ model=`expr $model + 1` ++done +-- +2.37.4 + + +From d7edd89a12be134a904d0a3d5fc3e4f68f111c16 Mon Sep 17 00:00:00 2001 +From: Mike Black W9MDB <mdblack98@yahoo.com> +Date: Mon, 14 Nov 2022 17:55:25 -0600 +Subject: [PATCH 2/2] Fix memcsv.c https://github.com/Hamlib/Hamlib/issues/1149 + +--- + tests/memcsv.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tests/memcsv.c b/tests/memcsv.c +index 8a107549..82becbf4 100644 +--- a/tests/memcsv.c ++++ b/tests/memcsv.c +@@ -48,6 +48,7 @@ char csv_sep = ','; /* CSV separator */ + * Prototypes + */ + static int dump_csv_chan(RIG *rig, ++ vfo_t vfo, + channel_t **chan, + int channel_num, + const chan_t *chan_list, +@@ -552,6 +553,7 @@ void dump_csv_name(const channel_cap_t *mem_caps, FILE *f) + + /* Caution! Keep the function consistent with dump_csv_name and set_channel_data! */ + int dump_csv_chan(RIG *rig, ++ vfo_t vfo, + channel_t **chan_pp, + int channel_num, + const chan_t *chan_list, +-- +2.37.4 + diff --git a/media-libs/hamlib/hamlib-4.4.ebuild b/media-libs/hamlib/hamlib-4.4.ebuild index 7a49e5967232..e6b249beabfe 100644 --- a/media-libs/hamlib/hamlib-4.4.ebuild +++ b/media-libs/hamlib/hamlib-4.4.ebuild @@ -40,6 +40,7 @@ DOCS=(AUTHORS NEWS PLAN README README.betatester README.developer) PATCHES=( "${FILESDIR}/${P}-slibtool.patch" # 798273 + "${FILESDIR}/${P}-fix-clang-warnings.patch" # 880961 ) S="${WORKDIR}/${MY_P}" |