mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
bpo-35059: PyObject_INIT() casts to PyObject* (GH-10674)
PyObject_INIT() and PyObject_INIT_VAR() now cast their first argument
to PyObject*, as done in Python 3.7.
Revert partially commit b4435e20a9.
This commit is contained in:
parent
353933e712
commit
b509d52083
8 changed files with 18 additions and 12 deletions
|
|
@ -211,7 +211,7 @@ _PyLong_New(Py_ssize_t size)
|
|||
PyErr_NoMemory();
|
||||
return NULL;
|
||||
}
|
||||
return (PyLongObject*)PyObject_INIT_VAR((PyVarObject *)result, &PyLong_Type, size);
|
||||
return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size);
|
||||
}
|
||||
|
||||
PyObject *
|
||||
|
|
@ -5620,7 +5620,7 @@ _PyLong_Init(void)
|
|||
assert(v->ob_digit[0] == (digit)abs(ival));
|
||||
}
|
||||
else {
|
||||
(void)PyObject_INIT((PyObject *)v, &PyLong_Type);
|
||||
(void)PyObject_INIT(v, &PyLong_Type);
|
||||
}
|
||||
Py_SIZE(v) = size;
|
||||
v->ob_digit[0] = (digit)abs(ival);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue