diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-06-12 13:11:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-12 13:11:59 (GMT) |
commit | be8b631b7a587aa781245e14c8cca32970e1be5b (patch) | |
tree | e754599e2e72d6e327667f1b8788f2d34d6fda36 /Objects/codeobject.c | |
parent | 9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba (diff) | |
download | cpython-be8b631b7a587aa781245e14c8cca32970e1be5b.zip cpython-be8b631b7a587aa781245e14c8cca32970e1be5b.tar.gz cpython-be8b631b7a587aa781245e14c8cca32970e1be5b.tar.bz2 |
Add more const modifiers. (GH-26691)
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r-- | Objects/codeobject.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 1a99ec3..701a37d 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -627,7 +627,7 @@ PyCode_Addr2Line(PyCodeObject *co, int addrq) } void -PyLineTable_InitAddressRange(char *linetable, Py_ssize_t length, int firstlineno, PyCodeAddressRange *range) +PyLineTable_InitAddressRange(const char *linetable, Py_ssize_t length, int firstlineno, PyCodeAddressRange *range) { range->opaque.lo_next = linetable; range->opaque.limit = range->opaque.lo_next + length; @@ -640,7 +640,7 @@ PyLineTable_InitAddressRange(char *linetable, Py_ssize_t length, int firstlineno int _PyCode_InitAddressRange(PyCodeObject* co, PyCodeAddressRange *bounds) { - char *linetable = PyBytes_AS_STRING(co->co_linetable); + const char *linetable = PyBytes_AS_STRING(co->co_linetable); Py_ssize_t length = PyBytes_GET_SIZE(co->co_linetable); PyLineTable_InitAddressRange(linetable, length, co->co_firstlineno, bounds); return bounds->ar_line; @@ -926,7 +926,7 @@ _PyCode_InitOpcache(PyCodeObject *co) return -1; } - _Py_CODEUNIT *opcodes = (_Py_CODEUNIT*)PyBytes_AS_STRING(co->co_code); + const _Py_CODEUNIT *opcodes = (const _Py_CODEUNIT*)PyBytes_AS_STRING(co->co_code); Py_ssize_t opts = 0; for (Py_ssize_t i = 0; i < co_size;) { |