From 69399f5ca20444ad52537647ded84e89e06fb65b Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 23 Apr 2019 16:26:44 -0700 Subject: [PATCH] Use PyLong_FromVoidPtr() Signed-off-by: Shane Loretz --- rclpy/src/rclpy/_rclpy_pycapsule.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rclpy/src/rclpy/_rclpy_pycapsule.c b/rclpy/src/rclpy/_rclpy_pycapsule.c index 80d504613..a654d2464 100644 --- a/rclpy/src/rclpy/_rclpy_pycapsule.c +++ b/rclpy/src/rclpy/_rclpy_pycapsule.c @@ -68,8 +68,7 @@ rclpy_pycapsule_pointer(PyObject * Py_UNUSED(self), PyObject * args) return NULL; } - _Static_assert(sizeof(uint64_t) >= sizeof(void *), "Unable to cast pointer to integer"); - return PyLong_FromUnsignedLongLong((uint64_t)pointer); + return PyLong_FromVoidPtr(pointer); } /// Destroy a pycapsule without waiting for the garbage collector.