diff --git a/ChangeLog b/ChangeLog index 4ec6ba1ffe..220e504e41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-06-28 Martin Nordholts + + * pygimp-pdb.c: + * pygimp-tile.c: + * pygimp-colors.c: Applied patch from Ed Swartz that makes use of + Py_ssize_t:s instead of int:s to better utilize 64-bit + systems. (Bug #540629.) + 2008-06-28 Michael Natterer * app/widgets/gimpcontainertreeview.[ch]: add new function diff --git a/plug-ins/pygimp/pygimp-colors.c b/plug-ins/pygimp/pygimp-colors.c index 8aa8d32184..bdf16ed556 100644 --- a/plug-ins/pygimp/pygimp-colors.c +++ b/plug-ins/pygimp/pygimp-colors.c @@ -562,7 +562,7 @@ rgb_subscript(PyObject *self, PyObject *item) return NULL; return rgb_getitem(self, i); } else if (PySlice_Check(item)) { - int start, stop, step, slicelength, cur, i; + Py_ssize_t start, stop, step, slicelength, cur, i; PyObject *ret; if (PySlice_GetIndicesEx((PySliceObject*)item, 4, @@ -1085,7 +1085,7 @@ hsv_subscript(PyObject *self, PyObject *item) return NULL; return hsv_getitem(self, i); } else if (PySlice_Check(item)) { - int start, stop, step, slicelength, cur, i; + Py_ssize_t start, stop, step, slicelength, cur, i; PyObject *ret; if (PySlice_GetIndicesEx((PySliceObject*)item, 4, @@ -1598,7 +1598,7 @@ hsl_subscript(PyObject *self, PyObject *item) return NULL; return hsl_getitem(self, i); } else if (PySlice_Check(item)) { - int start, stop, step, slicelength, cur, i; + Py_ssize_t start, stop, step, slicelength, cur, i; PyObject *ret; if (PySlice_GetIndicesEx((PySliceObject*)item, 4, @@ -2104,7 +2104,7 @@ cmyk_subscript(PyObject *self, PyObject *item) return NULL; return cmyk_getitem(self, i); } else if (PySlice_Check(item)) { - int start, stop, step, slicelength, cur, i; + Py_ssize_t start, stop, step, slicelength, cur, i; PyObject *ret; if (PySlice_GetIndicesEx((PySliceObject*)item, 5, diff --git a/plug-ins/pygimp/pygimp-pdb.c b/plug-ins/pygimp/pygimp-pdb.c index 35e95084d7..fc435ec073 100644 --- a/plug-ins/pygimp/pygimp-pdb.c +++ b/plug-ins/pygimp/pygimp-pdb.c @@ -820,7 +820,7 @@ pf_call(PyGimpPDBFunction *self, PyObject *args, PyObject *kwargs) #endif if (kwargs) { - int len, pos; + Py_ssize_t len, pos; PyObject *key, *val; len = PyDict_Size(kwargs); diff --git a/plug-ins/pygimp/pygimp-tile.c b/plug-ins/pygimp/pygimp-tile.c index 9b3d36823e..afdf2a1ea7 100644 --- a/plug-ins/pygimp/pygimp-tile.c +++ b/plug-ins/pygimp/pygimp-tile.c @@ -157,7 +157,7 @@ tile_subscript(PyGimpTile *self, PyObject *sub) { GimpTile *tile = self->tile; int bpp = tile->bpp; - long x, y; + Py_ssize_t x, y; if (PyInt_Check(sub)) { x = PyInt_AsLong(sub); @@ -193,7 +193,7 @@ tile_ass_sub(PyGimpTile *self, PyObject *v, PyObject *w) { GimpTile *tile = self->tile; int bpp = tile->bpp, i; - long x, y; + Py_ssize_t x, y; guchar *pix, *data; if (w == NULL) { @@ -306,7 +306,7 @@ PyTypeObject PyGimpTile_Type = { static PyObject * pr_resize(PyGimpPixelRgn *self, PyObject *args) { - int x, y, w, h; + Py_ssize_t x, y, w, h; if (!PyArg_ParseTuple(args, "iiii:resize", &x, &y, &w, &h)) return NULL; @@ -371,7 +371,7 @@ pr_subscript(PyGimpPixelRgn *self, PyObject *key) GimpPixelRgn *pr = &(self->pr); int bpp = pr->bpp; PyObject *x, *y; - int x1, y1, x2, y2, xs, ys; + Py_ssize_t x1, y1, x2, y2, xs, ys; if (!PyTuple_Check(key) || PyTuple_Size(key) != 2) { PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple"); @@ -480,7 +480,7 @@ pr_ass_sub(PyGimpPixelRgn *self, PyObject *v, PyObject *w) int bpp = pr->bpp; PyObject *x, *y; guchar *buf; - int len, x1, x2, xs, y1, y2, ys; + Py_ssize_t len, x1, x2, xs, y1, y2, ys; if (w == NULL) { PyErr_SetString(PyExc_TypeError, "can't delete subscripts");