~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/pygimp/pygimp-tile.c

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2008-08-22 11:50:05 UTC
  • mfrom: (0.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20080822115005-yxj5svf3v9x1mkr7
Tags: upstream-2.4.7
ImportĀ upstreamĀ versionĀ 2.4.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
    return s;
143
143
}
144
144
 
145
 
static int
146
 
tile_length(PyGimpTile *self)
 
145
static Py_ssize_t 
 
146
tile_length(PyObject *self)
147
147
{
148
 
    return self->tile->ewidth * self->tile->eheight;
 
148
    return ((PyGimpTile*)self)->tile->ewidth * ((PyGimpTile*)self)->tile->eheight;
149
149
}
150
150
 
151
151
static PyObject *
247
247
}
248
248
 
249
249
static PyMappingMethods tile_as_mapping = {
250
 
    (inquiry)tile_length, /*length*/
 
250
    tile_length, /*length*/
251
251
    (binaryfunc)tile_subscript, /*subscript*/
252
252
    (objobjargproc)tile_ass_sub, /*ass_sub*/
253
253
};
354
354
 
355
355
/* Code to access pr objects as mappings */
356
356
 
357
 
static int
358
 
pr_length(PyGimpPixelRgn *self)
 
357
static Py_ssize_t 
 
358
pr_length(PyObject *self)
359
359
{
360
360
    PyErr_SetString(pygimp_error, "Can't get size of pixel region");
361
361
    return -1;
367
367
    GimpPixelRgn *pr = &(self->pr);
368
368
    int bpp = pr->bpp;
369
369
    PyObject *x, *y;
370
 
    int x1, y1, x2, y2, xs, ys;
 
370
    Py_ssize_t x1, y1, x2, y2, xs, ys;
371
371
 
372
372
    if (!PyTuple_Check(key) || PyTuple_Size(key) != 2) {
373
373
        PyErr_SetString(PyExc_TypeError, "subscript must be a 2-tuple");
476
476
    int bpp = pr->bpp;
477
477
    PyObject *x, *y;
478
478
    guchar *buf;
479
 
    int len, x1, x2, xs, y1, y2, ys;
 
479
    Py_ssize_t len, x1, x2, xs, y1, y2, ys;
480
480
        
481
481
    if (w == NULL) {
482
482
        PyErr_SetString(PyExc_TypeError, "can't delete subscripts");
588
588
}
589
589
 
590
590
static PyMappingMethods pr_as_mapping = {
591
 
    (inquiry)pr_length,         /*mp_length*/
 
591
    pr_length,          /*mp_length*/
592
592
    (binaryfunc)pr_subscript,           /*mp_subscript*/
593
593
    (objobjargproc)pr_ass_sub,  /*mp_ass_subscript*/
594
594
};