• Fritz Reese's avatar
    Fix buffer_info for ctypes buffers (pybind#2502) (#2503) · e8ad33bb
    Fritz Reese authored
    * tests: New test for ctypes buffers (pybind#2502)
    
    * fix: fix buffer_info segfault on views with no stride (pybind11#2502)
    
    * Explicit conversions in buffer_info to make clang happy (pybind#2502)
    
    * Another explicit cast in buffer_info constructor for clang (pybind#2502)
    
    * Simpler implementation of buffer_info constructor from Py_buffer.
    
    * Move test_ctypes_buffer into test_buffers
    
    * Comment on why view->strides may be NULL (and fix some whitespace)
    
    * Use c_strides() instead of zero when view->strides is NULL.
    
    c_strides and f_strides are moved from numpy.h (py::array)
    to buffer_info.h (py::detail) so they can be used from the
    buffer_info Py_buffer constructor.
    
    * Increase ctypes buffer test coverage in test_buffers.
    
    * Split ctypes tests and skip one which is broken in PyPy2.
    e8ad33bb
test_buffers.cpp 7.79 KB