diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-04-11 10:48:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 10:48:40 +0300 |
commit | cd8295ff758891f21084a6a5ad3403d35dda38f7 (patch) | |
tree | a77f829dea34198a7f36658c6e22baf4bc0bf5f5 /Python/formatter_unicode.c | |
parent | 7ec43a73092d43c6c95e7dd2669f49d54b57966f (diff) | |
download | cpython-git-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.gz |
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r-- | Python/formatter_unicode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 841b25a43f..74638ca223 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -62,7 +62,7 @@ get_integer(PyObject *str, Py_ssize_t *ppos, Py_ssize_t end, Py_ssize_t accumulator, digitval, pos = *ppos; int numdigits; int kind = PyUnicode_KIND(str); - void *data = PyUnicode_DATA(str); + const void *data = PyUnicode_DATA(str); accumulator = numdigits = 0; for (; pos < end; pos++, numdigits++) { @@ -170,7 +170,7 @@ parse_internal_render_format_spec(PyObject *format_spec, { Py_ssize_t pos = start; int kind = PyUnicode_KIND(format_spec); - void *data = PyUnicode_DATA(format_spec); + const void *data = PyUnicode_DATA(format_spec); /* end-pos is used throughout this code to specify the length of the input string */ #define READ_spec(index) PyUnicode_READ(kind, data, index) @@ -443,7 +443,7 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, { Py_ssize_t remainder; int kind = PyUnicode_KIND(s); - void *data = PyUnicode_DATA(s); + const void *data = PyUnicode_DATA(s); while (pos<end && Py_ISDIGIT(PyUnicode_READ(kind, data, pos))) ++pos; |