Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #33210: Fix Cython warnings in sage.rings.polynomial.polynomial_…
Browse files Browse the repository at this point in the history
…modn_dense_ntl

{{{
[sagelib-9.5.rc2] warning:
sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:876:32: local
variable 'mod' referenced before assignment
[sagelib-9.5.rc2] warning:
sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:880:52: local
variable 'mod' referenced before assignment
[sagelib-9.5.rc2] warning:
sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1434:32: local
variable 'mod' referenced before assignment
[sagelib-9.5.rc2] warning:
sage/rings/polynomial/polynomial_modn_dense_ntl.pyx:1438:52: local
variable 'mod' referenced before assignment
}}}

URL: https://trac.sagemath.org/33210
Reported by: mjo
Ticket author(s): Michael Orlitzky
Reviewer(s): Martin Albrecht
  • Loading branch information
Release Manager committed Feb 5, 2022
2 parents 7935ebc + b0fcca3 commit e1c128f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=e55f01bc91f603e956f10c09d9792eb1e3b7dfda
md5=bbaeb3e3bf9fca242201132116257ade
cksum=897891867
sha1=257be8fe8647be6fd9b1124404a2afad7c9843ad
md5=dff9a895fd577c960b3a00d29aa78f8b
cksum=3524011344
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dfdf71e1e783f5c3378e34b35aacfa26a86e66cb
3a936cf7b6a79ffb30b017cfdbaeef6c00ec6b77
12 changes: 6 additions & 6 deletions src/sage/rings/polynomial/polynomial_modn_dense_ntl.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ cdef class Polynomial_dense_modn_ntl_zz(Polynomial_dense_mod_n):
return self.parent(1)

cdef Polynomial_dense_modn_ntl_zz r = self._new()
cdef zz_pX_Modulus_c *mod
cdef zz_pX_Modulus_c mod

self.c.restore_c()

Expand All @@ -873,11 +873,11 @@ cdef class Polynomial_dense_modn_ntl_zz(Polynomial_dense_mod_n):
else:
if not isinstance(modulus, Polynomial_dense_modn_ntl_zz):
modulus = self.parent()._coerce_(modulus)
zz_pX_Modulus_build(mod[0], (<Polynomial_dense_modn_ntl_zz>modulus).x)
zz_pX_Modulus_build(mod, (<Polynomial_dense_modn_ntl_zz>modulus).x)

do_sig = zz_pX_deg(self.x) * e * self.c.p_bits > 1e5
if do_sig: sig_on()
zz_pX_PowerMod_long_pre(r.x, self.x, e, mod[0])
zz_pX_PowerMod_long_pre(r.x, self.x, e, mod)
if do_sig: sig_off()

if recip:
Expand Down Expand Up @@ -1416,7 +1416,7 @@ cdef class Polynomial_dense_modn_ntl_ZZ(Polynomial_dense_mod_n):
if self == 0 and e == 0:
return self.parent(1)
cdef Polynomial_dense_modn_ntl_ZZ r = self._new()
cdef ZZ_pX_Modulus_c *mod
cdef ZZ_pX_Modulus_c mod

self.c.restore_c()

Expand All @@ -1431,11 +1431,11 @@ cdef class Polynomial_dense_modn_ntl_ZZ(Polynomial_dense_mod_n):
else:
if not isinstance(modulus, Polynomial_dense_modn_ntl_ZZ):
modulus = self.parent()._coerce_(modulus)
ZZ_pX_Modulus_build(mod[0], (<Polynomial_dense_modn_ntl_ZZ>modulus).x)
ZZ_pX_Modulus_build(mod, (<Polynomial_dense_modn_ntl_ZZ>modulus).x)

do_sig = ZZ_pX_deg(self.x) * e * self.c.p_bits > 1e5
if do_sig: sig_on()
ZZ_pX_PowerMod_long_pre(r.x, self.x, e, mod[0])
ZZ_pX_PowerMod_long_pre(r.x, self.x, e, mod)
if do_sig: sig_off()
if recip:
return ~r
Expand Down

0 comments on commit e1c128f

Please sign in to comment.