Skip to content

Commit 6bad9ff

Browse files
committed
Fix: use intptr_t instead of unsigned long
1 parent eb90f57 commit 6bad9ff

File tree

1 file changed

+3
-3
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+3
-3
lines changed

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ PyAPI_FUNC(void) PyTruffle_DECREF(PyObject* obj) {
526526
}
527527

528528
/** to be used from Java code only; calls ADDREF */
529-
PyAPI_FUNC(Py_ssize_t) PyTruffle_ADDREF(unsigned long ptr, Py_ssize_t value) {
529+
PyAPI_FUNC(Py_ssize_t) PyTruffle_ADDREF(intptr_t ptr, Py_ssize_t value) {
530530
PyObject* obj = (PyObject*) ptr; // avoid type attachment at the interop boundary
531531
#ifdef ASSERTIONS
532532
if (obj->ob_refcnt & 0xFFFFFFFF00000000L) {
@@ -546,7 +546,7 @@ PyAPI_FUNC(Py_ssize_t) PyTruffle_ADDREF(unsigned long ptr, Py_ssize_t value) {
546546
}
547547

548548
/** to be used from Java code only; calls DECREF */
549-
PyAPI_FUNC(Py_ssize_t) PyTruffle_SUBREF(unsigned long ptr, Py_ssize_t value) {
549+
PyAPI_FUNC(Py_ssize_t) PyTruffle_SUBREF(intptr_t ptr, Py_ssize_t value) {
550550
PyObject* obj = (PyObject*) ptr; // avoid type attachment at the interop boundary
551551
#ifdef ASSERTIONS
552552
if (obj->ob_refcnt & 0xFFFFFFFF00000000L) {
@@ -604,7 +604,7 @@ PyAPI_FUNC(uint64_t) PyTruffle_Wchar_Size() {
604604
}
605605

606606
/** free's a native pointer or releases a Sulong handle; DO NOT CALL WITH MANAGED POINTERS ! */
607-
PyAPI_FUNC(void) PyTruffle_Free(unsigned long val) {
607+
PyAPI_FUNC(void) PyTruffle_Free(intptr_t val) {
608608
PyMem_RawFree((void*) val);
609609
}
610610

0 commit comments

Comments
 (0)