File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -981,7 +981,7 @@ cdef class flint_mpoly(flint_elem):
981981 5*a
982982 """
983983 cdef:
984- slong * c_mapping
984+ slong * c_mapping = NULL
985985 slong i
986986
987987 ctx = self .context()
@@ -1001,7 +1001,7 @@ cdef class flint_mpoly(flint_elem):
10011001 }
10021002
10031003 try :
1004- c_mapping = < slong * > libc.stdlib.malloc(ctx.nvars() * sizeof(slong * ))
1004+ c_mapping = < slong * > libc.stdlib.malloc(ctx.nvars() * sizeof(slong))
10051005 if c_mapping is NULL :
10061006 raise MemoryError (" malloc returned a null pointer" )
10071007
Original file line number Diff line number Diff line change @@ -1815,7 +1815,7 @@ cdef class gr(flint_scalar):
18151815 raise NotImplementedError (" Cannot compare gr with >=" )
18161816 # res = self._ge(other_gr)
18171817 else :
1818- assert False , " Invalid rich comparison operator"
1818+ raise RuntimeError ( " Invalid rich comparison operator" )
18191819
18201820 return truth_to_py(res)
18211821
Original file line number Diff line number Diff line change @@ -4,12 +4,11 @@ from flint.utils.conversion cimport chars_from_str
44from flint.flintlib.types.flint cimport slong, ulong, pylong_as_slong
55from flint.flintlib.types.flint cimport PyObject
66from flint.flintlib.functions.fmpz cimport fmpz_t, fmpz_set_si, fmpz_set_signed_ui_array
7- import sys
87
98cdef int fmpz_set_any_ref(fmpz_t x, obj)
109cdef fmpz_get_intlong(fmpz_t x)
1110
12- cdef int is_big_endian = int (sys.byteorder == " big " )
11+ cdef int is_big_endian
1312
1413cdef inline ulong ulong_from_little_endian(unsigned char * ptr):
1514 # Read a ulong from little-endian bytes
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ from flint.flintlib.functions.arith cimport *
1313from flint.flintlib.functions.partitions cimport *
1414
1515from flint.utils.flint_exceptions import DomainError
16+ import sys
17+
18+ is_big_endian = int (sys.byteorder == " big" )
1619
1720cdef fmpz_get_intlong(fmpz_t x):
1821 """
You can’t perform that action at this time.
0 commit comments