summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-08-19 18:22:14 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-08-19 18:22:14 (GMT)
commitee58fa484ed535ec6d7f2b93cb3ef2addeb337e1 (patch)
tree9398d06f962ab532ad8bc80407630069491c1871 /Objects
parentfd036451bf0e0ade8783e21df801abf7be96d020 (diff)
downloadcpython-ee58fa484ed535ec6d7f2b93cb3ef2addeb337e1.zip
cpython-ee58fa484ed535ec6d7f2b93cb3ef2addeb337e1.tar.gz
cpython-ee58fa484ed535ec6d7f2b93cb3ef2addeb337e1.tar.bz2
#3560: cleanup C memoryview API
Diffstat (limited to 'Objects')
-rw-r--r--Objects/memoryobject.c6
-rw-r--r--Objects/unicodeobject.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index b36c3a7..c108363 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -29,7 +29,7 @@ PyDoc_STRVAR(memory_doc,
Create a new memoryview object which references the given object.");
PyObject *
-PyMemoryView_FromMemory(Py_buffer *info)
+PyMemoryView_FromBuffer(Py_buffer *info)
{
PyMemoryViewObject *mview;
@@ -231,7 +231,7 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
mem = PyObject_New(PyMemoryViewObject, &PyMemoryView_Type);
if (mem == NULL) return NULL;
- view = &PyMemoryView(mem);
+ view = &mem->view;
flags = PyBUF_FULL_RO;
switch(buffertype) {
case PyBUF_WRITE:
@@ -534,7 +534,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key)
/* XXX: This needs to be fixed so it
actually returns a sub-view
*/
- return PyMemoryView_FromMemory(&newview);
+ return PyMemoryView_FromBuffer(&newview);
}
}
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 5de265d..c85a063 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1200,7 +1200,7 @@ PyObject *PyUnicode_Decode(const char *s,
buffer = NULL;
if (PyBuffer_FillInfo(&info, NULL, (void *)s, size, 1, PyBUF_SIMPLE) < 0)
goto onError;
- buffer = PyMemoryView_FromMemory(&info);
+ buffer = PyMemoryView_FromBuffer(&info);
if (buffer == NULL)
goto onError;
unicode = PyCodec_Decode(buffer, encoding, errors);