Skip to content

Commit bf4789e

Browse files
committed
GAP: fix definition of 'Int'
The GAP Int type, like UInt, has the size of a machine pointer (at least on the usual desktop system architectures), not a machine int. I.e. on a typical 64bit OS it is a 64bit integer, not a 32bit integer. This often makes no difference on little endian systems but can have disastrous consequences for large values or on big endian systems. Also fix a copy&paste mistake in the `make_gap_integer` argument name.
1 parent 3202f65 commit bf4789e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sage/libs/gap/element.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ from sage.structure.element cimport Element, ModuleElement, RingElement
1515
cdef Obj make_gap_list(sage_list) except NULL
1616
cdef Obj make_gap_matrix(sage_list, gap_ring) except NULL
1717
cdef Obj make_gap_record(sage_dict) except NULL
18-
cdef Obj make_gap_integer(sage_dict) except NULL
18+
cdef Obj make_gap_integer(sage_int) except NULL
1919
cdef Obj make_gap_string(sage_string) except NULL
2020

2121
cdef GapElement make_any_gap_element(parent, Obj obj)

src/sage/libs/gap/gap_includes.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ from libc.stdint cimport uintptr_t, uint8_t, uint16_t, uint32_t, uint64_t
1313

1414
cdef extern from "gap/system.h" nogil:
1515
ctypedef char Char
16-
ctypedef int Int
16+
ctypedef intptr_t Int
1717
ctypedef uintptr_t UInt
1818
ctypedef uint8_t UInt1
1919
ctypedef uint16_t UInt2

0 commit comments

Comments
 (0)