Skip to content

Commit 4468d73

Browse files
author
Taiju Yamada
committed
Cast arguments for PyArray APIs
1 parent df36e7b commit 4468d73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/bindings/openravepy_global.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,10 @@ class PyTriMesh
431431

432432
PyObject *pPyVertices = vertices.ptr();
433433
if (PyArray_Check(pPyVertices)) {
434-
if (PyArray_NDIM(pPyVertices) != 2) {
434+
if (PyArray_NDIM((PyArrayObject*)pPyVertices) != 2) {
435435
throw openrave_exception(_("vertices must be a 2D array"), ORE_InvalidArguments);
436436
}
437-
if (!PyArray_ISFLOAT(pPyVertices)) {
437+
if (!PyArray_ISFLOAT((PyArrayObject*)pPyVertices)) {
438438
throw openrave_exception(_("vertices must be in float"), ORE_InvalidArguments);
439439
}
440440
PyArrayObject* pPyVerticesContiguous = PyArray_GETCONTIGUOUS(reinterpret_cast<PyArrayObject*>(pPyVertices));
@@ -477,7 +477,7 @@ class PyTriMesh
477477
mesh.indices.resize(3*numtris);
478478
PyObject *pPyIndices = indices.ptr();
479479
if (PyArray_Check(pPyIndices)) {
480-
if (PyArray_NDIM(pPyIndices) != 2 || PyArray_DIM(pPyIndices, 1) != 3 || !PyArray_ISINTEGER(pPyIndices)) {
480+
if (PyArray_NDIM((PyArrayObject*)pPyIndices) != 2 || PyArray_DIM((PyArrayObject*)pPyIndices, 1) != 3 || !PyArray_ISINTEGER((PyArrayObject*)pPyIndices)) {
481481
throw openrave_exception(_("indices must be a Nx3 int array"), ORE_InvalidArguments);
482482
}
483483
PyArrayObject* pPyIndiciesContiguous = PyArray_GETCONTIGUOUS(reinterpret_cast<PyArrayObject*>(pPyIndices));

0 commit comments

Comments
 (0)