public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libdnet/files/
@ 2025-04-10 10:19 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2025-04-10 10:19 UTC (permalink / raw
  To: gentoo-commits

commit:     02082e65bf077083e7aac1214ced4d256c7cd3a2
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Thu Apr  3 08:32:02 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Apr 10 10:17:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=02082e65

dev-libs/libdnet: fix errors on -Wincompatible-pointer-types

update last patch which fix -Wincompatible-function-pointer-types for
clang only

Closes: https://bugs.gentoo.org/933360
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/41442
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...-1.18.0-fix-incompatible-function-pointer.patch | 77 +++++++++++++++++++++-
 1 file changed, 75 insertions(+), 2 deletions(-)

diff --git a/dev-libs/libdnet/files/libdnet-1.18.0-fix-incompatible-function-pointer.patch b/dev-libs/libdnet/files/libdnet-1.18.0-fix-incompatible-function-pointer.patch
index 054bb9853ce9..836296f3895f 100644
--- a/dev-libs/libdnet/files/libdnet-1.18.0-fix-incompatible-function-pointer.patch
+++ b/dev-libs/libdnet/files/libdnet-1.18.0-fix-incompatible-function-pointer.patch
@@ -3,13 +3,16 @@ https://github.com/ofalk/libdnet/pull/104
 From de57a2349172148496386e284db91abe6406b02a Mon Sep 17 00:00:00 2001
 From: "Z. Liu" <zhixu.liu@gmail.com>
 Date: Wed, 19 Feb 2025 11:37:37 +0800
-Subject: [PATCH] python/dnet.pyx: fix incompatible-function-pointer-types for
- modern compiler
+Subject: [PATCH 1/2] python/dnet.pyx: fix incompatible-function-pointer-types
+ for modern compiler
 
 which is error now, see https://bugs.gentoo.org/933360,
 clang 19 (maybe earlier) has the same problem too
 
 Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
+---
+ python/dnet.pyx | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
 
 diff --git a/python/dnet.pyx b/python/dnet.pyx
 index 4e3604f..04db2c6 100644
@@ -108,3 +111,73 @@ index 4e3604f..04db2c6 100644
 -- 
 2.45.2
 
+
+From 0a742400b2167f67067e13bfcbecb9f17a7eefe8 Mon Sep 17 00:00:00 2001
+From: "Z. Liu" <zhixu.liu@gmail.com>
+Date: Thu, 3 Apr 2025 08:09:26 +0000
+Subject: [PATCH 2/2] python/dnet.pyx: fix -Wincompatible-pointer-types
+ reported by gcc14
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+./dnet.c:8451:52: error: passing argument 2 of ‘PyObject_AsReadBuffer’ from incompatible pointer type [-Wincompatible-pointer-types]
+ 8451 |   __pyx_t_1 = (PyObject_AsReadBuffer(__pyx_v_pkt, (&__pyx_v_p), (&__pyx_v_n)) == 0);
+      |                                                   ~^~~~~~~~~~~
+      |                                                    |
+      |                                                    char **
+/usr/include/python3.12/abstract.h:370:52: note: expected ‘const void **’ but argument is of type ‘char **’
+  370 |                                       const void **buffer,
+      |                                       ~~~~~~~~~~~~~^~~~~~
+./dnet.c:8451:66: error: passing argument 3 of ‘PyObject_AsReadBuffer’ from incompatible pointer type [-Wincompatible-pointer-types]
+ 8451 |   __pyx_t_1 = (PyObject_AsReadBuffer(__pyx_v_pkt, (&__pyx_v_p), (&__pyx_v_n)) == 0);
+      |                                                                 ~^~~~~~~~~~~
+      |                                                                  |
+      |                                                                  int *
+/usr/include/python3.12/abstract.h:371:51: note: expected ‘Py_ssize_t *’ {aka ‘long int *’} but argument is of type ‘int *’
+  371 |                                       Py_ssize_t *buffer_len);
+      |                                       ~~~~~~~~~~~~^~~~~~~~~~
+
+Signed-off-by: Z. Liu <zhixu.liu@gmail.com>
+---
+ python/dnet.pyx | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/python/dnet.pyx b/python/dnet.pyx
+index 04db2c6..6aefaa2 100644
+--- a/python/dnet.pyx
++++ b/python/dnet.pyx
+@@ -25,7 +25,7 @@ cdef extern from "dnet.h":
+ cdef extern from "Python.h":
+     object  PyBytes_FromStringAndSize(char *s, int len)
+     int     PyBytes_Size(object o)
+-    int     PyObject_AsReadBuffer(object o, char **pp, int *lenp)
++    int     PyObject_AsReadBuffer(object o, const void **pp, ssize_t *lenp)
+     int     PyLong_Check(object o)
+     int     PyLong_Check(object o)
+     long    PyLong_AsLong(object o)
+@@ -294,8 +294,8 @@ def ip_checksum(pkt):
+     """
+     cdef char buf[2048]
+     cdef char *p
+-    cdef int n
+-    if PyObject_AsReadBuffer(pkt, &p, &n) == 0:
++    cdef ssize_t n
++    if PyObject_AsReadBuffer(pkt, <const void **>&p, &n) == 0:
+         if n < 2048:
+             memcpy(buf, p, n)
+             __ip_checksum(buf, n)
+@@ -310,8 +310,8 @@ def ip_checksum(pkt):
+ 
+ def ip_cksum_add(buf, int sum):
+     cdef char *p
+-    cdef int n
+-    if PyObject_AsReadBuffer(buf, &p, &n) == 0:
++    cdef ssize_t n
++    if PyObject_AsReadBuffer(buf, <const void **>&p, &n) == 0:
+         return __ip_cksum_add(p, n, sum)
+     else:
+         raise TypeError
+-- 
+2.45.2
+


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-10 10:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 10:19 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libdnet/files/ Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox