diff options
Diffstat (limited to 'meta-python')
2 files changed, 39 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-lru-dict/0001-lru-Use-PyCFunction-instead-of-PyCFunctionWithKeywor.patch b/meta-python/recipes-devtools/python/python3-lru-dict/0001-lru-Use-PyCFunction-instead-of-PyCFunctionWithKeywor.patch new file mode 100644 index 0000000000..b93d1594da --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-lru-dict/0001-lru-Use-PyCFunction-instead-of-PyCFunctionWithKeywor.patch | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | From 5013406c409a0a143a315146df388281bfb2172d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Wed, 1 Mar 2023 19:53:36 -0800 | ||
| 4 | Subject: [PATCH] lru: Use PyCFunction instead of PyCFunctionWithKeywords | ||
| 5 | |||
| 6 | PyMethodDef uses PyMethodDef and not PyCFunctionWithKeywords and when | ||
| 7 | callback is specified as PyCFunctionWithKeywords, clang 16+ is able to | ||
| 8 | detect function signature mismatch in function pointers now. | ||
| 9 | |||
| 10 | Fixes | ||
| 11 | lru.c:629:17: error: incompatible function pointer types initializing 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') with an expression of type 'PyCFunctionWithKeywords' (aka 'struct _object *(*)(struct _object *, struct _object *, struct _object *)') [-Wincompatible-function-pointer-types] | ||
| 12 | {"popitem", (PyCFunctionWithKeywords)LRU_popitem, METH_VARARGS | METH_KEYWORDS, | ||
| 13 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 14 | 1 error generated. | ||
| 15 | |||
| 16 | Upstream-Status: Submitted [https://github.com/amitdev/lru-dict/pull/45] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | lru.c | 2 +- | ||
| 20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 21 | |||
| 22 | diff --git a/lru.c b/lru.c | ||
| 23 | index 8adcb4b..33c18ab 100644 | ||
| 24 | --- a/lru.c | ||
| 25 | +++ b/lru.c | ||
| 26 | @@ -626,7 +626,7 @@ static PyMethodDef LRU_methods[] = { | ||
| 27 | PyDoc_STR("L.setdefault(key, default=None) -> If L has key return its value, otherwise insert key with a value of default and return default")}, | ||
| 28 | {"pop", (PyCFunction)LRU_pop, METH_VARARGS, | ||
| 29 | PyDoc_STR("L.pop(key[, default]) -> If L has key return its value and remove it from L, otherwise return default. If default is not given and key is not in L, a KeyError is raised.")}, | ||
| 30 | - {"popitem", (PyCFunctionWithKeywords)LRU_popitem, METH_VARARGS | METH_KEYWORDS, | ||
| 31 | + {"popitem", (PyCFunction)LRU_popitem, METH_VARARGS | METH_KEYWORDS, | ||
| 32 | PyDoc_STR("L.popitem([least_recent=True]) -> Returns and removes a (key, value) pair. The pair returned is the least-recently used if least_recent is true, or the most-recently used if false.")}, | ||
| 33 | {"set_size", (PyCFunction)LRU_set_size, METH_VARARGS, | ||
| 34 | PyDoc_STR("L.set_size() -> set size of LRU")}, | ||
| 35 | -- | ||
| 36 | 2.39.2 | ||
| 37 | |||
diff --git a/meta-python/recipes-devtools/python/python3-lru-dict_1.1.8.bb b/meta-python/recipes-devtools/python/python3-lru-dict_1.1.8.bb index b870bc0889..e825e43dfe 100644 --- a/meta-python/recipes-devtools/python/python3-lru-dict_1.1.8.bb +++ b/meta-python/recipes-devtools/python/python3-lru-dict_1.1.8.bb | |||
| @@ -7,3 +7,5 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=9d10a486ee04034fdef5162fd791f153" | |||
| 7 | SRC_URI[sha256sum] = "878bc8ef4073e5cfb953dfc1cf4585db41e8b814c0106abde34d00ee0d0b3115" | 7 | SRC_URI[sha256sum] = "878bc8ef4073e5cfb953dfc1cf4585db41e8b814c0106abde34d00ee0d0b3115" |
| 8 | 8 | ||
| 9 | inherit pypi setuptools3 | 9 | inherit pypi setuptools3 |
| 10 | |||
| 11 | SRC_URI += "file://0001-lru-Use-PyCFunction-instead-of-PyCFunctionWithKeywor.patch" | ||
