summaryrefslogtreecommitdiffstats
path: root/Modules/cjkcodecs
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/cjkcodecs
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/cjkcodecs')
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h2
-rw-r--r--Modules/cjkcodecs/multibytecodec.c4
-rw-r--r--Modules/cjkcodecs/multibytecodec.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h
index 8f6f880..e41755b 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -72,7 +72,7 @@ static const struct dbcs_map *mapping_list;
#define ENCODER(encoding) \
static Py_ssize_t encoding##_encode( \
MultibyteCodec_State *state, const void *config, \
- int kind, void *data, \
+ int kind, const void *data, \
Py_ssize_t *inpos, Py_ssize_t inlen, \
unsigned char **outbuf, Py_ssize_t outleft, int flags)
#define ENCODER_RESET(encoding) \
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index a09c75d..9f9fbeb 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -228,7 +228,7 @@ multibytecodec_encerror(MultibyteCodec *codec,
Py_ssize_t r;
Py_ssize_t inpos;
int kind;
- void *data;
+ const void *data;
replchar = PyUnicode_FromOrdinal('?');
if (replchar == NULL)
@@ -457,7 +457,7 @@ multibytecodec_encode(MultibyteCodec *codec,
Py_ssize_t finalsize, r = 0;
Py_ssize_t datalen;
int kind;
- void *data;
+ const void *data;
if (PyUnicode_READY(text) < 0)
return NULL;
diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h
index 4d2b355..5946821 100644
--- a/Modules/cjkcodecs/multibytecodec.h
+++ b/Modules/cjkcodecs/multibytecodec.h
@@ -30,7 +30,7 @@ typedef struct {
typedef int (*mbcodec_init)(const void *config);
typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state,
const void *config,
- int kind, void *data,
+ int kind, const void *data,
Py_ssize_t *inpos, Py_ssize_t inlen,
unsigned char **outbuf, Py_ssize_t outleft,
int flags);