[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 4b6b5415f546a7dd0ffa3
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: n0nb <n0...@us...> - 2025-08-13 13:07:15
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via 4b6b5415f546a7dd0ffa3aaff09c7275449adbc5 (commit)
via 663fd4f738f770c27a6928012e443b35c0ff5fe6 (commit)
from 99047473585dcac9ccaff6a87015f974b73e9fd8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4b6b5415f546a7dd0ffa3aaff09c7275449adbc5
Merge: 990474735 663fd4f73
Author: Nate Bargmann <n0...@n0...>
Date: Wed Aug 13 07:06:43 2025 -0500
Merge GitHub PR #1844
commit 663fd4f738f770c27a6928012e443b35c0ff5fe6
Author: Daniele Forsi IU5HKX <iu...@gm...>
Date: Wed Aug 13 11:33:40 2025 +0200
Fix compiler warnings
Fixes:
hamlibpy_wrap.c: In function 'Rig_send_raw':
hamlibpy_wrap.c:4668:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
4668 | send = PyUnicode_AsUTF8AndSize(send_obj, &send_len);
| ^
hamlibpy_wrap.c:4679:30: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
4679 | term = PyUnicode_AsUTF8AndSize(term_obj, NULL);
| ^
Thanks to @GeoBaltz
diff --git a/bindings/rig.swg b/bindings/rig.swg
index 808183d2a..7aca173ef 100644
--- a/bindings/rig.swg
+++ b/bindings/rig.swg
@@ -739,13 +739,16 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin
PyObject *send_raw(PyObject *send_obj, PyObject *term_obj=NULL)
{
char *send, *term;
+ PyObject *bytes_obj;
size_t send_len;
int reply_len = MAX_RETURNSTR;
unsigned char reply_buffer[MAX_RETURNSTR];
int count;
if (PyUnicode_Check(send_obj)) {
- send = PyUnicode_AsUTF8AndSize(send_obj, &send_len);
+ bytes_obj = PyUnicode_AsUTF8String(send_obj);
+ PyBytes_AsStringAndSize(bytes_obj, &send, &send_len);
+ Py_XDECREF(bytes_obj);
} else if (PyBytes_Check(send_obj)) {
PyBytes_AsStringAndSize(send_obj, &send, &send_len);
} else {
@@ -756,7 +759,9 @@ int *rig_spectrum_cb_python(RIG *rig, struct rig_spectrum_line *rig_spectrum_lin
// Using NULL for length in PyUnicode_AsUTF8AndSize() and PyBytes_AsStringAndSize()
// because we can't accept '\0' because there is no length for term in rig_send_raw()
if (PyUnicode_Check(term_obj)) {
- term = PyUnicode_AsUTF8AndSize(term_obj, NULL);
+ bytes_obj = PyUnicode_AsUTF8String(term_obj);
+ PyBytes_AsStringAndSize(bytes_obj, &term, NULL);
+ Py_XDECREF(bytes_obj);
} else if (PyBytes_Check(term_obj)) {
PyBytes_AsStringAndSize(term_obj, &term, NULL);
} else if (term_obj == Py_None) {
-----------------------------------------------------------------------
Summary of changes:
bindings/rig.swg | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|