gh-92135: Rename _Py_reinterpret_cast() to _Py_CAST() (#92230)

Rename also _Py_static_cast() to _Py_STATIC_CAST().
This commit is contained in:
Victor Stinner 2022-05-03 16:37:06 +02:00 committed by GitHub
parent f6f36cc269
commit fbd5539a54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 24 additions and 24 deletions

View file

@ -104,7 +104,7 @@ struct _object {
};
/* Cast argument to PyObject* type. */
#define _PyObject_CAST(op) _Py_reinterpret_cast(PyObject*, (op))
#define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
typedef struct {
PyObject ob_base;
@ -112,7 +112,7 @@ typedef struct {
} PyVarObject;
/* Cast argument to PyVarObject* type. */
#define _PyVarObject_CAST(op) _Py_reinterpret_cast(PyVarObject*, (op))
#define _PyVarObject_CAST(op) _Py_CAST(PyVarObject*, (op))
// Test if the 'x' object is the 'y' object, the same as "x is y" in Python.
@ -781,7 +781,7 @@ static inline int PyType_Check(PyObject *op) {
#endif
#define _PyType_CAST(op) \
(assert(PyType_Check(op)), _Py_reinterpret_cast(PyTypeObject*, (op)))
(assert(PyType_Check(op)), _Py_CAST(PyTypeObject*, (op)))
static inline int PyType_CheckExact(PyObject *op) {
return Py_IS_TYPE(op, &PyType_Type);