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:
Victor Stinner 2018-10-26 14:35:00 +02:00 committed by GitHub
parent 7cd2543416
commit b4435e20a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 16 deletions

View file

@ -31,7 +31,7 @@ PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
op = free_list;
if (op != NULL) {
free_list = (PyCFunctionObject *)(op->m_self);
(void)PyObject_INIT(op, &PyCFunction_Type);
(void)PyObject_INIT((PyObject *)op, &PyCFunction_Type);
numfree--;
}
else {