Skip to content
Snippets Groups Projects
Commit d3e27b28 authored by Mark Winter's avatar Mark Winter
Browse files

Fixed old type-conversion error and warnings in python wrapper.

parent d7f1864e
No related branches found
No related tags found
No related merge requests found
......@@ -39,13 +39,13 @@ void converter(void* in, void* out, std::size_t len)
((U*)out)[i] = static_cast<U>(((T*)in)[i]);
}
bool pyarrayToVec(PyObject* ar, Vec<double>& outVec)
bool pyarrayToVec(PyArrayObject* ar, Vec<double>& outVec)
{
int ndim = PyArray_NDIM(ar);
if ( ndim > 1 )
return false;
int array_size = PyArray_DIM(ar, 0);
std::size_t array_size = PyArray_DIM(ar, 0);
if ( array_size != 3 )
return false;
......@@ -95,7 +95,7 @@ bool pyobjToVec(PyObject* list_array, Vec<double>& outVec)
return pylistToVec(list_array, outVec);
else if ( PyArray_Check(list_array) )
return pyarrayToVec(list_array, outVec);
return pyarrayToVec((PyArrayObject*)list_array, outVec);
return false;
}
......
......@@ -23,7 +23,6 @@ const char PyWrapGetMinMax::docString[] = "minValue,maxValue = HIP.GetMinMax(ima
PyObject* PyWrapGetMinMax::execute(PyObject* self, PyObject* args)
{
PyObject* imIn;
PyObject* inKern;
int device = -1;
......
......@@ -25,7 +25,6 @@ const char PyWrapMinMax::docString[] = "minOut,maxOut = HIP.MinMax(imageIn,[devi
PyObject* PyWrapMinMax::execute(PyObject* self, PyObject* args)
{
PyObject* imIn;
PyObject* inKern;
int device = -1;
......
......@@ -24,7 +24,6 @@ const char PyWrapSum::docString[] = "valueOut = HIP.Sum(imageIn, [device])\n\n"\
PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
{
PyObject* imIn;
PyObject* inKern;
int device = -1;
......@@ -53,7 +52,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_UINT8 )
{
unsigned char* imageInPtr, minVal, maxVal;
unsigned char* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......@@ -66,7 +65,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_UINT16 )
{
unsigned short* imageInPtr, minVal, maxVal;
unsigned short* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......@@ -79,7 +78,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_INT16 )
{
short* imageInPtr, minVal, maxVal;
short* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......@@ -92,7 +91,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_UINT32 )
{
unsigned int* imageInPtr, minVal, maxVal;
unsigned int* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......@@ -105,7 +104,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_INT32 )
{
int* imageInPtr, minVal, maxVal;
int* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......@@ -118,7 +117,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_FLOAT )
{
float* imageInPtr, minVal, maxVal;
float* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......@@ -131,7 +130,7 @@ PyObject* PyWrapSum::execute(PyObject* self, PyObject* args)
}
else if ( PyArray_TYPE(imContig) == NPY_DOUBLE )
{
double* imageInPtr, minVal, maxVal;
double* imageInPtr;
setupImagePointers(imContig, &imageInPtr, imageDims);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment