Skip to content

Commit

Permalink
Use PyLong_FromVoidPtr()
Browse files Browse the repository at this point in the history
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
  • Loading branch information
sloretz committed Apr 23, 2019
1 parent 2870fee commit 69399f5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rclpy/src/rclpy/_rclpy_pycapsule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 69399f5

Please sign in to comment.