Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f32556

Browse files
author
Jim Fulton
committed
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! :)
1 parent a24d73d commit 1f32556

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

Doc/ext/noddy.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ static PyMethodDef noddy_methods[] = {
5151
{NULL} /* Sentinel */
5252
};
5353

54+
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
55+
#define PyMODINIT_FUNC void
56+
#endif
5457
PyMODINIT_FUNC
5558
initnoddy(void)
5659
{

Doc/ext/noddy2.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Noddy_dealloc(Noddy* self)
1313
{
1414
Py_XDECREF(self->first);
1515
Py_XDECREF(self->last);
16-
self->ob_type->tp_free(self);
16+
self->ob_type->tp_free((PyObject*)self);
1717
}
1818

1919
static PyObject *
@@ -167,6 +167,9 @@ static PyMethodDef module_methods[] = {
167167
{NULL} /* Sentinel */
168168
};
169169

170+
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
171+
#define PyMODINIT_FUNC void
172+
#endif
170173
PyMODINIT_FUNC
171174
initnoddy2(void)
172175
{

Doc/ext/noddy3.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Noddy_dealloc(Noddy* self)
1313
{
1414
Py_XDECREF(self->first);
1515
Py_XDECREF(self->last);
16-
self->ob_type->tp_free(self);
16+
self->ob_type->tp_free((PyObject*)self);
1717
}
1818

1919
static PyObject *
@@ -220,6 +220,9 @@ static PyMethodDef module_methods[] = {
220220
{NULL} /* Sentinel */
221221
};
222222

223+
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
224+
#define PyMODINIT_FUNC void
225+
#endif
223226
PyMODINIT_FUNC
224227
initnoddy3(void)
225228
{

0 commit comments

Comments
 (0)