bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472)

This commit is contained in:
Serhiy Storchaka 2020-04-12 14:58:27 +03:00 committed by GitHub
parent 3e0dd3730b
commit 8f87eefe7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 38 additions and 37 deletions

View file

@ -3887,7 +3887,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
PyObject *path = NULL;
PyObject *output = NULL;
Py_ssize_t size;
void *data;
const char *data;
if (arg == NULL) {
Py_DECREF(*(PyObject**)addr);
*(PyObject**)addr = NULL;
@ -4718,7 +4718,7 @@ _PyUnicode_EncodeUTF7(PyObject *str,
unsigned int base64bits = 0;
unsigned long base64buffer = 0;
char * out;
char * start;
const char * start;
if (PyUnicode_READY(str) == -1)
return NULL;
@ -5446,7 +5446,7 @@ unicode_fill_utf8(PyObject *unicode)
return -1;
}
char *start = writer.use_small_buffer ? writer.small_buffer :
const char *start = writer.use_small_buffer ? writer.small_buffer :
PyBytes_AS_STRING(writer.buffer);
Py_ssize_t len = end - start;