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
|
@ -1428,7 +1428,7 @@ my_basename(PyObject *name)
|
|||
{
|
||||
Py_ssize_t i, size, offset;
|
||||
int kind;
|
||||
void *data;
|
||||
const void *data;
|
||||
|
||||
if (PyUnicode_READY(name))
|
||||
return NULL;
|
||||
|
@ -2953,7 +2953,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start)
|
|||
static PyObject *exec_prefix = NULL;
|
||||
Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text), match;
|
||||
int kind = PyUnicode_KIND(self->text);
|
||||
void *data = PyUnicode_DATA(self->text);
|
||||
const void *data = PyUnicode_DATA(self->text);
|
||||
|
||||
/* Ignore leading whitespace */
|
||||
while (start < text_len) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue