Mercurial > cpython-lru_cache-weakref
comparison Modules/arraymodule.c @ 43423:0476a2cc5658
Change PyBuffer to Py_buffer to be consistent with other non-object structures like Py_complex. Add some more functionality to the memoryview object.
| author | Travis E. Oliphant <oliphant@enthought.com> |
|---|---|
| date | Sun, 23 Sep 2007 02:00:13 +0000 |
| parents | 4e6b4ba60c3b |
| children | fb9d5306f4c7 |
comparison
equal
deleted
inserted
replaced
| 43421:f31d415554cd | 43423:0476a2cc5658 |
|---|---|
| 1782 | 1782 |
| 1783 static const void *emptybuf = ""; | 1783 static const void *emptybuf = ""; |
| 1784 | 1784 |
| 1785 | 1785 |
| 1786 static int | 1786 static int |
| 1787 array_buffer_getbuf(arrayobject *self, PyBuffer *view, int flags) | 1787 array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags) |
| 1788 { | 1788 { |
| 1789 if ((flags & PyBUF_CHARACTER)) { | 1789 if ((flags & PyBUF_CHARACTER)) { |
| 1790 PyErr_SetString(PyExc_TypeError, | 1790 PyErr_SetString(PyExc_TypeError, |
| 1791 "Cannot be a character buffer"); | 1791 "Cannot be a character buffer"); |
| 1792 return -1; | 1792 return -1; |
| 1823 self->ob_exports++; | 1823 self->ob_exports++; |
| 1824 return 0; | 1824 return 0; |
| 1825 } | 1825 } |
| 1826 | 1826 |
| 1827 static void | 1827 static void |
| 1828 array_buffer_relbuf(arrayobject *self, PyBuffer *view) | 1828 array_buffer_relbuf(arrayobject *self, Py_buffer *view) |
| 1829 { | 1829 { |
| 1830 self->ob_exports--; | 1830 self->ob_exports--; |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 static PySequenceMethods array_as_sequence = { | 1833 static PySequenceMethods array_as_sequence = { |
