summaryrefslogtreecommitdiff
path: root/graphics/py-cairo/patches/patch-ac
blob: 16bd9cc821c4718576b3108d57f94226d397e8da (plain)
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
$NetBSD: patch-ac,v 1.2 2009/05/13 12:56:47 obache Exp $

--- cairo/pycairo-surface.c.orig	2009-03-03 11:11:20.000000000 +0000
+++ cairo/pycairo-surface.c
@@ -123,7 +123,7 @@ _write_func (void *closure, const unsign
 {
     PyGILState_STATE gstate = PyGILState_Ensure();
     PyObject *res = PyObject_CallMethod ((PyObject *)closure, "write", "(s#)",
-					 data, (Py_ssize_t)length);
+					 data, length);
     if (res == NULL) {
 	/* an exception has occurred, it will be picked up later by
 	 * Pycairo_Check_Status()
@@ -424,7 +424,7 @@ image_surface_create_for_data (PyTypeObj
     cairo_format_t format;
     unsigned char *buffer;
     int width, height, stride = -1, res;
-    Py_ssize_t buffer_len;
+    int buffer_len;
     PyObject *obj;
 
     if (!PyArg_ParseTuple(args, "Oiii|i:Surface.create_for_data",
@@ -616,10 +616,10 @@ image_surface_buffer_getsegcount (Pycair
 
 /* See Python C API Manual 10.7 */
 static PyBufferProcs image_surface_as_buffer = {
-    (readbufferproc) image_surface_buffer_getreadbuf,
-    (writebufferproc)image_surface_buffer_getwritebuf,
-    (segcountproc)   image_surface_buffer_getsegcount,
-    (charbufferproc) NULL,
+    (getreadbufferproc) image_surface_buffer_getreadbuf,
+    (getwritebufferproc)image_surface_buffer_getwritebuf,
+    (getsegcountproc)   image_surface_buffer_getsegcount,
+    (getcharbufferproc) NULL,
 };
 
 static PyMethodDef image_surface_methods[] = {