[cairo-commit] pycairo/cairo pycairo-surface.c, 1.81, 1.82 pycairo-font.c, 1.32, 1.33

Steve Chaplin commit at pdx.freedesktop.org
Wed Dec 20 20:44:26 PST 2006


Committed by: stevech1097

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

Modified Files:
	pycairo-surface.c pycairo-font.c 
Log Message:
'SC'

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- pycairo-surface.c	21 Nov 2006 01:46:07 -0000	1.81
+++ pycairo-surface.c	21 Dec 2006 04:44:22 -0000	1.82
@@ -34,7 +34,6 @@
 #  include <config.h>
 #endif
 
-#include <stdint.h>
 #include "pycairo-private.h"
 
 
@@ -519,6 +518,8 @@
 static PyObject *
 image_surface_create_from_png (PyTypeObject *type, PyObject *file)
 {
+    PyObject* reader;
+
     if (PyObject_TypeCheck (file, &PyBaseString_Type)) {
 	return PycairoSurface_FromSurface (
             cairo_image_surface_create_from_png (PyString_AsString(file)),
@@ -526,7 +527,7 @@
     }
 
     /* file or file-like object argument */
-    PyObject* reader = PyObject_GetAttrString (file, "read");
+    reader = PyObject_GetAttrString (file, "read");
     if (reader == NULL || !PyCallable_Check (reader)) {
 	Py_XDECREF(reader);
 	PyErr_SetString(PyExc_TypeError,
@@ -577,14 +578,16 @@
 image_surface_buffer_getreadbuf (PycairoImageSurface *o, int segment,
 				 const void **ptr)
 {
+    cairo_surface_t *surface = o->surface;
+    int height, stride;
+
     if (segment != 0) {
 	PyErr_SetString(PyExc_SystemError,
 			"accessing non-existent ImageSurface segment");
 	return -1;
     }
-    cairo_surface_t *surface = o->surface;
-    int height = cairo_image_surface_get_height (surface);
-    int stride = cairo_image_surface_get_stride (surface);
+    height = cairo_image_surface_get_height (surface);
+    stride = cairo_image_surface_get_stride (surface);
     *ptr = (void *) cairo_image_surface_get_data (surface);
     return height * stride;
 }
@@ -593,14 +596,16 @@
 image_surface_buffer_getwritebuf (PycairoImageSurface *o, int segment,
 				  const void **ptr)
 {
+    cairo_surface_t *surface = o->surface;
+    int height, stride;
+
     if (segment != 0) {
 	PyErr_SetString(PyExc_SystemError,
 			"accessing non-existent ImageSurface segment");
 	return -1;
     }
-    cairo_surface_t *surface = o->surface;
-    int height = cairo_image_surface_get_height (surface);
-    int stride = cairo_image_surface_get_stride (surface);
+    height = cairo_image_surface_get_height (surface);
+    stride = cairo_image_surface_get_stride (surface);
     *ptr = (void *) cairo_image_surface_get_data (surface);
     return height * stride;
 }
@@ -700,7 +705,7 @@
 pdf_surface_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     double width_in_points, height_in_points;
-    PyObject *file;
+    PyObject *file, *writer;
 
     if (!PyArg_ParseTuple(args, "Odd:PDFSurface.__new__",
 			  &file, &width_in_points, &height_in_points))
@@ -714,7 +719,7 @@
 	       NULL);
     }
     /* file or file-like object argument */
-    PyObject* writer = PyObject_GetAttrString (file, "write");
+    writer = PyObject_GetAttrString (file, "write");
     if (writer == NULL || !PyCallable_Check (writer)) {
 	Py_XDECREF(writer);
 	PyErr_SetString(PyExc_TypeError,
@@ -803,7 +808,7 @@
 ps_surface_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     double width_in_points, height_in_points;
-    PyObject *file;
+    PyObject *file, *writer;
 
     if (!PyArg_ParseTuple(args, "Odd:PSSurface.__new__",
 			  &file, &width_in_points, &height_in_points))
@@ -818,7 +823,7 @@
 
     }
     /* else: file or file-like object argument */
-    PyObject* writer = PyObject_GetAttrString (file, "write");
+    writer = PyObject_GetAttrString (file, "write");
     if (writer == NULL || !PyCallable_Check (writer)) {
 	Py_XDECREF(writer);
 	PyErr_SetString(PyExc_TypeError,
@@ -942,7 +947,7 @@
 svg_surface_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     double width_in_points, height_in_points;
-    PyObject *file;
+    PyObject *file, *writer;
 
     if (!PyArg_ParseTuple(args, "Odd:SVGSurface.__new__",
 			  &file, &width_in_points, &height_in_points))
@@ -956,7 +961,7 @@
 	       NULL);
     }
     /* else: file or file-like object argument */
-    PyObject* writer = PyObject_GetAttrString (file, "write");
+    writer = PyObject_GetAttrString (file, "write");
     if (writer == NULL || !PyCallable_Check (writer)) {
 	Py_XDECREF(writer);
 	PyErr_SetString(PyExc_TypeError,

Index: pycairo-font.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-font.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- pycairo-font.c	29 Apr 2006 10:32:44 -0000	1.32
+++ pycairo-font.c	21 Dec 2006 04:44:22 -0000	1.33
@@ -197,6 +197,7 @@
     PycairoFontFace *ff;
     PycairoFontOptions *fo;
     PycairoMatrix *mx1, *mx2;
+    PyObject *o;
 
     if (!PyArg_ParseTuple(args, "O!O!O!O!:ScaledFont.__new__",
 			  &PycairoFontFace_Type, &ff,
@@ -205,7 +206,7 @@
 			  &PycairoFontOptions_Type, &fo))
 	return NULL;
 
-    PyObject *o = type->tp_alloc(type, 0);
+    o = type->tp_alloc(type, 0);
     if (o != NULL) {
 	cairo_scaled_font_t *scaled_font = cairo_scaled_font_create
 	    (ff->font_face, &mx1->matrix, &mx2->matrix, fo->font_options);



More information about the cairo-commit mailing list