Skip to content

Commit

Permalink
use Ref() instead of pointer() for output arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jwahlstrand committed Apr 18, 2024
1 parent 2b7185c commit 94994ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Cairo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ for (fname,cname) in ((:user_to_device!,:cairo_user_to_device),
function ($fname)(ctx::CairoContext, p::Vector{Float64})
ccall(($(Expr(:quote,cname)),libcairo),
Nothing, (Ptr{Nothing}, Ptr{Float64}, Ptr{Float64}),
ctx.ptr, pointer(p,1), pointer(p,2))
ctx.ptr, Ref(p,1), Ref(p,2))
p
end
end
Expand Down Expand Up @@ -1200,7 +1200,7 @@ end
function get_layout_size(ctx::CairoContext)
w = Vector{Int32}(undef, 2)
ccall((:pango_layout_get_pixel_size,libpango), Nothing,
(Ptr{Nothing},Ptr{Int32},Ptr{Int32}), ctx.layout, pointer(w,1), pointer(w,2))
(Ptr{Nothing},Ptr{Int32},Ptr{Int32}), ctx.layout, Ref(w,1), Ref(w,2))
w
end

Expand Down

0 comments on commit 94994ff

Please sign in to comment.