Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into ts_h5fl_reg
Browse files Browse the repository at this point in the history
  • Loading branch information
qkoziol committed Jan 24, 2025
2 parents 21323c1 + 1f62484 commit 358dc55
Show file tree
Hide file tree
Showing 39 changed files with 400 additions and 1,163 deletions.
4 changes: 2 additions & 2 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
skip = .git,*.svg,.codespellrc,./bin/trace,./hl/tools/h5watch/h5watch.c,./tools/test/h5jam/tellub.c,./config/sanitizer/LICENSE,./config/sanitizer/sanitizers.cmake,./tools/test/h5import/testfiles/*.conf,./tools/test/h5repack/testfiles/*.dat,./test/API/driver,./configure,./bin/ltmain.sh,./bin/depcomp,./bin/config.guess,./bin/config.sub,./autom4te.cache,./m4/libtool.m4,./c++/src/*.html,./HDF5Examples/depcomp
skip = .git,*.svg,.codespellrc,./bin/trace,./hl/tools/h5watch/h5watch.c,./tools/test/h5jam/tellub.c,./config/sanitizer/LICENSE,./config/sanitizer/sanitizers.cmake,./tools/test/h5import/testfiles/*.conf,./tools/test/h5repack/testfiles/*.dat,./test/API/driver,./configure,./bin/ltmain.sh,./bin/depcomp,./bin/config.guess,./bin/config.sub,./autom4te.cache,./m4/libtool.m4,./c++/src/*.html,./HDF5Examples/depcomp,./release_docs/HISTORY-*.txt
check-hidden = true
# ignore-regex =
ignore-words-list = ot,isnt,inout,nd,parms,parm,ba,offsetP,ser,ois,had,fiter,fo,clude,refere,minnum,offsetp,creat,ans:,eiter,lastr,ans,isn't,ifset,sur,trun,dne,tthe,hda,filname,te,htmp,ake,gord,numer,ro,oce,msdos,TEXTIN,FLE
ignore-words-list = ot,isnt,inout,nd,parms,parm,ba,offsetP,ser,ois,had,fiter,fo,clude,refere,minnum,offsetp,creat,ans:,eiter,lastr,ans,isn't,ifset,sur,trun,dne,tthe,hda,filname,te,htmp,ake,gord,numer,ro,oce,msdos,TEXTIN,indx,FLE
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM mcr.microsoft.com/devcontainers/base:debian

RUN apt-get update && apt-get -y install --no-install-recommends \
build-essential cmake cmake-curses-gui doxygen git graphviz \
less libtool-bin libyajl-dev mpi-default-dev valgrind wget
less libtool-bin libyajl-dev mpi-default-dev ninja-build valgrind wget
878 changes: 3 additions & 875 deletions .gitattributes

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HDF5Examples/C/H5FLT/tfiles/h5ex_d_bshuf.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 32008
COMMENT bitshuffle; see https://github.com/kiyo-masui/bitshuffle
PARAMS { 0 3 4 0 0 0 }
PARAMS { 0 4 4 0 0 0 }
}
}
FILLVALUE {
Expand Down
5 changes: 3 additions & 2 deletions c++/src/H5DataType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ DataType::p_decode() const
}

// Call C function to decode the binary object description
hid_t encoded_dtype_id = H5Tdecode(encoded_buf);
hid_t encoded_dtype_id = H5Tdecode2(encoded_buf, buf_size);

// If H5Tdecode fails, raise exception
if (encoded_dtype_id < 0) {
Expand Down Expand Up @@ -924,7 +924,8 @@ DataType::close()
// Free and reset buffer of encoded object description if it's been used
if (encoded_buf != NULL) {
delete[] encoded_buf;
buf_size = 0;
encoded_buf = NULL;
buf_size = 0;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions config/cmake/cacheinit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ set (BSHUF_GIT_URL "https://github.com/kiyo-masui/bitshuffle.git" CACHE STRING "
set (BSHUF_GIT_BRANCH "master" CACHE STRING "" FORCE)

set (BSHUF_TGZ_ORIGPATH "https://github.com/kiyo-masui/bitshuffle/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE)
set (BSHUF_TGZ_NAME "bitshuffle-0.5.1.tar.gz" CACHE STRING "Use BSHUF from compressed file" FORCE)
set (BSHUF_TGZ_NAME "bitshuffle-0.5.2.tar.gz" CACHE STRING "Use BSHUF from compressed file" FORCE)

set (BSHUF_PACKAGE_NAME "bshuf" CACHE STRING "Name of BSHUF package" FORCE)

Expand Down Expand Up @@ -126,7 +126,7 @@ set (BLOSC2_GIT_URL "https://github.com/Blosc/c-blosc2.git" CACHE STRING "Use BL
set (BLOSC2_GIT_BRANCH "main" CACHE STRING "" FORCE)

set (BLOSC2_TGZ_ORIGPATH "https://github.com/Blosc/c-blosc2/archive/refs/tags" CACHE STRING "Use PLUGINS from original location" FORCE)
set (BLOSC2_TGZ_NAME "c-blosc2-2.15.1.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE)
set (BLOSC2_TGZ_NAME "c-blosc2-2.15.2.tar.gz" CACHE STRING "Use BLOSC2 from compressed file" FORCE)

set (BLOSC2_PACKAGE_NAME "blosc2" CACHE STRING "Name of BLOSC2 package" FORCE)

Expand Down
2 changes: 1 addition & 1 deletion doxygen/dox/ImageSpec.dox
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ and blue components that make up each color.
<table>
<tr>
<td>
\image html Palettes.fm.anc.gif
\image html Palettes_fm_anc.gif
</td>
</tr>
</table>
Expand Down
File renamed without changes
41 changes: 0 additions & 41 deletions fortran/src/H5Tf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,47 +1890,6 @@ h5tcommitted_c(hid_t_f *dtype_id)
return ret_value;
}

/****if* H5Tf/h5tdecode_c
* NAME
* h5tdecode_c
* PURPOSE
* Call H5Tdecode
* INPUTS
*
* buf - Buffer for the data space object to be decoded.
* OUTPUTS
*
* obj_id - Object_id (non-negative)
*
* RETURNS
* 0 on success, -1 on failure
* SOURCE
*/

