@@ -382,7 +382,7 @@ _path_module::points_in_path(const Py::Tuple& args)
382
382
PyArray_STRIDE(points_array, 0 ),
383
383
PyArray_STRIDE(points_array, 1 ),
384
384
n, r, path, trans,
385
- (npy_bool *)PyArray_DATA(result));
385
+ (npy_bool *)PyArray_DATA((PyArrayObject*) result));
386
386
Py_DECREF (points_array);
387
387
388
388
return Py::Object (result, true );;
@@ -645,7 +645,7 @@ _path_module::get_path_collection_extents(const Py::Tuple& args)
645
645
}
646
646
647
647
size_t Npaths = paths.length ();
648
- size_t Noffsets = offsets-> dimensions [ 0 ] ;
648
+ size_t Noffsets = PyArray_DIM ( offsets, 0 ) ;
649
649
size_t N = std::max (Npaths, Noffsets);
650
650
size_t Ntransforms = std::min (transforms_obj.length (), N);
651
651
size_t i;
@@ -771,7 +771,7 @@ _path_module::point_in_path_collection(const Py::Tuple& args)
771
771
}
772
772
773
773
size_t Npaths = paths.length ();
774
- size_t Noffsets = offsets-> dimensions [ 0 ] ;
774
+ size_t Noffsets = PyArray_DIM ( offsets, 0 ) ;
775
775
size_t N = std::max (Npaths, Noffsets);
776
776
size_t Ntransforms = std::min (transforms_obj.length (), N);
777
777
size_t i;
@@ -1125,13 +1125,14 @@ _path_module::clip_path_to_rect(const Py::Tuple &args)
1125
1125
{
1126
1126
throw Py::MemoryError (" Could not allocate result array" );
1127
1127
}
1128
+ double * const data = (double *)PyArray_DATA (pyarray);
1128
1129
for (size_t i = 0 ; i < size; ++i)
1129
1130
{
1130
- (( double *)pyarray-> data ) [2 *i] = (*p)[i].x ;
1131
- (( double *)pyarray-> data ) [2 *i+1 ] = (*p)[i].y ;
1131
+ data[2 *i] = (*p)[i].x ;
1132
+ data[2 *i+1 ] = (*p)[i].y ;
1132
1133
}
1133
- (( double *)pyarray-> data ) [2 *size] = (*p)[0 ].x ;
1134
- (( double *)pyarray-> data ) [2 *size+1 ] = (*p)[0 ].y ;
1134
+ data[2 *size] = (*p)[0 ].x ;
1135
+ data[2 *size+1 ] = (*p)[0 ].y ;
1135
1136
1136
1137
if (PyList_SetItem (py_results, p - results.begin (), (PyObject *)pyarray) == -1 )
1137
1138
{
0 commit comments