mirror of https://github.com/python/cpython
bpo-46417: Use _PyType_CAST() in Python directory (GH-30769)
This commit is contained in:
parent
8ee07dda13
commit
7835cbf949
|
@ -536,7 +536,7 @@ static PyObject *
|
||||||
filter_vectorcall(PyObject *type, PyObject * const*args,
|
filter_vectorcall(PyObject *type, PyObject * const*args,
|
||||||
size_t nargsf, PyObject *kwnames)
|
size_t nargsf, PyObject *kwnames)
|
||||||
{
|
{
|
||||||
PyTypeObject *tp = (PyTypeObject *)type;
|
PyTypeObject *tp = _PyType_CAST(type);
|
||||||
if (tp == &PyFilter_Type && !_PyArg_NoKwnames("filter", kwnames)) {
|
if (tp == &PyFilter_Type && !_PyArg_NoKwnames("filter", kwnames)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1251,7 +1251,7 @@ static PyObject *
|
||||||
map_vectorcall(PyObject *type, PyObject * const*args,
|
map_vectorcall(PyObject *type, PyObject * const*args,
|
||||||
size_t nargsf, PyObject *kwnames)
|
size_t nargsf, PyObject *kwnames)
|
||||||
{
|
{
|
||||||
PyTypeObject *tp = (PyTypeObject *)type;
|
PyTypeObject *tp = _PyType_CAST(type);
|
||||||
if (tp == &PyMap_Type && !_PyArg_NoKwnames("map", kwnames)) {
|
if (tp == &PyMap_Type && !_PyArg_NoKwnames("map", kwnames)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1339,8 +1339,7 @@ specialize_class_call(
|
||||||
PyObject *callable, _Py_CODEUNIT *instr,
|
PyObject *callable, _Py_CODEUNIT *instr,
|
||||||
int nargs, SpecializedCacheEntry *cache)
|
int nargs, SpecializedCacheEntry *cache)
|
||||||
{
|
{
|
||||||
assert(PyType_Check(callable));
|
PyTypeObject *tp = _PyType_CAST(callable);
|
||||||
PyTypeObject *tp = (PyTypeObject *)callable;
|
|
||||||
if (_Py_OPCODE(instr[-1]) == PRECALL_METHOD) {
|
if (_Py_OPCODE(instr[-1]) == PRECALL_METHOD) {
|
||||||
SPECIALIZATION_FAIL(CALL_NO_KW, SPEC_FAIL_METHOD_CALL_CLASS);
|
SPECIALIZATION_FAIL(CALL_NO_KW, SPEC_FAIL_METHOD_CALL_CLASS);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue