bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
diff --git a/Modules/_json.c b/Modules/_json.c
index 3ab1cb3..1754416 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -159,8 +159,8 @@
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 @@
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 @@
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 @@
Returns a new PyList
*/
- void *str;
+ const void *str;
int kind;
Py_ssize_t end_idx;
PyObject *val = NULL;
@@ -911,7 +911,7 @@
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 @@
Returns a new PyObject representation of the term.
*/
PyObject *res;
- void *str;
+ const void *str;
int kind;
Py_ssize_t length;