From c6ba54641bcf5e44fa914476d72455a524ed172f Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sun, 10 Apr 2005 22:24:13 +0000 Subject: added xcode project cleaner error reporting added generic numpy support (not working) use lock count instead of message queuing to avoid py->py messaging deadlock fixing strange gcc behavior fixes for maxmsp support for buffer objects (preliminary) fixed reference count bug use optimized version updates for DSP processing adjust pd and py files for correct argument passing more optimizations fixed numarray headers little restructuring svn path=/trunk/; revision=2708 --- externals/grill/py/source/pybuffer.cpp | 46 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'externals/grill/py/source/pybuffer.cpp') diff --git a/externals/grill/py/source/pybuffer.cpp b/externals/grill/py/source/pybuffer.cpp index 42e23557..0893b983 100644 --- a/externals/grill/py/source/pybuffer.cpp +++ b/externals/grill/py/source/pybuffer.cpp @@ -15,43 +15,47 @@ WARRANTIES, see the file, "license.txt," in this distribution. #if defined(PY_NUMERIC) #define PY_ARRAYS 1 - - #if FLEXT_OS == FLEXT_OS_MAC - #include - #else - #include - #endif #elif defined(PY_NUMARRAY) #define PY_ARRAYS 1 #define NA +#endif + +#ifdef PY_ARRAYS #ifdef NA #if FLEXT_OS == FLEXT_OS_MAC - #include + #include #else - #include + #include #endif + +static NumarrayType numtype = tAny; +inline bool arrsupport() { return numtype != tAny; } + #else #if FLEXT_OS == FLEXT_OS_MAC #include #else #include #endif + +static PyArray_TYPES numtype = PyArray_NOTYPE; +inline bool arrsupport() { return numtype != PyArray_NOTYPE; } #endif #endif +PyObject *pybase::py_arraysupport(PyObject *self,PyObject *args) +{ + PyObject *ret; #ifdef PY_ARRAYS - -#ifdef NA -static NumarrayType numtype = tAny; -inline bool arrsupport() { return numtype != tAny; } + ret = Py_True; #else -static PyArray_TYPES numtype = PyArray_NOTYPE; -inline bool arrsupport() { return numtype != PyArray_NOTYPE; } -#endif - + ret = Py_False; #endif + Py_INCREF(ret); + return ret; +} // PD defines a T_OBJECT symbol @@ -408,13 +412,13 @@ static PyObject *buffer_repeat(pySamplebuffer *self,int rep) static PySequenceMethods buffer_as_seq = { - (inquiry)buffer_length, /* inquiry sq_length; /* __len__ */ + (inquiry)buffer_length, /* inquiry sq_length; __len__ */ (binaryfunc)buffer_concat, /* __add__ */ (intargfunc)buffer_repeat, /* __mul__ */ - (intargfunc)buffer_item, /* intargfunc sq_item; /* __getitem__ */ - (intintargfunc)buffer_slice, /* intintargfunc sq_slice; /* __getslice__ */ - (intobjargproc)buffer_ass_item, /* intobjargproc sq_ass_item; /* __setitem__ */ - (intintobjargproc)buffer_ass_slice, /* intintobjargproc sq_ass_slice; /* __setslice__ */ + (intargfunc)buffer_item, /* intargfunc sq_item; __getitem__ */ + (intintargfunc)buffer_slice, /* intintargfunc sq_slice; __getslice__ */ + (intobjargproc)buffer_ass_item, /* intobjargproc sq_ass_item; __setitem__ */ + (intintobjargproc)buffer_ass_slice, /* intintobjargproc sq_ass_slice; __setslice__ */ }; static PyObject *buffer_iter(PyObject *obj) -- cgit v1.2.1