From 1de00abf9d9887fba3b4b211710b1699ac25689e Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Tue, 2 Dec 2014 13:32:01 +0100 Subject: [PATCH] Fixed return types for interp3d --- python/_project.pyx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python/_project.pyx b/python/_project.pyx index 7e5eb89..3ccf7ad 100644 --- a/python/_project.pyx +++ b/python/_project.pyx @@ -22,7 +22,7 @@ cdef extern from "project_tool.hpp" namespace "": @cython.boundscheck(False) @cython.cdivision(True) @cython.wraparound(False) -cdef int interp3d_INTERNAL_periodic(DTYPE_t x, DTYPE_t y, +cdef void interp3d_INTERNAL_periodic(DTYPE_t x, DTYPE_t y, DTYPE_t z, DTYPE_t[:,:,:] d, DTYPE_t Lbox, DTYPE_t *retval) nogil: @@ -81,7 +81,7 @@ cdef int interp3d_INTERNAL_periodic(DTYPE_t x, DTYPE_t y, @cython.boundscheck(False) @cython.cdivision(True) @cython.wraparound(False) -cdef int ngp3d_INTERNAL_periodic(DTYPE_t x, DTYPE_t y, +cdef void ngp3d_INTERNAL_periodic(DTYPE_t x, DTYPE_t y, DTYPE_t z, DTYPE_t[:,:,:] d, DTYPE_t Lbox, DTYPE_t *retval) nogil: @@ -111,7 +111,7 @@ cdef int ngp3d_INTERNAL_periodic(DTYPE_t x, DTYPE_t y, @cython.boundscheck(False) @cython.cdivision(True) @cython.wraparound(False) -cdef int ngp3d_INTERNAL(DTYPE_t x, DTYPE_t y, +cdef void ngp3d_INTERNAL(DTYPE_t x, DTYPE_t y, DTYPE_t z, DTYPE_t[:,:,:] d, DTYPE_t Lbox, DTYPE_t *retval, DTYPE_t inval) nogil: @@ -132,6 +132,7 @@ cdef int ngp3d_INTERNAL(DTYPE_t x, DTYPE_t y, if ((ix < 0) or (ix+1) >= Ngrid or (iy < 0) or (iy+1) >= Ngrid or (iz < 0) or (iz+1) >= Ngrid): retval[0] = inval + return retval[0] = d[ix ,iy ,iz ] @@ -139,7 +140,7 @@ cdef int ngp3d_INTERNAL(DTYPE_t x, DTYPE_t y, @cython.boundscheck(False) @cython.cdivision(True) @cython.wraparound(False) -cdef int interp3d_INTERNAL(DTYPE_t x, DTYPE_t y, +cdef void interp3d_INTERNAL(DTYPE_t x, DTYPE_t y, DTYPE_t z, DTYPE_t[:,:,:] d, DTYPE_t Lbox, DTYPE_t *retval, DTYPE_t inval) nogil: @@ -163,6 +164,7 @@ cdef int interp3d_INTERNAL(DTYPE_t x, DTYPE_t y, if ((ix < 0) or (ix+1) >= Ngrid or (iy < 0) or (iy+1) >= Ngrid or (iz < 0) or (iz+1) >= Ngrid): retval[0] = inval + return # assert ((ix >= 0) and ((ix+1) < Ngrid)) # assert ((iy >= 0) and ((iy+1) < Ngrid)) # assert ((iz >= 0) and ((iz+1) < Ngrid))