summarylogtreecommitdiffstats
path: root/mirage-python3-python310-fixes.patch
diff options
context:
space:
mode:
authorDmytro Meleshko2022-02-22 12:46:18 +0200
committerDmytro Meleshko2022-02-22 12:46:18 +0200
commit8efc5020bf54ab0654264c4849b362bbbb76e2af (patch)
tree6e7f7e383412f42c5fbeeac9b2d1013a61210927 /mirage-python3-python310-fixes.patch
parent37608dd7f13a859d4e44dfeb0aeb1480d34d3a98 (diff)
downloadaur-mirage-python3.tar.gz
fix usages of Py_ssize_t on Python 3.10
Diffstat (limited to 'mirage-python3-python310-fixes.patch')
-rw-r--r--mirage-python3-python310-fixes.patch71
1 files changed, 71 insertions, 0 deletions
diff --git a/mirage-python3-python310-fixes.patch b/mirage-python3-python310-fixes.patch
new file mode 100644
index 000000000000..3ca29e7fc2bf
--- /dev/null
+++ b/mirage-python3-python310-fixes.patch
@@ -0,0 +1,71 @@
+diff --git a/mirage/imgfuncs.c b/mirage/imgfuncs.c
+index 88621c6..bd97e98 100644
+--- a/mirage/imgfuncs.c
++++ b/mirage/imgfuncs.c
+@@ -1,3 +1,4 @@
++#define PY_SSIZE_T_CLEAN
+ #include "Python.h"
+ /**
+ * copy length chars from source to dest
+@@ -14,7 +15,7 @@ PyObject *rotate_right(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -61,7 +62,7 @@ PyObject *rotate_left(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -108,7 +109,7 @@ PyObject *rotate_mirror(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -151,7 +152,7 @@ PyObject *flip_vert(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+@@ -194,7 +195,7 @@ PyObject *flip_horiz(PyObject *self, PyObject *args)
+ {
+ char *a1;
+ char *a2;
+- int length;
++ Py_ssize_t length;
+ int w1, w2;
+ int h1, h2;
+ int rws1, rws2;
+diff --git a/mirage/xmouse.c b/mirage/xmouse.c
+index 0309676..c368300 100644
+--- a/mirage/xmouse.c
++++ b/mirage/xmouse.c
+@@ -1,3 +1,4 @@
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+ #include <X11/Xlib.h>
+
+@@ -39,6 +40,7 @@ static PyMethodDef methods[] =
+ {
+ {"geometry", xmouse_geometry, METH_VARARGS,
+ "Get the geometry of the window under the mouse cursor."},
++ {NULL, NULL, 0}
+ };
+
+ static PyModuleDef xmouse_module = {