diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-10-03 17:49:17 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-10-03 17:49:17 +0000 |
commit | a31aee46eed48d5d1c26a6738f7a9ca60f19e9db (patch) | |
tree | d8c5e37c862082953ef118c0a7d5781a4ce2b184 /gtk/gdkpixbuf.override | |
parent | e095923a6eed461114cf30ecf211851dc11edb50 (diff) | |
download | pygtk-a31aee46eed48d5d1c26a6738f7a9ca60f19e9db.tar.gz |
Bug 337368 – Make PyGTK work with Python 2.5 and 64-bit
Diffstat (limited to 'gtk/gdkpixbuf.override')
-rw-r--r-- | gtk/gdkpixbuf.override | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gtk/gdkpixbuf.override b/gtk/gdkpixbuf.override index 294fb918..91323a68 100644 --- a/gtk/gdkpixbuf.override +++ b/gtk/gdkpixbuf.override @@ -167,7 +167,7 @@ _wrap_gdk_pixbuf_save(PyGObject *self, PyObject *args, if (py_options != NULL) { guint len; - gint pos = 0, i = 0; + Py_ssize_t pos = 0, i = 0; PyObject *key, *value; len = PyDict_Size(py_options); @@ -221,10 +221,10 @@ pixbuf_save_func(const gchar *buf, PyObject *ret; if (data->user_data) - ret = PyObject_CallFunction(data->callback, "s#O", buf, (int) count, data->user_data); + ret = PyObject_CallFunction(data->callback, "s#O", buf, (Py_ssize_t) count, data->user_data); else - ret = PyObject_CallFunction(data->callback, "s#", buf, (int) count); + ret = PyObject_CallFunction(data->callback, "s#", buf, (Py_ssize_t) count); if (ret == NULL) { PyErr_Print(); @@ -256,8 +256,8 @@ _wrap_gdk_pixbuf_save_to_callback(PyGObject *self, PyObject *args, } if (py_options != NULL) { - guint len; - gint pos = 0, i = 0; + Py_ssize_t len; + Py_ssize_t pos = 0, i = 0; PyObject *key, *value; len = PyDict_Size(py_options); @@ -305,8 +305,9 @@ _wrap_gdk_pixbuf_new_from_data(PyObject *self, PyObject *args, const gchar *data; GdkColorspace colorspace; gboolean has_alpha; - gint data_len, bits_per_sample, width, height, rowstride; - gint required_len; + Py_ssize_t data_len; + gint bits_per_sample, width, height, rowstride; + Py_ssize_t required_len; guchar *data_copy; GdkPixbuf *pixbuf; PyObject *ret; @@ -320,8 +321,8 @@ _wrap_gdk_pixbuf_new_from_data(PyObject *self, PyObject *args, required_len = height*rowstride; if (data_len < required_len) { PyErr_Format(PyExc_ValueError, - "data length (%d) is less then required by the other parameters (%d)", - data_len, required_len); + "data length (%ld) is less then required by the other parameters (%ld)", + (long int) data_len, (long int) required_len); return NULL; } data_copy = g_try_malloc(required_len); @@ -488,7 +489,8 @@ _wrap_gdk_pixbuf_loader_write(PyGObject *self, PyObject *kwargs) { static char *kwlist[] = { "buf", "count", NULL }; - int buf_len, count = -1, ret; + Py_ssize_t buf_len; + int count = -1, ret; guchar *buf; GError *error = NULL; |