int_f
h5tdecode_c(_fcd buf, hid_t_f *obj_id)
/******/
{
int ret_value = -1;
unsigned char *c_buf = NULL; /* Buffer to hold C string */
hid_t c_obj_id;

/*
* Call H5Tdecode function.
*/

c_buf = (unsigned char *)buf;

c_obj_id = H5Tdecode(c_buf);
if (c_obj_id < 0)
return ret_value;

*obj_id = (hid_t_f)c_obj_id;
ret_value = 0;

return ret_value;
}

/****if* H5Tf/h5tencode_c
* NAME
* h5tencode_c
Expand Down
41 changes: 28 additions & 13 deletions fortran/src/H5Tff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1855,32 +1855,47 @@ END SUBROUTINE h5tcommitted_f
!>
!! \ingroup FH5T
!!
!! \brief Decode A binary object description of data type and return a new object handle.
!! \brief Decode a binary object description of data type and return a new object handle.
!!
!! \param buf Buffer for the data space object to be decoded.
!! \param obj_id Object ID.
!! \param hdferr \fortran_error
!! \param buf Buffer for the data space object to be decoded.
!! \param obj_id Object ID.
!! \param hdferr \fortran_error
!! \param buf_size Size of the buffer.
!!
!! See C API: @ref H5Tdecode()
!! See C API: @ref H5Tdecode2()
!!
SUBROUTINE h5tdecode_f(buf, obj_id, hdferr)
SUBROUTINE h5tdecode_f(buf, obj_id, hdferr, buf_size)
IMPLICIT NONE
CHARACTER(LEN=*), INTENT(IN) :: buf
INTEGER(HID_T), INTENT(OUT) :: obj_id
INTEGER, INTENT(OUT) :: hdferr
INTEGER(SIZE_T), OPTIONAL, INTENT(IN) :: buf_size

INTEGER(SIZE_T) :: buf_size_default

INTERFACE
INTEGER FUNCTION h5tdecode_c(buf, obj_id) BIND(C,NAME='h5tdecode_c')
INTEGER(HID_T) FUNCTION H5Tdecode2(buf, buf_size) BIND(C,NAME='H5Tdecode2')
IMPORT :: C_CHAR
IMPORT :: HID_T
IMPORT :: HID_T, SIZE_T
IMPLICIT NONE
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: buf
INTEGER(HID_T), INTENT(OUT) :: obj_id
END FUNCTION h5tdecode_c
CHARACTER(KIND=C_CHAR), DIMENSION(*) :: buf
INTEGER(SIZE_T), VALUE :: buf_size
END FUNCTION H5Tdecode2
END INTERFACE

hdferr = h5tdecode_c(buf, obj_id)
IF(PRESENT(buf_size))THEN
buf_size_default = buf_size
ELSE
buf_size_default = LEN(buf)
ENDIF

obj_id = H5Tdecode2(buf, buf_size_default)

IF(obj_id.LT.0)THEN
hdferr = -1
ENDIF

END SUBROUTINE h5tdecode_f
END SUBROUTINE h5tdecode_f

!>
!! \ingroup FH5T
Expand Down
1 change: 0 additions & 1 deletion fortran/src/H5f90proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ H5_FCDLL int_f h5tvlen_create_c(hid_t_f *type_id, hid_t_f *vltype_id);
H5_FCDLL int_f h5tis_variable_str_c(hid_t_f *type_id, int_f *flag);
H5_FCDLL int_f h5tget_member_class_c(hid_t_f *type_id, int_f *member_no, int_f *cls);
H5_FCDLL int_f h5tcommit_anon_c(hid_t_f *loc_id, hid_t_f *dtype_id, hid_t_f *tcpl_id, hid_t_f *tapl_id);
H5_FCDLL int_f h5tdecode_c(_fcd buf, hid_t_f *obj_id);
H5_FCDLL int_f h5tencode_c(_fcd buf, hid_t_f *obj_id, size_t_f *nalloc);
H5_FCDLL int_f h5tget_create_plist_c(hid_t_f *dtype_id, hid_t_f *dtpl_id);
H5_FCDLL int_f h5tcompiler_conv_c(hid_t_f *src_id, hid_t_f *dst_id, int_f *c_flag);
Expand Down
17 changes: 15 additions & 2 deletions fortran/test/tH5T.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ SUBROUTINE compoundtest(cleanup, total_error)
CHARACTER(LEN=1024) :: cmpd_buf
INTEGER(SIZE_T) :: cmpd_buf_size=0
INTEGER(HID_T) :: decoded_tid1
INTEGER(HID_T) :: decoded_tid2

INTEGER(HID_T) :: fixed_str1, fixed_str2
LOGICAL :: are_equal
Expand Down Expand Up @@ -553,7 +554,10 @@ SUBROUTINE compoundtest(cleanup, total_error)
CALL H5Tencode_f(dtype_id, cmpd_buf, cmpd_buf_size, error)
CALL check("H5Tencode_f", error, total_error)

! Try decoding bogus buffer
! Try decoding bogus buffer with and without optional buffer size

CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error, cmpd_buf_size)
CALL verify("H5Tdecode_f", error, -1, total_error)

CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error)
CALL verify("H5Tdecode_f", error, -1, total_error)
Expand All @@ -562,14 +566,23 @@ SUBROUTINE compoundtest(cleanup, total_error)
CALL check("H5Tencode_f", error, total_error)

! Decode from the compound buffer and return an object handle
CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error)
CALL H5Tdecode_f(cmpd_buf, decoded_tid1, error, cmpd_buf_size)
CALL check("H5Tdecode_f", error, total_error)

! Verify that the datatype was copied exactly

CALL H5Tequal_f(decoded_tid1, dtype_id, flag, error)
CALL check("H5Tequal_f", error, total_error)
CALL verify("H5Tequal_f", flag, .TRUE., total_error)

! Decode from the compound buffer without the optional parameter
CALL H5Tdecode_f(cmpd_buf, decoded_tid2, error)
CALL check("H5Tdecode_f", error, total_error)

! Verify that the datatype was copied exactly
CALL H5Tequal_f(decoded_tid2, dtype_id, flag, error)
CALL check("H5Tequal_f", error, total_error)

!
! Close all open objects.
!
Expand Down
2 changes: 1 addition & 1 deletion hl/test/test_ld.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#define DSET_SCALAR "DSET_SCALAR"

/* Selected compound field members for testing */
#define VALID_FIELDS1 "field1,field2.a,field3,field4" /* TEMPORORAY */
#define VALID_FIELDS1 "field1,field2.a,field3,field4" /* TEMPORARY */
#define VALID_FIELDS2 "field2.b.a,field2.c,field4.b"

