Commit 1f325562 authored by Jim Fulton's avatar Jim Fulton

Added some missing PyObject* casts in the deallocators.

Added some defines for PyMODINIT_FUNC so that the examples work
with Python 2.2.

I think I'm done hacking this documentation. Yippie! :)
parent a24d73dd
...@@ -51,6 +51,9 @@ static PyMethodDef noddy_methods[] = { ...@@ -51,6 +51,9 @@ static PyMethodDef noddy_methods[] = {
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC PyMODINIT_FUNC
initnoddy(void) initnoddy(void)
{ {
......
...@@ -13,7 +13,7 @@ Noddy_dealloc(Noddy* self) ...@@ -13,7 +13,7 @@ Noddy_dealloc(Noddy* self)
{ {
Py_XDECREF(self->first); Py_XDECREF(self->first);
Py_XDECREF(self->last); Py_XDECREF(self->last);
self->ob_type->tp_free(self); self->ob_type->tp_free((PyObject*)self);
} }
static PyObject * static PyObject *
...@@ -167,6 +167,9 @@ static PyMethodDef module_methods[] = { ...@@ -167,6 +167,9 @@ static PyMethodDef module_methods[] = {
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC PyMODINIT_FUNC
initnoddy2(void) initnoddy2(void)
{ {
......
...@@ -13,7 +13,7 @@ Noddy_dealloc(Noddy* self) ...@@ -13,7 +13,7 @@ Noddy_dealloc(Noddy* self)
{ {
Py_XDECREF(self->first); Py_XDECREF(self->first);
Py_XDECREF(self->last); Py_XDECREF(self->last);
self->ob_type->tp_free(self); self->ob_type->tp_free((PyObject*)self);
} }
static PyObject * static PyObject *
...@@ -220,6 +220,9 @@ static PyMethodDef module_methods[] = { ...@@ -220,6 +220,9 @@ static PyMethodDef module_methods[] = {
{NULL} /* Sentinel */ {NULL} /* Sentinel */
}; };
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
#define PyMODINIT_FUNC void
#endif
PyMODINIT_FUNC PyMODINIT_FUNC
initnoddy3(void) initnoddy3(void)
{ {
......
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