Commit 1b05f8a1 authored by Georg Brandl's avatar Georg Brandl

These are true PyCFunctions, after adding the second argument to oss_self, no need to cast.

parent c30370a3
...@@ -470,7 +470,7 @@ oss_close(oss_audio_t *self, PyObject *unused) ...@@ -470,7 +470,7 @@ oss_close(oss_audio_t *self, PyObject *unused)
} }
static PyObject * static PyObject *
oss_self(PyObject *self) oss_self(PyObject *self, PyObject *unused)
{ {
Py_INCREF(self); Py_INCREF(self);
return self; return self;
...@@ -800,8 +800,8 @@ static PyMethodDef oss_methods[] = { ...@@ -800,8 +800,8 @@ static PyMethodDef oss_methods[] = {
{ "flush", (PyCFunction)oss_sync, METH_VARARGS }, { "flush", (PyCFunction)oss_sync, METH_VARARGS },
/* Support for the context manager protocol */ /* Support for the context manager protocol */
{ "__enter__", (PyCFunction)oss_self, METH_NOARGS }, { "__enter__", oss_self, METH_NOARGS },
{ "__exit__", (PyCFunction)oss_exit, METH_VARARGS }, { "__exit__", oss_exit, METH_VARARGS },
{ NULL, NULL} /* sentinel */ { NULL, NULL} /* sentinel */
}; };
...@@ -812,8 +812,8 @@ static PyMethodDef oss_mixer_methods[] = { ...@@ -812,8 +812,8 @@ static PyMethodDef oss_mixer_methods[] = {
{ "fileno", (PyCFunction)oss_mixer_fileno, METH_NOARGS }, { "fileno", (PyCFunction)oss_mixer_fileno, METH_NOARGS },
/* Support for the context manager protocol */ /* Support for the context manager protocol */
{ "__enter__", (PyCFunction)oss_self, METH_NOARGS }, { "__enter__", oss_self, METH_NOARGS },
{ "__exit__", (PyCFunction)oss_exit, METH_VARARGS }, { "__exit__", oss_exit, METH_VARARGS },
/* Simple ioctl wrappers */ /* Simple ioctl wrappers */
{ "controls", (PyCFunction)oss_mixer_controls, METH_VARARGS }, { "controls", (PyCFunction)oss_mixer_controls, METH_VARARGS },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment