diff options
author | Armin Rigo <arigo@tunes.org> | 2014-06-16 17:15:43 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2014-06-16 17:15:43 +0200 |
commit | 5ede874ad0ab213a0794dcc151b71bf559587a45 (patch) | |
tree | e5c3c0e984b043311688febc85a75965135e8c91 | |
parent | 72e60a15d3638f90bb13810533e991a2f0ca656d (diff) | |
download | cffi-5ede874ad0ab213a0794dcc151b71bf559587a45.tar.gz |
Ah, on http://bugs.python.org/issue21778 I got the answer as to what
the expected way to call this is.
-rw-r--r-- | c/minibuffer.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/c/minibuffer.h b/c/minibuffer.h index 6d3eae5..92cf079 100644 --- a/c/minibuffer.h +++ b/c/minibuffer.h @@ -105,12 +105,9 @@ static PyObject *mb_str(MiniBufferObj *self) static int mb_getbuf(MiniBufferObj *self, Py_buffer *view, int flags) { - static Py_ssize_t dummy_stride = 1; - int res = PyBuffer_FillInfo(view, (PyObject *)self, - self->mb_data, self->mb_size, - /*readonly=*/0, PyBUF_CONTIG | PyBUF_FORMAT); - view->strides = &dummy_stride; - return res; + return PyBuffer_FillInfo(view, (PyObject *)self, + self->mb_data, self->mb_size, + /*readonly=*/0, flags); } static PySequenceMethods mb_as_sequence = { |