diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-11-11 11:06:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-11 11:06:26 (GMT) |
commit | e2f92de6a90ae11a6d8e01bd17fd88b005516835 (patch) | |
tree | a5bc255a98f488e5ecf195dc3f55665e9afecc47 /Objects/bytearrayobject.c | |
parent | e184cfd7bf8bcfd160e3b611d4351ca3ce52d9e2 (diff) | |
download | cpython-e2f92de6a90ae11a6d8e01bd17fd88b005516835.zip cpython-e2f92de6a90ae11a6d8e01bd17fd88b005516835.tar.gz cpython-e2f92de6a90ae11a6d8e01bd17fd88b005516835.tar.bz2 |
Add the const qualifier to "char *" variables that refer to literal strings. (#4370)
Diffstat (limited to 'Objects/bytearrayobject.c')
-rw-r--r-- | Objects/bytearrayobject.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 83c3549..dc1515a 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1806,7 +1806,8 @@ bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes) /*[clinic end generated code: output=760412661a34ad5a input=ef7bb59b09c21d62]*/ { Py_ssize_t left, right, mysize, byteslen; - char *myptr, *bytesptr; + char *myptr; + const char *bytesptr; Py_buffer vbytes; if (bytes == Py_None) { @@ -1816,7 +1817,7 @@ bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes) else { if (PyObject_GetBuffer(bytes, &vbytes, PyBUF_SIMPLE) != 0) return NULL; - bytesptr = (char *) vbytes.buf; + bytesptr = (const char *) vbytes.buf; byteslen = vbytes.len; } myptr = PyByteArray_AS_STRING(self); @@ -1847,7 +1848,8 @@ bytearray_lstrip_impl(PyByteArrayObject *self, PyObject *bytes) /*[clinic end generated code: output=d005c9d0ab909e66 input=80843f975dd7c480]*/ { Py_ssize_t left, right, mysize, byteslen; - char *myptr, *bytesptr; + char *myptr; + const char *bytesptr; Py_buffer vbytes; if (bytes == Py_None) { @@ -1857,7 +1859,7 @@ bytearray_lstrip_impl(PyByteArrayObject *self, PyObject *bytes) else { if (PyObject_GetBuffer(bytes, &vbytes, PyBUF_SIMPLE) != 0) return NULL; - bytesptr = (char *) vbytes.buf; + bytesptr = (const char *) vbytes.buf; byteslen = vbytes.len; } myptr = PyByteArray_AS_STRING(self); @@ -1885,7 +1887,8 @@ bytearray_rstrip_impl(PyByteArrayObject *self, PyObject *bytes) /*[clinic end generated code: output=030e2fbd2f7276bd input=e728b994954cfd91]*/ { Py_ssize_t right, mysize, byteslen; - char *myptr, *bytesptr; + char *myptr; + const char *bytesptr; Py_buffer vbytes; if (bytes == Py_None) { @@ -1895,7 +1898,7 @@ bytearray_rstrip_impl(PyByteArrayObject *self, PyObject *bytes) else { if (PyObject_GetBuffer(bytes, &vbytes, PyBUF_SIMPLE) != 0) return NULL; - bytesptr = (char *) vbytes.buf; + bytesptr = (const char *) vbytes.buf; byteslen = vbytes.len; } myptr = PyByteArray_AS_STRING(self); |