Skip to content

Commit

Permalink
Update ccalls in src/antic/
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 29, 2024
1 parent 9df1993 commit ff3d4e8
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 195 deletions.
17 changes: 6 additions & 11 deletions src/antic/AnticTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ for some more specialized fields.
return get_cached!(AnticNumberFieldID, (parent(pol), pol, s), cached) do
nf = new()
nf.pol = pol
ccall((:nf_init, libflint), Nothing,
(Ref{AbsSimpleNumField}, Ref{QQPolyRingElem}), nf, pol)
@ccall libflint.nf_init(nf::Ref{AbsSimpleNumField}, pol::Ref{QQPolyRingElem})::Nothing
finalizer(_AnticNumberField_clear_fn, nf)
nf.S = s
return nf
Expand All @@ -56,7 +55,7 @@ const AnticNumberFieldID = CacheDictType{Tuple{QQPolyRing, QQPolyRingElem, Symbo


function _AnticNumberField_clear_fn(a::AbsSimpleNumField)
ccall((:nf_clear, libflint), Nothing, (Ref{AbsSimpleNumField},), a)
@ccall libflint.nf_clear(a::Ref{AbsSimpleNumField})::Nothing
end

"""
Expand All @@ -81,28 +80,24 @@ mutable struct AbsSimpleNumFieldElem <: SimpleNumFieldElem{QQFieldElem}

function AbsSimpleNumFieldElem(p::AbsSimpleNumField)
r = new()
ccall((:nf_elem_init, libflint), Nothing,
(Ref{AbsSimpleNumFieldElem}, Ref{AbsSimpleNumField}), r, p)
@ccall libflint.nf_elem_init(r::Ref{AbsSimpleNumFieldElem}, p::Ref{AbsSimpleNumField})::Nothing
r.parent = p
finalizer(_nf_elem_clear_fn, r)
return r
end

function AbsSimpleNumFieldElem(p::AbsSimpleNumField, a::AbsSimpleNumFieldElem)
r = new()
ccall((:nf_elem_init, libflint), Nothing,
(Ref{AbsSimpleNumFieldElem}, Ref{AbsSimpleNumField}), r, p)
ccall((:nf_elem_set, libflint), Nothing,
(Ref{AbsSimpleNumFieldElem}, Ref{AbsSimpleNumFieldElem}, Ref{AbsSimpleNumField}), r, a, p)
@ccall libflint.nf_elem_init(r::Ref{AbsSimpleNumFieldElem}, p::Ref{AbsSimpleNumField})::Nothing
@ccall libflint.nf_elem_set(r::Ref{AbsSimpleNumFieldElem}, a::Ref{AbsSimpleNumFieldElem}, p::Ref{AbsSimpleNumField})::Nothing
r.parent = p
finalizer(_nf_elem_clear_fn, r)
return r
end
end

function _nf_elem_clear_fn(a::AbsSimpleNumFieldElem)
ccall((:nf_elem_clear, libflint), Nothing,
(Ref{AbsSimpleNumFieldElem}, Ref{AbsSimpleNumField}), a, a.parent)
@ccall libflint.nf_elem_clear(a::Ref{AbsSimpleNumFieldElem}, a.parent::Ref{AbsSimpleNumField})::Nothing
end


Expand Down
Loading

0 comments on commit ff3d4e8

Please sign in to comment.