summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorDavid Hewitt <1939362+davidhewitt@users.noreply.github.com>2021-12-22 13:07:46 (GMT)
committerGitHub <noreply@github.com>2021-12-22 13:07:46 (GMT)
commit31ff96712e8f89ac1056c2da880b44650002219f (patch)
treef6cbc0c62bb78c3251a2ff7364fba22b6b36007a /Objects/abstract.c
parentfc54e722a2e66971f1a8e16cff24c844bf9c5ac4 (diff)
downloadcpython-31ff96712e8f89ac1056c2da880b44650002219f.zip
cpython-31ff96712e8f89ac1056c2da880b44650002219f.tar.gz
cpython-31ff96712e8f89ac1056c2da880b44650002219f.tar.bz2
bpo-46140: take more Py_buffer arguments as const * (GH-30217)
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 5c533bf..6a2d5ed 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -474,7 +474,7 @@ PyBuffer_IsContiguous(const Py_buffer *view, char order)
void*
-PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices)
+PyBuffer_GetPointer(const Py_buffer *view, const Py_ssize_t *indices)
{
char* pointer;
int i;
@@ -564,12 +564,13 @@ done:
}
int
-PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort)
+PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len, char fort)
{
int k;
void (*addone)(int, Py_ssize_t *, const Py_ssize_t *);
Py_ssize_t *indices, elements;
- char *src, *ptr;
+ char *ptr;
+ const char *src;
if (len > view->len) {
len = view->len;