diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-31 03:54:11 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-03-31 03:54:11 +0000 |
commit | 64d57eae96b65b3d618d8b3e8d68111da80f283a (patch) | |
tree | 886f24cf54d210509fa85ebd8c5dfbd3864a9bdb /externals/grill/py/source/clmeth.cpp | |
parent | 6c94eab605e5ec018654541bf2bf410b7db17788 (diff) |
fixed reference count bug
cleaner error reporting
more optimizations
added generic numpy support (not working)
fixes for maxmsp
svn path=/trunk/; revision=2655
Diffstat (limited to 'externals/grill/py/source/clmeth.cpp')
-rw-r--r-- | externals/grill/py/source/clmeth.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/externals/grill/py/source/clmeth.cpp b/externals/grill/py/source/clmeth.cpp index cfd8604a..4b403cf8 100644 --- a/externals/grill/py/source/clmeth.cpp +++ b/externals/grill/py/source/clmeth.cpp @@ -173,8 +173,8 @@ PyObject *pyext::pyext_outlet(PyObject *,PyObject *args) if(!tp) val = PySequence_GetSlice(args,2,sz); // new ref - AtomList *lst = GetPyArgs(val); - if(lst) { + AtomListStatic<16> lst; + if(GetPyArgs(lst,val)) { int o = PyInt_AsLong(outl); if(o >= 1 && o <= ext->Outlets()) { // offset outlet by signal outlets @@ -182,12 +182,12 @@ PyObject *pyext::pyext_outlet(PyObject *,PyObject *args) // by using the queue there is no immediate call of the next object // deadlock would occur if this was another py/pyext object! - if(lst->Count() && IsSymbol((*lst)[0])) - ext->ToOutAnything(o-1,GetSymbol((*lst)[0]),lst->Count()-1,lst->Atoms()+1); - else if(lst->Count() > 1) - ext->ToOutList(o-1,*lst); + if(lst.Count() && IsSymbol(lst[0])) + ext->ToOutAnything(o-1,GetSymbol(lst[0]),lst.Count()-1,lst.Atoms()+1); + else if(lst.Count() > 1) + ext->ToOutList(o-1,lst); else - ext->ToOutAtom(o-1,*lst->Atoms()); + ext->ToOutAtom(o-1,*lst.Atoms()); } else post("pyext: outlet index out of range"); @@ -196,7 +196,6 @@ PyObject *pyext::pyext_outlet(PyObject *,PyObject *args) } else post("py/pyext - No data to send"); - if(lst) delete lst; if(!tp) Py_DECREF(val); } @@ -296,13 +295,12 @@ PyObject *pyext::pyext_tocanvas(PyObject *,PyObject *args) if(!tp) val = PyTuple_GetSlice(args,1,sz); // new ref - AtomList *lst = GetPyArgs(val); - if(lst) { + AtomListStatic<16> lst; + if(GetPyArgs(lst,val)) { t_glist *gl = ext->thisCanvas(); //canvas_getcurrent(); t_class **cl = (t_pd *)gl; - if(cl) { - pd_forwardmess(cl,lst->Count(),lst->Atoms()); - } + if(cl) + pd_forwardmess(cl,lst.Count(),lst.Atoms()); #ifdef FLEXT_DEBUG else post("pyext - no parent canvas?!"); @@ -311,7 +309,6 @@ PyObject *pyext::pyext_tocanvas(PyObject *,PyObject *args) } else post("py/pyext - No data to send"); - if(lst) delete lst; if(!tp) Py_DECREF(val); } |