summaryrefslogtreecommitdiff
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-23 14:27:38 +0100
committerGitHub <noreply@github.com>2018-11-23 14:27:38 +0100
commitb509d52083e156f97d6bd36f2f894a052e960f03 (patch)
treee1df9b8a25b5bffccf4d20ef0a08487bab5def64 /Objects/longobject.c
parent353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 (diff)
downloadcpython-git-b509d52083e156f97d6bd36f2f894a052e960f03.tar.gz
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 b4435e20a92af474f117b78b98ddc6f515363af5.
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 26d6c53fa9..f42683e9d0 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((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);