From 4aee759527a8dce3427a43d6beb6343e496073bb Mon Sep 17 00:00:00 2001 From: Nathan Zimmerberg <39104088+nhz2@users.noreply.github.com> Date: Sat, 2 Dec 2023 21:16:18 -0500 Subject: [PATCH] Fix pointer conversion (#44) * fix pointer conversion * fix other pointer convert * disable nightly * bump version --- Project.toml | 2 +- src/compression.jl | 4 ++-- src/loading.jl | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 742b63f..cd1b955 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SmallZarrGroups" uuid = "d423b6e5-1c84-4ae2-8d2d-b903aee15ac7" authors = ["nhz2 "] -version = "0.8.1" +version = "0.8.2" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/compression.jl b/src/compression.jl index b056e04..d34081b 100644 --- a/src/compression.jl +++ b/src/compression.jl @@ -21,7 +21,7 @@ Uncompressed the data. sz == n || error("Blosc decompress error, compressed data is corrupted") return end - r = if isnothing(compressor) + r::Vector{UInt8} = if isnothing(compressor) src else id = compressor.id @@ -34,7 +34,7 @@ Uncompressed the data. end end @argcheck length(r) == n - GC.@preserve r Base.unsafe_copyto!(p, Base.unsafe_convert(Ptr{UInt8}, r), n) + GC.@preserve r Base.unsafe_copyto!(p, pointer(r), n) nothing end diff --git a/src/loading.jl b/src/loading.jl index 6142da8..d1cec30 100644 --- a/src/loading.jl +++ b/src/loading.jl @@ -105,7 +105,7 @@ function load_array( rawchunkdata = read_key_idx(reader, chunknameidx) decompressed_chunkdata = Vector{T}(undef, prod(chunks)) GC.@preserve decompressed_chunkdata unsafe_decompress!( - Base.unsafe_convert(Ptr{UInt8}, decompressed_chunkdata), + convert(Ptr{UInt8}, pointer(decompressed_chunkdata)), sizeof(decompressed_chunkdata), rawchunkdata, compressor,