1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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 = {
|