Skip to content

Commit

Permalink
Fix haddr_t and object_info deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
musm committed Jul 16, 2023
1 parent d4751f9 commit 6ee479c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/JLD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ function write_ref(parent::JldFile, data, wsession::JldWriteSession)
dset = _write(gref, name, writeas(data), wsession)

# Add reference to reference list
ref = HDF5.Reference(HDF5.API.hobj_ref_t(object_info(dset).addr))
ref = HDF5.Reference(HDF5.API.hobj_ref_t(HDF5.API.h5o_get_info1(HDF5.checkvalid(dset)).addr))
close(dset)
if !isa(data, Tuple) && ismutable(data)
wsession.h5ref[data] = ref
Expand Down
6 changes: 3 additions & 3 deletions src/jld_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ function jldatatype(parent::JldFile, dtype::HDF5.Datatype)
elseif class_id == HDF5.API.H5T_BITFIELD
Bool
elseif class_id == HDF5.API.H5T_COMPOUND || class_id == HDF5.API.H5T_OPAQUE
addr = object_info(dtype).addr
addr = HDF5.API.h5o_get_info1(HDF5.checkvalid(dtype)).addr
haskey(parent.h5jltype, addr) && return parent.h5jltype[addr]

typename = read_attribute(dtype, name_type_attr)
Expand Down Expand Up @@ -805,11 +805,11 @@ end
# it's already many times faster than calling H5Iget_name with a lot of
# data in the file, and it only needs to be called once per type.
# Revisit if this ever turns out to be a bottleneck.
function typeindex(parent::JldFile, addr::HDF5.haddr_t)
function typeindex(parent::JldFile, addr::HDF5.API.haddr_t)
gtypes = parent.plain[pathtypes]
i = 1
for x in gtypes
if object_info(x).addr == addr
if HDF5.API.h5o_get_info1(HDF5.checkvalid(x)).addr == addr
return i
end
i += 1
Expand Down

0 comments on commit 6ee479c

Please sign in to comment.