mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
ANSI-fication (fixed on parameter list I messed up in the patch)
This commit is contained in:
parent
8bc8f0d036
commit
3e3175b5e7
1 changed files with 19 additions and 53 deletions
|
|
@ -60,8 +60,7 @@ static PyObject *SunAudioError;
|
||||||
|
|
||||||
|
|
||||||
static sadobject *
|
static sadobject *
|
||||||
newsadobject(arg)
|
newsadobject(PyObject *args)
|
||||||
PyObject *arg;
|
|
||||||
{
|
{
|
||||||
sadobject *xp;
|
sadobject *xp;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
@ -72,7 +71,7 @@ newsadobject(arg)
|
||||||
char* opendev;
|
char* opendev;
|
||||||
|
|
||||||
/* Check arg for r/w/rw */
|
/* Check arg for r/w/rw */
|
||||||
if (!PyArg_Parse(arg, "s", &mode))
|
if (!PyArg_Parse(args, "s", &mode))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (strcmp(mode, "r") == 0)
|
if (strcmp(mode, "r") == 0)
|
||||||
imode = 0;
|
imode = 0;
|
||||||
|
|
@ -133,17 +132,14 @@ newsadobject(arg)
|
||||||
/* Sad methods */
|
/* Sad methods */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sad_dealloc(xp)
|
sad_dealloc(sadobject *xp)
|
||||||
sadobject *xp;
|
|
||||||
{
|
{
|
||||||
close(xp->x_fd);
|
close(xp->x_fd);
|
||||||
PyObject_Del(xp);
|
PyObject_Del(xp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_read(self, args)
|
sad_read(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
int size, count;
|
int size, count;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
@ -180,9 +176,7 @@ sad_read(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_write(self, args)
|
sad_write(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
char *cp;
|
char *cp;
|
||||||
int count, size;
|
int count, size;
|
||||||
|
|
@ -206,9 +200,7 @@ sad_write(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_getinfo(self, args)
|
sad_getinfo(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
sadstatusobject *rv;
|
sadstatusobject *rv;
|
||||||
|
|
||||||
|
|
@ -226,9 +218,7 @@ sad_getinfo(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_setinfo(self, arg)
|
sad_setinfo(sadobject *self, sadstatusobject *arg)
|
||||||
sadobject *self;
|
|
||||||
sadstatusobject *arg;
|
|
||||||
{
|
{
|
||||||
if (!is_sadstatusobject(arg)) {
|
if (!is_sadstatusobject(arg)) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
|
|
@ -244,9 +234,7 @@ sad_setinfo(self, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_ibufcount(self, args)
|
sad_ibufcount(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
audio_info_t ai;
|
audio_info_t ai;
|
||||||
|
|
||||||
|
|
@ -260,9 +248,7 @@ sad_ibufcount(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_obufcount(self, args)
|
sad_obufcount(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
audio_info_t ai;
|
audio_info_t ai;
|
||||||
|
|
||||||
|
|
@ -280,9 +266,7 @@ sad_obufcount(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_drain(self, args)
|
sad_drain(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!PyArg_Parse(args, ""))
|
if (!PyArg_Parse(args, ""))
|
||||||
|
|
@ -297,9 +281,7 @@ sad_drain(self, args)
|
||||||
|
|
||||||
#ifdef SOLARIS
|
#ifdef SOLARIS
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_getdev(self, args)
|
sad_getdev(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
struct audio_device ad;
|
struct audio_device ad;
|
||||||
|
|
||||||
|
|
@ -314,9 +296,7 @@ sad_getdev(self, args)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_flush(self, args)
|
sad_flush(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!PyArg_Parse(args, ""))
|
if (!PyArg_Parse(args, ""))
|
||||||
|
|
@ -330,9 +310,7 @@ sad_flush(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_close(self, args)
|
sad_close(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!PyArg_Parse(args, ""))
|
if (!PyArg_Parse(args, ""))
|
||||||
|
|
@ -346,9 +324,7 @@ sad_close(self, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_fileno(self, args)
|
sad_fileno(sadobject *self, PyObject *args)
|
||||||
sadobject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
if (!PyArg_Parse(args, ""))
|
if (!PyArg_Parse(args, ""))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -376,9 +352,7 @@ static PyMethodDef sad_methods[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sad_getattr(xp, name)
|
sad_getattr(sadobject *xp, char *name)
|
||||||
sadobject *xp;
|
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
if (xp->x_isctl)
|
if (xp->x_isctl)
|
||||||
return Py_FindMethod(sad_methods+CTL_METHODS,
|
return Py_FindMethod(sad_methods+CTL_METHODS,
|
||||||
|
|
@ -395,8 +369,7 @@ sads_alloc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sads_dealloc(xp)
|
sads_dealloc(sadstatusobject *xp)
|
||||||
sadstatusobject *xp;
|
|
||||||
{
|
{
|
||||||
PyMem_DEL(xp);
|
PyMem_DEL(xp);
|
||||||
}
|
}
|
||||||
|
|
@ -446,18 +419,13 @@ static struct memberlist sads_ml[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sads_getattr(xp, name)
|
sads_getattr(sadstatusobject *xp, char *name)
|
||||||
sadstatusobject *xp;
|
|
||||||
char *name;
|
|
||||||
{
|
{
|
||||||
return PyMember_Get((char *)&xp->ai, sads_ml, name);
|
return PyMember_Get((char *)&xp->ai, sads_ml, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
sads_setattr(xp, name, v)
|
sads_setattr(sadstatusobject *xp, char *name, PyObject *v)
|
||||||
sadstatusobject *xp;
|
|
||||||
char *name;
|
|
||||||
PyObject *v;
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
|
|
@ -503,9 +471,7 @@ static PyTypeObject Sadstatustype = {
|
||||||
/* ------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------- */
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
sadopen(self, args)
|
sadopen(PyObject *self, PyObject *args)
|
||||||
PyObject *self;
|
|
||||||
PyObject *args;
|
|
||||||
{
|
{
|
||||||
return (PyObject *)newsadobject(args);
|
return (PyObject *)newsadobject(args);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue