Question - Is that Coverity warning true?
gimp_drawable_get_tile was defined in libgimp/gimpdrawable.c at line 150.
GimpTile *
gimp_drawable_get_tile (GimpDrawable *drawable,
gboolean shadow,
gint row,
gint col)
But it has two different usages in the same file. (libgimp/pygimp-drawable.c)
at line 140:
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iii:get_tile", kwlist,
&shadow, &row, &col))
return NULL;
ensure_drawable(self);
if(row < 0 || row >= self->drawable->ntile_rows ||
col < 0 || col >= self->drawable->ntile_cols) {
Py_INCREF(Py_None);
return Py_None;
}
t = gimp_drawable_get_tile(self->drawable, shadow, row, col);
return pygimp_tile_new(t, self);
at line 180.
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "iii:get_tile2", kwlist,
&shadow, &x ,&y))
return NULL;
ensure_drawable(self);
if(x < 0 || x >= self->drawable->width ||
y < 0 || y >= self->drawable->height) {
Py_INCREF(Py_None);
return Py_None;
}
col = x / gimp_tile_width ();
row = y / gimp_tile_height ();
t = gimp_drawable_get_tile(self->drawable, shadow, col, row);
Coverity Scan warning implies that arguments are in the wrong order. "col" was passed to "row", "row" was passed do "col".
It is obvious they were swapped but is it intentional or not?