aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/bound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill/py/source/bound.cpp')
-rw-r--r--externals/grill/py/source/bound.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/externals/grill/py/source/bound.cpp b/externals/grill/py/source/bound.cpp
index 2504dde0..ce17578c 100644
--- a/externals/grill/py/source/bound.cpp
+++ b/externals/grill/py/source/bound.cpp
@@ -2,7 +2,7 @@
py/pyext - python external object for PD and MaxMSP
-Copyright (c) 2002-2004 Thomas Grill (gr@grrrr.org)
+Copyright (c)2002-2005 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
@@ -21,11 +21,12 @@ struct bounddata
FuncSet funcs;
};
-bool pyext::boundmeth(flext_base *,t_symbol *sym,int argc,t_atom *argv,void *data)
+bool pyext::boundmeth(flext_base *th,t_symbol *sym,int argc,t_atom *argv,void *data)
{
bounddata *obj = (bounddata *)data;
+ py *pyth = static_cast<py *>(th);
- PY_LOCK
+ PyThreadState *state = pyth->PyLock();
PyObject *args = MakePyArgs(sym,argc,argv,-1,obj->self != NULL);
@@ -40,14 +41,14 @@ bool pyext::boundmeth(flext_base *,t_symbol *sym,int argc,t_atom *argv,void *dat
Py_XDECREF(args);
- PY_UNLOCK
+ pyth->PyUnlock(state);
return true;
}
PyObject *pyext::pyext_bind(PyObject *,PyObject *args)
{
PyObject *self,*meth;
- C *name;
+ char *name;
if(!PyArg_ParseTuple(args, "OsO:pyext_bind", &self,&name,&meth))
post("py/pyext - Wrong arguments!");
else if(!PyInstance_Check(self) || !(PyMethod_Check(meth) || PyFunction_Check(meth))) {
@@ -91,7 +92,7 @@ PyObject *pyext::pyext_bind(PyObject *,PyObject *args)
PyObject *pyext::pyext_unbind(PyObject *,PyObject *args)
{
PyObject *self,*meth;
- C *name;
+ char *name;
if(!PyArg_ParseTuple(args, "OsO:pyext_bind", &self,&name,&meth))
post("py/pyext - Wrong arguments!");
else if(!PyInstance_Check(self) || !(PyMethod_Check(meth) || PyFunction_Check(meth))) {
@@ -127,7 +128,7 @@ PyObject *pyext::pyext_unbind(PyObject *,PyObject *args)
}
-V pyext::ClearBinding()
+void pyext::ClearBinding()
{
// in case the object couldn't be constructed...
if(!pyobj) return;