#define INVALID_FIELDS1 "field2.k.a,field2.c,field4.k"
Expand Down
9 changes: 6 additions & 3 deletions java/src/hdf/hdf5lib/H5.java
Original file line number Diff line number Diff line change
Expand Up @@ -13865,16 +13865,19 @@ public static long H5Tcreate(int tclass, long size) throws HDF5LibraryException
* @param buf
* IN: Buffer for the data type object to be decoded.
*
* @param buf_size
* IN: Size of the buffer.
*
* @return a new object handle
*
* @exception HDF5LibraryException
* Error from the HDF5 Library.
* @exception NullPointerException
* buf is null.
**/
public static long H5Tdecode(byte[] buf) throws HDF5LibraryException, NullPointerException
public static long H5Tdecode(byte[] buf, long buf_size) throws HDF5LibraryException, NullPointerException
{
long id = _H5Tdecode(buf);
long id = _H5Tdecode(buf, buf_size);
if (id > 0) {
log.trace("OPEN_IDS: H5Tdecode add {}", id);
OPEN_IDS.add(id);
Expand All @@ -13883,7 +13886,7 @@ public static long H5Tdecode(byte[] buf) throws HDF5LibraryException, NullPointe
return id;
}

private synchronized static native long _H5Tdecode(byte[] buf)
private synchronized static native long _H5Tdecode(byte[] buf, long buf_size)
throws HDF5LibraryException, NullPointerException;

/**
Expand Down
Loading

0 comments on commit 358dc55

Please sign in to comment.