summaryrefslogtreecommitdiffstats
path: root/Modules/_csv.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-11 07:48:40 (GMT)
committerGitHub <noreply@github.com>2020-04-11 07:48:40 (GMT)
commitcd8295ff758891f21084a6a5ad3403d35dda38f7 (patch)
treea77f829dea34198a7f36658c6e22baf4bc0bf5f5 /Modules/_csv.c
parent7ec43a73092d43c6c95e7dd2669f49d54b57966f (diff)
downloadcpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.zip
cpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.gz
cpython-cd8295ff758891f21084a6a5ad3403d35dda38f7.tar.bz2
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345)
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r--Modules/_csv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c
index 9c49715..950b0d7 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -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)