mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -789,7 +789,7 @@ Reader_iternext(ReaderObj *self)
|
|||
Py_UCS4 c;
|
||||
Py_ssize_t pos, linelen;
|
||||
unsigned int kind;
|
||||
void *data;
|
||||
const void *data;
|
||||
PyObject *lineobj;
|
||||
|
||||
if (parse_reset(self) < 0)
|
||||
|
@ -996,7 +996,7 @@ join_reset(WriterObj *self)
|
|||
* record length.
|
||||
*/
|
||||
static Py_ssize_t
|
||||
join_append_data(WriterObj *self, unsigned int field_kind, void *field_data,
|
||||
join_append_data(WriterObj *self, unsigned int field_kind, const void *field_data,
|
||||
Py_ssize_t field_len, int *quoted,
|
||||
int copy_phase)
|
||||
{
|
||||
|
@ -1107,7 +1107,7 @@ static int
|
|||
join_append(WriterObj *self, PyObject *field, int quoted)
|
||||
{
|
||||
unsigned int field_kind = -1;
|
||||
void *field_data = NULL;
|
||||
const void *field_data = NULL;
|
||||
Py_ssize_t field_len = 0;
|
||||
Py_ssize_t rec_len;
|
||||
|
||||
|
@ -1139,7 +1139,7 @@ join_append_lineterminator(WriterObj *self)
|
|||
{
|
||||
Py_ssize_t terminator_len, i;
|
||||
unsigned int term_kind;
|
||||
void *term_data;
|
||||
const void *term_data;
|
||||
|
||||
terminator_len = PyUnicode_GET_LENGTH(self->dialect->lineterminator);
|
||||
if (terminator_len == -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue