diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-24 16:51:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-24 16:51:59 (GMT) |
commit | 042f31da552c19054acd3ef7bb6cfd857bce172b (patch) | |
tree | d1aa8f20f873c89adebbac7072d80dceb19d32c4 /Objects/moduleobject.c | |
parent | ec091bd47e2f968b0d1631b9a8104283a7beeb1b (diff) | |
download | cpython-042f31da552c19054acd3ef7bb6cfd857bce172b.zip cpython-042f31da552c19054acd3ef7bb6cfd857bce172b.tar.gz cpython-042f31da552c19054acd3ef7bb6cfd857bce172b.tar.bz2 |
bpo-45459: C API uses type names rather than structure names (GH-31528)
Thanks to the new pytypedefs.h, it becomes to use type names like
PyObject rather like structure names like "struct _object".
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r-- | Objects/moduleobject.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index bd5e561..72ed9bb 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -19,7 +19,7 @@ static PyMemberDef module_members[] = { PyTypeObject PyModuleDef_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "moduledef", /* tp_name */ - sizeof(struct PyModuleDef), /* tp_basicsize */ + sizeof(PyModuleDef), /* tp_basicsize */ 0, /* tp_itemsize */ }; @@ -32,13 +32,13 @@ _PyModule_IsExtension(PyObject *obj) } PyModuleObject *module = (PyModuleObject*)obj; - struct PyModuleDef *def = module->md_def; + PyModuleDef *def = module->md_def; return (def != NULL && def->m_methods != NULL); } PyObject* -PyModuleDef_Init(struct PyModuleDef* def) +PyModuleDef_Init(PyModuleDef* def) { assert(PyModuleDef_Type.tp_flags & Py_TPFLAGS_READY); if (def->m_base.m_index == 0) { @@ -182,7 +182,7 @@ _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions) } PyObject * -PyModule_Create2(struct PyModuleDef* module, int module_api_version) +PyModule_Create2(PyModuleDef* module, int module_api_version) { if (!_PyImport_IsInitialized(_PyInterpreterState_GET())) { PyErr_SetString(PyExc_SystemError, @@ -193,7 +193,7 @@ PyModule_Create2(struct PyModuleDef* module, int module_api_version) } PyObject * -_PyModule_CreateInitialized(struct PyModuleDef* module, int module_api_version) +_PyModule_CreateInitialized(PyModuleDef* module, int module_api_version) { const char* name; PyModuleObject *m; @@ -256,7 +256,7 @@ _PyModule_CreateInitialized(struct PyModuleDef* module, int module_api_version) } PyObject * -PyModule_FromDefAndSpec2(struct PyModuleDef* def, PyObject *spec, int module_api_version) +PyModule_FromDefAndSpec2(PyModuleDef* def, PyObject *spec, int module_api_version) { PyModuleDef_Slot* cur_slot; PyObject *(*create)(PyObject *, PyModuleDef*) = NULL; |