mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-35059: Convert PyObject_INIT() to function (GH-10077)
* Convert PyObject_INIT() and PyObject_INIT_VAR() macros to static inline functions. * Fix usage of these functions: cast to PyObject* or PyVarObject*.
This commit is contained in:
parent
7cd2543416
commit
b4435e20a9
8 changed files with 33 additions and 16 deletions
|
@ -228,7 +228,7 @@ PyComplex_FromCComplex(Py_complex cval)
|
|||
op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject));
|
||||
if (op == NULL)
|
||||
return PyErr_NoMemory();
|
||||
(void)PyObject_INIT(op, &PyComplex_Type);
|
||||
(void)PyObject_INIT((PyObject *)op, &PyComplex_Type);
|
||||
op->cval = cval;
|
||||
return (PyObject *) op;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue