|
16 | 16 | #include "eigenpy/registration.hpp" |
17 | 17 | #include "eigenpy/map.hpp" |
18 | 18 |
|
| 19 | +namespace boost { namespace python { namespace detail { |
| 20 | + |
| 21 | + template<class MatType> |
| 22 | + struct referent_size<Eigen::MatrixBase<MatType>&> |
| 23 | + { |
| 24 | + BOOST_STATIC_CONSTANT( |
| 25 | + std::size_t, value = sizeof(MatType)); |
| 26 | + }; |
| 27 | + |
| 28 | +}}} |
| 29 | + |
19 | 30 | namespace boost { namespace python { namespace converter { |
20 | 31 |
|
21 | 32 | template<class MatType> |
@@ -67,7 +78,8 @@ struct implicit<MatType,Eigen::MatrixBase<MatType> > |
67 | 78 |
|
68 | 79 | static void construct(PyObject* obj, rvalue_from_python_stage1_data* data) |
69 | 80 | { |
70 | | - void* storage = ((rvalue_from_python_storage<Source>*)data)->storage.bytes; |
| 81 | + void* storage = reinterpret_cast<rvalue_from_python_storage<Target>*> |
| 82 | + (reinterpret_cast<void*>(data))->storage.bytes; |
71 | 83 |
|
72 | 84 | arg_from_python<Source> get_source(obj); |
73 | 85 | bool convertible = get_source.convertible(); |
@@ -565,8 +577,8 @@ namespace eigenpy |
565 | 577 | PyArrayObject * pyArray = reinterpret_cast<PyArrayObject*>(pyObj); |
566 | 578 | assert((PyArray_DIMS(pyArray)[0]<INT_MAX) && (PyArray_DIMS(pyArray)[1]<INT_MAX)); |
567 | 579 |
|
568 | | - void* storage = ((bp::converter::rvalue_from_python_storage<MatType>*) |
569 | | - ((void*)memory))->storage.bytes; |
| 580 | + void* storage = reinterpret_cast<bp::converter::rvalue_from_python_storage<MatType>*> |
| 581 | + (reinterpret_cast<void*>(memory))->storage.bytes; |
570 | 582 |
|
571 | 583 | EigenObjectAllocator<MatType>::allocate(pyArray,storage); |
572 | 584 |
|
|
0 commit comments