Skip to content

Commit

Permalink
fix deprecated use of isbits (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin authored Aug 19, 2018
1 parent a6d5329 commit 67a1d6f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function Compat.rmul!(v::VectorView{T},value::T) where T<:Number
end
nothing
end
function reinterpret_unsafe(::Type{T},x::Vector{R}) where {T,R}
function reinterpret_unsafe(::Type{T}, x::Vector{R}) where {T, R}
# how many T's fit into x?
@assert isbits(T) && isbits(R)
len = length(x)*sizeof(R)
p = reinterpret(Ptr{T},pointer(x))
return VectorView(0,div(len,sizeof(T)),p)
@assert isbitstype(T) && isbitstype(R)
len = length(x) * sizeof(R)
p = reinterpret(Ptr{T}, pointer(x))
return VectorView(0, div(len, sizeof(T)), p)
end

0 comments on commit 67a1d6f

Please sign in to comment.