summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-23 13:27:38 (GMT)
committerGitHub <noreply@github.com>2018-11-23 13:27:38 (GMT)
commitb509d52083e156f97d6bd36f2f894a052e960f03 (patch)
treee1df9b8a25b5bffccf4d20ef0a08487bab5def64 /Objects/bytesobject.c
parent353933e712b6c7f7ba9a9a50bd5bd472db7c35d0 (diff)
downloadcpython-b509d52083e156f97d6bd36f2f894a052e960f03.zip
cpython-b509d52083e156f97d6bd36f2f894a052e960f03.tar.gz
cpython-b509d52083e156f97d6bd36f2f894a052e960f03.tar.bz2
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/bytesobject.c')
-rw-r--r--Objects/bytesobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index bed75ee..e4a4973 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -86,7 +86,7 @@ _PyBytes_FromSize(Py_ssize_t size, int use_calloc)
op = (PyBytesObject *)PyObject_Malloc(PyBytesObject_SIZE + size);
if (op == NULL)
return PyErr_NoMemory();
- (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size);
+ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
op->ob_shash = -1;
if (!use_calloc)
op->ob_sval[size] = '\0';
@@ -164,7 +164,7 @@ PyBytes_FromString(const char *str)
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size);
if (op == NULL)
return PyErr_NoMemory();
- (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size);
+ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
op->ob_shash = -1;
memcpy(op->ob_sval, str, size+1);
/* share short strings */
@@ -1509,7 +1509,7 @@ bytes_repeat(PyBytesObject *a, Py_ssize_t n)
op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes);
if (op == NULL)
return PyErr_NoMemory();
- (void)PyObject_INIT_VAR((PyVarObject *)op, &PyBytes_Type, size);
+ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size);
op->ob_shash = -1;
op->ob_sval[size] = '\0';
if (Py_SIZE(a) == 1 && n > 0) {