Skip to content

Commit

Permalink
Merge 51d9956 into a6d5329
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Aug 19, 2018
2 parents a6d5329 + 51d9956 commit c043077
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils.jl
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 c043077

Please sign in to comment.