[cairo-commit] pycairo/cairo cairomodule.c, 1.61, 1.62 pycairo-context.c, 1.80, 1.81 pycairo-font.c, 1.35, 1.36 pycairo-matrix.c, 1.25, 1.26 pycairo-path.c, 1.9, 1.10 pycairo-pattern.c, 1.37, 1.38 pycairo-private.h, 1.42, 1.43 pycairo-surface.c, 1.84, 1.85

Steve Chaplin commit at pdx.freedesktop.org
Tue Jan 16 06:59:38 PST 2007


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory kemper:/tmp/cvs-serv9051/cairo

Modified Files:
	cairomodule.c pycairo-context.c pycairo-font.c 
	pycairo-matrix.c pycairo-path.c pycairo-pattern.c 
	pycairo-private.h pycairo-surface.c 
Log Message:
'SC'

Index: cairomodule.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/cairomodule.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- cairomodule.c	27 Dec 2006 23:04:58 -0000	1.61
+++ cairomodule.c	16 Jan 2007 14:59:34 -0000	1.62
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H

Index: pycairo-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-context.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- pycairo-context.c	14 Jan 2007 02:15:41 -0000	1.80
+++ pycairo-context.c	16 Jan 2007 14:59:34 -0000	1.81
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H

Index: pycairo-font.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-font.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- pycairo-font.c	8 Jan 2007 01:20:50 -0000	1.35
+++ pycairo-font.c	16 Jan 2007 14:59:34 -0000	1.36
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H

Index: pycairo-matrix.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-matrix.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- pycairo-matrix.c	8 Jan 2007 01:17:49 -0000	1.25
+++ pycairo-matrix.c	16 Jan 2007 14:59:34 -0000	1.26
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H
@@ -205,7 +206,7 @@
 }
 
 static PyObject *
-matrix_item (PycairoMatrix *o, int i)
+matrix_item (PycairoMatrix *o, Py_ssize_t i)
 {
     switch (i) {
     case 0:
@@ -237,7 +238,7 @@
   (unaryfunc)0,
   (unaryfunc)0,
   (unaryfunc)0,
-  (inquiry)0,
+  (lenfunc)0,
   (unaryfunc)0,
   (binaryfunc)0,
   (binaryfunc)0,
@@ -256,7 +257,7 @@
     0,                  		/* sq_length */
     0,                  		/* sq_concat */
     0,                  		/* sq_repeat */
-    (intargfunc)matrix_item,		/* sq_item */
+    (ssizeargfunc)matrix_item,		/* sq_item */
     0,                     		/* sq_slice */
     0,					/* sq_ass_item */
     0,					/* sq_ass_slice */

Index: pycairo-path.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-path.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pycairo-path.c	21 Sep 2006 12:15:10 -0000	1.9
+++ pycairo-path.c	16 Jan 2007 14:59:34 -0000	1.10
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H

Index: pycairo-pattern.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-pattern.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- pycairo-pattern.c	28 Dec 2006 07:55:48 -0000	1.37
+++ pycairo-pattern.c	16 Jan 2007 14:59:34 -0000	1.38
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H

Index: pycairo-private.h
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-private.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- pycairo-private.h	8 Jan 2007 01:17:49 -0000	1.42
+++ pycairo-private.h	16 Jan 2007 14:59:34 -0000	1.43
@@ -103,7 +103,7 @@
 
 int Pycairo_Check_Status (cairo_status_t status);
 
-/* useful macros from Python 2.4 */
+/* Python 2.4 compatibility */
 #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4
 #  define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
 #  define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
@@ -118,6 +118,20 @@
         } while (0)
 #endif /* PY_MAJOR_VERSION */
 
+/* Python 2.5 compatibility */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+typedef inquiry lenfunc;
+typedef intargfunc ssizeargfunc;
+typedef intobjargproc ssizeobjargproc;
+typedef getreadbufferproc readbufferproc;
+typedef getwritebufferproc writebufferproc;
+typedef getsegcountproc segcountproc;
+typedef getcharbufferproc charbufferproc;
+#endif
+
 /* error checking macros */
 #define RETURN_NULL_IF_CAIRO_ERROR(status)    \
     do {                                      \

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- pycairo-surface.c	28 Dec 2006 07:55:48 -0000	1.84
+++ pycairo-surface.c	16 Jan 2007 14:59:34 -0000	1.85
@@ -28,6 +28,7 @@
  * the specific language governing rights and limitations.
  */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #ifdef HAVE_CONFIG_H
@@ -126,7 +127,7 @@
 _write_func (void *closure, const unsigned char *data, unsigned int length)
 {
     PyObject *res = PyObject_CallMethod ((PyObject *)closure, "write", "(s#)",
-					 data, length);
+					 data, (Py_ssize_t)length);
     if (res == NULL) {
 	/* an exception has occurred, it will be picked up later by
 	 * Pycairo_Check_Status()
@@ -445,7 +446,8 @@
     cairo_surface_t *surface;
     cairo_format_t format;
     unsigned char *buffer;
-    int buffer_len, width, height, stride = -1, res;
+    int width, height, stride = -1, res;
+    Py_ssize_t buffer_len;
     PyObject *obj;
 
     if (!PyArg_ParseTuple(args, "Oiii|i:Surface.create_for_data",
@@ -624,10 +626,10 @@
 
 /* See Python C API Manual 10.7 */
 static PyBufferProcs image_surface_as_buffer = {
-    (getreadbufferproc) image_surface_buffer_getreadbuf,
-    (getwritebufferproc)image_surface_buffer_getwritebuf,
-    (getsegcountproc)   image_surface_buffer_getsegcount,
-    (getcharbufferproc) NULL,
+    (readbufferproc) image_surface_buffer_getreadbuf,
+    (writebufferproc)image_surface_buffer_getwritebuf,
+    (segcountproc)   image_surface_buffer_getsegcount,
+    (charbufferproc) NULL,
 };
 
 static PyMethodDef image_surface_methods[] = {



More information about the cairo-commit mailing list