Issue #25923: Added the const qualifier to static constant arrays.

This commit is contained in:
Serhiy Storchaka 2015-12-25 19:53:18 +02:00
parent ea8c43152f
commit 2d06e84455
44 changed files with 139 additions and 134 deletions

View file

@ -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;