mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #25923: Added the const qualifier to static constant arrays.
This commit is contained in:
parent
ea8c43152f
commit
2d06e84455
44 changed files with 139 additions and 134 deletions
|
@ -772,7 +772,7 @@ typedef struct {
|
|||
encodefunc_t encodefunc;
|
||||
} encodefuncentry;
|
||||
|
||||
static encodefuncentry encodefuncs[] = {
|
||||
static const encodefuncentry encodefuncs[] = {
|
||||
{"ascii", (encodefunc_t) ascii_encode},
|
||||
{"iso8859-1", (encodefunc_t) latin1_encode},
|
||||
{"utf-8", (encodefunc_t) utf8_encode},
|
||||
|
@ -1022,7 +1022,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
|
|||
goto error;
|
||||
}
|
||||
else if (PyUnicode_Check(res)) {
|
||||
encodefuncentry *e = encodefuncs;
|
||||
const encodefuncentry *e = encodefuncs;
|
||||
while (e->name != NULL) {
|
||||
if (!PyUnicode_CompareWithASCIIString(res, e->name)) {
|
||||
self->encodefunc = e->encodefunc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue