Split __init__ into __init__ and __new__, code clean up

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1056 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
remi-k 2009-03-14 22:28:16 +00:00
parent 15ba8f9b3c
commit d4e7e7724f
30 changed files with 305 additions and 542 deletions

View file

@ -76,17 +76,14 @@ PySfSoundRecorder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PySfSoundRecorder *self;
self = (PySfSoundRecorder *)type->tp_alloc(type, 0);
if (self != NULL)
{
self->obj = new CustomSoundRecorder();
self->obj->SoundRecorder = (PyObject *)self;
}
return (PyObject *)self;
}
static int
PySfSoundRecorder_init(PySfSoundRecorder *self, PyObject *args)
{
self->obj = new CustomSoundRecorder();
self->obj->SoundRecorder = (PyObject *)self;
return 0;
}
static PyObject *
PySfSoundRecorder_Start(PySfSoundRecorder* self, PyObject *args)
{
@ -162,7 +159,7 @@ Construct the sound recorder with a callback function for processing captured sa
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
(initproc)PySfSoundRecorder_init, /* tp_init */
0, /* tp_init */
0, /* tp_alloc */
PySfSoundRecorder_new, /* tp_new */
};