@@ -86,7 +86,7 @@ static PyObject *
8686get_small_int (sdigit ival )
8787{
8888 // GraalPy change - we tag 32-bit integers
89- return int_to_pointer (ival );
89+ return int32_to_pointer (ival );
9090}
9191
9292#if 0 // GraalPy change
@@ -474,7 +474,7 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
474474 }
475475 if (points_to_py_int_handle (vv )) {
476476 * overflow = 0 ;
477- return pointer_to_long (vv );
477+ return pointer_to_int64 (vv );
478478 }
479479 long result = (long ) GraalPyPrivate_Long_AsPrimitive (vv , MODE_COERCE_SIGNED , sizeof (long ));
480480 if (result == -1L && PyErr_Occurred () && PyErr_ExceptionMatches (PyExc_OverflowError )) {
@@ -494,7 +494,7 @@ PyLong_AsLong(PyObject *obj)
494494{
495495 // GraalPy change: different implementation
496496 if (points_to_py_int_handle (obj )) {
497- return pointer_to_long (obj );
497+ return pointer_to_int64 (obj );
498498 }
499499 return (long ) GraalPyPrivate_Long_AsPrimitive (obj , MODE_COERCE_SIGNED , sizeof (long ));
500500}
@@ -523,7 +523,7 @@ _PyLong_AsInt(PyObject *obj)
523523Py_ssize_t
524524PyLong_AsSsize_t (PyObject * vv ) {
525525 if (points_to_py_int_handle (vv )) {
526- return pointer_to_long (vv );
526+ return pointer_to_int64 (vv );
527527 }
528528 return (Py_ssize_t ) GraalPyPrivate_Long_AsPrimitive (vv , MODE_PINT_SIGNED , sizeof (Py_ssize_t ));
529529}
@@ -540,7 +540,7 @@ PyLong_AsUnsignedLong(PyObject *vv)
540540 return (unsigned long ) -1 ;
541541 }
542542 if (points_to_py_int_handle (vv )) {
543- long value = pointer_to_long (vv );
543+ long value = pointer_to_int64 (vv );
544544 if (value < 0 ) {
545545 PyErr_SetString (PyExc_OverflowError , "can't convert negative value to unsigned int" );
546546 return (unsigned long ) -1 ;
@@ -558,7 +558,7 @@ PyLong_AsSize_t(PyObject *vv)
558558{
559559 // GraalPy change: different implementation
560560 if (points_to_py_int_handle (vv )) {
561- long value = pointer_to_long (vv );
561+ long value = pointer_to_int64 (vv );
562562 if (value < 0 ) {
563563 PyErr_SetString (PyExc_OverflowError , "can't convert negative value to unsigned int" );
564564 return (size_t ) -1 ;
@@ -610,7 +610,7 @@ PyLong_AsUnsignedLongMask(PyObject *op)
610610 return (unsigned long ) -1 ;
611611 }
612612 if (points_to_py_int_handle (op )) {
613- return pointer_to_long (op );
613+ return pointer_to_int64 (op );
614614 }
615615 return (unsigned long ) GraalPyPrivate_Long_AsPrimitive (op , MODE_COERCE_MASK , sizeof (unsigned long ));
616616}
@@ -979,7 +979,7 @@ PyLong_FromLongLong(long long ival)
979979{
980980 // GraalPy change: different implementation
981981 if ((int )ival == ival ) {
982- return int_to_pointer (ival );
982+ return int32_to_pointer (ival );
983983 } else {
984984 return GraalPyPrivate_Long_FromLongLong (ival );
985985 }
@@ -1006,7 +1006,7 @@ PyLong_AsLongLong(PyObject *vv)
10061006 return -1 ;
10071007 }
10081008 if (points_to_py_int_handle (vv )) {
1009- return pointer_to_long (vv );
1009+ return pointer_to_int64 (vv );
10101010 }
10111011 return (long long ) GraalPyPrivate_Long_AsPrimitive (vv , MODE_COERCE_SIGNED , sizeof (long long ));
10121012}
@@ -1023,7 +1023,7 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
10231023 return (unsigned long long )-1 ;
10241024 }
10251025 if (points_to_py_int_handle (vv )) {
1026- long value = pointer_to_long (vv );
1026+ long value = pointer_to_int64 (vv );
10271027 if (value < 0 ) {
10281028 PyErr_SetString (PyExc_OverflowError , "can't convert negative value to unsigned int" );
10291029 return (unsigned long long ) -1 ;
@@ -1076,7 +1076,7 @@ PyLong_AsUnsignedLongLongMask(PyObject *op)
10761076 return (unsigned long long )-1 ;
10771077 }
10781078 if (points_to_py_int_handle (op )) {
1079- return pointer_to_long (op );
1079+ return pointer_to_int64 (op );
10801080 }
10811081 return (unsigned long long ) GraalPyPrivate_Long_AsPrimitive (op , MODE_COERCE_MASK , sizeof (unsigned long long ));
10821082}
@@ -6140,15 +6140,15 @@ PyUnstable_Long_CompactValue(const PyLongObject* op) {
61406140
61416141Py_ssize_t PyUnstable_Long_CompactValue (const PyLongObject * op ) {
61426142 if (points_to_py_int_handle (op )) {
6143- return pointer_to_long (op );
6143+ return pointer_to_int64 (op );
61446144 }
61456145 return GraalPyPrivate_Long_AsPrimitive ((PyObject * ) op , MODE_PINT_SIGNED , sizeof (Py_ssize_t ));
61466146}
61476147
61486148// GraalPy additions
61496149uintptr_t GraalPyPrivate_Long_lv_tag (const PyLongObject * op ) {
61506150 if (points_to_py_int_handle (op )) {
6151- int64_t t = pointer_to_long (op );
6151+ int64_t t = pointer_to_int64 (op );
61526152 if (t == 0 ) {
61536153 return SIGN_ZERO ;
61546154 }
0 commit comments