diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-10-26 12:35:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-26 12:35:00 (GMT) |
commit | b4435e20a92af474f117b78b98ddc6f515363af5 (patch) | |
tree | 4383bfb9ba3f9ec21a2d0cbdd726b38c5a9e1956 /Objects/longobject.c | |
parent | 7cd25434164882c2093ea41ccfc7b95a05cd5cbd (diff) | |
download | cpython-b4435e20a92af474f117b78b98ddc6f515363af5.zip cpython-b4435e20a92af474f117b78b98ddc6f515363af5.tar.gz cpython-b4435e20a92af474f117b78b98ddc6f515363af5.tar.bz2 |
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*.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 6f7fe33..ab5ac34 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -211,7 +211,7 @@ _PyLong_New(Py_ssize_t size) PyErr_NoMemory(); return NULL; } - return (PyLongObject*)PyObject_INIT_VAR(result, &PyLong_Type, size); + return (PyLongObject*)PyObject_INIT_VAR((PyVarObject *)result, &PyLong_Type, size); } PyObject * @@ -5620,7 +5620,7 @@ _PyLong_Init(void) assert(v->ob_digit[0] == (digit)abs(ival)); } else { - (void)PyObject_INIT(v, &PyLong_Type); + (void)PyObject_INIT((PyObject *)v, &PyLong_Type); } Py_SIZE(v) = size; v->ob_digit[0] = (digit)abs(ival); |