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

@ -43,16 +43,11 @@ PySfSoundBufferRecorder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PySfSoundBufferRecorder *self;
self = (PySfSoundBufferRecorder *)type->tp_alloc(type, 0);
if (self != NULL)
self->obj = new sf::SoundBufferRecorder();
return (PyObject *)self;
}
static int
PySfSoundBufferRecorder_init(PySfSoundBufferRecorder *self, PyObject *args)
{
self->obj = new sf::SoundBufferRecorder();
return 0;
}
static PyObject *
PySfSoundBufferRecorder_GetBuffer(PySfSoundBufferRecorder* self)
{
@ -103,7 +98,7 @@ PyTypeObject PySfSoundBufferRecorderType = {
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
(initproc)PySfSoundBufferRecorder_init, /* tp_init */
0, /* tp_init */
0, /* tp_alloc */
PySfSoundBufferRecorder_new, /* tp_new */
};