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 /Include | |
parent | 9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba (diff) | |
download | cpython-be8b631b7a587aa781245e14c8cca32970e1be5b.zip cpython-be8b631b7a587aa781245e14c8cca32970e1be5b.tar.gz cpython-be8b631b7a587aa781245e14c8cca32970e1be5b.tar.bz2 |
Add more const modifiers. (GH-26691)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/code.h | 6 | ||||
-rw-r--r-- | Include/internal/pycore_code.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h index a3db7d9..f6e789d 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -196,8 +196,8 @@ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); /* for internal use only */ struct _opaque { int computed_line; - char *lo_next; - char *limit; + const char *lo_next; + const char *limit; }; typedef struct _line_offsets { @@ -234,7 +234,7 @@ PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index, int _PyCode_InitAddressRange(PyCodeObject* co, PyCodeAddressRange *bounds); /** Out of process API for initializing the line number table. */ -void PyLineTable_InitAddressRange(char *linetable, Py_ssize_t length, int firstlineno, PyCodeAddressRange *range); +void PyLineTable_InitAddressRange(const char *linetable, Py_ssize_t length, int firstlineno, PyCodeAddressRange *range); /** API for traversing the line number table. */ int PyLineTable_NextAddressRange(PyCodeAddressRange *range); diff --git a/Include/internal/pycore_code.h b/Include/internal/pycore_code.h index 05ba522..bfc2deb 100644 --- a/Include/internal/pycore_code.h +++ b/Include/internal/pycore_code.h @@ -79,7 +79,7 @@ typedef union _cache_or_instruction { * The zeroth entry immediately precedes the instructions. */ static inline SpecializedCacheEntry * -_GetSpecializedCacheEntry(_Py_CODEUNIT *first_instr, Py_ssize_t n) +_GetSpecializedCacheEntry(const _Py_CODEUNIT *first_instr, Py_ssize_t n) { SpecializedCacheOrInstruction *last_cache_plus_one = (SpecializedCacheOrInstruction *)first_instr; assert(&last_cache_plus_one->code[0] == first_instr); @@ -126,7 +126,7 @@ offset_from_oparg_and_nexti(int oparg, int nexti) * nexti is used as it corresponds to the instruction pointer in the interpreter. * This doesn't check that an entry has been allocated for that instruction. */ static inline SpecializedCacheEntry * -_GetSpecializedCacheEntryForInstruction(_Py_CODEUNIT *first_instr, int nexti, int oparg) +_GetSpecializedCacheEntryForInstruction(const _Py_CODEUNIT *first_instr, int nexti, int oparg) { return _GetSpecializedCacheEntry( first_instr, |