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 | |
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')
-rw-r--r-- | Objects/call.c | 3 | ||||
-rw-r--r-- | Objects/dictobject.c | 6 | ||||
-rw-r--r-- | Objects/moduleobject.c | 12 | ||||
-rw-r--r-- | Objects/typeobject.c | 4 |
4 files changed, 12 insertions, 13 deletions
diff --git a/Objects/call.c b/Objects/call.c index c3939ea..9646ad2 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -884,8 +884,7 @@ PyObject_CallMethodObjArgs(PyObject *obj, PyObject *name, ...) PyObject * -_PyObject_CallMethodIdObjArgs(PyObject *obj, - struct _Py_Identifier *name, ...) +_PyObject_CallMethodIdObjArgs(PyObject *obj, _Py_Identifier *name, ...) { PyThreadState *tstate = _PyThreadState_GET(); if (obj == NULL || name == NULL) { diff --git a/Objects/dictobject.c b/Objects/dictobject.c index fca879f..68b79f2 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -1500,7 +1500,7 @@ _PyDict_GetItemWithError(PyObject *dp, PyObject *kv) } PyObject * -_PyDict_GetItemIdWithError(PyObject *dp, struct _Py_Identifier *key) +_PyDict_GetItemIdWithError(PyObject *dp, _Py_Identifier *key) { PyObject *kv; kv = _PyUnicode_FromId(key); /* borrowed */ @@ -3411,7 +3411,7 @@ _PyDict_Contains_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash) } int -_PyDict_ContainsId(PyObject *op, struct _Py_Identifier *key) +_PyDict_ContainsId(PyObject *op, _Py_Identifier *key) { PyObject *kv = _PyUnicode_FromId(key); /* borrowed */ if (kv == NULL) { @@ -3589,7 +3589,7 @@ PyDict_GetItemString(PyObject *v, const char *key) } int -_PyDict_SetItemId(PyObject *v, struct _Py_Identifier *key, PyObject *item) +_PyDict_SetItemId(PyObject *v, _Py_Identifier *key, PyObject *item) { PyObject *kv; kv = _PyUnicode_FromId(key); /* borrowed */ 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; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 4b7035c..2862612 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3716,7 +3716,7 @@ PyType_GetModuleState(PyTypeObject *type) * given PyModuleDef. */ PyObject * -PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def) +PyType_GetModuleByDef(PyTypeObject *type, PyModuleDef *def) { assert(PyType_Check(type)); @@ -3869,7 +3869,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) } PyObject * -_PyType_LookupId(PyTypeObject *type, struct _Py_Identifier *name) +_PyType_LookupId(PyTypeObject *type, _Py_Identifier *name) { PyObject *oname; oname = _PyUnicode_FromId(name); /* borrowed */ |