Skip to content

Commit

Permalink
fix deprecations of cfunction (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 committed Jul 2, 2018
1 parent 8deaff3 commit fbe295a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.6
BinaryProvider 0.3
Compat 0.67
Compat 0.68
4 changes: 3 additions & 1 deletion src/EzXML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ import Compat:
Cvoid,
stdin,
stdout,
bytesavailable
bytesavailable,
findall,
@cfunction
using Compat.Libdl
using Compat.Printf: @printf

Expand Down
2 changes: 1 addition & 1 deletion src/document.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ end
function make_read_callback()
# Passing an input stream as an argument is impossible to create a callback
# because Julia does not support C-callable closures yet.
return cfunction(Cint, Tuple{Ptr{Cvoid}, Ptr{UInt8}, Cint}) do context, buffer, len
return @cfunction(Cint, (Ptr{Cvoid}, Ptr{UInt8}, Cint)) do context, buffer, len
input = unsafe_pointer_to_objref(context)
avail = min(bytesavailable(input), len)
if avail > 0
Expand Down
2 changes: 1 addition & 1 deletion src/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end

# Initialize an error handler.
function init_error_handler()
error_handler = cfunction(Cvoid, Tuple{Ptr{Cvoid}, Ptr{Cvoid}}) do ctx, err_ptr
error_handler = @cfunction(Cvoid, (Ptr{Cvoid}, Ptr{Cvoid})) do ctx, err_ptr
if ctx == pointer_from_objref(_Error)
err = unsafe_load(convert(Ptr{_Error}, err_ptr))
push!(XML_GLOBAL_ERROR_STACK, XMLError(err.domain, err.code, chomp(unsafe_string(err.message)), err.level, err.line))
Expand Down

0 comments on commit fbe295a

Please sign in to comment.