===Python API===

Bugfix: unary minus on a point object should not modify the original point
data but return a new point.
This commit is contained in:
Ken Hughes
2006-08-21 14:36:11 +00:00
parent e3ff8e3507
commit e5be894a29

View File

@@ -400,12 +400,14 @@ static PyObject *Point_mul(PyObject * p1, PyObject * p2)
static PyObject *Point_neg(PointObject *self)
{
int x;
for(x = 0; x < self->size; x++){
self->coord[x] = -self->coord[x];
}
float coord[3];
return EXPP_incr_ret((PyObject *)self);
for(x = 0; x < self->size; x++)
coord[x] = -self->coord[x];
return newPointObject(coord, self->size, Py_NEW);
}
//------------------------coerce(obj, obj)-----------------------
//coercion of unknown types to type PointObject for numeric protocols
/*Coercion() is called whenever a math operation has 2 operands that