summaryrefslogtreecommitdiffstats
path: root/Modules/_json.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-11 07:48:40 (GMT)
committerGitHub <noreply@github.com>2020-04-11 07:48:40 (GMT)
commitcd8295ff758891f21084a6a5ad3403d35dda38f7 (patch)
treea77f829dea34198a7f36658c6e22baf4bc0bf5f5 /Modules/_json.c
parent7ec43a73092d43c6c95e7dd2669f49d54b57966f (diff)
downloadcpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.zip
cpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.gz
cpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.bz2
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
Diffstat (limited to 'Modules/_json.c')
-rw-r--r--Modules/_json.c14
1 files changed, 7 insertions, 7 deletions
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 @@ 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;