Skip to content

Commit

Permalink
Some manual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 31, 2024
1 parent 66a46b9 commit 425e2ad
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/arb/ComplexPoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function unique_integer(x::ComplexPolyRingElem)
end

function isreal(x::ComplexPolyRingElem)
return @ccall libflint.acb_poly_is_real(x::Ref{ComplexPolyRingElem})::Cint != 0
return Bool(@ccall libflint.acb_poly_is_real(x::Ref{ComplexPolyRingElem})::Cint)
end

###############################################################################
Expand Down
20 changes: 11 additions & 9 deletions src/arb/acb_calc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ function integrate(C::ComplexField, F, a, b;

res = C()

status = @ccall libflint.acb_calc_integrate(res::Ref{ComplexFieldElem}, acb_calc_func_wrap_c()::#res
Ptr{Nothing}, F::#func
Any, lower::#params
Ref{ComplexFieldElem}, upper::#a
Ref{ComplexFieldElem}, cgoal::#b
Int, ctol::#rel_goal
Ref{mag_struct}, opts::#abs_tol
Ref{acb_calc_integrate_opts}, precision(Balls)::#opts
Int)::UInt
status = @ccall libflint.acb_calc_integrate(
res::Ref{ComplexFieldElem}, #res
acb_calc_func_wrap_c()::Ptr{Nothing}, #func
F::Any, #params
lower::Ref{ComplexFieldElem}, #a
upper::Ref{ComplexFieldElem}, #b
cgoal::Int, #rel_goal
ctol::Ref{mag_struct}, #abs_tol
opts::Ref{acb_calc_integrate_opts}, #opts
precision(Balls)::Int
)::UInt

@ccall libflint.mag_clear(ctol::Ref{mag_struct})::Nothing

Expand Down
2 changes: 1 addition & 1 deletion src/arb/acb_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function unique_integer(x::AcbPolyRingElem)
end

function isreal(x::AcbPolyRingElem)
return @ccall libflint.acb_poly_is_real(x::Ref{AcbPolyRingElem})::Cint != 0
return Bool(@ccall libflint.acb_poly_is_real(x::Ref{AcbPolyRingElem})::Cint)
end

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/flint/FlintTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ mutable struct FpMPolyRingElem <: MPolyRingElem{FpFieldElem}

function FpMPolyRingElem(ctx::FpMPolyRing, a::Union{ZZRingElem, FpFieldElem})
z = FpMPolyRingElem(ctx)
@ccall libflint.fmpz_mod_mpoly_set_fmpz(z::Ref{FpMPolyRingElem}, a isa ZZRingElem ? a : data(a)::Ref{ZZRingElem}, ctx::Ref{FpMPolyRing})::Nothing
@ccall libflint.fmpz_mod_mpoly_set_fmpz(z::Ref{FpMPolyRingElem}, (a isa ZZRingElem ? a : data(a))::Ref{ZZRingElem}, ctx::Ref{FpMPolyRing})::Nothing
return z
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fmpq_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ end

function Base.isless(a::QQMPolyRingElem, b::QQMPolyRingElem)
(!is_monomial(a) || !is_monomial(b)) && error("Not monomials in comparison")
return @ccall libflint.fmpq_mpoly_cmp(a::Ref{QQMPolyRingElem}, b::Ref{QQMPolyRingElem}, a.parent::Ref{QQMPolyRing})::Cint < 0
return (@ccall libflint.fmpq_mpoly_cmp(a::Ref{QQMPolyRingElem}, b::Ref{QQMPolyRingElem}, a.parent::Ref{QQMPolyRing})::Cint) < 0
end

###############################################################################
Expand Down
8 changes: 4 additions & 4 deletions src/flint/fmpz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ function numerator(a::ZZRingElem)
return a
end

isodd(a::ZZRingElemOrPtr) = @ccall libflint.fmpz_is_odd(a::Ref{ZZRingElem})::Cint % Bool
iseven(a::ZZRingElemOrPtr) = @ccall libflint.fmpz_is_even(a::Ref{ZZRingElem})::Cint % Bool
isodd(a::ZZRingElemOrPtr) = (@ccall libflint.fmpz_is_odd(a::Ref{ZZRingElem})::Cint) % Bool
iseven(a::ZZRingElemOrPtr) = (@ccall libflint.fmpz_is_even(a::Ref{ZZRingElem})::Cint) % Bool

###############################################################################
#
Expand Down Expand Up @@ -1029,7 +1029,7 @@ function invmod(x::ZZRingElem, m::ZZRingElem)
if isone(m)
return ZZRingElem(0)
end
if @ccall libflint.fmpz_invmod(z::Ref{ZZRingElem}, x::Ref{ZZRingElem}, m::Ref{ZZRingElem})::Cint == 0
if (@ccall libflint.fmpz_invmod(z::Ref{ZZRingElem}, x::Ref{ZZRingElem}, m::Ref{ZZRingElem})::Cint) == 0
error("Impossible inverse in invmod")
end
return z
Expand Down Expand Up @@ -2892,7 +2892,7 @@ end
if Culong !== UInt
function (::Type{Culong})(a::ZZRingElem)
fits(Culong, a) || throw(InexactError(:convert, Culong, a))
return @ccall libflint.fmpz_get_ui(a::Ref{ZZRingElem})::UInt%Culong
return (@ccall libflint.fmpz_get_ui(a::Ref{ZZRingElem})::UInt) % Culong
end
end

Expand Down
6 changes: 3 additions & 3 deletions src/flint/fmpz_mat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ function maximum(f::typeof(abs), a::ZZMatrix)
for i = 1:nrows(a)
for j = 1:ncols(a)
z = mat_entry_ptr(a, i, j)
if @ccall libflint.fmpz_cmpabs(m::Ptr{ZZRingElem}, z::Ptr{ZZRingElem})::Cint < 0
if (@ccall libflint.fmpz_cmpabs(m::Ptr{ZZRingElem}, z::Ptr{ZZRingElem})::Cint) < 0

Check warning on line 779 in src/flint/fmpz_mat.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpz_mat.jl#L779

Added line #L779 was not covered by tests
m = z
end
end
Expand All @@ -793,7 +793,7 @@ function maximum(a::ZZMatrix)
for i = 1:nrows(a)
for j = 1:ncols(a)
z = mat_entry_ptr(a, i, j)
if @ccall libflint.fmpz_cmp(m::Ptr{ZZRingElem}, z::Ptr{ZZRingElem})::Cint < 0
if (@ccall libflint.fmpz_cmp(m::Ptr{ZZRingElem}, z::Ptr{ZZRingElem})::Cint) < 0

Check warning on line 796 in src/flint/fmpz_mat.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpz_mat.jl#L796

Added line #L796 was not covered by tests
m = z
end
end
Expand All @@ -810,7 +810,7 @@ function minimum(a::ZZMatrix)
for i = 1:nrows(a)
for j = 1:ncols(a)
z = mat_entry_ptr(a, i, j)
if @ccall libflint.fmpz_cmp(m::Ptr{ZZRingElem}, z::Ptr{ZZRingElem})::Cint > 0
if (@ccall libflint.fmpz_cmp(m::Ptr{ZZRingElem}, z::Ptr{ZZRingElem})::Cint) > 0

Check warning on line 813 in src/flint/fmpz_mat.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpz_mat.jl#L813

Added line #L813 was not covered by tests
m = z
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fmpz_mod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ for (etype, rtype, ftype, ctype) in (

function Base.isless(a::($etype), b::($etype))
(!is_monomial(a) || !is_monomial(b)) && error("Not monomials in comparison")
return @ccall libflint.fmpz_mod_mpoly_cmp(a::Ref{($etype)}, b::Ref{($etype)}, a.parent::Ref{($rtype)})::Cint < 0
return (@ccall libflint.fmpz_mod_mpoly_cmp(a::Ref{($etype)}, b::Ref{($etype)}, a.parent::Ref{($rtype)})::Cint) < 0
end

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/flint/fmpz_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ end

function Base.isless(a::ZZMPolyRingElem, b::ZZMPolyRingElem)
(!is_monomial(a) || !is_monomial(b)) && error("Not monomials in comparison")
return @ccall libflint.fmpz_mpoly_cmp(a::Ref{ZZMPolyRingElem}, b::Ref{ZZMPolyRingElem}, a.parent::Ref{ZZMPolyRing})::Cint < 0
return (@ccall libflint.fmpz_mpoly_cmp(a::Ref{ZZMPolyRingElem}, b::Ref{ZZMPolyRingElem}, a.parent::Ref{ZZMPolyRing})::Cint) < 0
end

###############################################################################
Expand Down
4 changes: 2 additions & 2 deletions src/flint/fq_nmod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ end

function ==(a::fqPolyRepMPolyRingElem, b::fqPolyRepMPolyRingElem)
check_parent(a, b)
return @ccall libflint.fq_nmod_mpoly_equal(a::Ref{fqPolyRepMPolyRingElem}, b::Ref{fqPolyRepMPolyRingElem}, a.parent::Ref{fqPolyRepMPolyRing})::Cint != 0
return Bool(@ccall libflint.fq_nmod_mpoly_equal(a::Ref{fqPolyRepMPolyRingElem}, b::Ref{fqPolyRepMPolyRingElem}, a.parent::Ref{fqPolyRepMPolyRing})::Cint)
end

function Base.isless(a::fqPolyRepMPolyRingElem, b::fqPolyRepMPolyRingElem)
(!is_monomial(a) || !is_monomial(b)) && error("Not monomials in comparison")
return @ccall libflint.fq_nmod_mpoly_cmp(a::Ref{fqPolyRepMPolyRingElem}, b::Ref{fqPolyRepMPolyRingElem}, a.parent::Ref{fqPolyRepMPolyRing})::Cint < 0
return (@ccall libflint.fq_nmod_mpoly_cmp(a::Ref{fqPolyRepMPolyRingElem}, b::Ref{fqPolyRepMPolyRingElem}, a.parent::Ref{fqPolyRepMPolyRing})::Cint) < 0
end

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/flint/nmod_mpoly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ for (etype, rtype, ftype, ctype, utype) in (

function Base.isless(a::($etype), b::($etype))
(!is_monomial(a) || !is_monomial(b)) && error("Not monomials in comparison")
return @ccall libflint.nmod_mpoly_cmp(a::Ref{($etype)}, b::Ref{($etype)}, a.parent::Ref{($rtype)})::Cint < 0
return (@ccall libflint.nmod_mpoly_cmp(a::Ref{($etype)}, b::Ref{($etype)}, a.parent::Ref{($rtype)})::Cint) < 0
end

###############################################################################
Expand Down

0 comments on commit 425e2ad

Please sign in to comment.