Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions cypari2/convert.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cdef extern from *:
ctypedef struct PyLongObject:
digit* ob_digit

Py_ssize_t* Py_SIZE_PTR "&Py_SIZE"(object)
void __Pyx_SET_SIZE(object, Py_ssize_t)


########################################################################
Expand Down Expand Up @@ -450,13 +450,11 @@ cdef PyLong_FromINT(GEN g):
if d:
sizedigits_final = i+1

# Set correct size (use a pointer to hack around Cython's
# non-support for lvalues).
cdef Py_ssize_t* sizeptr = Py_SIZE_PTR(x)
# Set correct size
if signe(g) > 0:
sizeptr[0] = sizedigits_final
__Pyx_SET_SIZE(x, sizedigits_final)
else:
sizeptr[0] = -sizedigits_final
__Pyx_SET_SIZE(x, -sizedigits_final)

return x

Expand Down