Commit 2f9ba8d2 authored by Mark Florisson's avatar Mark Florisson

Fix py24-py25 memoryview compilation errors

parent ed516fb9
...@@ -1047,7 +1047,10 @@ cdef Py_ssize_t slice_get_size({{memviewslice_name}} *src, int ndim) nogil: ...@@ -1047,7 +1047,10 @@ cdef Py_ssize_t slice_get_size({{memviewslice_name}} *src, int ndim) nogil:
cdef Py_ssize_t fill_contig_strides_array( cdef Py_ssize_t fill_contig_strides_array(
Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride, Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
int ndim, char order) nogil: int ndim, char order) nogil:
"Fill the strides array for a slice with C or F contiguous strides" """
Fill the strides array for a slice with C or F contiguous strides.
This is like PyBuffer_FillContiguousStrides, but compatible with py < 2.6
"""
cdef int idx cdef int idx
if order == 'F': if order == 'F':
......
...@@ -222,8 +222,8 @@ static int __Pyx_ValidateAndInit_memviewslice( ...@@ -222,8 +222,8 @@ static int __Pyx_ValidateAndInit_memviewslice(
if ((unsigned)buf->itemsize != dtype->size) { if ((unsigned)buf->itemsize != dtype->size) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"Item size of buffer (%" PY_FORMAT_SIZE_T "d byte%s) " "Item size of buffer (%" PY_FORMAT_SIZE_T "u byte%s) "
"does not match size of '%s' (%" PY_FORMAT_SIZE_T "d byte%s)", "does not match size of '%s' (%" PY_FORMAT_SIZE_T "u byte%s)",
buf->itemsize, buf->itemsize,
(buf->itemsize > 1) ? "s" : "", (buf->itemsize > 1) ? "s" : "",
dtype->name, dtype->name,
......
...@@ -71,6 +71,8 @@ ...@@ -71,6 +71,8 @@
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment