From 933c4ed8875270b5e672f6446d330b9488e54372 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 4 Jan 2024 12:06:34 +0100 Subject: [PATCH] Use the recommended way to integrate Cython and NumPy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This follows the example code in . The previous version results in an int-conversion error with current compilers: …-build/wrappers/python/freenect3.c:16598:3: error: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast 16598 | import_array(); | ^~~~~~~~~~~~ --- wrappers/python/freenect.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wrappers/python/freenect.pyx b/wrappers/python/freenect.pyx index 5bda18b4..f69483d4 100644 --- a/wrappers/python/freenect.pyx +++ b/wrappers/python/freenect.pyx @@ -27,7 +27,6 @@ import numpy as np cimport numpy as npc cdef extern from "numpy/arrayobject.h": - void import_array() cdef object PyArray_SimpleNewFromData(int nd, npc.npy_intp *dims, int typenum, void *data) @@ -455,7 +454,7 @@ def base_runloop(CtxPtr ctx, body=None): except Kill: pass -import_array() +npc.import_array() cdef object _depth_cb_np(void *data, freenect_frame_mode *mode): cdef npc.npy_intp dims[2]