On Friday, August 26, 2016 at 9:15:23 PM UTC-4, J Luis wrote:
>
> Hi,
> So I started trying to port my code to 0.5 using Compat and it seams a
> hell is expecting me.
> This is one example of what happens when I try to follow the deprecation
> suggestions. This
>
> t = pointer_to_array(Gb.data, h.size)
> #@compat t = unsafe_wrap(Gb.data, h.size)
>
> warns that
>
> WARNING: pointer_to_array{T}(p::Ptr{T},d::Union{Integer,Tuple{Vararg{
> Integer}}},own::Bool=false) is deprecated, use unsafe_wrap(Array,p,d,own)
> instead.
> in depwarn(::String, ::Symbol) at .\deprecated.jl:64
> in pointer_to_array(::Ptr{Float32}, ::UInt64, ::Bool) at .\deprecated.jl:
> 50 (repeats 2 times)
> in GMTJL_grid_init(::Ptr{Void}, ::Bool, ::GMT.GMTJL_GRID, ::Array{Any,1},
> ::Array{Any,1}, ::Int64) at C:\j\.julia\v0.5\GMT\src\gmt_main.jl:1014
>
> so I make it
>
> @compat t = unsafe_wrap(Gb.data, h.size)
>
No, it is:
t = unsafe_wrap(Array, Gb.data, h.size)
as in the deprecation warning.
(You don't need @compat just for function calls. You only need @compat
for things where the syntax changes in a more complicated way.)