@@ -59,7 +59,8 @@ cdef extern from *:
59
59
ctypedef struct PyLongObject:
60
60
digit* ob_digit
61
61
62
- void __Pyx_SET_SIZE(object , Py_ssize_t)
62
+ cdef extern from " Py_SET_SIZE.h" :
63
+ void Py_SET_SIZE(py_long o, Py_ssize_t size)
63
64
64
65
65
66
# #######################################################################
@@ -422,8 +423,8 @@ cdef PyLong_FromINT(GEN g):
422
423
# Actual correct computed size
423
424
cdef Py_ssize_t sizedigits_final = 0
424
425
425
- x = _PyLong_New(sizedigits)
426
- cdef digit* D = ( < PyLongObject * > x) .ob_digit
426
+ cdef py_long x = _PyLong_New(sizedigits)
427
+ cdef digit* D = x .ob_digit
427
428
428
429
cdef digit d
429
430
cdef ulong w
@@ -452,9 +453,9 @@ cdef PyLong_FromINT(GEN g):
452
453
453
454
# Set correct size
454
455
if signe(g) > 0 :
455
- __Pyx_SET_SIZE (x, sizedigits_final)
456
+ Py_SET_SIZE (x, sizedigits_final)
456
457
else :
457
- __Pyx_SET_SIZE (x, - sizedigits_final)
458
+ Py_SET_SIZE (x, - sizedigits_final)
458
459
459
460
return x
460
461
@@ -463,8 +464,8 @@ cdef PyLong_FromINT(GEN g):
463
464
# Conversion Python -> PARI
464
465
# #######################################################################
465
466
466
- cdef GEN PyLong_AS_GEN(x):
467
- cdef const digit* D = ( < PyLongObject * > x) .ob_digit
467
+ cdef GEN PyLong_AS_GEN(py_long x):
468
+ cdef const digit* D = x .ob_digit
468
469
469
470
# Size of the input
470
471
cdef size_t sizedigits
0 commit comments