mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 20:36:40 +02:00
Fix incompatible pointer types error on 32-bit arches.
```
tfpython.c: In function 'pyvar_to_tfvar':
tfpython.c:213:76: error: passing argument 3 of 'PyBytes_AsStringAndSize' from incompatible pointer type [-Wincompatible-pointer-types]
213 | if( PyBytes_Check( pRc ) && ( PyBytes_AsStringAndSize( pRc, &cstr, &len ) != -1 ) ) {
| ^~~~
| |
| long int *
In file included from /usr/include/python3.14/Python.h:89:
/usr/include/python3.14/bytesobject.h:54:17: note: expected 'Py_ssize_t *' {aka 'int *'} but argument is of type 'long int *'
54 | Py_ssize_t *len /* pointer to length variable or NULL */
| ~~~~~~~~~~~~^~~
tfpython.c:219:55: error: passing argument 3 of 'PyBytes_AsStringAndSize' from incompatible pointer type [-Wincompatible-pointer-types]
219 | PyBytes_AsStringAndSize( temp, &cstr, &len );
| ^~~~
| |
| long int *
/usr/include/python3.14/bytesobject.h:54:17: note: expected 'Py_ssize_t *' {aka 'int *'} but argument is of type 'long int *'
54 | Py_ssize_t *len /* pointer to length variable or NULL */
| ~~~~~~~~~~~~^~~
```
Also realign `gnu-source.patch` to remove a `'_GNU_SOURCE' redefined` warning.
13 lines
368 B
Diff
13 lines
368 B
Diff
diff -rupN a/src/tfpython.c b/src/tfpython.c
|
|
--- a/src/tfpython.c 2025-10-27 16:50:44.000000000 +0000
|
|
+++ b/src/tfpython.c 2026-03-29 02:42:54.570000000 +0000
|
|
@@ -201,7 +201,7 @@ static struct Value* pyvar_to_tfvar( PyO
|
|
{
|
|
struct Value *rc;
|
|
char *cstr;
|
|
- long int len; // Py_ssize_t len;
|
|
+ Py_ssize_t len;
|
|
|
|
// can be null if exception was thrown
|
|
if( !pRc ) {
|