summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-03-03 08:47:19 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-06 09:52:16 +0000
commit2393d516b7ce4a527b8cbe8c775b5d7b26a648a5 (patch)
treef19c290c5bbc2770a3f53ad74cc896ec3839d722
parent8cbc5846413e6591bbcfcca24e54afad1ca4a52e (diff)
downloadpoky-2393d516b7ce4a527b8cbe8c775b5d7b26a648a5.tar.gz
libcomps: Fix callback function prototype for PyCOMPS_hash
(From OE-Core rev: 5e1f6fd8a93e38ec3ee1271ab319ea2d125c442b) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/libcomps/libcomps/0001-libcomps-Use-Py_hash_t-instead-of-long-in-PyCOMPS_ha.patch66
-rw-r--r--meta/recipes-devtools/libcomps/libcomps_0.1.19.bb1
2 files changed, 67 insertions, 0 deletions
diff --git a/meta/recipes-devtools/libcomps/libcomps/0001-libcomps-Use-Py_hash_t-instead-of-long-in-PyCOMPS_ha.patch b/meta/recipes-devtools/libcomps/libcomps/0001-libcomps-Use-Py_hash_t-instead-of-long-in-PyCOMPS_ha.patch
new file mode 100644
index 0000000000..dd9ebc8af4
--- /dev/null
+++ b/meta/recipes-devtools/libcomps/libcomps/0001-libcomps-Use-Py_hash_t-instead-of-long-in-PyCOMPS_ha.patch
@@ -0,0 +1,66 @@
1From 26a9647c832de15248ee649e5b77075521f3d4f0 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 3 Mar 2023 08:37:35 -0800
4Subject: [PATCH] libcomps: Use Py_hash_t instead of long in PyCOMPS_hash()
5
6This function is used as a hashfunc callback in
7_typeobject defined python3.11/cpython/object.h
8compilers detect the protype mismatch for function pointers
9with clang16+
10
11Fixes
12libcomps/src/python/src/pycomps_sequence.c:667:5: error: incompatible function pointer types initializing 'hashfunc' (aka 'int (*)(struct _object *)') with an expression of type 'long (*)(PyObject *)' (aka 'long (*)(struct _object *)') [-Wincompatible-function-pointer-types]
13 &PyCOMPS_hash, /*tp_hash */
14
15Upstream-Status: Submitted [https://github.com/rpm-software-management/libcomps/pull/101]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 libcomps/src/python/src/pycomps_hash.c | 4 ++--
19 libcomps/src/python/src/pycomps_hash.h | 2 +-
20 libcomps/src/python/src/pycomps_utils.h | 2 +-
21 3 files changed, 4 insertions(+), 4 deletions(-)
22
23diff --git a/libcomps/src/python/src/pycomps_hash.c b/libcomps/src/python/src/pycomps_hash.c
24index 474afd5..4577769 100644
25--- a/libcomps/src/python/src/pycomps_hash.c
26+++ b/libcomps/src/python/src/pycomps_hash.c
27@@ -20,9 +20,9 @@
28 #include "pycomps_hash.h"
29 #include "pycomps_utils.h"
30
31-long PyCOMPS_hash(PyObject *self) {
32+Py_hash_t PyCOMPS_hash(PyObject *self) {
33 char *cstr = NULL;
34- long crc;
35+ Py_hash_t crc;
36
37 cstr = comps_object_tostr(((PyCompsObject*)self)->c_obj);
38 crc = crc32(0, cstr, strlen(cstr));
39diff --git a/libcomps/src/python/src/pycomps_hash.h b/libcomps/src/python/src/pycomps_hash.h
40index b664cae..54e08d9 100644
41--- a/libcomps/src/python/src/pycomps_hash.h
42+++ b/libcomps/src/python/src/pycomps_hash.h
43@@ -26,6 +26,6 @@
44 #include "pycomps_utils.h"
45
46
47-long PyCOMPS_hash(PyObject *self);
48+Py_hash_t PyCOMPS_hash(PyObject *self);
49
50 #endif
51diff --git a/libcomps/src/python/src/pycomps_utils.h b/libcomps/src/python/src/pycomps_utils.h
52index ba9bc2f..b34e4dc 100644
53--- a/libcomps/src/python/src/pycomps_utils.h
54+++ b/libcomps/src/python/src/pycomps_utils.h
55@@ -137,7 +137,7 @@ COMPS_Object* __pycomps_bytes_in(PyObject *pobj);
56 PyObject* __pycomps_str_out(COMPS_Object *obj);
57 PyObject *str_to_unicode(void* str);
58
59-long PyCOMPS_hash(PyObject *self);
60+Py_hash_t PyCOMPS_hash(PyObject *self);
61
62 PyObject* PyCOMPSSeq_extra_get(PyObject *self, PyObject *key);
63
64--
652.39.2
66
diff --git a/meta/recipes-devtools/libcomps/libcomps_0.1.19.bb b/meta/recipes-devtools/libcomps/libcomps_0.1.19.bb
index fa1fbc8f0d..f8063d9400 100644
--- a/meta/recipes-devtools/libcomps/libcomps_0.1.19.bb
+++ b/meta/recipes-devtools/libcomps/libcomps_0.1.19.bb
@@ -5,6 +5,7 @@ LICENSE = "GPL-2.0-only"
5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 5LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
6 6
7SRC_URI = "git://github.com/rpm-software-management/libcomps.git;branch=master;protocol=https \ 7SRC_URI = "git://github.com/rpm-software-management/libcomps.git;branch=master;protocol=https \
8 file://0001-libcomps-Use-Py_hash_t-instead-of-long-in-PyCOMPS_ha.patch \
8 file://0002-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \ 9 file://0002-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
9 " 10 "
10 11