mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
This commit is contained in:
parent
7ec43a7309
commit
cd8295ff75
27 changed files with 250 additions and 221 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue