mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
C extensions: fix use of self->ob_type everywhere
Part of general preparations for the python3 port.
This commit is contained in:
parent
acd683b3ac
commit
2761fd5bd0
@ -184,7 +184,7 @@ Device_dealloc(Device* self)
|
|||||||
Py_XDECREF(self->serial_number); self->serial_number = NULL;
|
Py_XDECREF(self->serial_number); self->serial_number = NULL;
|
||||||
Py_XDECREF(self->device_version); self->device_version = NULL;
|
Py_XDECREF(self->device_version); self->device_version = NULL;
|
||||||
|
|
||||||
self->ob_type->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -32,7 +32,7 @@ dealloc(Device* self)
|
|||||||
|
|
||||||
Py_XDECREF(self->device_information); self->device_information = NULL;
|
Py_XDECREF(self->device_information); self->device_information = NULL;
|
||||||
|
|
||||||
self->ob_type->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -244,4 +244,3 @@ PyTypeObject wpd::DeviceType = { // {{{
|
|||||||
0, /* tp_alloc */
|
0, /* tp_alloc */
|
||||||
0, /* tp_new */
|
0, /* tp_new */
|
||||||
}; // }}}
|
}; // }}}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Face_dealloc(Face* self)
|
|||||||
Py_XDECREF(self->data);
|
Py_XDECREF(self->data);
|
||||||
self->data = NULL;
|
self->data = NULL;
|
||||||
|
|
||||||
self->ob_type->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -160,7 +160,7 @@ dealloc(FreeType* self)
|
|||||||
}
|
}
|
||||||
self->library = NULL;
|
self->library = NULL;
|
||||||
|
|
||||||
self->ob_type->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -319,4 +319,3 @@ initfreetype(void) {
|
|||||||
PyModule_AddObject(m, "FreeType", (PyObject *)&FreeTypeType);
|
PyModule_AddObject(m, "FreeType", (PyObject *)&FreeTypeType);
|
||||||
PyModule_AddObject(m, "Face", (PyObject *)&FaceType);
|
PyModule_AddObject(m, "Face", (PyObject *)&FaceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ static void
|
|||||||
PDFDoc_dealloc(PDFDoc* self)
|
PDFDoc_dealloc(PDFDoc* self)
|
||||||
{
|
{
|
||||||
if (self->doc != NULL) delete self->doc;
|
if (self->doc != NULL) delete self->doc;
|
||||||
self->ob_type->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -13,7 +13,7 @@ using namespace pdf;
|
|||||||
static void
|
static void
|
||||||
dealloc(PDFOutlineItem* self)
|
dealloc(PDFOutlineItem* self)
|
||||||
{
|
{
|
||||||
self->ob_type->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@ -138,5 +138,3 @@ PyTypeObject pdf::PDFOutlineItemType = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user