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>
* app/widgets/gimpcontainertreeview.[ch]: add new function

View File

@ -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,

View File

@ -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);

View File

@ -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");