From eb93592edfd07e0b698ad1508066f94152fe8df9 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 6 Nov 2009 00:41:39 +0100 Subject: [PATCH] py-cvec.c: cvec.length to return the actual length --- interfaces/python/py-cvec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interfaces/python/py-cvec.c b/interfaces/python/py-cvec.c index 63904bc0..18e386d7 100644 --- a/interfaces/python/py-cvec.c +++ b/interfaces/python/py-cvec.c @@ -28,7 +28,7 @@ Py_cvec_new (PyTypeObject * type, PyObject * args, PyObject * kwds) self = (Py_cvec *) type->tp_alloc (type, 0); - self->length = Py_default_vector_length; + self->length = Py_default_vector_length / 2 + 1; self->channels = Py_default_vector_channels; if (self == NULL) { @@ -36,7 +36,7 @@ Py_cvec_new (PyTypeObject * type, PyObject * args, PyObject * kwds) } if (length > 0) { - self->length = length; + self->length = length / 2 + 1; } else if (length < 0) { PyErr_SetString (PyExc_ValueError, "can not use negative number of elements"); @@ -57,7 +57,7 @@ Py_cvec_new (PyTypeObject * type, PyObject * args, PyObject * kwds) static int Py_cvec_init (Py_cvec * self, PyObject * args, PyObject * kwds) { - self->o = new_cvec (self->length, self->channels); + self->o = new_cvec ((self->length - 1) * 2, self->channels); if (self->o == NULL) { return -1; } -- 2.11.0