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 cd63461 commit 869d75d
Show file tree
Hide file tree
Showing 4 changed files with 5 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
3 changes: 2 additions & 1 deletion src/EzXML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ import Compat:
stdin,
stdout,
bytesavailable,
findall
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 @@ -218,7 +218,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 869d75d

Please sign in to comment.