Applied patch from Ed Swartz that makes use of Py_ssize_t:s instead of

2008-06-28  Martin Nordholts  <martinn@svn.gnome.org>

	* 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.)

svn path=/trunk/; revision=26011
This commit is contained in:
Martin Nordholts
2008-06-28 16:38:50 +00:00
committed by Martin Nordholts
parent 5e5448c16a
commit c3d5eeab80
4 changed files with 18 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2008-06-28 Martin Nordholts <martinn@svn.gnome.org>
* 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 <mitch@gimp.org> 2008-06-28 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcontainertreeview.[ch]: add new function * app/widgets/gimpcontainertreeview.[ch]: add new function

View File

@ -562,7 +562,7 @@ rgb_subscript(PyObject *self, PyObject *item)
return NULL; return NULL;
return rgb_getitem(self, i); return rgb_getitem(self, i);
} else if (PySlice_Check(item)) { } else if (PySlice_Check(item)) {
int start, stop, step, slicelength, cur, i; Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret; PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 4, if (PySlice_GetIndicesEx((PySliceObject*)item, 4,
@ -1085,7 +1085,7 @@ hsv_subscript(PyObject *self, PyObject *item)
return NULL; return NULL;
return hsv_getitem(self, i); return hsv_getitem(self, i);
} else if (PySlice_Check(item)) { } else if (PySlice_Check(item)) {
int start, stop, step, slicelength, cur, i; Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret; PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 4, if (PySlice_GetIndicesEx((PySliceObject*)item, 4,
@ -1598,7 +1598,7 @@ hsl_subscript(PyObject *self, PyObject *item)
return NULL; return NULL;
return hsl_getitem(self, i); return hsl_getitem(self, i);
} else if (PySlice_Check(item)) { } else if (PySlice_Check(item)) {
int start, stop, step, slicelength, cur, i; Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret; PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 4, if (PySlice_GetIndicesEx((PySliceObject*)item, 4,
@ -2104,7 +2104,7 @@ cmyk_subscript(PyObject *self, PyObject *item)
return NULL; return NULL;
return cmyk_getitem(self, i); return cmyk_getitem(self, i);
} else if (PySlice_Check(item)) { } else if (PySlice_Check(item)) {
int start, stop, step, slicelength, cur, i; Py_ssize_t start, stop, step, slicelength, cur, i;
PyObject *ret; PyObject *ret;
if (PySlice_GetIndicesEx((PySliceObject*)item, 5, if (PySlice_GetIndicesEx((PySliceObject*)item, 5,

View File

@ -820,7 +820,7 @@ pf_call(PyGimpPDBFunction *self, PyObject *args, PyObject *kwargs)
#endif #endif
if (kwargs) { if (kwargs) {
int len, pos; Py_ssize_t len, pos;
PyObject *key, *val; PyObject *key, *val;
len = PyDict_Size(kwargs); len = PyDict_Size(kwargs);

View File

@ -157,7 +157,7 @@ tile_subscript(PyGimpTile *self, PyObject *sub)
{ {
GimpTile *tile = self->tile; GimpTile *tile = self->tile;
int bpp = tile->bpp; int bpp = tile->bpp;
long x, y; Py_ssize_t x, y;
if (PyInt_Check(sub)) { if (PyInt_Check(sub)) {
x = PyInt_AsLong(sub); x = PyInt_AsLong(sub);
@ -193,7 +193,7 @@ tile_ass_sub(PyGimpTile *self, PyObject *v, PyObject *w)
{ {
GimpTile *tile = self->tile; GimpTile *tile = self->tile;
int bpp = tile->bpp, i; int bpp = tile->bpp, i;
long x, y; Py_ssize_t x, y;
guchar *pix, *data; guchar *pix, *data;
if (w == NULL) { if (w == NULL) {
@ -306,7 +306,7 @@ PyTypeObject PyGimpTile_Type = {
static PyObject * static PyObject *
pr_resize(PyGimpPixelRgn *self, PyObject *args) 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)) if (!PyArg_ParseTuple(args, "iiii:resize", &x, &y, &w, &h))
return NULL; return NULL;
@ -371,7 +371,7 @@ pr_subscript(PyGimpPixelRgn *self, PyObject *key)
GimpPixelRgn *pr = &(self->pr); GimpPixelRgn *pr = &(self->pr);
int bpp = pr->bpp; int bpp = pr->bpp;
PyObject *x, *y; 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) { if (!PyTuple_Check(key) || PyTuple_Size(key) != 2) {
PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple"); 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; int bpp = pr->bpp;
PyObject *x, *y; PyObject *x, *y;
guchar *buf; guchar *buf;
int len, x1, x2, xs, y1, y2, ys; Py_ssize_t len, x1, x2, xs, y1, y2, ys;
if (w == NULL) { if (w == NULL) {
PyErr_SetString(PyExc_TypeError, "can't delete subscripts"); PyErr_SetString(PyExc_TypeError, "can't delete subscripts");