Ticket #12173: 12173_fixes.patch

File 12173_fixes.patch, 3.4 KB (added by jdemeyer, 9 years ago)
  • module_list.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1358431691 -3600
    # Node ID 5d5c2b6936150cd26e87d20871c3bd40175dcaf1
    # Parent  4e5f1201d2e87cd8afbe7431f148b4ed3389d84b
    Small fixes to the FLINT2 patch
    
    diff --git a/module_list.py b/module_list.py
    a b  
    14331433              sources = ['sage/rings/fraction_field_FpT.pyx'],
    14341434              language = 'c++',
    14351435              libraries = ["csage", "flint", "gmp", "gmpxx", "ntl", "zn_poly"],
    1436               extra_compile_args=["-std=c99", "-D_XPG6"],
    14371436              include_dirs = [SAGE_INC + 'flint/'],
    14381437              depends = flint_depends),
    14391438   
     
    17081707              sources = ['sage/rings/polynomial/polynomial_zmod_flint.pyx'],
    17091708              language = 'c++',
    17101709              libraries = ["csage", "flint", "gmp", "gmpxx", "ntl", "zn_poly"],
    1711               extra_compile_args=["-std=c99", "-D_XPG6"],
    17121710              include_dirs = [SAGE_INC + 'flint/'],
    17131711              depends = flint_depends),
    17141712
     
    17281726    Extension('sage.rings.polynomial.polynomial_rational_flint',
    17291727              sources = ['sage/rings/polynomial/polynomial_rational_flint.pyx'],
    17301728              language = 'c++',
    1731               extra_compile_args=["-std=c99"] + uname_specific('SunOS', [], ['-D_XPG6']),
    17321729              libraries = ["csage", "flint", "ntl", "gmpxx", "gmp"],
    17331730              include_dirs = [SAGE_INC + 'flint/', 'sage/libs/flint/'],
    17341731              depends = flint_depends),
  • sage/rings/polynomial/polynomial_zmod_flint.pxd

    diff --git a/sage/rings/polynomial/polynomial_zmod_flint.pxd b/sage/rings/polynomial/polynomial_zmod_flint.pxd
    a b  
    99
    1010cdef class Polynomial_zmod_flint(Polynomial_template):
    1111    cdef Polynomial_template _new(self)
    12     cdef void _set_list(self, x)
    13     cdef void _set_fmpz_poly(self, fmpz_poly_t)
     12    cdef int _set_list(self, x) except -1
     13    cdef int _set_fmpz_poly(self, fmpz_poly_t) except -1
    1414    cpdef _mul_trunc(self, Polynomial_zmod_flint other, length)
    1515    cpdef _mul_trunc_opposite(self, Polynomial_zmod_flint other, length)
    1616    cpdef rational_reconstruct(self, m, n_deg=?, d_deg=?)
  • sage/rings/polynomial/polynomial_zmod_flint.pyx

    diff --git a/sage/rings/polynomial/polynomial_zmod_flint.pyx b/sage/rings/polynomial/polynomial_zmod_flint.pyx
    a b  
    146146        celement_set_si(&r.x, int(x), get_cparent(P))
    147147        return r
    148148
    149     cdef void _set_list(self, x):
     149    cdef int _set_list(self, x) except -1:
    150150        """
    151151        Set the coefficients of ``self`` from a list of coefficients.
    152152
     
    170170        cdef int i
    171171        if length == 0:
    172172            nmod_poly_zero(&self.x)
    173             return
     173            return 0
    174174
    175175        # resize to length of list
    176176        sig_on()
     
    181181        for i from 0 <= i < length:
    182182            nmod_poly_set_coeff_ui(&self.x, i, l_in[i])
    183183        sig_off()
     184        return 0
    184185
    185     cdef void _set_fmpz_poly(self, fmpz_poly_t x):
     186    cdef int _set_fmpz_poly(self, fmpz_poly_t x) except -1:
    186187        """
    187188        Set the coefficients of ``self`` from the coefficients of an ``fmpz_poly_t`` element.
    188189
     
    209210        sig_on()
    210211        fmpz_poly_get_nmod_poly(&self.x, x)
    211212        sig_off()
     213        return 0
    212214
    213215    def __getitem__(self, i):
    214216        """