bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)

This commit is contained in:
Serhiy Storchaka 2020-04-11 10:48:40 +03:00 committed by GitHub
parent 7ec43a7309
commit cd8295ff75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 250 additions and 221 deletions

View file

@ -159,8 +159,8 @@ ascii_escape_unicode(PyObject *pystr)
Py_ssize_t output_size;
Py_ssize_t chars;
PyObject *rval;
void *input;
unsigned char *output;
const void *input;
Py_UCS1 *output;
int kind;
if (PyUnicode_READY(pystr) == -1)
@ -225,7 +225,7 @@ escape_unicode(PyObject *pystr)
Py_ssize_t output_size;
Py_ssize_t chars;
PyObject *rval;
void *input;
const void *input;
int kind;
Py_UCS4 maxchar;
@ -678,7 +678,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
Returns a new PyObject (usually a dict, but object_hook can change that)
*/
void *str;
const void *str;
int kind;
Py_ssize_t end_idx;
PyObject *val = NULL;
@ -808,7 +808,7 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
Returns a new PyList
*/
void *str;
const void *str;
int kind;
Py_ssize_t end_idx;
PyObject *val = NULL;
@ -911,7 +911,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
PyLong, or PyFloat.
May return other types if parse_int or parse_float are set
*/
void *str;
const void *str;
int kind;
Py_ssize_t end_idx;
Py_ssize_t idx = start;
@ -1028,7 +1028,7 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
Returns a new PyObject representation of the term.
*/
PyObject *res;
void *str;
const void *str;
int kind;
Py_ssize_t length;