From 5683be342751e642719d14fa1baed83acaa71532 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 13:29:04 -0700 Subject: HDFFV-10325: removed the COMMON/EQUIV statements. --- fortran/src/H5_ff.F90 | 449 ++++++++++++++++++++++++++++- fortran/src/H5f90global.F90 | 671 +++++--------------------------------------- 2 files changed, 512 insertions(+), 608 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ef89d2f..f875d0e 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -38,7 +38,7 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T USE H5GLOBAL IMPLICIT NONE @@ -71,7 +71,102 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1, error_2, error_3 + ! + ! H5F flags + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER :: H5F_flags(H5F_FLAGS_LEN) + ! + ! H5generic flags + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + ! + ! H5G flags + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER :: H5G_flags(H5G_FLAGS_LEN) + ! + ! H5D flags + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + ! + ! H5E flags + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + ! + ! H5FD flags + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + ! + ! H5FD file drivers flags + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + ! + ! H5I flags + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER :: H5I_flags(H5I_FLAGS_LEN) + ! + ! H5L flags + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER :: H5L_flags(H5L_FLAGS_LEN) + ! + ! H5O flags + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER :: H5o_flags(H5O_FLAGS_LEN) + ! + ! H5P flags + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + ! + ! H5P integers flags + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + ! + ! H5R flags + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER :: H5R_flags(H5R_FLAGS_LEN) + ! + ! H5S flags + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) + ! + ! H5T flags + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER :: H5T_flags(H5T_FLAGS_LEN) + ! + ! H5Z flags + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + ! + ! H5 Library flags + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & @@ -147,8 +242,59 @@ CONTAINS INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) END FUNCTION h5init1_flags_c END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & + + error = h5init_types_c(predef_types, floating_types, integer_types) + + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER = predef_types(6) + H5T_NATIVE_REAL = predef_types(7) + H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_CHARACTER = predef_types(9) + H5T_STD_REF_OBJ = predef_types(10) + H5T_STD_REF_DSETREG = predef_types(11) + H5T_NATIVE_REAL_C_FLOAT = predef_types(12) + H5T_NATIVE_REAL_C_DOUBLE = predef_types(13) + H5T_NATIVE_REAL_C_LONG_DOUBLE = predef_types(14) + H5T_NATIVE_B8 = predef_types(15) + H5T_NATIVE_B16 = predef_types(16) + H5T_NATIVE_B32 = predef_types(17) + H5T_NATIVE_B64 = predef_types(18) + H5T_NATIVE_FLOAT_128 = predef_types(19) + + H5T_IEEE_F32BE = floating_types(1) + H5T_IEEE_F32LE = floating_types(2) + H5T_IEEE_F64BE = floating_types(3) + H5T_IEEE_F64LE = floating_types(4) + + H5T_STD_I8BE = integer_types(1) + H5T_STD_I8LE = integer_types(2) + H5T_STD_I16BE = integer_types(3) + H5T_STD_I16LE = integer_types(4) + H5T_STD_I32BE = integer_types(5) + H5T_STD_I32LE = integer_types(6) + H5T_STD_I64BE = integer_types(7) + H5T_STD_I64LE = integer_types(8) + H5T_STD_U8BE = integer_types(9) + H5T_STD_U8LE = integer_types(10) + H5T_STD_U16BE = integer_types(11) + H5T_STD_U16LE = integer_types(12) + H5T_STD_U32BE = integer_types(13) + H5T_STD_U32LE = integer_types(14) + H5T_STD_U64BE = integer_types(15) + H5T_STD_U64LE = integer_types(16) + H5T_STRING = integer_types(17) + H5T_STD_B8BE = integer_types(18) + H5T_STD_B8LE = integer_types(19) + H5T_STD_B16BE = integer_types(20) + H5T_STD_B16LE = integer_types(21) + H5T_STD_B32BE = integer_types(22) + H5T_STD_B32LE = integer_types(23) + H5T_STD_B64BE = integer_types(24) + H5T_STD_B64LE = integer_types(25) + H5T_FORTRAN_S1 = integer_types(26) + H5T_C_S1 = integer_types(27) + + error = error + h5init_flags_c(H5D_flags, & H5D_size_flags, & H5E_flags, & H5E_hid_flags, & @@ -169,8 +315,299 @@ CONTAINS H5Z_flags, & H5generic_flags,& H5generic_haddr_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 + ! + ! H5F flags + ! + H5F_ACC_RDWR_F = H5F_flags(1) + H5F_ACC_RDONLY_F = H5F_flags(2) + H5F_ACC_TRUNC_F = H5F_flags(3) + H5F_ACC_EXCL_F = H5F_flags(4) + H5F_ACC_DEBUG_F = H5F_flags(5) + H5F_SCOPE_LOCAL_F = H5F_flags(6) + H5F_SCOPE_GLOBAL_F = H5F_flags(7) + H5F_CLOSE_DEFAULT_F = H5F_flags(8) + H5F_CLOSE_WEAK_F = H5F_flags(9) + H5F_CLOSE_SEMI_F = H5F_flags(10) + H5F_CLOSE_STRONG_F = H5F_flags(11) + H5F_OBJ_FILE_F = H5F_flags(12) + H5F_OBJ_DATASET_F = H5F_flags(13) + H5F_OBJ_GROUP_F = H5F_flags(14) + H5F_OBJ_DATATYPE_F = H5F_flags(15) + H5F_OBJ_ALL_F = H5F_flags(16) + H5F_LIBVER_EARLIEST_F = H5F_flags(17) + H5F_LIBVER_LATEST_F = H5F_flags(18) + H5F_UNLIMITED_F = H5F_flags(19) + ! + ! H5generic flags + ! + H5_INDEX_UNKNOWN_F = H5generic_flags(1) + H5_INDEX_NAME_F = H5generic_flags(2) + H5_INDEX_CRT_ORDER_F = H5generic_flags(3) + H5_INDEX_N_F = H5generic_flags(4) + H5_ITER_UNKNOWN_F = H5generic_flags(5) + H5_ITER_INC_F = H5generic_flags(6) + H5_ITER_DEC_F = H5generic_flags(7) + H5_ITER_NATIVE_F = H5generic_flags(8) + H5_ITER_N_F = H5generic_flags(9) + + HADDR_UNDEF_F = H5generic_haddr_flags(1) + ! + ! H5G flags + ! + H5G_UNKNOWN_F = H5G_flags(1) + H5G_GROUP_F = H5G_flags(2) + H5G_DATASET_F = H5G_flags(3) + H5G_TYPE_F = H5G_flags(4) + H5G_SAME_LOC_F = H5G_flags(5) + H5G_LINK_ERROR_F = H5G_flags(6) + H5G_LINK_HARD_F = H5G_flags(7) + H5G_LINK_SOFT_F = H5G_flags(8) + H5G_STORAGE_TYPE_UNKNOWN_F = H5G_flags(9) + H5G_STORAGE_TYPE_SYMBOL_TABLE_F = H5G_flags(10) + H5G_STORAGE_TYPE_COMPACT_F = H5G_flags(11) + H5G_STORAGE_TYPE_DENSE_F = H5G_flags(12) + ! + ! H5D flags + ! + H5D_COMPACT_F = H5D_flags(1) + H5D_CONTIGUOUS_F = H5D_flags(2) + H5D_CHUNKED_F = H5D_flags(3) + H5D_ALLOC_TIME_ERROR_F = H5D_flags(4) + H5D_ALLOC_TIME_DEFAULT_F = H5D_flags(5) + H5D_ALLOC_TIME_EARLY_F = H5D_flags(6) + H5D_ALLOC_TIME_LATE_F = H5D_flags(7) + H5D_ALLOC_TIME_INCR_F = H5D_flags(8) + H5D_SPACE_STS_ERROR_F = H5D_flags(9) + H5D_SPACE_STS_NOT_ALLOCATED_F = H5D_flags(10) + H5D_SPACE_STS_PART_ALLOCATED_F = H5D_flags(11) + H5D_SPACE_STS_ALLOCATED_F = H5D_flags(12) + H5D_FILL_TIME_ERROR_F = H5D_flags(13) + H5D_FILL_TIME_ALLOC_F = H5D_flags(14) + H5D_FILL_TIME_NEVER_F = H5D_flags(15) + H5D_FILL_VALUE_ERROR_F = H5D_flags(16) + H5D_FILL_VALUE_UNDEFINED_F = H5D_flags(17) + H5D_FILL_VALUE_DEFAULT_F = H5D_flags(18) + H5D_FILL_VALUE_USER_DEFINED_F = H5D_flags(19) + H5D_CHUNK_CACHE_W0_DFLT_F = H5D_flags(20) + H5D_MPIO_NO_COLLECTIVE_F = H5D_flags(21) + H5D_MPIO_CHUNK_INDEPENDENT_F = H5D_flags(22) + H5D_MPIO_CHUNK_COLLECTIVE_F = H5D_flags(23) + H5D_MPIO_CHUNK_MIXED_F = H5D_flags(24) + H5D_MPIO_CONTIG_COLLECTIVE_F = H5D_flags(25) + H5D_VDS_ERROR_F = H5D_flags(26) + H5D_VDS_FIRST_MISSING_F = H5D_flags(27) + H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) + H5D_VIRTUAL_F = H5D_flags(29) + + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) + H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) + ! + ! H5E flags + ! + H5E_DEFAULT_F = H5E_hid_flags(1) + + H5E_MAJOR_F = H5E_flags(1) + H5E_MINOR_F = H5E_flags(2) + H5E_WALK_UPWARD_F = H5E_flags(3) + H5E_WALK_DOWNWARD_F = H5E_flags(4) + ! + ! H5FD flags + ! + H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) + H5FD_MPIO_COLLECTIVE_F = H5FD_flags(2) + H5FD_MEM_NOLIST_F = H5FD_flags(3) + H5FD_MEM_DEFAULT_F = H5FD_flags(4) + H5FD_MEM_SUPER_F = H5FD_flags(5) + H5FD_MEM_BTREE_F = H5FD_flags(6) + H5FD_MEM_DRAW_F = H5FD_flags(7) + H5FD_MEM_GHEAP_F = H5FD_flags(8) + H5FD_MEM_LHEAP_F = H5FD_flags(9) + H5FD_MEM_OHDR_F = H5FD_flags(10) + H5FD_MEM_NTYPES_F = H5FD_flags(11) + ! + ! H5FD file driver flags + ! + H5FD_CORE_F = H5FD_hid_flags(1) + H5FD_FAMILY_F = H5FD_hid_flags(2) + H5FD_LOG_F = H5FD_hid_flags(3) + H5FD_MPIO_F = H5FD_hid_flags(4) + H5FD_MULTI_F = H5FD_hid_flags(5) + H5FD_SEC2_F = H5FD_hid_flags(6) + H5FD_STDIO_F = H5FD_hid_flags(7) + ! + ! H5I flags declaration + ! + H5I_FILE_F = H5I_flags(1) + H5I_GROUP_F = H5I_flags(2) + H5I_DATATYPE_F = H5I_flags(3) + H5I_DATASPACE_F = H5I_flags(4) + H5I_DATASET_F = H5I_flags(5) + H5I_ATTR_F = H5I_flags(6) + H5I_BADID_F = H5I_flags(7) + ! + ! H5L flags + ! + H5L_TYPE_ERROR_F = H5L_flags(1) + H5L_TYPE_HARD_F = H5L_flags(2) + H5L_TYPE_SOFT_F = H5L_flags(3) + H5L_TYPE_EXTERNAL_F = H5L_flags(4) + H5L_SAME_LOC_F = H5L_flags(5) + H5L_LINK_CLASS_T_VERS_F = H5L_flags(6) + ! + ! H5O flags + ! + H5O_COPY_SHALLOW_HIERARCHY_F = h5o_flags(1) + H5O_COPY_EXPAND_SOFT_LINK_F = h5o_flags(2) + H5O_COPY_EXPAND_EXT_LINK_F = h5o_flags(3) + H5O_COPY_EXPAND_REFERENCE_F = h5o_flags(4) + H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) + H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) + H5O_COPY_ALL_F = h5o_flags(7) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) + H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_HDR_ALL_FLAGS_F = h5o_flags(20) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_TYPE_NTYPES_F = h5o_flags(27) + ! + ! H5P flags + ! + H5P_FILE_CREATE_F = H5P_flags(1) + H5P_FILE_ACCESS_F = H5P_flags(2) + H5P_DATASET_CREATE_F = H5P_flags(3) + H5P_DATASET_XFER_F = H5P_flags(4) + H5P_FILE_MOUNT_F = H5P_flags(5) + H5P_DEFAULT_F = H5P_flags(6) + H5P_ROOT_F = H5P_flags(7) + H5P_OBJECT_CREATE_F = H5P_flags(8) + H5P_DATASET_ACCESS_F = H5P_flags(9) + H5P_GROUP_CREATE_F = H5P_flags(10) + H5P_GROUP_ACCESS_F = H5P_flags(11) + H5P_DATATYPE_CREATE_F = H5P_flags(12) + H5P_DATATYPE_ACCESS_F = H5P_flags(13) + H5P_STRING_CREATE_F = H5P_flags(14) + H5P_ATTRIBUTE_CREATE_F = H5P_flags(15) + H5P_OBJECT_COPY_F = H5P_flags(16) + H5P_LINK_CREATE_F = H5P_flags(17) + H5P_LINK_ACCESS_F = H5P_flags(18) + ! + ! H5P integers flags + ! + H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) + H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) + ! + ! H5R flags + ! + H5R_OBJECT_F = H5R_flags(1) + H5R_DATASET_REGION_F = H5R_flags(2) + ! + ! H5S flags + ! + H5S_ALL_F = H5S_hid_flags(1) + + H5S_UNLIMITED_F = H5S_hsize_flags(1) + + H5S_SCALAR_F = H5S_flags(1) + H5S_SIMPLE_F = H5S_flags(2) + H5S_NULL_F = H5S_flags(3) + H5S_SELECT_SET_F = H5S_flags(4) + H5S_SELECT_OR_F = H5S_flags(5) + H5S_SELECT_NOOP_F = H5S_flags(6) + H5S_SELECT_AND_F = H5S_flags(7) + H5S_SELECT_XOR_F = H5S_flags(8) + H5S_SELECT_NOTB_F = H5S_flags(9) + H5S_SELECT_NOTA_F = H5S_flags(10) + H5S_SELECT_APPEND_F = H5S_flags(11) + H5S_SELECT_PREPEND_F = H5S_flags(12) + H5S_SELECT_INVALID_F = H5S_flags(13) + H5S_SEL_ERROR_F = H5S_flags(14) + H5S_SEL_NONE_F = H5S_flags(15) + H5S_SEL_POINTS_F = H5S_flags(16) + H5S_SEL_HYPERSLABS_F = H5S_flags(17) + H5S_SEL_ALL_F = H5S_flags(18) + ! + ! H5T flags declaration + ! + H5T_NO_CLASS_F = H5T_flags(1) + H5T_INTEGER_F = H5T_flags(2) + H5T_FLOAT_F = H5T_flags(3) + H5T_TIME_F = H5T_flags(4) + H5T_STRING_F = H5T_flags(5) + H5T_BITFIELD_F = H5T_flags(6) + H5T_OPAQUE_F = H5T_flags(7) + H5T_COMPOUND_F = H5T_flags(8) + H5T_REFERENCE_F = H5T_flags(9) + H5T_ENUM_F = H5T_flags(10) + H5T_ORDER_LE_F = H5T_flags(11) + H5T_ORDER_BE_F = H5T_flags(12) + H5T_ORDER_MIXED_F = H5T_flags(13) + H5T_ORDER_VAX_F = H5T_flags(14) + H5T_ORDER_NONE_F = H5T_flags(15) + H5T_PAD_ZERO_F = H5T_flags(16) + H5T_PAD_ONE_F = H5T_flags(17) + H5T_PAD_BACKGROUND_F = H5T_flags(18) + H5T_PAD_ERROR_F = H5T_flags(19) + H5T_SGN_NONE_F = H5T_flags(20) + H5T_SGN_2_F = H5T_flags(21) + H5T_SGN_ERROR_F = H5T_flags(22) + H5T_NORM_IMPLIED_F = H5T_flags(23) + H5T_NORM_MSBSET_F = H5T_flags(24) + H5T_NORM_NONE_F = H5T_flags(25) + H5T_CSET_ASCII_F = H5T_flags(26) + H5T_CSET_UTF8_F = H5T_flags(27) + H5T_STR_NULLTERM_F = H5T_flags(28) + H5T_STR_NULLPAD_F = H5T_flags(29) + H5T_STR_SPACEPAD_F = H5T_flags(30) + H5T_STR_ERROR_F = H5T_flags(31) + H5T_VLEN_F = H5T_flags(32) + H5T_ARRAY_F = H5T_flags(33) + H5T_DIR_ASCEND_F = H5T_flags(34) + H5T_DIR_DESCEND_F = H5T_flags(35) + ! + ! H5Z flags + ! + H5Z_FILTER_ERROR_F = H5Z_flags(1) + H5Z_FILTER_NONE_F = H5Z_flags(2) + H5Z_FILTER_DEFLATE_F = H5Z_flags(3) + H5Z_FILTER_SHUFFLE_F = H5Z_flags(4) + H5Z_FILTER_FLETCHER32_F = H5Z_flags(5) + H5Z_ERROR_EDC_F = H5Z_flags(6) + H5Z_DISABLE_EDC_F = H5Z_flags(7) + H5Z_ENABLE_EDC_F = H5Z_flags(8) + H5Z_NO_EDC_F = H5Z_flags(9) + H5Z_FILTER_SZIP_F = H5Z_flags(10) + H5Z_FLAG_OPTIONAL_F = H5Z_flags(11) + H5Z_FILTER_ENCODE_ENABLED_F = H5Z_flags(12) + H5Z_FILTER_DECODE_ENABLED_F = H5Z_flags(13) + H5Z_FILTER_ALL_F = H5Z_flags(14) + H5Z_FILTER_NBIT_F = H5Z_flags(15) + H5Z_FILTER_SCALEOFFSET_F = H5Z_flags(16) + H5Z_SO_FLOAT_DSCALE_F = H5Z_flags(17) + H5Z_SO_FLOAT_ESCALE_F = H5Z_flags(18) + H5Z_SO_INT_F = H5Z_flags(19) + H5Z_SO_INT_MINBITS_DEFAULT_F = H5Z_flags(20) + + error = error + h5init1_flags_c(H5LIB_flags) + ! + ! H5 Library flags + ! + H5_SZIP_EC_OM_F = H5LIB_flags(1) + H5_SZIP_NN_OM_F = H5LIB_flags(2) + END SUBROUTINE h5open_f !****s* H5LIB/h5close_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 629418a..be7195c 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -71,9 +71,9 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this - ! value when new predefined - ! datatypes are added + ! Do not forget to change this value when new predefined + ! datatypes are added + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change the following line when new predefined ! floating data types are added @@ -83,32 +83,56 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT, & - H5T_NATIVE_REAL_C_DOUBLE, & - H5T_NATIVE_REAL_C_LONG_DOUBLE, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE + ! These arrays need to be global because they are used in + ! both h5open_f and in h5close_f + INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types + INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types + INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + ! + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -116,139 +140,22 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard - EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(9), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(10), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(11), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_FLOAT) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_DOUBLE) - EQUIVALENCE (predef_types(14), H5T_NATIVE_REAL_C_LONG_DOUBLE) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(18), H5T_NATIVE_B64) - EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! + ! H5generic flags declaration ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + INTEGER(HADDR_T) :: HADDR_UNDEF_F ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -268,77 +175,9 @@ MODULE H5GLOBAL INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ - !DEC$endif - COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags - - INTEGER(HADDR_T) :: HADDR_UNDEF_F - - EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -353,35 +192,9 @@ MODULE H5GLOBAL INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F INTEGER :: H5G_STORAGE_TYPE_COMPACT_F INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -413,6 +226,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,81 +237,17 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F INTEGER :: H5D_VDS_LAST_AVAILABLE_F INTEGER :: H5D_VIRTUAL_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_VDS_ERROR_F) - EQUIVALENCE(H5D_flags(27), H5D_VDS_FIRST_MISSING_F) - EQUIVALENCE(H5D_flags(28), H5D_VDS_LAST_AVAILABLE_F) - EQUIVALENCE(H5D_flags(29), H5D_VIRTUAL_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - ! ! H5E flags declaration ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F INTEGER :: H5E_WALK_UPWARD_F INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - ! - ! H5FD flags declaration + ! H5FD file drivers flags declaration ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -509,28 +259,6 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -538,25 +266,9 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5FD_MULTI_F INTEGER(HID_T) :: H5FD_SEC2_F INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - ! ! H5I flags declaration ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -564,48 +276,18 @@ MODULE H5GLOBAL INTEGER :: H5I_DATASET_F INTEGER :: H5I_ATTR_F INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) ! ! H5L flags declaration ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F INTEGER :: H5L_TYPE_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! ! H5O flags declaration ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -633,45 +315,9 @@ MODULE H5GLOBAL INTEGER :: H5O_TYPE_DATASET_F INTEGER :: H5O_TYPE_NAMED_DATATYPE_F INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -691,72 +337,16 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5P_LINK_CREATE_F INTEGER(HID_T) :: H5P_LINK_ACCESS_F - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) ! ! H5R flags declaration ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HID_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HID_FLAGS/ H5S_hid_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -781,43 +371,9 @@ MODULE H5GLOBAL INTEGER :: H5S_SEL_POINTS_F INTEGER :: H5S_SEL_HYPERSLABS_F INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hid_flags(1), H5S_ALL_F) - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - - EQUIVALENCE(H5S_flags(6), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(7), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTA_F) - - EQUIVALENCE(H5S_flags(11), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_INVALID_F) - EQUIVALENCE(H5S_flags(14), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(15), H5S_SEL_NONE_F) - - EQUIVALENCE(H5S_flags(16), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -853,52 +409,9 @@ MODULE H5GLOBAL INTEGER :: H5T_STR_ERROR_F INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! - ! H5Z flags declaration + ! H5Z flags ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -919,58 +432,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_FLOAT_ESCALE_F INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - ! - ! H5 Library flags declaration + ! H5 Library flags ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) CONTAINS -- cgit v0.12 From c9b78a6714e6f7a781ab49b8ccecc022b3ef8529 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 14:23:01 -0700 Subject: misc. clean-up --- fortran/src/H5_ff.F90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index f875d0e..79ab280 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -638,7 +638,6 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & @@ -653,10 +652,9 @@ CONTAINS INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error = error_1 END SUBROUTINE h5close_f -- cgit v0.12 From a0d40002a3a06974d8643f9e4edc6d0c58bb9844 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 11:11:35 -0700 Subject: misc. code clean-up --- fortran/src/H5_ff.F90 | 140 ++++++++++++++++++++++---------------------- fortran/src/H5f90global.F90 | 11 ++-- 2 files changed, 75 insertions(+), 76 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index 79ab280..faa64a8 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -72,101 +72,101 @@ CONTAINS INTEGER, INTENT(OUT) :: error !***** ! - ! H5F flags + ! H5F flags declaration ! INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags ! - ! H5generic flags + ! H5generic flags declaration ! INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags ! - ! H5G flags + ! H5G flags declaration ! INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags ! - ! H5D flags + ! H5D flags declaration ! INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags ! - ! H5E flags + ! H5E flags declaration ! INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags ! - ! H5FD flags + ! H5FD flags declaration ! INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags ! - ! H5FD file drivers flags + ! H5FD file drivers flags declaration ! INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags ! - ! H5I flags + ! H5I flags declaration ! INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags ! - ! H5L flags + ! H5L flags declaration ! INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags ! - ! H5O flags + ! H5O flags declaration ! INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags ! - ! H5P flags + ! H5P flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags ! - ! H5P integers flags + ! H5P integers flags declaration ! INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int ! - ! H5R flags + ! H5R flags declaration ! INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags ! - ! H5S flags + ! H5S flags declaration ! INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags ! - ! H5T flags + ! H5T flags declaration ! INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags ! - ! H5Z flags + ! H5Z flags declaration ! INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags ! - ! H5 Library flags + ! H5 Library flags declaration ! INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags INTERFACE INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & @@ -174,9 +174,9 @@ CONTAINS IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c END INTERFACE INTERFACE @@ -211,27 +211,27 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HID_T) i_H5S_hid_flags(H5S_HID_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c END INTERFACE INTERFACE @@ -239,7 +239,7 @@ CONTAINS BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c END INTERFACE @@ -644,12 +644,12 @@ CONTAINS i_types, I_TYPES_LEN ) & BIND(C,NAME='h5close_types_c') IMPORT :: HID_T - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + INTEGER :: P_TYPES_LEN + INTEGER :: F_TYPES_LEN + INTEGER :: I_TYPES_LEN + INTEGER(HID_T), DIMENSION(1:P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index be7195c..ee8959e 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -50,7 +50,6 @@ MODULE H5GLOBAL END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -85,9 +84,9 @@ MODULE H5GLOBAL ! These arrays need to be global because they are used in ! both h5open_f and in h5close_f - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types ! INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE @@ -410,7 +409,7 @@ MODULE H5GLOBAL INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F ! - ! H5Z flags + ! H5Z flags declaration ! INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F @@ -433,7 +432,7 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F ! - ! H5 Library flags + ! H5 Library flags declaration ! INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F -- cgit v0.12 From 51bb1d431a494937e7e01a3726f7646cd51fae24 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 20:39:35 -0700 Subject: added public, private --- fortran/src/H5_ff.F90 | 208 +++++++++++++++++++++++++------------------------- 1 file changed, 106 insertions(+), 102 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index faa64a8..a7749f4 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -42,6 +42,107 @@ MODULE H5LIB USE H5GLOBAL IMPLICIT NONE + PRIVATE + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags + ! + ! H5D flags declaration + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags + + PUBLIC :: h5open_f, h5close_f, h5get_libversion_f, h5dont_atexit_f, h5kind_to_type, h5offsetof + PUBLIC :: h5garbage_collect_f, h5check_version_f + CONTAINS !****s* H5LIB/h5open_f ! @@ -71,104 +172,8 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - ! - ! H5F flags declaration - ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags - ! - ! H5G flags declaration - ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags - ! - ! H5D flags declaration - ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags - ! - ! H5E flags declaration - ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags - ! - ! H5FD flags declaration - ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags - ! - ! H5I flags declaration - ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags - ! - ! H5L flags declaration - ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags - ! - ! H5O flags declaration - ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags - ! - ! H5P flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int - ! - ! H5R flags declaration - ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags - ! - ! H5S flags declaration - ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags - ! - ! H5T flags declaration - ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags - ! - ! H5Z flags declaration - ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags - ! - ! H5 Library flags declaration - ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags - INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & BIND(C,NAME='h5init_types_c') IMPORT :: HID_T @@ -178,8 +183,7 @@ CONTAINS INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & i_H5D_size_flags,& i_H5E_flags, & @@ -233,16 +237,16 @@ CONTAINS INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c - END INTERFACE + END INTERFACE + error = h5init_types_c(predef_types, floating_types, integer_types) H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) -- cgit v0.12 From bdd2d3a1beef336e1835332763b9711d2fb31a8c Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 20 Nov 2017 21:01:43 -0700 Subject: misc clean-up --- fortran/src/H5_ff.F90 | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index a7749f4..db57f03 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -123,7 +123,7 @@ MODULE H5LIB INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags ! ! H5T flags declaration ! @@ -166,7 +166,7 @@ CONTAINS ! ! Removed call to h5open_c since this may cause a problem for an ! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 +! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) IMPLICIT NONE @@ -179,9 +179,9 @@ CONTAINS IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & @@ -215,26 +215,26 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags - INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags - INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags - INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags - INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags - INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags - INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags - INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags - INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags - INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags - INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags - INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags - INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int - INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags - INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags - INTEGER(HID_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags - INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags - INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags - INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags - INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER , DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T) , DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER , DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER , DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER , DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T) , DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER , DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER , DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER , DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T) , DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER , DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER , DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER , DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c -- cgit v0.12 From 8cb45292110453354afd78b7cf1da50db2341014 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Nov 2017 18:13:18 -0800 Subject: Fixed misc Warnings flagged by VS2017. --- examples/h5_cmprss.c | 1 - src/H5Dio.c | 4 +- src/H5MF.c | 5 +- src/H5Tdbg.c | 227 +++++++++++++++++++++++++-------------------------- src/H5system.c | 2 +- test/cache_tagging.c | 13 +-- test/tarray.c | 24 +++--- test/tattr.c | 14 ++-- test/tchecksum.c | 2 +- test/testhdf5.h | 1 + test/tfile.c | 6 +- test/th5o.c | 4 +- test/theap.c | 30 +++---- test/tid.c | 18 ++-- test/titerate.c | 18 ++-- test/tmisc.c | 36 ++++---- test/trefstr.c | 26 +++--- test/tselect.c | 130 ++++++++++++++--------------- test/tskiplist.c | 142 ++++++++++++++++---------------- test/ttst.c | 18 ++-- test/tvltypes.c | 6 +- 21 files changed, 364 insertions(+), 363 deletions(-) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index ebc7712..b51ec44 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -36,7 +36,6 @@ int main () { hsize_t dims[2]; hsize_t cdims[2]; - int idx; int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; diff --git a/src/H5Dio.c b/src/H5Dio.c index 104a632..280d602 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -962,7 +962,9 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -done: +#ifdef H5_DEBUG_BUILD + done: +#endif /* H5_DEBUG_BUILD */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_init() */ diff --git a/src/H5MF.c b/src/H5MF.c index 49c7b77..7e06654 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3247,7 +3247,6 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5FS_stat_t fs_stat; /* Information for hdr FSM */ H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t reset_ring = FALSE; /* Whether we set the ring */ @@ -3310,6 +3309,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) reset_ring = TRUE; #ifndef NDEBUG +{ + H5FS_stat_t fs_stat; /* Information for hdr FSM */ + /* Verify that sm_hdr_fspace is floating if it exists */ if(sm_hdr_fspace) { /* Query free space manager info for this type */ @@ -3357,6 +3359,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ +} #endif /* NDEBUG */ /* Free the space in the metadata aggregator. Do this via the diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index f434543..eb648f3 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -32,9 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -74,28 +74,21 @@ /*------------------------------------------------------------------------- - * Function: H5T__print_stats + * Function: H5T__print_stats * - * Purpose: Print statistics about a conversion path. Statistics are - * printed only if all the following conditions are true: + * Purpose: Print statistics about a conversion path. Statistics are + * printed only if all the following conditions are true: * - * 1. The library was compiled with H5T_DEBUG defined. - * 2. Data type debugging is turned on at run time. - * 3. The path was called at least one time. + * 1. The library was compiled with H5T_DEBUG defined. + * 2. Data type debugging is turned on at run time. + * 3. The path was called at least one time. * - * The optional NPRINT argument keeps track of the number of - * conversions paths for which statistics have been shown. If - * its value is zero then table headers are printed before the - * first line of output. + * The optional NPRINT argument keeps track of the number of + * conversions paths for which statistics have been shown. If + * its value is zero then table headers are printed before the + * first line of output. * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Robb Matzke - * Monday, December 14, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -110,34 +103,34 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG - if(H5DEBUG(T) && path->stats.ncalls > 0) { - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } - if(path->src && path->dst) + if (H5DEBUG(T) && path->stats.ncalls > 0) { + if (nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } + if (path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); - else if(path->src) + else if (path->src) nbytes = H5T_get_size(path->src); - else if(path->dst) + else if (path->dst) nbytes = H5T_get_size(path->dst); else nbytes = 0; - nbytes *= path->stats.nelmts; - H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, - path->stats.timer.etime, - bandwidth); + nbytes *= path->stats.nelmts; + H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); + HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", + path->name, + path->stats.nelmts, + path->stats.ncalls, + path->stats.timer.utime, + path->stats.timer.stime, + path->stats.timer.etime, + bandwidth); } #endif FUNC_LEAVE_NOAPI(SUCCEED) @@ -145,24 +138,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* /*------------------------------------------------------------------------- - * Function: H5T_debug - * - * Purpose: Prints information about a data type. + * Function: H5T_debug * - * Return: Non-negative on success/Negative on failure + * Purpose: Prints information about a data type. * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5T_debug(const H5T_t *dt, FILE *stream) { - const char *s1 = "", *s2 = ""; - unsigned i; + const char *s1 = ""; + const char *s2 = ""; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -171,7 +160,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDassert(dt); HDassert(stream); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -221,9 +210,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = ""; break; - } /* end switch */ + } /* end switch */ - switch(dt->shared->state) { + switch (dt->shared->state) { case H5T_STATE_TRANSIENT: s2 = "[transient]"; break; @@ -245,14 +234,14 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; default: HDassert(0 && "This Should never be executed!"); - } /* end switch */ + } /* end switch */ - fprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); + HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); - if(H5T_IS_ATOMIC(dt->shared)) { - uint64_t tmp; + if (H5T_IS_ATOMIC(dt->shared)) { + uint64_t tmp; - switch(dt->shared->u.atomic.order) { + switch (dt->shared->u.atomic.order) { case H5T_ORDER_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "order error"); break; @@ -277,17 +266,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = "order?"; break; - } /* end switch */ + } /* end switch */ + + HDfprintf(stream, ", %s", s1); - fprintf(stream, ", %s", s1); + if (dt->shared->u.atomic.offset) + HDfprintf(stream, ", offset=%lu", (unsigned long) (dt->shared->u.atomic.offset)); + if (dt->shared->u.atomic.prec != 8 * dt->shared->size) + HDfprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); - if(dt->shared->u.atomic.offset) - fprintf(stream, ", offset=%lu", - (unsigned long) (dt->shared->u.atomic.offset)); - if(dt->shared->u.atomic.prec != 8 * dt->shared->size) - fprintf(stream, ", prec=%lu", - (unsigned long) (dt->shared->u.atomic.prec)); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -313,7 +301,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end switch */ if(s1) - fprintf(stream, ", %s", s1); + HDfprintf(stream, ", %s", s1); break; case H5T_FLOAT: @@ -339,23 +327,24 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - fprintf(stream, ", sign=%lu+1", + HDfprintf(stream, ", sign=%lu+1", (unsigned long)(dt->shared->u.atomic.u.f.sign)); - fprintf(stream, ", mant=%lu+%lu (%s)", + HDfprintf(stream, ", mant=%lu+%lu (%s)", (unsigned long)(dt->shared->u.atomic.u.f.mpos), (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); - fprintf(stream, ", exp=%lu+%lu", + HDfprintf(stream, ", exp=%lu+%lu", (unsigned long)(dt->shared->u.atomic.u.f.epos), (unsigned long)(dt->shared->u.atomic.u.f.esize)); tmp = dt->shared->u.atomic.u.f.ebias >> 32; - if(tmp) { + if (tmp) { size_t hi = (size_t)tmp; size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx%08lx", + HDfprintf(stream, " bias=0x%08lx%08lx", (unsigned long)hi, (unsigned long)lo); - } else { + } + else { size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx", (unsigned long)lo); + HDfprintf(stream, " bias=0x%08lx", (unsigned long)lo); } break; @@ -372,69 +361,73 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: /* No additional info */ break; - } /* end switch */ - } else if(H5T_COMPOUND == dt->shared->type) { - /* Compound data type */ - for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - fprintf(stream, "\n\"%s\" @%lu", - dt->shared->u.compnd.memb[i].name, - (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - fprintf(stream, " "); - H5T_debug(dt->shared->u.compnd.memb[i].type, stream); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_VLEN == dt->shared->type) { - switch(dt->shared->u.vlen.loc) { + } /* end switch */ + } + else if (H5T_COMPOUND == dt->shared->type) { + /* Compound data type */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + HDfprintf(stream, "\n\"%s\" @%lu", + dt->shared->u.compnd.memb[i].name, + (unsigned long)(dt->shared->u.compnd.memb[i].offset)); + HDfprintf(stream, " "); + H5T_debug(dt->shared->u.compnd.memb[i].type, stream); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_VLEN == dt->shared->type) { + switch (dt->shared->u.vlen.loc) { case H5T_LOC_BADLOC: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype location"); break; case H5T_LOC_MEMORY: - fprintf(stream, ", loc=memory"); + HDfprintf(stream, ", loc=memory"); break; case H5T_LOC_DISK: - fprintf(stream, ", loc=disk"); + HDfprintf(stream, ", loc=disk"); break; case H5T_LOC_MAXLOC: default: - fprintf(stream, ", loc=UNKNOWN"); + HDfprintf(stream, ", loc=UNKNOWN"); break; } /* end switch */ - if(H5T_IS_VL_STRING(dt->shared)) + if (H5T_IS_VL_STRING(dt->shared)) /* Variable length string datatype */ - fprintf(stream, ", variable-length"); + HDfprintf(stream, ", variable-length"); else { /* Variable length sequence datatype */ - fprintf(stream, " VLEN "); + HDfprintf(stream, " VLEN "); H5T_debug(dt->shared->parent, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end else */ - } else if(H5T_ENUM == dt->shared->type) { + } + else if (H5T_ENUM == dt->shared->type) { size_t base_size; - /* Enumeration data type */ - fprintf(stream, " "); - H5T_debug(dt->shared->parent, stream); - base_size = dt->shared->parent->shared->size; - for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { + /* Enumeration data type */ + HDfprintf(stream, " "); + H5T_debug(dt->shared->parent, stream); + base_size = dt->shared->parent->shared->size; + for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { size_t k; - fprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); - for(k = 0; k < base_size; k++) - fprintf(stream, "%02lx", - (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_OPAQUE == dt->shared->type) { - fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); - } else { - /* Unknown */ - fprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); + HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); + for (k = 0; k < base_size; k++) + HDfprintf(stream, "%02lx", (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_OPAQUE == dt->shared->type) { + HDfprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); + } + else { + /* Unknown */ + HDfprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); } - fprintf(stream, "}"); + HDfprintf(stream, "}"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5system.c b/src/H5system.c index a1cdf19..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -977,7 +977,7 @@ Wround(double arg) float Wroundf(float arg) { - return arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F); + return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); } #endif /* H5_HAVE_WIN32_API */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 99ab49c..9c79968 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3631,11 +3631,14 @@ error: static unsigned check_invalid_tag_application(void) { +#if H5C_DO_TAGGING_SANITY_CHECKS /* Variables */ H5F_t * f = NULL; - hid_t fid, dxpl_id = -1; + hid_t fid = -1; + hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); @@ -3683,8 +3686,8 @@ check_invalid_tag_application(void) PASSED(); #else SKIPPED(); - printf(" test skipped because sanity checking on tag value is disabled.\n"); -#endif + HDprintf(" test skipped because sanity checking on tag value is disabled.\n"); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 0; @@ -3791,10 +3794,10 @@ main(void) HDremove(FILENAME2); /* Return Errors */ - return(nerrs > 0); + return nerrs > 0; error: /* Return with Error */ - return(1); + return 1; } /* main */ diff --git a/test/tarray.c b/test/tarray.c index a35b8a3..b2e0ee7 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -679,7 +679,7 @@ test_array_compound_atomic(void) /* Check the 1st field's name */ mname = H5Tget_member_name(tid2, 0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "i") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -698,7 +698,7 @@ test_array_compound_atomic(void) /* Check the 2nd field's name */ mname = H5Tget_member_name(tid2, 1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "f") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -897,7 +897,7 @@ test_array_compound_array(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid2,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -916,7 +916,7 @@ test_array_compound_array(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid2,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1604,7 +1604,7 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK(dtsinfo, NULL, "HDmalloc"); + CHECK_PTR(dtsinfo, "HDmalloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1927,7 +1927,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1946,7 +1946,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1965,7 +1965,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -2009,7 +2009,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2028,7 +2028,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2073,7 +2073,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2118,7 +2118,7 @@ test_compat(void) /* Check the 4th field's name */ mname=H5Tget_member_name(tid1,3); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"d")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); diff --git a/test/tattr.c b/test/tattr.c index 3786d0d..2d333e9 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -277,7 +277,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -313,7 +313,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -6862,7 +6862,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK(visited, NULL, "HDmalloc"); + CHECK_PTR(visited, "HDmalloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -8040,7 +8040,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8371,7 +8371,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8817,7 +8817,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9186,7 +9186,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ diff --git a/test/tchecksum.c b/test/tchecksum.c index febaacc..ffbab45 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -187,7 +187,7 @@ test_chksum_large(void) /* Allocate the buffer */ large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK(large_buf, NULL, "HDmalloc"); + CHECK_PTR(large_buf, "HDmalloc"); /* Initialize buffer w/known data */ for(u = 0; u < BUF_LEN; u++) diff --git a/test/testhdf5.h b/test/testhdf5.h index 2cbe6c6..41675cf 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -54,6 +54,7 @@ } \ } +/* Check that a pointer is valid (i.e.: not NULL) */ #define CHECK_PTR(ret,where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..80ba4da 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1072,7 +1072,7 @@ test_get_obj_ids(void) VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1135,7 +1135,7 @@ test_get_obj_ids(void) VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -2667,7 +2667,7 @@ cal_chksum(const char *file, uint32_t *chksum) /* Allocate space for the file data */ file_data = HDmalloc((size_t)sb.st_size); - CHECK(file_data, NULL, "HDmalloc"); + CHECK_PTR(file_data, "HDmalloc"); if(file_data) { /* Read file's data into memory */ diff --git a/test/th5o.c b/test/th5o.c index 4baac20..144ea4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -783,9 +783,9 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); /* Initialize the raw data */ for(i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) diff --git a/test/theap.c b/test/theap.c index 3c23025..cdb423e 100644 --- a/test/theap.c +++ b/test/theap.c @@ -88,11 +88,11 @@ test_heap_init(void) /* Allocate arrays */ rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(rand_num, NULL, "HDmalloc"); + CHECK_PTR(rand_num, "HDmalloc"); inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(inc_sort_num, NULL, "HDmalloc"); + CHECK_PTR(inc_sort_num, "HDmalloc"); dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(dec_sort_num, NULL, "HDmalloc"); + CHECK_PTR(dec_sort_num, "HDmalloc"); /* Create randomized set of numbers */ curr_time = HDtime(NULL); @@ -127,7 +127,7 @@ test_heap_create(void) /* Try creating a maximum Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -135,7 +135,7 @@ test_heap_create(void) /* Try creating a minimum Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -163,7 +163,7 @@ test_heap_insert_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -237,7 +237,7 @@ test_heap_insert_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -325,7 +325,7 @@ test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, i /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -405,7 +405,7 @@ test_heap_remove_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -479,7 +479,7 @@ test_heap_remove_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -567,7 +567,7 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -714,7 +714,7 @@ test_heap_change_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -788,7 +788,7 @@ test_heap_change_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -880,7 +880,7 @@ test_heap_incdec_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -955,7 +955,7 @@ test_heap_incdec_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); diff --git a/test/tid.c b/test/tid.c index 494ee60..375ef69 100644 --- a/test/tid.c +++ b/test/tid.c @@ -57,7 +57,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -65,7 +65,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -118,7 +118,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -126,14 +126,14 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; /* Remove an ID and make sure we can't access it */ testPtr = (int*) H5Iremove_verify(arrayID, myType); - CHECK(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR(testPtr, "H5Iremove_verify"); if(testPtr == NULL) goto out; @@ -141,7 +141,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iobject_verify(arrayID, myType); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -263,7 +263,7 @@ static int id_predefined_test(void ) testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Isearch"); + CHECK_PTR_NULL(testPtr, "H5Isearch"); if(testPtr != NULL) goto out; @@ -301,7 +301,7 @@ static int id_predefined_test(void ) testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -309,7 +309,7 @@ static int id_predefined_test(void ) testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; diff --git a/test/titerate.c b/test/titerate.c index aad62c9..231bd2e 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -159,7 +159,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Keep a copy of the dataset names around for later */ lnames[i] = HDstrdup(name); - CHECK(lnames[i], NULL, "strdup"); + CHECK_PTR(lnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -170,13 +170,13 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Gcreate2"); lnames[NDATASETS] = HDstrdup("grp"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); lnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -412,7 +412,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) /* Keep a copy of the attribute names around for later */ anames[i] = HDstrdup(name); - CHECK(anames[i], NULL, "strdup"); + CHECK_PTR(anames[i], "strdup"); ret = H5Aclose(attribute); CHECK(ret, FAIL, "H5Aclose"); @@ -596,7 +596,7 @@ test_iter_group_large(hid_t fapl) /* Allocate & initialize array */ names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK(names, NULL, "HDcalloc"); + CHECK_PTR(names, "HDcalloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -733,7 +733,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ dnames[i] = HDstrdup(name); - CHECK(dnames[i], NULL, "strdup"); + CHECK_PTR(dnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -744,13 +744,13 @@ static void test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Gcreate2"); dnames[NDATASETS] = HDstrdup("grp"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); dnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -797,7 +797,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ obj_names[i] = HDstrdup(dataset_name); - CHECK(obj_names[i], NULL, "strdup"); + CHECK_PTR(obj_names[i], "strdup"); ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_idx"); diff --git a/test/tmisc.c b/test/tmisc.c index 6da4589..f0e595b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -723,7 +723,7 @@ create_struct3(void) herr_t ret; /* For error checking */ str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); - CHECK(str3hndl,NULL,"malloc"); + CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate"); @@ -766,7 +766,7 @@ create_struct2(void) herr_t ret; /* For error checking */ str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK(str2hndl, NULL, "malloc"); + CHECK_PTR(str2hndl, "HDmalloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -775,7 +775,7 @@ create_struct2(void) CHECK(ret, FAIL, "H5Tinsert"); str2hndl->st2h_st3hndl = create_struct3(); - CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); + CHECK_PTR(str2hndl->st2h_st3hndl, "create_struct3"); ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -811,7 +811,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el2.len = MISC5_DBGNELM3; buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); - CHECK(buf->st2_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st2_el2.p, "HDmalloc"); for(i=0; i<(buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -832,7 +832,7 @@ create_struct1(void) herr_t ret; /* For error checking */ str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK(str1hndl, NULL, "malloc"); + CHECK_PTR(str1hndl, "HDmalloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -841,7 +841,7 @@ create_struct1(void) CHECK(ret, FAIL, "H5Tinsert"); str1hndl->st1h_st2hndl=create_struct2(); - CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); + CHECK_PTR(str1hndl->st1h_st2hndl, "create_struct2"); ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -877,7 +877,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el2.len=MISC5_DBGNELM2; buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); - CHECK(buf->st1_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st1_el2.p, "HDmalloc"); for(i=0; i<(buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -913,7 +913,7 @@ test_misc5(void) /* Create the memory structure to write */ str1hndl = create_struct1(); - CHECK(str1hndl, NULL, "create_struct1"); + CHECK_PTR(str1hndl, "create_struct1"); /* Create the dataspace */ dims[0] = MISC5_NELMTOPLVL; @@ -927,7 +927,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK(buf.p, NULL, "malloc"); + CHECK_PTR(buf.p, "HDmalloc"); /* Create the top-level VL information */ for(i = 0; i < MISC5_DBGNELM1; i++) @@ -1253,10 +1253,10 @@ test_misc8(void) /* Allocate space for the data to write & read */ wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(wdata,NULL,"malloc"); + CHECK_PTR(wdata, "HDmalloc"); #ifdef VERIFY_DATA rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(rdata,NULL,"malloc"); + CHECK_PTR(rdata, "HDmalloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -2144,7 +2144,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) /* Create a data buffer for the dataset read */ read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(read_data, NULL, "HDcalloc"); + CHECK_PTR(read_data, "HDcalloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2270,14 +2270,14 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Allocate space for the user block */ user_block = HDcalloc(size, (size_t)1); - CHECK(user_block, NULL, "HDcalloc"); + CHECK_PTR(user_block, "HDcalloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, strlen(str)); /* Open the new file */ new_fp = HDfopen(new_name,"wb"); - CHECK(new_fp, NULL, "HDfopen"); + CHECK_PTR(new_fp, "HDfopen"); /* Write the user block to the new file */ written = HDfwrite(user_block, (size_t)1, size, new_fp); @@ -2285,11 +2285,11 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Open the old file */ old_fp = HDfopen(old_name,"rb"); - CHECK(old_fp, NULL, "HDfopen"); + CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK(copy_buf, NULL, "HDmalloc"); + CHECK_PTR(copy_buf, "HDmalloc"); /* Copy data from the old file to the new file */ while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2439,7 +2439,7 @@ test_misc13(void) /* Create a data buffer for the datasets */ data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(data, NULL, "HDcalloc"); + CHECK_PTR(data, "HDcalloc"); /* Initialize data to write */ misc13_init_data(data); @@ -3446,7 +3446,7 @@ test_misc19(void) /* Get a VFD class to register */ vfd_cls = h5_get_dummy_vfd_class(); - CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + CHECK_PTR(vfd_cls, "h5_get_dummy_vfd_class"); /* Register a virtual file driver */ vfdid = H5FDregister(vfd_cls); diff --git a/test/trefstr.c b/test/trefstr.c index 40ce344..f55ede0 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -67,7 +67,7 @@ test_refstr_create(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -97,7 +97,7 @@ test_refstr_count(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -144,7 +144,7 @@ test_refstr_dup(void) /* Try creating a ref-counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs1); @@ -152,7 +152,7 @@ test_refstr_dup(void) /* Duplicate r-string */ rs2=H5RS_dup(rs1); - CHECK(rs2, NULL, "H5RS_dup"); + CHECK_PTR(rs2, "H5RS_dup"); /* Get the reference count on the strings */ count=H5RS_get_count(rs1); @@ -194,11 +194,11 @@ test_refstr_cmp(void) /* Create first reference counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Create second reference counted string */ rs2=H5RS_create("foo2"); - CHECK(rs2, NULL, "H5RS_create"); + CHECK_PTR(rs2, "H5RS_create"); /* Compare the strings in various ways */ cmp=H5RS_cmp(rs1,rs1); @@ -246,11 +246,11 @@ test_refstr_wrap(void) /* Wrap ref-counted string around existing buffer */ rs=H5RS_wrap(buf); - CHECK(rs, NULL, "H5RS_wrap"); + CHECK_PTR(rs, "H5RS_wrap"); /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); VERIFY(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -264,7 +264,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); CHECK(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); if(cmp<=0) @@ -299,16 +299,16 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK(s, NULL, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ rs=H5RS_own(s); - CHECK(rs, NULL, "H5RS_own"); + CHECK_PTR(rs, "H5RS_own"); /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -322,7 +322,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tselect.c b/test/tselect.c index 85c21bb..2022a11 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -228,9 +228,9 @@ test_select_hyper(hid_t xfer_plist) /* Allocate write & read buffers */ wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK(wbuf, NULL, "HDmalloc"); + CHECK_PTR(wbuf, "HDmalloc"); rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK(rbuf, NULL, "HDcalloc"); + CHECK_PTR(rbuf, "HDcalloc"); /* Initialize write buffer */ for(i=0, tbuf=wbuf; islist, &j); - CHECK(obj_ret, NULL, "H5SL_remove"); + CHECK_PTR(obj_ret, "H5SL_remove"); obj_ret->nfrees++; obj_list->nobjs_rem--; } /* end else */ @@ -1324,7 +1324,7 @@ test_skiplist_try_free_safe(void) /* Create a skip list */ obj_list.slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(obj_list.slist, NULL, "H5SL_create"); + CHECK_PTR(obj_list.slist, "H5SL_create"); /* Init obj_list.list */ obj_list.list = list; @@ -1396,7 +1396,7 @@ test_skiplist_less(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u=0; u<10; u++) { @@ -1430,7 +1430,7 @@ test_skiplist_less(void) VERIFY(*found_item,5,"H5SL_less"); find_item=4; found_item=(unsigned *)H5SL_less(slist,&find_item); - VERIFY(found_item,NULL,"H5SL_less"); + CHECK_PTR_NULL(found_item, "H5SL_less"); /* Close the skip list */ ret=H5SL_close(slist); @@ -1460,7 +1460,7 @@ test_skiplist_greater(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1488,7 +1488,7 @@ test_skiplist_greater(void) VERIFY(*found_item, 90, "H5SL_greater"); find_item = 100; found_item = (unsigned *)H5SL_greater(slist, &find_item); - VERIFY(found_item, NULL, "H5SL_greater"); + CHECK_PTR_NULL(found_item, "H5SL_greater"); find_item = 6; found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 10, "H5SL_greater"); @@ -1525,7 +1525,7 @@ test_skiplist_below(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1536,44 +1536,44 @@ test_skiplist_below(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 90; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 5; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); /* Find item less than a missing key, in various positions */ find_item = 19; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 15, "H5SL_below"); find_item = 89; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 80, "H5SL_below"); find_item = 100; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_below"); find_item = 9; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_below"); find_item = 4; node = (H5SL_node_t *)H5SL_less(slist, &find_item); - VERIFY(node, NULL, "H5SL_below"); + CHECK_PTR_NULL(node, "H5SL_below"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1604,7 +1604,7 @@ test_skiplist_above(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1615,42 +1615,42 @@ test_skiplist_above(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 90; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 5; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); /* Find item greater than a missing key, in various positions */ find_item = 19; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 20, "H5SL_above"); find_item = 89; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_above"); find_item = 100; node = H5SL_above(slist, &find_item); - VERIFY(node, NULL, "H5SL_above"); + CHECK_PTR_NULL(node, "H5SL_above"); find_item = 6; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 10, "H5SL_above"); find_item = 4; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_above"); @@ -1681,7 +1681,7 @@ test_skiplist_remove_first(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1697,7 +1697,7 @@ test_skiplist_remove_first(void) /* Check for removing object from empty list */ found_item = (unsigned *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1725,7 +1725,7 @@ test_skiplist_remove_first_many(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < NUM_ELEMS; u++) { @@ -1742,7 +1742,7 @@ test_skiplist_remove_first_many(void) /* Check for removing object from empty list */ found_item = (int *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); diff --git a/test/ttst.c b/test/ttst.c index b26d582..c5912c5 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -157,7 +157,7 @@ test_tst_create(void) /* Try creating a TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Try closing a real tree */ ret=H5ST_close(tree); @@ -186,7 +186,7 @@ test_tst_insert(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,uniq_words[u])) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]); obj=H5ST_locate(tree,uniq_words[u]); - CHECK(obj, NULL, "H5ST_locate"); + CHECK_PTR(obj, "H5ST_locate"); if(HDstrcmp((const char *)obj,uniq_words[u])) TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]); @@ -246,7 +246,7 @@ test_tst_iterate(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,rand_uniq_words[u])) diff --git a/test/tvltypes.c b/test/tvltypes.c index 5121a66..0c4cb9d 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1015,9 +1015,9 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); for(i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; @@ -2503,7 +2503,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK(rbuf, NULL, "HDmalloc"); + CHECK_PTR(rbuf, "HDmalloc"); /* Create the small & large dataspaces to use */ -- cgit v0.12 From 856e475c47ffd66668d2f868817357b4354f164b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 08:57:26 -0800 Subject: Added CHECK_PTR_EQ macro to testhdf5 to quiet cast warnings on Windows. --- test/testhdf5.h | 208 +++++++++++++++++---------------- test/theap.c | 12 +- test/tid.c | 342 ++++++++++++++++++++++++++++--------------------------- test/trefstr.c | 6 +- test/tskiplist.c | 14 +-- 5 files changed, 300 insertions(+), 282 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 41675cf..6244524 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -30,131 +30,147 @@ /* Use %ld to print the value because long should cover most cases. */ /* Used to make certain a return value _is_not_ a value */ -#define CHECK(ret, val, where) do { \ - if (VERBOSE_HI) print_func(" Call to routine: %15s at line %4d " \ - "in %s returned %ld \n", \ - where, (int)__LINE__, __FILE__, \ - (long)(ret)); \ - if ((ret) == (val)) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK(ret, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d " \ + "in %s returned %ld \n", \ + where, (int)__LINE__, __FILE__, \ + (long)(ret)); \ + } \ + if ((ret) == (val)) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) -#define CHECK_I(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ - (where), (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if ((ret)<0) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ - (where), (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_I(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ + (where), (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if ((ret)<0) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ + (where), (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Check that a pointer is valid (i.e.: not NULL) */ -#define CHECK_PTR(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (!(ret)) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_PTR(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (!(ret)) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } -#define CHECK_PTR_NULL(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (ret) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +/* Check that a pointer is NULL */ +#define CHECK_PTR_NULL(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ +} + +/* Check that two pointers are equal */ +#define CHECK_PTR_EQ(ret, val, where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret != val) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ + (where), ret, val, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Used to make certain a return value _is_ a value */ -#define VERIFY(_x, _val, where) do { \ - long __x = (long)_x, __val = (long)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY(_x, _val, where) do { \ + long __x = (long)_x, __val = (long)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a (non-'long' type's) return value _is_ a value */ -#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ - _type __x = (_type)_x, __val = (_type)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - _format " \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ + _type __x = (_type)_x, __val = (_type)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + _format " \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a string return value _is_ a value */ -#define VERIFY_STR(x, val, where) do { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%s \n", (where), (int)__LINE__, __FILE__, x); \ - } \ - if (HDstrcmp(x, val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ - "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_STR(x, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%s \n", (where), (int)__LINE__, __FILE__, x); \ + } \ + if (HDstrcmp(x, val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ + "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test and to check for errors */ -#define RESULT(ret,func) do { \ - if (VERBOSE_MED) { \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if (VERBOSE_HI) \ - H5Eprint2(H5E_DEFAULT, stdout); \ - if ((ret) == FAIL) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define RESULT(ret,func) do { \ + if (VERBOSE_MED) { \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if (VERBOSE_HI) \ + H5Eprint2(H5E_DEFAULT, stdout); \ + if ((ret) == FAIL) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test */ #if defined(H5_HAVE_PARALLEL) && defined(H5_PARALLEL_TEST) -#define MESSAGE(V,A) { \ - int mpi_rank; \ - \ - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ - if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ - print_func A ; \ +#define MESSAGE(V,A) { \ + int mpi_rank; \ + \ + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ + if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ + print_func A ; \ } #else /* H5_HAVE_PARALLEL */ #define MESSAGE(V,A) {if (HDGetTestVerbosity() > (V)) print_func A;} #endif /* H5_HAVE_PARALLEL */ /* Used to indicate an error that is complex to check for */ -#define ERROR(where) do { \ - if(VERBOSE_HI) \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ - where, (int)__LINE__, __FILE__); \ +#define ERROR(where) do { \ + if(VERBOSE_HI) \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "invalid result\n", where, (int)__LINE__, __FILE__); \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ + where, (int)__LINE__, __FILE__); \ } while(0) /* definitions for command strings */ diff --git a/test/theap.c b/test/theap.c index cdb423e..7b2fadb 100644 --- a/test/theap.c +++ b/test/theap.c @@ -434,19 +434,19 @@ test_heap_remove_min(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); @@ -508,19 +508,19 @@ test_heap_remove_max(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); diff --git a/test/tid.c b/test/tid.c index 375ef69..7d6757f 100644 --- a/test/tid.c +++ b/test/tid.c @@ -16,223 +16,225 @@ #include "testhdf5.h" #include "hdf5.h" - /* Include H5Ipkg.h to calculate max number of groups */ +/* Include H5Ipkg.h to calculate max number of groups */ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" - /* Test basic functionality of registering and deleting types and IDs */ +/* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { - H5I_type_t myType = H5I_BADID; - hid_t arrayID = H5I_INVALID_HID; - void* testObj = NULL; - void* testPtr = NULL; - char nameString[10]; - hid_t testID; - ssize_t testSize = -1; - herr_t err; - int num_ref; - hsize_t num_members; - + H5I_type_t myType = H5I_BADID; + hid_t arrayID = H5I_INVALID_HID; + void* testObj = NULL; + void* testPtr = NULL; + char nameString[10]; + hid_t testID; + ssize_t testSize = -1; + herr_t err; + int num_ref; + hsize_t num_members; + + + /* Try to register an ID with ficticious types */ + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) 420, testObj); + H5E_END_TRY - /* Try to register an ID with ficticious types */ - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) 420, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) -1, testObj); + H5E_END_TRY - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) -1, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + /* Try to access IDs with ficticious types */ + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); + H5E_END_TRY - /* Try to access IDs with ficticious types */ - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Register a type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + /* Register an ID and retrieve the object it points to. + * Once the ID has been registered, testObj will be freed when + * its ID type is destroyed. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - /* Register an ID and retrieve the object it points to. - * Once the ID has been registered, testObj will be freed when - * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + testPtr = (int *)H5Iobject_verify(arrayID, myType); - testPtr = (int *) H5Iobject_verify(arrayID, myType); + CHECK_PTR_EQ(testPtr, testObj, "H5Iobject_verify"); + if(testPtr != testObj) + goto out; - VERIFY(testPtr, testObj, "H5Iobject_verify"); - if(testPtr != testObj) - goto out; + /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this + * is an hid_t for the wrong kind of object + */ + H5E_BEGIN_TRY + testID = H5Iget_file_id(arrayID); + H5E_END_TRY - /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this - * is an hid_t for the wrong kind of object */ - H5E_BEGIN_TRY - testID = H5Iget_file_id(arrayID); - H5E_END_TRY + VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); + if(testID != H5I_INVALID_HID) + goto out; - VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); - if(testID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + testSize = H5Iget_name(arrayID, nameString, (size_t)9); + H5E_END_TRY - H5E_BEGIN_TRY - testSize = H5Iget_name(arrayID, nameString, (size_t)9); - H5E_END_TRY + VERIFY(testSize, -1, "H5Iget_name"); + if(testSize != -1) + goto out; - VERIFY(testSize, -1, "H5Iget_name"); - if(testSize != -1) - goto out; + /* Make sure H5Iremove_verify catches objects of the wrong type */ + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); + H5E_END_TRY - /* Make sure H5Iremove_verify catches objects of the wrong type */ - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + /* Remove an ID and make sure we can't access it */ + testPtr = (int*) H5Iremove_verify(arrayID, myType); - /* Remove an ID and make sure we can't access it */ - testPtr = (int*) H5Iremove_verify(arrayID, myType); + CHECK_PTR(testPtr, "H5Iremove_verify"); + if(testPtr == NULL) + goto out; - CHECK_PTR(testPtr, "H5Iremove_verify"); - if(testPtr == NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iobject_verify(arrayID, myType); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iobject_verify(arrayID, myType); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Delete the type and make sure we can't access objects within it */ + arrayID = H5Iregister(myType, testObj); - /* Delete the type and make sure we can't access objects within it */ - arrayID = H5Iregister(myType, testObj); + err = H5Idestroy_type(myType); + VERIFY(err, 0, "H5Idestroy_type"); + if( err != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if(H5Itype_exists(myType) != 0) + goto out; - err = H5Idestroy_type(myType); - VERIFY(err, 0, "H5Idestroy_type"); - if( err != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if(H5Itype_exists(myType) != 0) + H5E_BEGIN_TRY + VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); + if(H5Inmembers(myType, NULL) != -1) goto out; + H5E_END_TRY - H5E_BEGIN_TRY - VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); - if(H5Inmembers(myType, NULL) != -1) - goto out; - H5E_END_TRY - - /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + /* Register another type and another object in that type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - /* The memory that testObj pointed to should already have been - * freed when the previous type was destroyed. Allocate new - * memory for it. - */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + /* The memory that testObj pointed to should already have been + * freed when the previous type was destroyed. Allocate new + * memory for it. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* Increment references to type and ensure that dec_type_ref - doesn't destroy the type */ - num_ref = H5Iinc_type_ref(myType); - VERIFY(num_ref, 2, "H5Iinc_type_ref"); - if( num_ref != 2) - goto out; - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 1, "H5Idec_type_ref"); - if(num_ref != 1) - goto out; - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + /* Increment references to type and ensure that dec_type_ref + * doesn't destroy the type + */ + num_ref = H5Iinc_type_ref(myType); + VERIFY(num_ref, 2, "H5Iinc_type_ref"); + if( num_ref != 2) + goto out; + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 1, "H5Idec_type_ref"); + if(num_ref != 1) + goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* This call to dec_type_ref should destroy the type */ - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 0, "H5Idec_type_ref"); - if(num_ref != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if (H5Itype_exists(myType) != 0) - goto out; + /* This call to dec_type_ref should destroy the type */ + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 0, "H5Idec_type_ref"); + if(num_ref != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if (H5Itype_exists(myType) != 0) + goto out; - H5E_BEGIN_TRY + H5E_BEGIN_TRY err = H5Inmembers(myType, &num_members); - if(err >= 0) - goto out; - H5E_END_TRY + if(err >= 0) + goto out; + H5E_END_TRY - return 0; + return 0; out: - /* Clean up type if it has been allocated and free memory used - * by testObj */ - if(myType >= 0) - H5Idestroy_type(myType); + /* Clean up type if it has been allocated and free memory used + * by testObj + */ + if(myType >= 0) + H5Idestroy_type(myType); - return -1; + return -1; } diff --git a/test/trefstr.c b/test/trefstr.c index f55ede0..83e2951 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -251,7 +251,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); - VERIFY(s, buf, "wrapping"); + CHECK_PTR_EQ(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -309,7 +309,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -323,7 +323,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 12320ea..2806afe 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -322,17 +322,17 @@ test_skiplist_remove(void) search_key=key1; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key1, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key1, "H5SL_remove"); search_key=key2; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key2, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key2, "H5SL_remove"); search_key=key3; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key3, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key3, "H5SL_remove"); /* Check that the skip list has no elements */ num=H5SL_count(slist); @@ -1210,8 +1210,8 @@ static herr_t test_tfs_iter(void *_obj, void *key, void *_udata) { test_tfs_it_ud_t *udata = (test_tfs_it_ud_t *)_udata; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Increment number of calls */ udata->ncalls++; @@ -1236,8 +1236,8 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) { htri_t ret_value; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Mark this object as freed (to make sure it isn't recursively freed, that * is not something we support, we will undo this if we decide later not to -- cgit v0.12 From 8d8dc867a4919af7774a73fbd90633dcd4c1a4ed Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:11:53 -0800 Subject: Casted pointers to void to quiet warnings on Linux. --- test/testhdf5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 6244524..c36c4e1 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -90,7 +90,7 @@ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), ret, val, (int)__LINE__, __FILE__); \ + (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 9fdd984cdea6fce8b5fdd16a7ccc3cc9bbca6fed Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:15:45 -0800 Subject: Changed casts to const void * --- test/testhdf5.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index c36c4e1..127c687 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -86,11 +86,11 @@ #define CHECK_PTR_EQ(ret, val, where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ + (where), (int)__LINE__, __FILE__, (const void *)(ret)); \ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ + (where), (const void *)(ret), (const void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From c3249ecd79735fd8d32f0527db40493cbe89b502 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Nov 2017 13:06:10 -0600 Subject: Update macros --- config/cmake_ext_mod/HDFMacros.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 602b6bf..192a5c8 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -108,6 +108,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES + OUTPUT_NAME ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} -- cgit v0.12 From 4db7461569a90f466ba6be14d7e292a040bc3a36 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 09:52:37 -0600 Subject: intialized h5open_f arrays --- fortran/src/H5f90global.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index ee8959e..d4a9008 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -84,9 +84,9 @@ MODULE H5GLOBAL ! These arrays need to be global because they are used in ! both h5open_f and in h5close_f - INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types - INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types - INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE -- cgit v0.12 From 4f7af1390ba62553278dc64b65f44b8efd870b83 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 10:08:10 -0600 Subject: misc. clean-up --- fortran/src/H5f90global.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index d4a9008..4a04971 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -83,7 +83,8 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in - ! both h5open_f and in h5close_f + ! both h5open_f and in h5close_f; initialize to fix linking issues + ! on OSX and Intel compilers. INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 @@ -437,7 +438,6 @@ MODULE H5GLOBAL INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - CONTAINS ! Copy a c string to a Fortran string -- cgit v0.12 From 858e6c3c9c374fa474b7da6fd594fbc022fdc9ae Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Fri, 17 Nov 2017 13:29:04 -0700 Subject: HDFFV-10325: removed the COMMON/EQUIV statements. --- fortran/src/H5_ff.F90 | 531 ++++++++++++++++++++++++++++++++--- fortran/src/H5f90global.F90 | 668 +++++--------------------------------------- 2 files changed, 552 insertions(+), 647 deletions(-) diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90 index ef89d2f..db57f03 100644 --- a/fortran/src/H5_ff.F90 +++ b/fortran/src/H5_ff.F90 @@ -38,10 +38,111 @@ MODULE H5LIB - USE, INTRINSIC :: ISO_C_BINDING, ONLY : c_ptr, C_INTPTR_T + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_INTPTR_T USE H5GLOBAL IMPLICIT NONE + PRIVATE + ! + ! H5F flags declaration + ! + INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 + INTEGER, DIMENSION(1:H5F_FLAGS_LEN) :: H5F_flags + ! + ! H5generic flags declaration + ! + INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 + INTEGER, DIMENSION(1:H5generic_FLAGS_LEN) :: H5generic_flags + + INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: H5generic_haddr_flags + ! + ! H5G flags declaration + ! + INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 + INTEGER, DIMENSION(1:H5G_FLAGS_LEN) :: H5G_flags + ! + ! H5D flags declaration + ! + INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 + INTEGER, DIMENSION(1:H5D_FLAGS_LEN) :: H5D_flags + INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 + INTEGER(SIZE_T), DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: H5D_size_flags + ! + ! H5E flags declaration + ! + INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 + INTEGER, DIMENSION(1:H5E_FLAGS_LEN) :: H5E_flags + INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 + INTEGER(HID_T), DIMENSION(1:H5E_HID_FLAGS_LEN) :: H5E_hid_flags + ! + ! H5FD flags declaration + ! + INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 + INTEGER, DIMENSION(1:H5FD_FLAGS_LEN) :: H5FD_flags + ! + ! H5FD file drivers flags declaration + ! + INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 + INTEGER(HID_T), DIMENSION(1:H5FD_HID_FLAGS_LEN) :: H5FD_hid_flags + ! + ! H5I flags declaration + ! + INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 + INTEGER, DIMENSION(1:H5I_FLAGS_LEN) :: H5I_flags + ! + ! H5L flags declaration + ! + INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 + INTEGER, DIMENSION(1:H5L_FLAGS_LEN) :: H5L_flags + ! + ! H5O flags declaration + ! + INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 + INTEGER, DIMENSION(1:H5O_FLAGS_LEN) :: H5o_flags + ! + ! H5P flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 + INTEGER(HID_T), DIMENSION(1:H5P_FLAGS_LEN) :: H5P_flags + ! + ! H5P integers flags declaration + ! + INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 + INTEGER, DIMENSION(1:H5P_FLAGS_INT_LEN) :: H5P_flags_int + ! + ! H5R flags declaration + ! + INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5R_FLAGS_LEN) :: H5R_flags + ! + ! H5S flags declaration + ! + INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 + INTEGER, DIMENSION(1:H5S_FLAGS_LEN) :: H5S_flags + INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: H5S_hsize_flags + INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 + INTEGER(HSIZE_T), DIMENSION(1:H5S_HID_FLAGS_LEN) :: H5S_hid_flags + ! + ! H5T flags declaration + ! + INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 + INTEGER, DIMENSION(1:H5T_FLAGS_LEN) :: H5T_flags + ! + ! H5Z flags declaration + ! + INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 + INTEGER, DIMENSION(1:H5Z_FLAGS_LEN) :: H5Z_flags + ! + ! H5 Library flags declaration + ! + INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: H5LIB_flags + + PUBLIC :: h5open_f, h5close_f, h5get_libversion_f, h5dont_atexit_f, h5kind_to_type, h5offsetof + PUBLIC :: h5garbage_collect_f, h5check_version_f + CONTAINS !****s* H5LIB/h5open_f ! @@ -65,26 +166,24 @@ CONTAINS ! ! Removed call to h5open_c since this may cause a problem for an ! application that uses HDF5 library outside HDF5 Fortran APIs. -! October 13, 2011 +! October 13, 2011 ! Fortran90 Interface: SUBROUTINE h5open_f(error) IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1, error_2, error_3 - INTERFACE + INTEGER FUNCTION h5init_types_c(p_types, f_types, i_types) & BIND(C,NAME='h5init_types_c') IMPORT :: HID_T IMPORT :: PREDEF_TYPES_LEN, FLOATING_TYPES_LEN, INTEGER_TYPES_LEN IMPLICIT NONE - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: i_types + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: i_types END FUNCTION h5init_types_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init_flags_c(i_H5D_flags, & i_H5D_size_flags,& i_H5E_flags, & @@ -116,39 +215,90 @@ CONTAINS H5R_FLAGS_LEN, H5S_FLAGS_LEN, H5S_HID_FLAGS_LEN, H5S_HSIZE_FLAGS_LEN, & H5T_FLAGS_LEN, H5Z_FLAGS_LEN, H5generic_FLAGS_LEN, H5generic_haddr_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5D_flags(H5D_FLAGS_LEN) - INTEGER(SIZE_T) i_H5D_size_flags(H5D_SIZE_FLAGS_LEN) - INTEGER i_H5E_flags(H5E_FLAGS_LEN) - INTEGER(HID_T) i_H5E_hid_flags(H5E_HID_FLAGS_LEN) - INTEGER i_H5F_flags(H5F_FLAGS_LEN) - INTEGER i_H5G_flags(H5G_FLAGS_LEN) - INTEGER i_H5FD_flags(H5FD_FLAGS_LEN) - INTEGER(HID_T) i_H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - INTEGER i_H5I_flags(H5I_FLAGS_LEN) - INTEGER i_H5L_flags(H5L_FLAGS_LEN) - INTEGER i_H5O_flags(H5O_FLAGS_LEN) - INTEGER(HID_T) i_H5P_flags(H5P_FLAGS_LEN) - INTEGER i_H5P_flags_int(H5P_FLAGS_INT_LEN) - INTEGER i_H5R_flags(H5R_FLAGS_LEN) - INTEGER i_H5S_flags(H5S_FLAGS_LEN) - INTEGER(HID_T) i_H5S_hid_flags(H5S_HID_FLAGS_LEN) - INTEGER(HSIZE_T) i_H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER i_H5T_flags(H5T_FLAGS_LEN) - INTEGER i_H5Z_flags(H5Z_FLAGS_LEN) - INTEGER i_H5generic_flags(H5generic_FLAGS_LEN) - INTEGER(HADDR_T) i_H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) + INTEGER , DIMENSION(1:H5D_FLAGS_LEN) :: i_H5D_flags + INTEGER(SIZE_T) , DIMENSION(1:H5D_SIZE_FLAGS_LEN) :: i_H5D_size_flags + INTEGER , DIMENSION(1:H5E_FLAGS_LEN) :: i_H5E_flags + INTEGER(HID_T) , DIMENSION(1:H5E_HID_FLAGS_LEN) :: i_H5E_hid_flags + INTEGER , DIMENSION(1:H5F_FLAGS_LEN) :: i_H5F_flags + INTEGER , DIMENSION(1:H5G_FLAGS_LEN) :: i_H5G_flags + INTEGER , DIMENSION(1:H5FD_FLAGS_LEN) :: i_H5FD_flags + INTEGER(HID_T) , DIMENSION(1:H5FD_HID_FLAGS_LEN) :: i_H5FD_hid_flags + INTEGER , DIMENSION(1:H5I_FLAGS_LEN) :: i_H5I_flags + INTEGER , DIMENSION(1:H5L_FLAGS_LEN) :: i_H5L_flags + INTEGER , DIMENSION(1:H5O_FLAGS_LEN) :: i_H5O_flags + INTEGER(HID_T) , DIMENSION(1:H5P_FLAGS_LEN) :: i_H5P_flags + INTEGER , DIMENSION(1:H5P_FLAGS_INT_LEN) :: i_H5P_flags_int + INTEGER , DIMENSION(1:H5R_FLAGS_LEN) :: i_H5R_flags + INTEGER , DIMENSION(1:H5S_FLAGS_LEN) :: i_H5S_flags + INTEGER(HID_T) , DIMENSION(1:H5S_HID_FLAGS_LEN) :: i_H5S_hid_flags + INTEGER(HSIZE_T), DIMENSION(1:H5S_HSIZE_FLAGS_LEN) :: i_H5S_hsize_flags + INTEGER , DIMENSION(1:H5T_FLAGS_LEN) :: i_H5T_flags + INTEGER , DIMENSION(1:H5Z_FLAGS_LEN) :: i_H5Z_flags + INTEGER , DIMENSION(1:H5generic_FLAGS_LEN) :: i_H5generic_flags + INTEGER(HADDR_T), DIMENSION(1:H5generic_haddr_FLAGS_LEN) :: i_H5generic_haddr_flags END FUNCTION h5init_flags_c - END INTERFACE - INTERFACE + INTEGER FUNCTION h5init1_flags_c( i_H5LIB_flags ) & BIND(C,NAME='h5init1_flags_c') IMPORT :: H5LIB_FLAGS_LEN IMPLICIT NONE - INTEGER i_H5LIB_flags(H5LIB_FLAGS_LEN) + INTEGER, DIMENSION(1:H5LIB_FLAGS_LEN) :: i_H5LIB_flags END FUNCTION h5init1_flags_c + END INTERFACE - error_1 = h5init_types_c(predef_types, floating_types, integer_types) - error_2 = h5init_flags_c(H5D_flags, & + + error = h5init_types_c(predef_types, floating_types, integer_types) + + H5T_NATIVE_INTEGER_KIND(1:5) = predef_types(1:5) + H5T_NATIVE_INTEGER = predef_types(6) + H5T_NATIVE_REAL = predef_types(7) + H5T_NATIVE_DOUBLE = predef_types(8) + H5T_NATIVE_CHARACTER = predef_types(9) + H5T_STD_REF_OBJ = predef_types(10) + H5T_STD_REF_DSETREG = predef_types(11) + H5T_NATIVE_REAL_C_FLOAT = predef_types(12) + H5T_NATIVE_REAL_C_DOUBLE = predef_types(13) + H5T_NATIVE_REAL_C_LONG_DOUBLE = predef_types(14) + H5T_NATIVE_B8 = predef_types(15) + H5T_NATIVE_B16 = predef_types(16) + H5T_NATIVE_B32 = predef_types(17) + H5T_NATIVE_B64 = predef_types(18) + H5T_NATIVE_FLOAT_128 = predef_types(19) + + H5T_IEEE_F32BE = floating_types(1) + H5T_IEEE_F32LE = floating_types(2) + H5T_IEEE_F64BE = floating_types(3) + H5T_IEEE_F64LE = floating_types(4) + + H5T_STD_I8BE = integer_types(1) + H5T_STD_I8LE = integer_types(2) + H5T_STD_I16BE = integer_types(3) + H5T_STD_I16LE = integer_types(4) + H5T_STD_I32BE = integer_types(5) + H5T_STD_I32LE = integer_types(6) + H5T_STD_I64BE = integer_types(7) + H5T_STD_I64LE = integer_types(8) + H5T_STD_U8BE = integer_types(9) + H5T_STD_U8LE = integer_types(10) + H5T_STD_U16BE = integer_types(11) + H5T_STD_U16LE = integer_types(12) + H5T_STD_U32BE = integer_types(13) + H5T_STD_U32LE = integer_types(14) + H5T_STD_U64BE = integer_types(15) + H5T_STD_U64LE = integer_types(16) + H5T_STRING = integer_types(17) + H5T_STD_B8BE = integer_types(18) + H5T_STD_B8LE = integer_types(19) + H5T_STD_B16BE = integer_types(20) + H5T_STD_B16LE = integer_types(21) + H5T_STD_B32BE = integer_types(22) + H5T_STD_B32LE = integer_types(23) + H5T_STD_B64BE = integer_types(24) + H5T_STD_B64LE = integer_types(25) + H5T_FORTRAN_S1 = integer_types(26) + H5T_C_S1 = integer_types(27) + + error = error + h5init_flags_c(H5D_flags, & H5D_size_flags, & H5E_flags, & H5E_hid_flags, & @@ -169,8 +319,299 @@ CONTAINS H5Z_flags, & H5generic_flags,& H5generic_haddr_flags) - error_3 = h5init1_flags_c(H5LIB_flags ) - error = error_1 + error_2 + error_3 + ! + ! H5F flags + ! + H5F_ACC_RDWR_F = H5F_flags(1) + H5F_ACC_RDONLY_F = H5F_flags(2) + H5F_ACC_TRUNC_F = H5F_flags(3) + H5F_ACC_EXCL_F = H5F_flags(4) + H5F_ACC_DEBUG_F = H5F_flags(5) + H5F_SCOPE_LOCAL_F = H5F_flags(6) + H5F_SCOPE_GLOBAL_F = H5F_flags(7) + H5F_CLOSE_DEFAULT_F = H5F_flags(8) + H5F_CLOSE_WEAK_F = H5F_flags(9) + H5F_CLOSE_SEMI_F = H5F_flags(10) + H5F_CLOSE_STRONG_F = H5F_flags(11) + H5F_OBJ_FILE_F = H5F_flags(12) + H5F_OBJ_DATASET_F = H5F_flags(13) + H5F_OBJ_GROUP_F = H5F_flags(14) + H5F_OBJ_DATATYPE_F = H5F_flags(15) + H5F_OBJ_ALL_F = H5F_flags(16) + H5F_LIBVER_EARLIEST_F = H5F_flags(17) + H5F_LIBVER_LATEST_F = H5F_flags(18) + H5F_UNLIMITED_F = H5F_flags(19) + ! + ! H5generic flags + ! + H5_INDEX_UNKNOWN_F = H5generic_flags(1) + H5_INDEX_NAME_F = H5generic_flags(2) + H5_INDEX_CRT_ORDER_F = H5generic_flags(3) + H5_INDEX_N_F = H5generic_flags(4) + H5_ITER_UNKNOWN_F = H5generic_flags(5) + H5_ITER_INC_F = H5generic_flags(6) + H5_ITER_DEC_F = H5generic_flags(7) + H5_ITER_NATIVE_F = H5generic_flags(8) + H5_ITER_N_F = H5generic_flags(9) + + HADDR_UNDEF_F = H5generic_haddr_flags(1) + ! + ! H5G flags + ! + H5G_UNKNOWN_F = H5G_flags(1) + H5G_GROUP_F = H5G_flags(2) + H5G_DATASET_F = H5G_flags(3) + H5G_TYPE_F = H5G_flags(4) + H5G_SAME_LOC_F = H5G_flags(5) + H5G_LINK_ERROR_F = H5G_flags(6) + H5G_LINK_HARD_F = H5G_flags(7) + H5G_LINK_SOFT_F = H5G_flags(8) + H5G_STORAGE_TYPE_UNKNOWN_F = H5G_flags(9) + H5G_STORAGE_TYPE_SYMBOL_TABLE_F = H5G_flags(10) + H5G_STORAGE_TYPE_COMPACT_F = H5G_flags(11) + H5G_STORAGE_TYPE_DENSE_F = H5G_flags(12) + ! + ! H5D flags + ! + H5D_COMPACT_F = H5D_flags(1) + H5D_CONTIGUOUS_F = H5D_flags(2) + H5D_CHUNKED_F = H5D_flags(3) + H5D_ALLOC_TIME_ERROR_F = H5D_flags(4) + H5D_ALLOC_TIME_DEFAULT_F = H5D_flags(5) + H5D_ALLOC_TIME_EARLY_F = H5D_flags(6) + H5D_ALLOC_TIME_LATE_F = H5D_flags(7) + H5D_ALLOC_TIME_INCR_F = H5D_flags(8) + H5D_SPACE_STS_ERROR_F = H5D_flags(9) + H5D_SPACE_STS_NOT_ALLOCATED_F = H5D_flags(10) + H5D_SPACE_STS_PART_ALLOCATED_F = H5D_flags(11) + H5D_SPACE_STS_ALLOCATED_F = H5D_flags(12) + H5D_FILL_TIME_ERROR_F = H5D_flags(13) + H5D_FILL_TIME_ALLOC_F = H5D_flags(14) + H5D_FILL_TIME_NEVER_F = H5D_flags(15) + H5D_FILL_VALUE_ERROR_F = H5D_flags(16) + H5D_FILL_VALUE_UNDEFINED_F = H5D_flags(17) + H5D_FILL_VALUE_DEFAULT_F = H5D_flags(18) + H5D_FILL_VALUE_USER_DEFINED_F = H5D_flags(19) + H5D_CHUNK_CACHE_W0_DFLT_F = H5D_flags(20) + H5D_MPIO_NO_COLLECTIVE_F = H5D_flags(21) + H5D_MPIO_CHUNK_INDEPENDENT_F = H5D_flags(22) + H5D_MPIO_CHUNK_COLLECTIVE_F = H5D_flags(23) + H5D_MPIO_CHUNK_MIXED_F = H5D_flags(24) + H5D_MPIO_CONTIG_COLLECTIVE_F = H5D_flags(25) + H5D_VDS_ERROR_F = H5D_flags(26) + H5D_VDS_FIRST_MISSING_F = H5D_flags(27) + H5D_VDS_LAST_AVAILABLE_F = H5D_flags(28) + H5D_VIRTUAL_F = H5D_flags(29) + + H5D_CHUNK_CACHE_NSLOTS_DFLT_F = H5D_size_flags(1) + H5D_CHUNK_CACHE_NBYTES_DFLT_F = H5D_size_flags(2) + ! + ! H5E flags + ! + H5E_DEFAULT_F = H5E_hid_flags(1) + + H5E_MAJOR_F = H5E_flags(1) + H5E_MINOR_F = H5E_flags(2) + H5E_WALK_UPWARD_F = H5E_flags(3) + H5E_WALK_DOWNWARD_F = H5E_flags(4) + ! + ! H5FD flags + ! + H5FD_MPIO_INDEPENDENT_F = H5FD_flags(1) + H5FD_MPIO_COLLECTIVE_F = H5FD_flags(2) + H5FD_MEM_NOLIST_F = H5FD_flags(3) + H5FD_MEM_DEFAULT_F = H5FD_flags(4) + H5FD_MEM_SUPER_F = H5FD_flags(5) + H5FD_MEM_BTREE_F = H5FD_flags(6) + H5FD_MEM_DRAW_F = H5FD_flags(7) + H5FD_MEM_GHEAP_F = H5FD_flags(8) + H5FD_MEM_LHEAP_F = H5FD_flags(9) + H5FD_MEM_OHDR_F = H5FD_flags(10) + H5FD_MEM_NTYPES_F = H5FD_flags(11) + ! + ! H5FD file driver flags + ! + H5FD_CORE_F = H5FD_hid_flags(1) + H5FD_FAMILY_F = H5FD_hid_flags(2) + H5FD_LOG_F = H5FD_hid_flags(3) + H5FD_MPIO_F = H5FD_hid_flags(4) + H5FD_MULTI_F = H5FD_hid_flags(5) + H5FD_SEC2_F = H5FD_hid_flags(6) + H5FD_STDIO_F = H5FD_hid_flags(7) + ! + ! H5I flags declaration + ! + H5I_FILE_F = H5I_flags(1) + H5I_GROUP_F = H5I_flags(2) + H5I_DATATYPE_F = H5I_flags(3) + H5I_DATASPACE_F = H5I_flags(4) + H5I_DATASET_F = H5I_flags(5) + H5I_ATTR_F = H5I_flags(6) + H5I_BADID_F = H5I_flags(7) + ! + ! H5L flags + ! + H5L_TYPE_ERROR_F = H5L_flags(1) + H5L_TYPE_HARD_F = H5L_flags(2) + H5L_TYPE_SOFT_F = H5L_flags(3) + H5L_TYPE_EXTERNAL_F = H5L_flags(4) + H5L_SAME_LOC_F = H5L_flags(5) + H5L_LINK_CLASS_T_VERS_F = H5L_flags(6) + ! + ! H5O flags + ! + H5O_COPY_SHALLOW_HIERARCHY_F = h5o_flags(1) + H5O_COPY_EXPAND_SOFT_LINK_F = h5o_flags(2) + H5O_COPY_EXPAND_EXT_LINK_F = h5o_flags(3) + H5O_COPY_EXPAND_REFERENCE_F = h5o_flags(4) + H5O_COPY_WITHOUT_ATTR_FLAG_F = h5o_flags(5) + H5O_COPY_PRESERVE_NULL_FLAG_F = h5o_flags(6) + H5O_COPY_ALL_F = h5o_flags(7) + H5O_SHMESG_NONE_FLAG_F = h5o_flags(8) + H5O_SHMESG_SDSPACE_FLAG_F = h5o_flags(9) + H5O_SHMESG_DTYPE_FLAG_F = h5o_flags(10) + H5O_SHMESG_FILL_FLAG_F = h5o_flags(11) + H5O_SHMESG_PLINE_FLAG_F = h5o_flags(12) + H5O_SHMESG_ATTR_FLAG_F = h5o_flags(13) + H5O_SHMESG_ALL_FLAG_F = h5o_flags(14) + H5O_HDR_CHUNK0_SIZE_F = h5o_flags(15) + H5O_HDR_ATTR_CRT_ORDER_TRACK_F = h5o_flags(16) + H5O_HDR_ATTR_CRT_ORDER_INDEX_F = h5o_flags(17) + H5O_HDR_ATTR_STORE_PHASE_CHA_F = h5o_flags(18) + H5O_HDR_STORE_TIMES_F = h5o_flags(19) + H5O_HDR_ALL_FLAGS_F = h5o_flags(20) + H5O_SHMESG_MAX_NINDEXES_F = h5o_flags(21) + H5O_SHMESG_MAX_LIST_SIZE_F = h5o_flags(22) + H5O_TYPE_UNKNOWN_F = h5o_flags(23) + H5O_TYPE_GROUP_F = h5o_flags(24) + H5O_TYPE_DATASET_F = h5o_flags(25) + H5O_TYPE_NAMED_DATATYPE_F = h5o_flags(26) + H5O_TYPE_NTYPES_F = h5o_flags(27) + ! + ! H5P flags + ! + H5P_FILE_CREATE_F = H5P_flags(1) + H5P_FILE_ACCESS_F = H5P_flags(2) + H5P_DATASET_CREATE_F = H5P_flags(3) + H5P_DATASET_XFER_F = H5P_flags(4) + H5P_FILE_MOUNT_F = H5P_flags(5) + H5P_DEFAULT_F = H5P_flags(6) + H5P_ROOT_F = H5P_flags(7) + H5P_OBJECT_CREATE_F = H5P_flags(8) + H5P_DATASET_ACCESS_F = H5P_flags(9) + H5P_GROUP_CREATE_F = H5P_flags(10) + H5P_GROUP_ACCESS_F = H5P_flags(11) + H5P_DATATYPE_CREATE_F = H5P_flags(12) + H5P_DATATYPE_ACCESS_F = H5P_flags(13) + H5P_STRING_CREATE_F = H5P_flags(14) + H5P_ATTRIBUTE_CREATE_F = H5P_flags(15) + H5P_OBJECT_COPY_F = H5P_flags(16) + H5P_LINK_CREATE_F = H5P_flags(17) + H5P_LINK_ACCESS_F = H5P_flags(18) + ! + ! H5P integers flags + ! + H5P_CRT_ORDER_INDEXED_F = H5P_flags_int(1) + H5P_CRT_ORDER_TRACKED_F = H5P_flags_int(2) + ! + ! H5R flags + ! + H5R_OBJECT_F = H5R_flags(1) + H5R_DATASET_REGION_F = H5R_flags(2) + ! + ! H5S flags + ! + H5S_ALL_F = H5S_hid_flags(1) + + H5S_UNLIMITED_F = H5S_hsize_flags(1) + + H5S_SCALAR_F = H5S_flags(1) + H5S_SIMPLE_F = H5S_flags(2) + H5S_NULL_F = H5S_flags(3) + H5S_SELECT_SET_F = H5S_flags(4) + H5S_SELECT_OR_F = H5S_flags(5) + H5S_SELECT_NOOP_F = H5S_flags(6) + H5S_SELECT_AND_F = H5S_flags(7) + H5S_SELECT_XOR_F = H5S_flags(8) + H5S_SELECT_NOTB_F = H5S_flags(9) + H5S_SELECT_NOTA_F = H5S_flags(10) + H5S_SELECT_APPEND_F = H5S_flags(11) + H5S_SELECT_PREPEND_F = H5S_flags(12) + H5S_SELECT_INVALID_F = H5S_flags(13) + H5S_SEL_ERROR_F = H5S_flags(14) + H5S_SEL_NONE_F = H5S_flags(15) + H5S_SEL_POINTS_F = H5S_flags(16) + H5S_SEL_HYPERSLABS_F = H5S_flags(17) + H5S_SEL_ALL_F = H5S_flags(18) + ! + ! H5T flags declaration + ! + H5T_NO_CLASS_F = H5T_flags(1) + H5T_INTEGER_F = H5T_flags(2) + H5T_FLOAT_F = H5T_flags(3) + H5T_TIME_F = H5T_flags(4) + H5T_STRING_F = H5T_flags(5) + H5T_BITFIELD_F = H5T_flags(6) + H5T_OPAQUE_F = H5T_flags(7) + H5T_COMPOUND_F = H5T_flags(8) + H5T_REFERENCE_F = H5T_flags(9) + H5T_ENUM_F = H5T_flags(10) + H5T_ORDER_LE_F = H5T_flags(11) + H5T_ORDER_BE_F = H5T_flags(12) + H5T_ORDER_MIXED_F = H5T_flags(13) + H5T_ORDER_VAX_F = H5T_flags(14) + H5T_ORDER_NONE_F = H5T_flags(15) + H5T_PAD_ZERO_F = H5T_flags(16) + H5T_PAD_ONE_F = H5T_flags(17) + H5T_PAD_BACKGROUND_F = H5T_flags(18) + H5T_PAD_ERROR_F = H5T_flags(19) + H5T_SGN_NONE_F = H5T_flags(20) + H5T_SGN_2_F = H5T_flags(21) + H5T_SGN_ERROR_F = H5T_flags(22) + H5T_NORM_IMPLIED_F = H5T_flags(23) + H5T_NORM_MSBSET_F = H5T_flags(24) + H5T_NORM_NONE_F = H5T_flags(25) + H5T_CSET_ASCII_F = H5T_flags(26) + H5T_CSET_UTF8_F = H5T_flags(27) + H5T_STR_NULLTERM_F = H5T_flags(28) + H5T_STR_NULLPAD_F = H5T_flags(29) + H5T_STR_SPACEPAD_F = H5T_flags(30) + H5T_STR_ERROR_F = H5T_flags(31) + H5T_VLEN_F = H5T_flags(32) + H5T_ARRAY_F = H5T_flags(33) + H5T_DIR_ASCEND_F = H5T_flags(34) + H5T_DIR_DESCEND_F = H5T_flags(35) + ! + ! H5Z flags + ! + H5Z_FILTER_ERROR_F = H5Z_flags(1) + H5Z_FILTER_NONE_F = H5Z_flags(2) + H5Z_FILTER_DEFLATE_F = H5Z_flags(3) + H5Z_FILTER_SHUFFLE_F = H5Z_flags(4) + H5Z_FILTER_FLETCHER32_F = H5Z_flags(5) + H5Z_ERROR_EDC_F = H5Z_flags(6) + H5Z_DISABLE_EDC_F = H5Z_flags(7) + H5Z_ENABLE_EDC_F = H5Z_flags(8) + H5Z_NO_EDC_F = H5Z_flags(9) + H5Z_FILTER_SZIP_F = H5Z_flags(10) + H5Z_FLAG_OPTIONAL_F = H5Z_flags(11) + H5Z_FILTER_ENCODE_ENABLED_F = H5Z_flags(12) + H5Z_FILTER_DECODE_ENABLED_F = H5Z_flags(13) + H5Z_FILTER_ALL_F = H5Z_flags(14) + H5Z_FILTER_NBIT_F = H5Z_flags(15) + H5Z_FILTER_SCALEOFFSET_F = H5Z_flags(16) + H5Z_SO_FLOAT_DSCALE_F = H5Z_flags(17) + H5Z_SO_FLOAT_ESCALE_F = H5Z_flags(18) + H5Z_SO_INT_F = H5Z_flags(19) + H5Z_SO_INT_MINBITS_DEFAULT_F = H5Z_flags(20) + + error = error + h5init1_flags_c(H5LIB_flags) + ! + ! H5 Library flags + ! + H5_SZIP_EC_OM_F = H5LIB_flags(1) + H5_SZIP_NN_OM_F = H5LIB_flags(2) + END SUBROUTINE h5open_f !****s* H5LIB/h5close_f @@ -201,25 +642,23 @@ CONTAINS IMPLICIT NONE INTEGER, INTENT(OUT) :: error !***** - INTEGER :: error_1 INTERFACE INTEGER FUNCTION h5close_types_c(p_types, P_TYPES_LEN, & f_types, F_TYPES_LEN, & i_types, I_TYPES_LEN ) & BIND(C,NAME='h5close_types_c') IMPORT :: HID_T - INTEGER P_TYPES_LEN - INTEGER F_TYPES_LEN - INTEGER I_TYPES_LEN - INTEGER(HID_T), DIMENSION(P_TYPES_LEN) :: p_types - INTEGER(HID_T), DIMENSION(F_TYPES_LEN) :: f_types - INTEGER(HID_T), DIMENSION(I_TYPES_LEN) :: i_types + INTEGER :: P_TYPES_LEN + INTEGER :: F_TYPES_LEN + INTEGER :: I_TYPES_LEN + INTEGER(HID_T), DIMENSION(1:P_TYPES_LEN) :: p_types + INTEGER(HID_T), DIMENSION(1:F_TYPES_LEN) :: f_types + INTEGER(HID_T), DIMENSION(1:I_TYPES_LEN) :: i_types END FUNCTION h5close_types_c END INTERFACE - error_1 = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & + error = h5close_types_c(predef_types, PREDEF_TYPES_LEN, & floating_types, FLOATING_TYPES_LEN, & integer_types, INTEGER_TYPES_LEN ) - error = error_1 END SUBROUTINE h5close_f diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 629418a..d4a9008 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -50,7 +50,6 @@ MODULE H5GLOBAL END ENUM INTEGER, PARAMETER :: ENUM_T = KIND(enum_dtype) - ! Definitions for reference datatypes. ! If you change the value of these parameters, do not forget to change corresponding ! values in the H5f90.h file. @@ -71,9 +70,9 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change this - ! value when new predefined - ! datatypes are added + ! Do not forget to change this value when new predefined + ! datatypes are added + INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 ! Do not forget to change the following line when new predefined ! floating data types are added @@ -83,32 +82,56 @@ MODULE H5GLOBAL ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT, & - H5T_NATIVE_REAL_C_DOUBLE, & - H5T_NATIVE_REAL_C_LONG_DOUBLE, & - H5T_NATIVE_INTEGER, & - H5T_NATIVE_REAL, & - H5T_NATIVE_DOUBLE, & - H5T_NATIVE_CHARACTER , & - H5T_STD_REF_OBJ, & - H5T_STD_REF_DSETREG, & - H5T_IEEE_F32BE, & - H5T_IEEE_F32LE, & - H5T_IEEE_F64BE, & - H5T_IEEE_F64LE, & - H5T_STD_I8BE, & - H5T_STD_I8LE, & - H5T_STD_I16BE, & - H5T_STD_I16LE, & - H5T_STD_I32BE, & - H5T_STD_I32LE, & - H5T_STD_I64BE, & - H5T_STD_I64LE, & - H5T_STD_U8BE, & - H5T_STD_U8LE, & - H5T_STD_U16BE, & - H5T_STD_U16LE, & - H5T_STD_U32BE + ! These arrays need to be global because they are used in + ! both h5open_f and in h5close_f + INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 + INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 + INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 + ! + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -116,139 +139,22 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- -! NOTE: Splitting the line since the Fortran 95 standard limits the number of -! continuation lines to 39; the F03/F08 standard limits the number -! to 255 lines. - - INTEGER(HID_T) :: H5T_STD_U32LE, & - H5T_STD_U64BE, & - H5T_STD_U64LE, & - H5T_STRING, & - H5T_STD_B8BE, & - H5T_STD_B8LE, & - H5T_STD_B16BE, & - H5T_STD_B16LE, & - H5T_STD_B32BE, & - H5T_STD_B32LE, & - H5T_STD_B64BE, & - H5T_STD_B64LE, & - H5T_NATIVE_B8, & - H5T_NATIVE_B16, & - H5T_NATIVE_B32, & - H5T_NATIVE_B64, & - H5T_FORTRAN_S1, & - H5T_C_S1 - - - INTEGER(HID_T), DIMENSION(PREDEF_TYPES_LEN) :: predef_types - EQUIVALENCE (predef_types(1), H5T_NATIVE_INTEGER_KIND(1)) - ! EQUIVALENCE predef_types(2:5) are unnecessary and violate the standard - EQUIVALENCE (predef_types(6), H5T_NATIVE_INTEGER) - EQUIVALENCE (predef_types(7), H5T_NATIVE_REAL) - EQUIVALENCE (predef_types(8), H5T_NATIVE_DOUBLE) - EQUIVALENCE (predef_types(9), H5T_NATIVE_CHARACTER) - EQUIVALENCE (predef_types(10), H5T_STD_REF_OBJ) - EQUIVALENCE (predef_types(11), H5T_STD_REF_DSETREG) - EQUIVALENCE (predef_types(12), H5T_NATIVE_REAL_C_FLOAT) - EQUIVALENCE (predef_types(13), H5T_NATIVE_REAL_C_DOUBLE) - EQUIVALENCE (predef_types(14), H5T_NATIVE_REAL_C_LONG_DOUBLE) - EQUIVALENCE (predef_types(15), H5T_NATIVE_B8 ) - EQUIVALENCE (predef_types(16), H5T_NATIVE_B16) - EQUIVALENCE (predef_types(17), H5T_NATIVE_B32) - EQUIVALENCE (predef_types(18), H5T_NATIVE_B64) - EQUIVALENCE (predef_types(19), H5T_NATIVE_FLOAT_128) ! ADDED NEW TYPE -MSB- - - INTEGER(HID_T), DIMENSION(FLOATING_TYPES_LEN) :: floating_types - EQUIVALENCE (floating_types(1), H5T_IEEE_F32BE ) - EQUIVALENCE (floating_types(2), H5T_IEEE_F32LE) - EQUIVALENCE (floating_types(3), H5T_IEEE_F64BE) - EQUIVALENCE (floating_types(4), H5T_IEEE_F64LE) - - INTEGER(HID_T), DIMENSION(INTEGER_TYPES_LEN) :: integer_types - EQUIVALENCE (integer_types(1), H5T_STD_I8BE ) - EQUIVALENCE (integer_types(2), H5T_STD_I8LE) - EQUIVALENCE (integer_types(3), H5T_STD_I16BE) - EQUIVALENCE (integer_types(4), H5T_STD_I16LE) - EQUIVALENCE (integer_types(5), H5T_STD_I32BE) - EQUIVALENCE (integer_types(6), H5T_STD_I32LE) - EQUIVALENCE (integer_types(7), H5T_STD_I64BE) - EQUIVALENCE (integer_types(8), H5T_STD_I64LE) - EQUIVALENCE (integer_types(9), H5T_STD_U8BE) - EQUIVALENCE (integer_types(10), H5T_STD_U8LE) - EQUIVALENCE (integer_types(11), H5T_STD_U16BE) - EQUIVALENCE (integer_types(12), H5T_STD_U16LE) - EQUIVALENCE (integer_types(13), H5T_STD_U32BE) - EQUIVALENCE (integer_types(14), H5T_STD_U32LE) - EQUIVALENCE (integer_types(15), H5T_STD_U64BE) - EQUIVALENCE (integer_types(16), H5T_STD_U64LE) - EQUIVALENCE (integer_types(17), H5T_STRING) - EQUIVALENCE (integer_types(18), H5T_STD_B8BE) - EQUIVALENCE (integer_types(19), H5T_STD_B8LE) - EQUIVALENCE (integer_types(20), H5T_STD_B16BE) - EQUIVALENCE (integer_types(21), H5T_STD_B16LE) - EQUIVALENCE (integer_types(22), H5T_STD_B32BE) - EQUIVALENCE (integer_types(23), H5T_STD_B32LE) - EQUIVALENCE (integer_types(24), H5T_STD_B64BE) - EQUIVALENCE (integer_types(25), H5T_STD_B64LE) - EQUIVALENCE (integer_types(26), H5T_FORTRAN_S1) - EQUIVALENCE (integer_types(27), H5T_C_S1) - - - ! COMMON /PREDEFINED_TYPES/ H5T_NATIVE_INTEGER, & - ! H5T_NATIVE_REAL, & - ! H5T_NATIVE_DOUBLE, & - ! H5T_NATIVE_CHARACTER, & - ! H5T_STD_REF_OBJ, & - ! H5T_STD_REF_DSETREG - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /PREDEFINED_TYPES/ - !DEC$endif - COMMON /PREDEFINED_TYPES/ predef_types - - ! COMMON /FLOATING_TYPES/ H5T_IEEE_F32BE, & - ! H5T_IEEE_F32LE, & - ! H5T_IEEE_F64BE, & - ! H5T_IEEE_F64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /FLOATING_TYPES/ - !DEC$endif - COMMON /FLOATING_TYPES/ floating_types - ! - ! COMMON /INTEGER_TYPES/ H5T_STD_I8BE, & - ! H5T_STD_I8LE, & - ! H5T_STD_I16BE, & - ! H5T_STD_I16LE, & - ! H5T_STD_I32BE, & - ! H5T_STD_I32LE, & - ! H5T_STD_I64BE, & - ! H5T_STD_I64LE, & - ! H5T_STD_U8BE, & - ! H5T_STD_U8LE, & - ! H5T_STD_U16BE, & - ! H5T_STD_U16LE, & - ! H5T_STD_U32BE, & - ! H5T_STD_U32LE, & - ! H5T_STD_U64BE, & - ! H5T_STD_U64LE - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /INTEGER_TYPES/ - !DEC$endif - COMMON /INTEGER_TYPES/ integer_types - ! - ! Fortran flags - ! + ! H5generic flags declaration ! - ! H5F flags (DO NOT FORGET TO UPDATE WHEN NEW FLAGS ARE ADDED !) + INTEGER :: H5_INDEX_UNKNOWN_F + INTEGER :: H5_INDEX_NAME_F + INTEGER :: H5_INDEX_CRT_ORDER_F + INTEGER :: H5_INDEX_N_F + INTEGER :: H5_ITER_UNKNOWN_F + INTEGER :: H5_ITER_INC_F + INTEGER :: H5_ITER_DEC_F + INTEGER :: H5_ITER_NATIVE_F + INTEGER :: H5_ITER_N_F + + INTEGER(HADDR_T) :: HADDR_UNDEF_F ! ! H5F flags declaration ! - INTEGER, PARAMETER :: H5F_FLAGS_LEN = 19 - INTEGER :: H5F_flags(H5F_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5F_FLAGS/ - !DEC$endif - COMMON /H5F_FLAGS/ H5F_flags - INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -268,77 +174,9 @@ MODULE H5GLOBAL INTEGER :: H5F_LIBVER_EARLIEST_F INTEGER :: H5F_LIBVER_LATEST_F INTEGER :: H5F_UNLIMITED_F - - EQUIVALENCE(H5F_flags(1), H5F_ACC_RDWR_F) - EQUIVALENCE(H5F_flags(2), H5F_ACC_RDONLY_F) - EQUIVALENCE(H5F_flags(3), H5F_ACC_TRUNC_F) - EQUIVALENCE(H5F_flags(4), H5F_ACC_EXCL_F) - EQUIVALENCE(H5F_flags(5), H5F_ACC_DEBUG_F) - EQUIVALENCE(H5F_flags(6), H5F_SCOPE_LOCAL_F) - EQUIVALENCE(H5F_flags(7), H5F_SCOPE_GLOBAL_F) - EQUIVALENCE(H5F_flags(8), H5F_CLOSE_DEFAULT_F) - EQUIVALENCE(H5F_flags(9), H5F_CLOSE_WEAK_F) - EQUIVALENCE(H5F_flags(10), H5F_CLOSE_SEMI_F) - EQUIVALENCE(H5F_flags(11), H5F_CLOSE_STRONG_F) - EQUIVALENCE(H5F_flags(12), H5F_OBJ_FILE_F) - EQUIVALENCE(H5F_flags(13), H5F_OBJ_DATASET_F) - EQUIVALENCE(H5F_flags(14), H5F_OBJ_GROUP_F) - EQUIVALENCE(H5F_flags(15), H5F_OBJ_DATATYPE_F) - EQUIVALENCE(H5F_flags(16), H5F_OBJ_ALL_F) - EQUIVALENCE(H5F_flags(17), H5F_LIBVER_EARLIEST_F) - EQUIVALENCE(H5F_flags(18), H5F_LIBVER_LATEST_F) - EQUIVALENCE(H5F_flags(19), H5F_UNLIMITED_F) - ! - ! H5generic flags declaration - ! - INTEGER, PARAMETER :: H5generic_FLAGS_LEN = 9 - INTEGER :: H5generic_flags(H5generic_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_FLAGS/ - !DEC$endif - COMMON /H5generic_FLAGS/ H5generic_flags - - INTEGER :: H5_INDEX_UNKNOWN_F - INTEGER :: H5_INDEX_NAME_F - INTEGER :: H5_INDEX_CRT_ORDER_F - INTEGER :: H5_INDEX_N_F - INTEGER :: H5_ITER_UNKNOWN_F - INTEGER :: H5_ITER_INC_F - INTEGER :: H5_ITER_DEC_F - INTEGER :: H5_ITER_NATIVE_F - INTEGER :: H5_ITER_N_F - - EQUIVALENCE(H5generic_flags(1), H5_INDEX_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(2), H5_INDEX_NAME_F) - EQUIVALENCE(H5generic_flags(3), H5_INDEX_CRT_ORDER_F) - EQUIVALENCE(H5generic_flags(4), H5_INDEX_N_F) - EQUIVALENCE(H5generic_flags(5), H5_ITER_UNKNOWN_F) - EQUIVALENCE(H5generic_flags(6), H5_ITER_INC_F) - EQUIVALENCE(H5generic_flags(7), H5_ITER_DEC_F) - EQUIVALENCE(H5generic_flags(8), H5_ITER_NATIVE_F) - EQUIVALENCE(H5generic_flags(9), H5_ITER_N_F) - - INTEGER, PARAMETER :: H5generic_haddr_FLAGS_LEN = 1 - INTEGER(HADDR_T) :: H5generic_haddr_flags(H5generic_haddr_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5generic_haddr_FLAGS/ - !DEC$endif - COMMON /H5generic_haddr_FLAGS/ H5generic_haddr_flags - - INTEGER(HADDR_T) :: HADDR_UNDEF_F - - EQUIVALENCE(H5generic_haddr_flags(1), HADDR_UNDEF_F) - ! ! H5G flags declaration ! - INTEGER, PARAMETER :: H5G_FLAGS_LEN = 12 - INTEGER :: H5G_flags(H5G_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5G_FLAGS/ - !DEC$endif - COMMON /H5G_FLAGS/ H5G_flags - INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -353,35 +191,9 @@ MODULE H5GLOBAL INTEGER :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F INTEGER :: H5G_STORAGE_TYPE_COMPACT_F INTEGER :: H5G_STORAGE_TYPE_DENSE_F - - EQUIVALENCE(H5G_flags(1), H5G_UNKNOWN_F) ! Unknown object type - EQUIVALENCE(H5G_flags(2), H5G_GROUP_F) ! Object is a group - EQUIVALENCE(H5G_flags(3), H5G_DATASET_F) ! Object is a dataset - EQUIVALENCE(H5G_flags(4), H5G_TYPE_F) ! Object is a named data type - EQUIVALENCE(H5G_flags(5), H5G_SAME_LOC_F) - EQUIVALENCE(H5G_flags(6), H5G_LINK_ERROR_F) - EQUIVALENCE(H5G_flags(7), H5G_LINK_HARD_F) - EQUIVALENCE(H5G_flags(8), H5G_LINK_SOFT_F) - - EQUIVALENCE(H5G_flags(9), H5G_STORAGE_TYPE_UNKNOWN_F ) - EQUIVALENCE(H5G_flags(10), H5G_STORAGE_TYPE_SYMBOL_TABLE_F) - EQUIVALENCE(H5G_flags(11), H5G_STORAGE_TYPE_COMPACT_F) - EQUIVALENCE(H5G_flags(12), H5G_STORAGE_TYPE_DENSE_F) - ! ! H5D flags declaration ! - INTEGER, PARAMETER :: H5D_FLAGS_LEN = 29 - INTEGER :: H5D_flags(H5D_FLAGS_LEN) - INTEGER, PARAMETER :: H5D_SIZE_FLAGS_LEN = 2 - INTEGER(SIZE_T) :: H5D_size_flags(H5D_SIZE_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5D_SIZE_FLAGS/ - !DEC$endif - COMMON /H5D_FLAGS/ H5D_flags - COMMON /H5D_SIZE_FLAGS/ H5D_size_flags - INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -413,6 +225,7 @@ MODULE H5GLOBAL INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + INTEGER :: H5D_CHUNK_CACHE_W0_DFLT_F INTEGER :: H5D_MPIO_NO_COLLECTIVE_F INTEGER :: H5D_MPIO_CHUNK_INDEPENDENT_F @@ -423,81 +236,17 @@ MODULE H5GLOBAL INTEGER :: H5D_VDS_FIRST_MISSING_F INTEGER :: H5D_VDS_LAST_AVAILABLE_F INTEGER :: H5D_VIRTUAL_F - - EQUIVALENCE(H5D_flags(1), H5D_COMPACT_F) - EQUIVALENCE(H5D_flags(2), H5D_CONTIGUOUS_F) - EQUIVALENCE(H5D_flags(3), H5D_CHUNKED_F) - - EQUIVALENCE(H5D_flags(4), H5D_ALLOC_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(5), H5D_ALLOC_TIME_DEFAULT_F) - EQUIVALENCE(H5D_flags(6), H5D_ALLOC_TIME_EARLY_F) - EQUIVALENCE(H5D_flags(7), H5D_ALLOC_TIME_LATE_F) - EQUIVALENCE(H5D_flags(8), H5D_ALLOC_TIME_INCR_F) - - EQUIVALENCE(H5D_flags(9), H5D_SPACE_STS_ERROR_F) - EQUIVALENCE(H5D_flags(10), H5D_SPACE_STS_NOT_ALLOCATED_F) - EQUIVALENCE(H5D_flags(11), H5D_SPACE_STS_PART_ALLOCATED_F) - EQUIVALENCE(H5D_flags(12), H5D_SPACE_STS_ALLOCATED_F) - - EQUIVALENCE(H5D_flags(13), H5D_FILL_TIME_ERROR_F) - EQUIVALENCE(H5D_flags(14), H5D_FILL_TIME_ALLOC_F) - EQUIVALENCE(H5D_flags(15), H5D_FILL_TIME_NEVER_F) - - EQUIVALENCE(H5D_flags(16), H5D_FILL_VALUE_ERROR_F) - EQUIVALENCE(H5D_flags(17), H5D_FILL_VALUE_UNDEFINED_F) - EQUIVALENCE(H5D_flags(18), H5D_FILL_VALUE_DEFAULT_F) - EQUIVALENCE(H5D_flags(19), H5D_FILL_VALUE_USER_DEFINED_F) - - EQUIVALENCE(H5D_flags(20), H5D_CHUNK_CACHE_W0_DFLT_F) - EQUIVALENCE(H5D_flags(21), H5D_MPIO_NO_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(22), H5D_MPIO_CHUNK_INDEPENDENT_F) - EQUIVALENCE(H5D_flags(23), H5D_MPIO_CHUNK_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(24), H5D_MPIO_CHUNK_MIXED_F) - EQUIVALENCE(H5D_flags(25), H5D_MPIO_CONTIG_COLLECTIVE_F) - EQUIVALENCE(H5D_flags(26), H5D_VDS_ERROR_F) - EQUIVALENCE(H5D_flags(27), H5D_VDS_FIRST_MISSING_F) - EQUIVALENCE(H5D_flags(28), H5D_VDS_LAST_AVAILABLE_F) - EQUIVALENCE(H5D_flags(29), H5D_VIRTUAL_F) - - EQUIVALENCE(H5D_size_flags(1), H5D_CHUNK_CACHE_NSLOTS_DFLT_F) - EQUIVALENCE(H5D_size_flags(2), H5D_CHUNK_CACHE_NBYTES_DFLT_F) - ! ! H5E flags declaration ! - INTEGER, PARAMETER :: H5E_FLAGS_LEN = 4 - INTEGER :: H5E_flags(H5E_FLAGS_LEN) - INTEGER, PARAMETER :: H5E_HID_FLAGS_LEN = 1 - INTEGER(HID_T) :: H5E_hid_flags(H5E_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5E_HID_FLAGS/ - !DEC$endif - COMMON /H5E_FLAGS/ H5E_flags - COMMON /H5E_HID_FLAGS/ H5E_hid_flags - INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F INTEGER :: H5E_WALK_UPWARD_F INTEGER :: H5E_WALK_DOWNWARD_F - - EQUIVALENCE(H5E_hid_flags(1), H5E_DEFAULT_F) - EQUIVALENCE(H5E_flags(1) , H5E_MAJOR_F) - EQUIVALENCE(H5E_flags(2) , H5E_MINOR_F) - EQUIVALENCE(H5E_flags(3) , H5E_WALK_UPWARD_F) - EQUIVALENCE(H5E_flags(4) , H5E_WALK_DOWNWARD_F) - ! - ! H5FD flags declaration + ! H5FD file drivers flags declaration ! - INTEGER, PARAMETER :: H5FD_FLAGS_LEN = 11 - INTEGER :: H5FD_flags(H5FD_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_FLAGS/ - !DEC$endif - COMMON /H5FD_FLAGS/ H5FD_flags - INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -509,28 +258,6 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F INTEGER :: H5FD_MEM_NTYPES_F - - EQUIVALENCE(H5FD_flags(1), H5FD_MPIO_INDEPENDENT_F) - EQUIVALENCE(H5FD_flags(2), H5FD_MPIO_COLLECTIVE_F) - EQUIVALENCE(H5FD_flags(3), H5FD_MEM_NOLIST_F) - EQUIVALENCE(H5FD_flags(4), H5FD_MEM_DEFAULT_F) - EQUIVALENCE(H5FD_flags(5), H5FD_MEM_SUPER_F) - EQUIVALENCE(H5FD_flags(6), H5FD_MEM_BTREE_F) - EQUIVALENCE(H5FD_flags(7), H5FD_MEM_DRAW_F) - EQUIVALENCE(H5FD_flags(8), H5FD_MEM_GHEAP_F) - EQUIVALENCE(H5FD_flags(9), H5FD_MEM_LHEAP_F) - EQUIVALENCE(H5FD_flags(10), H5FD_MEM_OHDR_F) - EQUIVALENCE(H5FD_flags(11), H5FD_MEM_NTYPES_F) - ! - ! H5FD file drivers flags declaration - ! - INTEGER, PARAMETER :: H5FD_HID_FLAGS_LEN = 7 - INTEGER(HID_T) :: H5FD_hid_flags(H5FD_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5FD_HID_FLAGS/ - !DEC$endif - COMMON /H5FD_HID_FLAGS/ H5FD_hid_flags - INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -538,25 +265,9 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5FD_MULTI_F INTEGER(HID_T) :: H5FD_SEC2_F INTEGER(HID_T) :: H5FD_STDIO_F - - EQUIVALENCE(H5FD_hid_flags(1), H5FD_CORE_F) - EQUIVALENCE(H5FD_hid_flags(2), H5FD_FAMILY_F) - EQUIVALENCE(H5FD_hid_flags(3), H5FD_LOG_F) - EQUIVALENCE(H5FD_hid_flags(4), H5FD_MPIO_F) - EQUIVALENCE(H5FD_hid_flags(5), H5FD_MULTI_F) - EQUIVALENCE(H5FD_hid_flags(6), H5FD_SEC2_F) - EQUIVALENCE(H5FD_hid_flags(7), H5FD_STDIO_F) - ! ! H5I flags declaration ! - INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7 - INTEGER :: H5I_flags(H5I_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5I_FLAGS/ - !DEC$endif - COMMON /H5I_FLAGS/ H5I_flags - INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -564,48 +275,18 @@ MODULE H5GLOBAL INTEGER :: H5I_DATASET_F INTEGER :: H5I_ATTR_F INTEGER :: H5I_BADID_F - - EQUIVALENCE(H5I_flags(1), H5I_FILE_F) - EQUIVALENCE(H5I_flags(2), H5I_GROUP_F) - EQUIVALENCE(H5I_flags(3), H5I_DATATYPE_F) - EQUIVALENCE(H5I_flags(4), H5I_DATASPACE_F) - EQUIVALENCE(H5I_flags(5), H5I_DATASET_F) - EQUIVALENCE(H5I_flags(6), H5I_ATTR_F) - EQUIVALENCE(H5I_flags(7), H5I_BADID_F) ! ! H5L flags declaration ! - INTEGER, PARAMETER :: H5L_FLAGS_LEN = 6 - INTEGER :: H5L_flags(H5L_FLAGS_LEN) - INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F INTEGER :: H5L_TYPE_EXTERNAL_F INTEGER :: H5L_SAME_LOC_F INTEGER :: H5L_LINK_CLASS_T_VERS_F - - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5L_FLAGS/ - !DEC$endif - COMMON /H5L_FLAGS/ H5L_flags - - EQUIVALENCE(H5L_flags(1), H5L_TYPE_ERROR_F) - EQUIVALENCE(H5L_flags(2), H5L_TYPE_HARD_F) - EQUIVALENCE(H5L_flags(3), H5L_TYPE_SOFT_F) - EQUIVALENCE(H5L_flags(4), H5L_TYPE_EXTERNAL_F) - EQUIVALENCE(H5L_flags(5), H5L_SAME_LOC_F) - EQUIVALENCE(H5L_flags(6), H5L_LINK_CLASS_T_VERS_F) ! ! H5O flags declaration ! - INTEGER, PARAMETER :: H5O_FLAGS_LEN = 27 - INTEGER :: H5o_flags(H5O_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5O_FLAGS/ - !DEC$endif - COMMON /H5O_FLAGS/ H5O_flags - INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -633,45 +314,9 @@ MODULE H5GLOBAL INTEGER :: H5O_TYPE_DATASET_F INTEGER :: H5O_TYPE_NAMED_DATATYPE_F INTEGER :: H5O_TYPE_NTYPES_F - - EQUIVALENCE(h5o_flags(1) , H5O_COPY_SHALLOW_HIERARCHY_F) - EQUIVALENCE(h5o_flags(2) , H5O_COPY_EXPAND_SOFT_LINK_F) - EQUIVALENCE(h5o_flags(3) , H5O_COPY_EXPAND_EXT_LINK_F) - EQUIVALENCE(h5o_flags(4) , H5O_COPY_EXPAND_REFERENCE_F) - EQUIVALENCE(h5o_flags(5) , H5O_COPY_WITHOUT_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(6) , H5O_COPY_PRESERVE_NULL_FLAG_F) - EQUIVALENCE(h5o_flags(7) , H5O_COPY_ALL_F) - EQUIVALENCE(h5o_flags(8) , H5O_SHMESG_NONE_FLAG_F) - EQUIVALENCE(h5o_flags(9) , H5O_SHMESG_SDSPACE_FLAG_F) - EQUIVALENCE(h5o_flags(10) , H5O_SHMESG_DTYPE_FLAG_F) - EQUIVALENCE(h5o_flags(11) , H5O_SHMESG_FILL_FLAG_F) - EQUIVALENCE(h5o_flags(12) , H5O_SHMESG_PLINE_FLAG_F) - EQUIVALENCE(h5o_flags(13) , H5O_SHMESG_ATTR_FLAG_F) - EQUIVALENCE(h5o_flags(14) , H5O_SHMESG_ALL_FLAG_F) - EQUIVALENCE(h5o_flags(15) , H5O_HDR_CHUNK0_SIZE_F) - EQUIVALENCE(h5o_flags(16) , H5O_HDR_ATTR_CRT_ORDER_TRACK_F) - EQUIVALENCE(h5o_flags(17) , H5O_HDR_ATTR_CRT_ORDER_INDEX_F) - EQUIVALENCE(h5o_flags(18) , H5O_HDR_ATTR_STORE_PHASE_CHA_F) - EQUIVALENCE(h5o_flags(19) , H5O_HDR_STORE_TIMES_F) - EQUIVALENCE(h5o_flags(20) , H5O_HDR_ALL_FLAGS_F) - EQUIVALENCE(h5o_flags(21) , H5O_SHMESG_MAX_NINDEXES_F) - EQUIVALENCE(h5o_flags(22) , H5O_SHMESG_MAX_LIST_SIZE_F) - EQUIVALENCE(h5o_flags(23) , H5O_TYPE_UNKNOWN_F) - EQUIVALENCE(h5o_flags(24) , H5O_TYPE_GROUP_F) - EQUIVALENCE(h5o_flags(25) , H5O_TYPE_DATASET_F) - EQUIVALENCE(h5o_flags(26) , H5O_TYPE_NAMED_DATATYPE_F) - EQUIVALENCE(h5o_flags(27) , H5O_TYPE_NTYPES_F) - ! ! H5P flags declaration ! - INTEGER, PARAMETER :: H5P_FLAGS_LEN = 18 - INTEGER(HID_T) H5P_flags(H5P_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS/ - !DEC$endif - COMMON /H5P_FLAGS/ H5P_flags - INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -691,72 +336,16 @@ MODULE H5GLOBAL INTEGER(HID_T) :: H5P_LINK_CREATE_F INTEGER(HID_T) :: H5P_LINK_ACCESS_F - EQUIVALENCE(H5P_flags(1), H5P_FILE_CREATE_F) - EQUIVALENCE(H5P_flags(2), H5P_FILE_ACCESS_F) - EQUIVALENCE(H5P_flags(3), H5P_DATASET_CREATE_F) - EQUIVALENCE(H5P_flags(4), H5P_DATASET_XFER_F) - EQUIVALENCE(H5P_flags(5), H5P_FILE_MOUNT_F) - EQUIVALENCE(H5P_flags(6), H5P_DEFAULT_F) - EQUIVALENCE(H5P_flags(7), H5P_ROOT_F) - EQUIVALENCE(H5P_flags(8), H5P_OBJECT_CREATE_F) - EQUIVALENCE(H5P_flags(9), H5P_DATASET_ACCESS_F) - EQUIVALENCE(H5P_flags(10), H5P_GROUP_CREATE_F) - EQUIVALENCE(H5P_flags(11), H5P_GROUP_ACCESS_F) - EQUIVALENCE(H5P_flags(12), H5P_DATATYPE_CREATE_F) - EQUIVALENCE(H5P_flags(13), H5P_DATATYPE_ACCESS_F) - EQUIVALENCE(H5P_flags(14), H5P_STRING_CREATE_F) - EQUIVALENCE(H5P_flags(15), H5P_ATTRIBUTE_CREATE_F) - EQUIVALENCE(H5P_flags(16), H5P_OBJECT_COPY_F) - EQUIVALENCE(H5P_flags(17), H5P_LINK_CREATE_F) - EQUIVALENCE(H5P_flags(18), H5P_LINK_ACCESS_F) - - ! - ! H5P integers flags declaration - ! - INTEGER, PARAMETER :: H5P_FLAGS_INT_LEN = 2 - INTEGER :: H5P_flags_int(H5P_FLAGS_INT_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5P_FLAGS_INT/ - !DEC$endif - COMMON /H5P_FLAGS_INT/ H5P_flags_int INTEGER :: H5P_CRT_ORDER_INDEXED_F INTEGER :: H5P_CRT_ORDER_TRACKED_F - EQUIVALENCE(H5P_flags_int(1), H5P_CRT_ORDER_INDEXED_F) - EQUIVALENCE(H5P_flags_int(2), H5P_CRT_ORDER_TRACKED_F) ! ! H5R flags declaration ! - INTEGER, PARAMETER :: H5R_FLAGS_LEN = 2 - INTEGER :: H5R_flags(H5R_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5R_FLAGS/ - !DEC$endif - COMMON /H5R_FLAGS/ H5R_flags - INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F - - EQUIVALENCE(H5R_flags(1), H5R_OBJECT_F) - EQUIVALENCE(H5R_flags(2), H5R_DATASET_REGION_F) - ! ! H5S flags declaration ! - INTEGER, PARAMETER :: H5S_FLAGS_LEN = 18 - INTEGER :: H5S_flags(H5S_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HSIZE_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hsize_flags(H5S_HSIZE_FLAGS_LEN) - INTEGER, PARAMETER :: H5S_HID_FLAGS_LEN = 1 - INTEGER(HSIZE_T) H5S_hid_flags(H5S_HID_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HID_FLAGS/ - !DEC$ATTRIBUTES DLLEXPORT :: /H5S_HSIZE_FLAGS/ - !DEC$endif - COMMON /H5S_FLAGS/ H5S_flags - COMMON /H5S_HID_FLAGS/ H5S_hid_flags - COMMON /H5S_HSIZE_FLAGS/ H5S_hsize_flags - INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -781,43 +370,9 @@ MODULE H5GLOBAL INTEGER :: H5S_SEL_POINTS_F INTEGER :: H5S_SEL_HYPERSLABS_F INTEGER :: H5S_SEL_ALL_F - - EQUIVALENCE(H5S_hid_flags(1), H5S_ALL_F) - - EQUIVALENCE(H5S_hsize_flags(1), H5S_UNLIMITED_F) - - EQUIVALENCE(H5S_flags(1), H5S_SCALAR_F) - EQUIVALENCE(H5S_flags(2), H5S_SIMPLE_F) - EQUIVALENCE(H5S_flags(3), H5S_NULL_F) - EQUIVALENCE(H5S_flags(4), H5S_SELECT_SET_F) - EQUIVALENCE(H5S_flags(5), H5S_SELECT_OR_F) - - EQUIVALENCE(H5S_flags(6), H5S_SELECT_NOOP_F) - EQUIVALENCE(H5S_flags(7), H5S_SELECT_AND_F) - EQUIVALENCE(H5S_flags(8), H5S_SELECT_XOR_F) - EQUIVALENCE(H5S_flags(9), H5S_SELECT_NOTB_F) - EQUIVALENCE(H5S_flags(10), H5S_SELECT_NOTA_F) - - EQUIVALENCE(H5S_flags(11), H5S_SELECT_APPEND_F) - EQUIVALENCE(H5S_flags(12), H5S_SELECT_PREPEND_F) - EQUIVALENCE(H5S_flags(13), H5S_SELECT_INVALID_F) - EQUIVALENCE(H5S_flags(14), H5S_SEL_ERROR_F) - EQUIVALENCE(H5S_flags(15), H5S_SEL_NONE_F) - - EQUIVALENCE(H5S_flags(16), H5S_SEL_POINTS_F) - EQUIVALENCE(H5S_flags(17), H5S_SEL_HYPERSLABS_F) - EQUIVALENCE(H5S_flags(18), H5S_SEL_ALL_F) - ! ! H5T flags declaration ! - INTEGER, PARAMETER :: H5T_FLAGS_LEN = 35 - INTEGER :: H5T_flags(H5T_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5T_FLAGS/ - !DEC$endif - COMMON /H5T_FLAGS/ H5T_flags - INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -853,52 +408,9 @@ MODULE H5GLOBAL INTEGER :: H5T_STR_ERROR_F INTEGER :: H5T_DIR_ASCEND_F INTEGER :: H5T_DIR_DESCEND_F - - EQUIVALENCE(H5T_flags(1), H5T_NO_CLASS_F) - EQUIVALENCE(H5T_flags(2), H5T_INTEGER_F) - EQUIVALENCE(H5T_flags(3), H5T_FLOAT_F) - EQUIVALENCE(H5T_flags(4), H5T_TIME_F) - EQUIVALENCE(H5T_flags(5), H5T_STRING_F) - EQUIVALENCE(H5T_flags(6), H5T_BITFIELD_F) - EQUIVALENCE(H5T_flags(7), H5T_OPAQUE_F) - EQUIVALENCE(H5T_flags(8), H5T_COMPOUND_F) - EQUIVALENCE(H5T_flags(9), H5T_REFERENCE_F) - EQUIVALENCE(H5T_flags(10), H5T_ENUM_F) - EQUIVALENCE(H5T_flags(11), H5T_ORDER_LE_F) - EQUIVALENCE(H5T_flags(12), H5T_ORDER_BE_F) - EQUIVALENCE(H5T_flags(13), H5T_ORDER_MIXED_F) - EQUIVALENCE(H5T_flags(14), H5T_ORDER_VAX_F) - EQUIVALENCE(H5T_flags(15), H5T_ORDER_NONE_F) - EQUIVALENCE(H5T_flags(16), H5T_PAD_ZERO_F) - EQUIVALENCE(H5T_flags(17), H5T_PAD_ONE_F) - EQUIVALENCE(H5T_flags(18), H5T_PAD_BACKGROUND_F) - EQUIVALENCE(H5T_flags(19), H5T_PAD_ERROR_F) - EQUIVALENCE(H5T_flags(20), H5T_SGN_NONE_F) - EQUIVALENCE(H5T_flags(21), H5T_SGN_2_F) - EQUIVALENCE(H5T_flags(22), H5T_SGN_ERROR_F) - EQUIVALENCE(H5T_flags(23), H5T_NORM_IMPLIED_F) - EQUIVALENCE(H5T_flags(24), H5T_NORM_MSBSET_F) - EQUIVALENCE(H5T_flags(25), H5T_NORM_NONE_F) - EQUIVALENCE(H5T_flags(26), H5T_CSET_ASCII_F) - EQUIVALENCE(H5T_flags(27), H5T_CSET_UTF8_F) - EQUIVALENCE(H5T_flags(28), H5T_STR_NULLTERM_F) - EQUIVALENCE(H5T_flags(29), H5T_STR_NULLPAD_F) - EQUIVALENCE(H5T_flags(30), H5T_STR_SPACEPAD_F) - EQUIVALENCE(H5T_flags(31), H5T_STR_ERROR_F) - EQUIVALENCE(H5T_flags(32), H5T_VLEN_F) - EQUIVALENCE(H5T_flags(33), H5T_ARRAY_F) - EQUIVALENCE(H5T_flags(34), H5T_DIR_ASCEND_F) - EQUIVALENCE(H5T_flags(35), H5T_DIR_DESCEND_F) ! ! H5Z flags declaration ! - INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 20 - INTEGER :: H5Z_flags(H5Z_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/ - !DEC$endif - COMMON /H5Z_FLAGS/ H5Z_flags - INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -919,58 +431,12 @@ MODULE H5GLOBAL INTEGER :: H5Z_SO_FLOAT_ESCALE_F INTEGER :: H5Z_SO_INT_F INTEGER :: H5Z_SO_INT_MINBITS_DEFAULT_F - - EQUIVALENCE(H5Z_flags(1), H5Z_FILTER_ERROR_F) - EQUIVALENCE(H5Z_flags(2), H5Z_FILTER_NONE_F) - EQUIVALENCE(H5Z_flags(3), H5Z_FILTER_DEFLATE_F) - EQUIVALENCE(H5Z_flags(4), H5Z_FILTER_SHUFFLE_F) - EQUIVALENCE(H5Z_flags(5), H5Z_FILTER_FLETCHER32_F) - EQUIVALENCE(H5Z_flags(6), H5Z_ERROR_EDC_F) - EQUIVALENCE(H5Z_flags(7), H5Z_DISABLE_EDC_F) - EQUIVALENCE(H5Z_flags(8), H5Z_ENABLE_EDC_F) - EQUIVALENCE(H5Z_flags(9), H5Z_NO_EDC_F) - EQUIVALENCE(H5Z_flags(10), H5Z_FILTER_SZIP_F) - EQUIVALENCE(H5Z_flags(11), H5Z_FLAG_OPTIONAL_F) - EQUIVALENCE(H5Z_flags(12), H5Z_FILTER_ENCODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(13), H5Z_FILTER_DECODE_ENABLED_F) - EQUIVALENCE(H5Z_flags(14), H5Z_FILTER_ALL_F) - EQUIVALENCE(H5Z_flags(15), H5Z_FILTER_NBIT_F) - EQUIVALENCE(H5Z_flags(16), H5Z_FILTER_SCALEOFFSET_F) - EQUIVALENCE(H5Z_flags(17), H5Z_SO_FLOAT_DSCALE_F) - EQUIVALENCE(H5Z_flags(18), H5Z_SO_FLOAT_ESCALE_F) - EQUIVALENCE(H5Z_flags(19), H5Z_SO_INT_F) - EQUIVALENCE(H5Z_flags(20), H5Z_SO_INT_MINBITS_DEFAULT_F) - ! ! H5 Library flags declaration ! - INTEGER, PARAMETER :: H5LIB_FLAGS_LEN = 2 - INTEGER :: H5LIB_flags(H5LIB_FLAGS_LEN) - !DEC$if defined(BUILD_HDF5_DLL) - !DEC$ATTRIBUTES DLLEXPORT :: /H5LIB_FLAGS/ - !DEC$endif - COMMON /H5LIB_FLAGS/ H5LIB_flags INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - ! - EQUIVALENCE(H5LIB_flags(1), H5_SZIP_EC_OM_F) - EQUIVALENCE(H5LIB_flags(2), H5_SZIP_NN_OM_F) - - ! General H5 flags declarations - ! -!!$ INTEGER, PARAMETER :: H5_FLAGS_LEN = 2 -!!$ INTEGER H5_flags(H5_FLAGS_LEN) -!!$!DEC$if defined(BUILD_HDF5_DLL) -!!$!DEC$ATTRIBUTES DLLEXPORT :: /H5_FLAGS/ -!!$!DEC$endif -!!$ COMMON /H5_FLAGS/ H5_flags -!!$ -!!$ INTEGER :: _F -!!$ INTEGER :: H5F_SCOPE_LOCAL_F -!!$ -!!$ EQUIVALENCE(H5F_flags(1), H5F_SCOPE_GLOBAL_F) -!!$ EQUIVALENCE(H5F_flags(2), H5F_SCOPE_LOCAL_F) CONTAINS -- cgit v0.12 From b162b949988def452b2a4a34426212d246e54b52 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 15 Nov 2017 17:14:35 -0600 Subject: Correct linkage of filters and other libs --- CMakeFilters.cmake | 16 ++++++++-------- src/CMakeLists.txt | 4 ++-- test/CMakeLists.txt | 4 ++-- test/dsets.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 804b16b..71dabb1 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -45,8 +45,8 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (NOT ZLIB_FOUND) find_package (ZLIB) # Legacy find if (ZLIB_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_LIBRARIES}) endif () endif () endif () @@ -78,9 +78,9 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${ZLIB_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${ZLIB_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) message (STATUS "Filter ZLIB is ON") endif () @@ -96,8 +96,8 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find if (SZIP_FOUND) - set (LINK_LIBS ${LINK_LIBS} ${SZIP_LIBRARIES}) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_LIBRARIES}) endif () endif () endif () @@ -119,9 +119,9 @@ if (HDF5_ENABLE_SZIP_SUPPORT) endif () endif () if (BUILD_SHARED_LIBS) - set (LINK_SHARED_LIBS ${LINK_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) + set (LINK_COMP_SHARED_LIBS ${LINK_COMP_SHARED_LIBS} ${SZIP_SHARED_LIBRARY}) endif () - set (LINK_LIBS ${LINK_LIBS} ${SZIP_STATIC_LIBRARY}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) message (STATUS "Filter SZIP is ON") if (H5_HAVE_FILTER_SZIP) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 91b8e0c..b163b8a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -883,7 +883,7 @@ set (gen_SRCS ${HDF5_BINARY_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIB_TARGET} STATIC " " " ") -target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS}) +target_link_libraries (${HDF5_LIB_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIB_TARGET} PUBLIC dl) endif () @@ -927,7 +927,7 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_BINARY_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED " " " ") - target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS}) + target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS}) if (NOT WIN32) target_link_libraries (${HDF5_LIBSH_TARGET} PUBLIC dl) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a2afbf..fca864b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,7 +37,7 @@ endif () if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") endif () -target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) +target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test @@ -53,7 +53,7 @@ if (BUILD_SHARED_LIBS) if (MINGW) target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") endif () - target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_LIBS}) H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION}) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test diff --git a/test/dsets.c b/test/dsets.c index 4088304..0fff2d1 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -2087,7 +2087,7 @@ test_get_filter_info(void) #ifdef H5_HAVE_FILTER_SZIP if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR - if(SZ_encoder_enabled()) { + if(H5Z_SZIP->encoder_present) { if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR -- cgit v0.12 From bbc0c85ab221d88565ddd2a1f4852b73d77d0fa2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:04:50 -0600 Subject: Add note for plugins --- release_docs/RELEASE.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f8ad620..9e3c3a9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -157,6 +157,25 @@ Bug Fixes since HDF5-1.10.1 release Library ------- + - filter plugin handling in H5PL.c and H5Z.c + + It was discovered that the dynamic loading process used by + filter plugins had issues with memory allocation and library + dependencies. + + CMake build process changed to use LINK INTERFACE keywords, which + allowed HDF5 C library to make dependent libraries private. The + filter plugin libraries no longer require dependent libraries + (such as szip or zlib) to be available. + (ADB - 2017/11/16, HDFFV-10328) + + The H5Z_class2_t structure returned by the filter plugins are + now dynamically allocated in H5Zregister function. Access to + the functions in the filter library now always use the dynamic + library API. + + (ADB - 2017/11/16, HDFFV-10329) + - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 3098356df0eeed116acca9d8997f672f6c8520a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 09:28:58 -0600 Subject: Fix some of the whitespace --- test/tattr.c | 254 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/test/tattr.c b/test/tattr.c index d7152ed..3786d0d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -163,21 +163,21 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, static void test_attr_basic_write(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t attr_size; /* storage size for attribute */ - ssize_t attr_name_size; /* size of attribute name */ - char *attr_name=NULL; /* name of attribute */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int i; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1,sid2; /* Dataspace ID */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t attr_size; /* storage size for attribute */ + ssize_t attr_name_size; /* size of attribute name */ + char *attr_name=NULL; /* name of attribute */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int i; + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n")); @@ -402,15 +402,15 @@ test_attr_basic_write(hid_t fapl) static void test_attr_basic_read(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t attr; /* Attribute ID */ - H5O_info_t oinfo; /* Object info */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t attr; /* Attribute ID */ + H5O_info_t oinfo; /* Object info */ int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ - int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + int i, j; /* Local index variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -500,7 +500,7 @@ test_attr_flush(hid_t fapl) set; /* Dataset ID */ double wdata=3.14159F; /* Data to write */ double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Flushing\n")); @@ -563,12 +563,12 @@ test_attr_plist(hid_t fapl) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t plist; /* Property list ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - H5T_cset_t cset; /* Character set for attributes */ - herr_t ret; /* Generic return value */ + hid_t attr; /* Attribute ID */ + hid_t plist; /* Property list ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + H5T_cset_t cset; /* Character set for attributes */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Property Lists\n")); @@ -675,14 +675,14 @@ static void test_attr_compound_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -762,11 +762,11 @@ test_attr_compound_write(hid_t fapl) static void test_attr_compound_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ int rank; /* Attribute rank */ hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ @@ -781,7 +781,7 @@ test_attr_compound_read(hid_t fapl) ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j; /* Local index variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -830,7 +830,7 @@ test_attr_compound_read(hid_t fapl) HDstrcmp(fieldname, ATTR4_FIELDNAME3))) TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname); H5free_memory(fieldname); - } /* end for */ + } /* end for */ offset = H5Tget_member_offset(type, 0); VERIFY(offset, attr4_field1_off, "H5Tget_member_offset"); offset = H5Tget_member_offset(type, 1); @@ -878,7 +878,7 @@ test_attr_compound_read(hid_t fapl) printf("%d: attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n", __LINE__, i, j, attr_data4[i][j].i, i, j, read_data4[i][j].i); printf("%d: attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n", __LINE__, i, j, attr_data4[i][j].d, i, j, read_data4[i][j].d); TestErrPrintf("%d: attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n", __LINE__, i, j, attr_data4[i][j].c, i, j, read_data4[i][j].c); - } /* end if */ + } /* end if */ /* Verify Name */ name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name); @@ -913,12 +913,12 @@ static void test_attr_scalar_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -979,13 +979,13 @@ static void test_attr_scalar_read(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ H5S_class_t stype; /* Dataspace class */ - float rdata = 0.0F; /* Buffer for reading 1st attribute */ + float rdata = 0.0F; /* Buffer for reading 1st attribute */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n")); @@ -1013,8 +1013,8 @@ test_attr_scalar_read(hid_t fapl) /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(rdata, attr_data5)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__); /* Get the attribute's dataspace */ sid = H5Aget_space(attr); @@ -1051,15 +1051,15 @@ static void test_attr_mult_write(hid_t fapl) { hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1,sid2; /* Dataspace ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid1,sid2; /* Dataspace ID */ hid_t attr; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; - hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2}; + hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3}; hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Multiple Attribute Functions\n")); @@ -1170,11 +1170,11 @@ test_attr_mult_write(hid_t fapl) static void test_attr_mult_read(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t space; /* Attribute dataspace */ hid_t type; /* Attribute datatype */ - hid_t attr; /* Attribute ID */ + hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */ int rank; /* Attribute rank */ @@ -1185,10 +1185,10 @@ test_attr_mult_read(hid_t fapl) int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */ int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */ double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3] = {{{0}}}; /* Buffer for reading 3rd attribute */ - ssize_t name_len; /* Length of attribute name */ + ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ int i, j, k; /* Local index values */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1432,12 +1432,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR static void test_attr_iterate(hid_t fapl) { - hid_t file; /* HDF5 File ID */ + hid_t file; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ int count; /* operator data for the iterator */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1504,13 +1504,13 @@ test_attr_iterate(hid_t fapl) static void test_attr_delete(hid_t fapl) { - hid_t fid1; /* HDF5 File ID */ + hid_t fid1; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ hid_t attr; /* Attribute ID */ char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */ ssize_t name_len; /* Length of attribute name */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Attribute Functions\n")); @@ -1635,7 +1635,7 @@ test_attr_dtype_shared(hid_t fapl) H5O_info_t oinfo; /* Object's information */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Shared Datatypes with Attributes\n")); @@ -1802,17 +1802,17 @@ test_attr_dtype_shared(hid_t fapl) static void test_attr_duplicate_ids(hid_t fapl) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t gid1, gid2; /* Group ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t gid1, gid2; /* Group ID */ hid_t sid1,sid2; /* Dataspace ID */ - hid_t attr, attr2; /* Attribute ID */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {ATTR1_DIM1}; - int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ - int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ - int i; - herr_t ret; /* Generic return value */ + hid_t attr, attr2; /* Attribute ID */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {ATTR1_DIM1}; + int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */ + int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ + int i; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two ID handles\n")); @@ -1830,7 +1830,7 @@ test_attr_duplicate_ids(hid_t fapl) /* Create a dataset */ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); /* Create dataspace for attribute */ @@ -2047,12 +2047,12 @@ test_attr_duplicate_ids(hid_t fapl) static int test_attr_dense_verify(hid_t loc_id, unsigned max_attr) { - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - hid_t attr; /* Attribute ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t attr; /* Attribute ID */ unsigned value; /* Attribute value */ unsigned u; /* Local index variable */ int old_nerrs; /* Number of errors when entering this check */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Retrieve the current # of reported errors */ old_nerrs = GetTestNumErrs(); @@ -2117,19 +2117,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) static void test_attr_dense_create(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dense Attribute Storage Creation\n")); @@ -2248,19 +2248,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) static void test_attr_dense_open(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n")); @@ -2387,20 +2387,20 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) static void test_attr_dense_delete(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n")); @@ -2565,21 +2565,21 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) static void test_attr_dense_rename(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t attr; /* Attribute ID */ - hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ - char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t attr; /* Attribute ID */ + hid_t dcpl; /* Dataset creation property list ID */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n")); @@ -2724,21 +2724,21 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) static void test_attr_dense_unlink(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ size_t mesg_count; /* # of shared messages */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ H5O_info_t oinfo; /* Object info */ unsigned u; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n")); @@ -2856,17 +2856,17 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) { hid_t fid; /* HDF5 File ID */ hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ + hid_t sid; /* Dataspace ID */ hid_t attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u; /* Local index variable */ h5_stat_size_t empty_filesize; /* Size of empty file */ h5_stat_size_t filesize; /* Size of file after modifications */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n")); @@ -3019,13 +3019,13 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) static void test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) { - hid_t fid; /* HDF5 File ID */ - hid_t dataset; /* Dataset ID */ + hid_t fid; /* HDF5 File ID */ + hid_t dataset; /* Dataset ID */ hid_t gid1, gid2; /* Group ID */ - hid_t sid, sid2; /* Dataspace ID */ + hid_t sid, sid2; /* Dataspace ID */ hid_t attr, attr2, add_attr; /* Attribute ID */ hid_t dcpl; /* Dataset creation property list ID */ - char attrname[NAME_BUF_SIZE]; /* Name of attribute */ + char attrname[NAME_BUF_SIZE]; /* Name of attribute */ hsize_t dims[] = {ATTR1_DIM1}; int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */ @@ -3033,9 +3033,9 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) unsigned read_scalar; /* variable for reading attribute*/ unsigned max_compact; /* Maximum # of attributes to store compactly */ unsigned min_dense; /* Minimum # of attributes to store "densely" */ - htri_t is_dense; /* Are attributes stored densely? */ + htri_t is_dense; /* Are attributes stored densely? */ unsigned u, i; /* Local index variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n")); -- cgit v0.12 From f4f94e1bf845e40ea085c93d03724ac96cb61b68 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 11:45:36 -0600 Subject: HDFFV-10328 merge allocation changes from 1.8 --- src/H5PLint.c | 21 +- src/H5PLplugin_cache.c | 26 +- src/H5Z.c | 715 ++++++++++++++++++++++++++----------------------- 3 files changed, 422 insertions(+), 340 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..e969cbf 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,19 +342,38 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { + H5Z_class2_t *plugin_copy = NULL; /* Store the plugin in the cache */ if (H5PL__add_plugin(type, id, handle)) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") + /* allocate local copy of plugin info */ + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = (const void *)info; + + plugin_copy->version = info->version; + plugin_copy->id = info->id; + plugin_copy->encoder_present = info->encoder_present; + plugin_copy->decoder_present = info->decoder_present; + plugin_copy->can_apply = info->can_apply; + plugin_copy->set_local = info->set_local; + plugin_copy->filter = info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") + /* Set output parameters */ *success = TRUE; - *plugin_info = (const void *)info; } } done: if (!success && handle) + if (*plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index d826ba0..ec14159 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,18 +280,34 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; + H5Z_class2_t *plugin_copy = NULL; /* Get the "get plugin info" function from the plugin. */ if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info"))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get function for H5PLget_plugin_info") /* Call the "get plugin info" function */ if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "can't get plugin info") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + + if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") + /* Set the plugin info to return */ + *plugin_info = plugin_copy; + + plugin_copy->version = filter_info->version; + plugin_copy->id = filter_info->id; + plugin_copy->encoder_present = filter_info->encoder_present; + plugin_copy->decoder_present = filter_info->decoder_present; + plugin_copy->can_apply = filter_info->can_apply; + plugin_copy->set_local = filter_info->set_local; + plugin_copy->filter = filter_info->filter; + /* copy the user's string into the property */ + if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") /* Set output parameters */ *found = TRUE; - *plugin_info = filter_info; /* No need to continue processing */ break; @@ -301,6 +317,10 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: + /* unallocate local copy of plugin info on failure */ + if (FAIL == ret_value && *plugin_info) { + *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index 1d023b5..e7574cd 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -34,15 +34,15 @@ #ifdef H5Z_DEBUG typedef struct H5Z_stats_t { struct { - hsize_t total; /*total number of bytes processed */ - hsize_t errors; /*bytes of total attributable to errors */ - H5_timer_t timer; /*execution time including errors */ - } stats[2]; /*0=output, 1=input */ + hsize_t total; /* total number of bytes processed */ + hsize_t errors; /* bytes of total attributable to errors */ + H5_timer_t timer; /* execution time including errors */ + } stats[2]; /* 0=output, 1=input */ } H5Z_stats_t; #endif /* H5Z_DEBUG */ typedef struct H5Z_object_t { - H5Z_filter_t filter_id; /* ID of the filter we're looking for */ + H5Z_filter_t filter_id; /* ID of the filter we're looking for */ htri_t found; /* Whether we find an object using the filter */ } H5Z_object_t; @@ -86,23 +86,23 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if(H5Z_register(H5Z_SHUFFLE) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if(H5Z_register(H5Z_FLETCHER32) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if(H5Z_register(H5Z_NBIT) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if(H5Z_register(H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register (H5Z_SHUFFLE) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register (H5Z_FLETCHER32) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register (H5Z_NBIT) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register (H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if(H5Z_register(H5Z_DEFLATE) < 0) + if (H5Z_register (H5Z_DEFLATE) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if(H5Z_register(H5Z_SZIP) < 0) + if (H5Z_register (H5Z_SZIP) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ @@ -123,6 +123,7 @@ int H5Z_term_package(void) { int n = 0; + size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -130,7 +131,6 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; - size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,6 +179,12 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ + for (i = 0; i < H5Z_table_used_g; i++) { + H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (cls->name) + cls->name = (char *)H5MM_xfree(cls->name); + } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -211,8 +217,8 @@ herr_t H5Zregister(const void *cls) { const H5Z_class2_t *cls_real = (const H5Z_class2_t *) cls; /* "Real" class pointer */ - H5Z_class2_t cls_new; /* Translated class struct */ - herr_t ret_value=SUCCEED; /* Return value */ + H5Z_class2_t cls_new; /* Translated class struct */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "*x", cls); @@ -231,7 +237,7 @@ H5Zregister(const void *cls) * at least 256, there should be no overlap and the version of the struct * can be determined by the value of the first field. */ - if(cls_real->version != H5Z_CLASS_T_VERS) { + if (cls_real->version != H5Z_CLASS_T_VERS) { #ifndef H5_NO_DEPRECATED_SYMBOLS /* Assume it is an old "H5Z_class1_t" instead */ const H5Z_class1_t *cls_old = (const H5Z_class1_t *) cls; @@ -251,19 +257,19 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ - if (cls_real->id<0 || cls_real->id>H5Z_FILTER_MAX) + if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if (cls_real->idid < H5Z_FILTER_RESERVED) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") - if (cls_real->filter==NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + if (cls_real->filter == NULL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls_real)<0) + if (H5Z_register (cls_real) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: @@ -277,39 +283,40 @@ done: * Purpose: Same as the public version except this one allows filters * to be set for predefined method numbers id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert (cls); + HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ - for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == cls->id) + for (i = 0; i < H5Z_table_used_g; i++) + if (H5Z_table_g[i].id == cls->id) break; /* Filter not already registered */ - if(i >= H5Z_table_used_g) { - if(H5Z_table_used_g >= H5Z_table_alloc_g) { - size_t n = MAX(H5Z_MAX_NFILTERS, 2*H5Z_table_alloc_g); + if (i >= H5Z_table_used_g) { + if (H5Z_table_used_g >= H5Z_table_alloc_g) { + size_t n = MAX(H5Z_MAX_NFILTERS, 2 * H5Z_table_alloc_g); H5Z_class2_t *table = (H5Z_class2_t *)H5MM_realloc(H5Z_table_g, n * sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ - if(!table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") + if (!table) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") H5Z_table_g = table; #ifdef H5Z_DEBUG - if(!stat_table) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") + if (!stat_table) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") H5Z_stat_table_g = stat_table; #endif /* H5Z_DEBUG */ H5Z_table_alloc_g = n; @@ -317,15 +324,21 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #ifdef H5Z_DEBUG - HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); + HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { + H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); + /* deallocate plugin info name */ + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); + old_cls->name = (char *)H5MM_xstrdup(cls->name); } /* end else */ done: @@ -338,25 +351,26 @@ done: * * Purpose: This function unregisters a filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Zunregister(H5Z_filter_t id) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("e", "Zf", id); /* Check args */ - if(id < 0 || id > H5Z_FILTER_MAX) + if (id < 0 || id > H5Z_FILTER_MAX) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if(id < H5Z_FILTER_RESERVED) + if (id < H5Z_FILTER_RESERVED) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") /* Do it */ - if(H5Z_unregister(id) < 0) + if (H5Z_unregister(id) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to unregister filter") done: @@ -370,27 +384,29 @@ done: * Purpose: Same as the public version except this one allows filters * to be unset for predefined method numbers =0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (filter_index=0; filter_index=H5Z_table_used_g) + if (filter_index >= H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") /* Initialize the structure object for iteration */ @@ -398,28 +414,32 @@ H5Z_unregister(H5Z_filter_t filter_id) object.found = FALSE; /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_DATASET, H5Z__check_unregister_dset_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a dataset is still using it") /* Iterate through all opened groups, returns a failure if any of them uses the filter */ - if(H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) + if (H5I_iterate(H5I_GROUP, H5Z__check_unregister_group_cb, &object, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - if(object.found) + if (object.found) HGOTO_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "can't unregister filter because a group is still using it") /* Iterate through all opened files and flush them */ - if(H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) + if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") + /* deallocate plugin info name */ + old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); + if (old_cls->name) + old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -431,10 +451,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister * - * Purpose: Check if an object uses the filter to be unregistered. + * Purpose: Check if an object uses the filter to be unregistered. * - * Return: TRUE if the object uses the filter. - * FALSE if not, NEGATIVE on error. + * Return: TRUE if the object uses the filter. + * FALSE if not, NEGATIVE on error. *------------------------------------------------------------------------- */ static htri_t @@ -446,12 +466,12 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) FUNC_ENTER_STATIC /* Get the plist structure of object creation */ - if(NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) + HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ - if((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -483,25 +503,25 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void HDassert(obj_ptr); /* Get the group creation property */ - if((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -510,13 +530,13 @@ done: /*------------------------------------------------------------------------- * Function: H5Z__check_unregister_dset_cb * - * Purpose: The callback function for H5Z_unregister. It iterates - * through all opened objects. If the object is a dataset - * or a group and it uses the filter to be unregistered, the - * function returns TRUE. + * Purpose: The callback function for H5Z_unregister. It iterates + * through all opened objects. If the object is a dataset + * or a group and it uses the filter to be unregistered, the + * function returns TRUE. * - * Return: TRUE if the object uses the filter. - * FALSE otherwise. + * Return: TRUE if the object uses the filter. + * FALSE otherwise. *------------------------------------------------------------------------- */ static int @@ -529,28 +549,28 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* Get the dataset creation property */ - if((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") + if ((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") /* Check if the filter is in the dataset creation property list */ - if((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. */ - if(filter_in_pline) { + if (filter_in_pline) { object->found = TRUE; ret_value = TRUE; } /* end if */ done: - if(ocpl_id > 0) - if(H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + if (ocpl_id > 0) + if (H5I_dec_app_ref(ocpl_id) < 0) + HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -569,17 +589,17 @@ done: static int H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUSED *key) { - int ret_value = FALSE; /* Return value */ + int ret_value = FALSE; /* Return value */ FUNC_ENTER_STATIC - HDassert(obj_ptr); + HDassert (obj_ptr); /* Call the flush routine for mounted file hierarchies. Do a global flush * if the file is opened for write */ - if(H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { - if(H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + if (H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { + if (H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -598,17 +618,17 @@ done: htri_t H5Zfilter_avail(H5Z_filter_t id) { - htri_t ret_value=FALSE; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("t", "Zf", id); /* Check args */ - if(id<0 || id>H5Z_FILTER_MAX) + if (id < 0 || id > H5Z_FILTER_MAX) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") - if((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + if ((ret_value = H5Z_filter_avail(id)) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -626,21 +646,25 @@ done: htri_t H5Z_filter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ - const H5Z_class2_t *filter_info; - htri_t ret_value = FALSE; /* Return value */ + size_t i; /* Local index variable */ + H5Z_class2_t *filter_info; + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ - for(i = 0; i < H5Z_table_used_g; i++) - if(H5Z_table_g[i].id == id) - HGOTO_DONE(TRUE) - - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") - HGOTO_DONE(TRUE) + for (i = 0; i < H5Z_table_used_g; i++) + if (H5Z_table_g[i].id == id) + HGOTO_DONE (TRUE) + + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE (TRUE) } done: FUNC_LEAVE_NOAPI(ret_value) @@ -666,59 +690,59 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, { H5Z_class2_t *fclass; /* Individual filter information */ size_t u; /* Local index variable */ - htri_t ret_value = TRUE; /* Return value */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI_NOINIT HDassert(pline->nused > 0); /* Iterate over filters */ - for(u = 0; u < pline->nused; u++) { + for (u = 0; u < pline->nused; u++) { /* Get filter information */ - if(NULL == (fclass = H5Z_find(pline->filter[u].id))) { + if (NULL == (fclass = H5Z_find(pline->filter[u].id))) { /* Ignore errors from optional filters */ - if(pline->filter[u].flags & H5Z_FLAG_OPTIONAL) - H5E_clear_stack(NULL); + if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) + H5E_clear_stack (NULL); else - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ - switch(prelude_type) { + switch (prelude_type) { case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ - if(!fclass->encoder_present) - HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + if (!fclass->encoder_present) + HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ - if(fclass->can_apply) { + if (fclass->can_apply) { /* Make callback to filter's "can apply" function */ htri_t status = (fclass->can_apply)(dcpl_id, type_id, space_id); /* Indicate error during filter callback */ - if(status < 0) + if (status < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "error during user callback") /* Indicate filter can't apply to this combination of parameters. * If the filter is NOT optional, returns failure. */ - if(status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) + if (status == FALSE && !(pline->filter[u].flags & H5Z_FLAG_OPTIONAL)) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate") } /* end if */ break; case H5Z_PRELUDE_SET_LOCAL: /* Check if there is a "set local" callback */ - if(fclass->set_local) { + if (fclass->set_local) { /* Make callback to filter's "set local" function */ - if((fclass->set_local)(dcpl_id, type_id, space_id) < 0) + if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; default: - HDassert("invalid prelude type" && 0); + HDassert ("invalid prelude type" && 0); } /* end switch */ } /* end else */ } /* end for */ @@ -745,62 +769,62 @@ done: static herr_t H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { - hid_t space_id = -1; /* ID for dataspace describing chunk */ - herr_t ret_value = SUCCEED; /* Return value */ + hid_t space_id = -1; /* ID for dataspace describing chunk */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert(H5I_DATATYPE == H5I_get_type(type_id)); + HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert (H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ - if(dcpl_id != H5P_DATASET_CREATE_DEFAULT) { - H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - H5O_layout_t dcpl_layout; /* Dataset's layout information */ + if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + H5O_layout_t dcpl_layout; /* Dataset's layout information */ /* Get dataset creation property list object */ - if(NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") + if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) + HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Peek at the layout information */ - if(H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") + if (H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") /* Check if the dataset is chunked */ - if(H5D_CHUNKED == dcpl_layout.type) { + if (H5D_CHUNKED == dcpl_layout.type) { H5O_pline_t dcpl_pline; /* Object's I/O pipeline information */ /* Get I/O pipeline information */ - if(H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") + if (H5P_peek(dc_plist, H5O_CRT_PIPELINE_NAME, &dcpl_pline) < 0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve pipeline filter") /* Check if the chunks have filters */ - if(dcpl_pline.nused > 0) { + if (dcpl_pline.nused > 0) { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; /* Size of chunk dimensions */ - H5S_t *space; /* Dataspace describing chunk */ - size_t u; /* Local index variable */ + H5S_t *space; /* Dataspace describing chunk */ + size_t u; /* Local index variable */ - /* Create a data space for a chunk & set the extent */ - for(u = 0; u < dcpl_layout.u.chunk.ndims; u++) + /* Create a dataspace for a chunk & set the extent */ + for (u = 0; u < dcpl_layout.u.chunk.ndims; u++) chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; - if(NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") + if (NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) + HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ - if((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close(space); - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") + if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { + (void)H5S_close (space); + HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ /* Make the callbacks */ - if(H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") } /* end if */ } /* end if */ } /* end if */ done: - if(space_id > 0 && H5I_dec_ref(space_id) < 0) + if (space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") FUNC_LEAVE_NOAPI(ret_value) @@ -814,7 +838,8 @@ done: * property list can be applied to a particular combination of * datatype and dataspace for a dataset. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure * * Notes: The chunk dimensions are used to create a dataspace, instead * of passing in the dataset's dataspace, since the chunk @@ -829,8 +854,8 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -844,7 +869,8 @@ done: * settings for filters on a new dataset, based on the datatype * and dataspace of that dataset (chunk). * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure * * Notes: The chunk dimensions are used to create a dataspace, instead * of passing in the dataset's dataspace, since the chunk @@ -859,8 +885,8 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) FUNC_ENTER_NOAPI(FAIL) /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -874,7 +900,8 @@ done: * applied to an opaque byte stream (currently only a group). * The pipeline is assumed to have at least one filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -884,11 +911,11 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -902,7 +929,8 @@ done: * new opaque object. The pipeline is assumed to have at * least one filter. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure * * Notes: This callback will almost certainly not do anything * useful, other than to make certain that the filter will @@ -916,11 +944,11 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert(pline->nused > 0); + HDassert (pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -930,58 +958,59 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_modify * - * Purpose: Modify filter parameters for specified pipeline. + * Purpose: Modify filter parameters for specified pipeline. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - size_t idx; /* Index of filter in pipeline */ - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx > pline->nused) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + if (idx > pline->nused) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; pline->filter[idx].cd_nelmts = cd_nelmts; /* Free any existing parameters */ - if(pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values != NULL && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) H5MM_xfree(pline->filter[idx].cd_values); /* Set parameters */ - if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) - pline->filter[idx].cd_values[i] = cd_values[i]; + for (i = 0; i < cd_nelmts; i++) + pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else pline->filter[idx].cd_values = NULL; @@ -996,36 +1025,37 @@ done: * * Purpose: Append another filter to the specified pipeline. * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]) { - size_t idx; - herr_t ret_value = SUCCEED; /* Return value */ + size_t idx; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert(0 == cd_nelmts || cd_values); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert (0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may * decide to relax this restriction in the future. */ - if(pline->nused >= H5Z_MAX_NFILTERS) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") + if (pline->nused >= H5Z_MAX_NFILTERS) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "too many filters in pipeline") /* Check for freshly allocated filter pipeline */ - if(pline->version == 0) + if (pline->version == 0) pline->version = H5O_PLINE_VERSION_1; /* Allocate additional space in the pipeline if it's full */ - if(pline->nused >= pline->nalloc) { + if (pline->nused >= pline->nalloc) { H5O_pline_t x; size_t n; @@ -1036,14 +1066,14 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, * filter struct is reallocated. Set these pointers to ~NULL * so that we can reset them after reallocating the filters array. */ - for(n = 0; n < pline->nalloc; ++n) - if(pline->filter[n].cd_values == pline->filter[n]._cd_values) + for (n = 0; n < pline->nalloc; ++n) + if (pline->filter[n].cd_values == pline->filter[n]._cd_values) pline->filter[n].cd_values = (unsigned *)((void *) ~((size_t)NULL)); x.nalloc = MAX(H5Z_MAX_NFILTERS, 2 * pline->nalloc); x.filter = (H5Z_filter_info_t *)H5MM_realloc(pline->filter, x.nalloc * sizeof(x.filter[0])); - if(NULL == x.filter) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") + if (NULL == x.filter) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") /* Fix pointers in previous filters that need to point to their own * internal data. @@ -1061,22 +1091,22 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, idx = pline->nused; pline->filter[idx].id = filter; pline->filter[idx].flags = flags; - pline->filter[idx].name = NULL; /* we'll pick it up later*/ + pline->filter[idx].name = NULL; /*we'll pick it up later*/ pline->filter[idx].cd_nelmts = cd_nelmts; - if(cd_nelmts > 0) { - size_t i; /* Local index variable */ + if (cd_nelmts > 0) { + size_t i; /* Local index variable */ /* Allocate memory or point at internal buffer */ - if(cd_nelmts > H5Z_COMMON_CD_VALUES) { + if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); - if(NULL == pline->filter[idx].cd_values) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + if (NULL == pline->filter[idx].cd_values) + HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; /* Copy client data values */ - for(i = 0; i < cd_nelmts; i++) + for (i = 0; i < cd_nelmts; i++) pline->filter[idx].cd_values[i] = cd_values[i]; } /* end if */ else @@ -1095,8 +1125,8 @@ done: * Purpose: Given a filter ID return the offset in the global array * that holds all the registered filters. * - * Return: Success: Non-negative index of entry in global filter table. - * Failure: Negative + * Return: Success: Non-negative index of entry in global filter table. + * Failure: Negative *------------------------------------------------------------------------- */ static int @@ -1107,9 +1137,9 @@ H5Z_find_idx(H5Z_filter_t id) FUNC_ENTER_NOAPI_NOINIT_NOERR - for (i=0; ifilter[].flags). The filters are processed in - * definition order unless the H5Z_FLAG_REVERSE is set. The - * FILTER_MASK is a bit-mask to indicate which filters to skip - * and on exit will indicate which filters failed. Each - * filter has an index number in the pipeline and that index - * number is the filter's bit in the FILTER_MASK. NBYTES is the - * number of bytes of data to filter and on exit should be the - * number of resulting bytes while BUF_SIZE holds the total - * allocated size of the buffer, which is pointed to BUF. - * - * If the buffer must grow during processing of the pipeline - * then the pipeline function should free the original buffer - * and return a fresh buffer, adjusting BUF_SIZE accordingly. - * - * Return: Non-negative on success/Negative on failure + * Purpose: Process data through the filter pipeline. The FLAGS argument + * is the filter invocation flags (definition flags come from + * the PLINE->filter[].flags). The filters are processed in + * definition order unless the H5Z_FLAG_REVERSE is set. The + * FILTER_MASK is a bit-mask to indicate which filters to skip + * and on exit will indicate which filters failed. Each + * filter has an index number in the pipeline and that index + * number is the filter's bit in the FILTER_MASK. NBYTES is the + * number of bytes of data to filter and on exit should be the + * number of resulting bytes while BUF_SIZE holds the total + * allocated size of the buffer, which is pointed to BUF. + * + * If the buffer must grow during processing of the pipeline + * then the pipeline function should free the original buffer + * and return a fresh buffer, adjusting BUF_SIZE accordingly. + * + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1174,51 +1205,55 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/) { - size_t i, idx, new_nbytes; - int fclass_idx; /* Index of filter class in global table */ - H5Z_class2_t *fclass = NULL; /* Filter class pointer */ + size_t i, idx, new_nbytes; + int fclass_idx; /* Index of filter class in global table */ + H5Z_class2_t *fclass=NULL; /* Filter class pointer */ #ifdef H5Z_DEBUG - H5Z_stats_t *fstats = NULL; /* Filter stats pointer */ + H5Z_stats_t *fstats=NULL; /* Filter stats pointer */ H5_timer_t timer; #endif - unsigned failed = 0; - unsigned tmp_flags; - herr_t ret_value = SUCCEED; /* Return value */ + unsigned failed = 0; + unsigned tmp_flags; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert(filter_mask); - HDassert(nbytes && *nbytes > 0); - HDassert(buf_size && *buf_size > 0); - HDassert(buf && *buf); - HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); + HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); + HDassert (filter_mask); + HDassert (nbytes && *nbytes>0); + HDassert (buf_size && *buf_size>0); + HDassert (buf && *buf); + HDassert (!pline || pline->nusednused; i > 0; --i) { - idx = i - 1; + idx = i-1; if (*filter_mask & ((unsigned)1 << idx)) { failed |= (unsigned)1 << idx; - continue;/*filter excluded*/ + continue; /* filter excluded */ } /* If the filter isn't registered and the application doesn't - * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), - * try to load it dynamically and register it. Otherwise, return failure - */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { + * indicate no plugin through HDF5_PRELOAD_PLUG (using the symbol "::"), + * try to load it dynamically and register it. Otherwise, return failure + */ + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - const H5Z_class2_t *filter_info; + H5Z_class2_t *filter_info; /* Try loading the filter */ - if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ - if(H5Z_register(filter_info) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + herr_t status = H5Z_register(filter_info); + if (filter_info->name) + filter_info->name = (char *)H5MM_xfree(filter_info->name); + filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); + if (status < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ - if((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) + if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; } /* end if */ else @@ -1227,8 +1262,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Check for error */ if(issue_error) { /* Print out the filter name to give more info. But the name is optional for - * the filter */ - if(pline->filter[idx].name) + * the filter */ + if (pline->filter[idx].name) HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") @@ -1238,26 +1273,26 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + H5_timer_begin (&timer); #endif - tmp_flags = flags|(pline->filter[idx].flags); + tmp_flags = flags | (pline->filter[idx].flags); tmp_flags |= (edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[1].timer), &timer); + H5_timer_end (&(fstats->stats[1].timer), &timer); fstats->stats[1].total += MAX(*nbytes, new_nbytes); if (0 == new_nbytes) fstats->stats[1].errors += *nbytes; #endif - if(0==new_nbytes) { - if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") + if (0 == new_nbytes) { + if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) + HGOTO_ERROR (H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } else { *nbytes = new_nbytes; @@ -1276,35 +1311,34 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); continue; /*filter excluded*/ } fclass = &H5Z_table_g[fclass_idx]; #ifdef H5Z_DEBUG fstats = &H5Z_stat_table_g[fclass_idx]; - H5_timer_begin(&timer); + H5_timer_begin (&timer); #endif - new_nbytes = (fclass->filter)(flags|(pline->filter[idx].flags), pline->filter[idx].cd_nelmts, - pline->filter[idx].cd_values, *nbytes, buf_size, buf); + new_nbytes = (fclass->filter)(flags | (pline->filter[idx].flags), pline->filter[idx].cd_nelmts, + pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG - H5_timer_end(&(fstats->stats[0].timer), &timer); + H5_timer_end (&(fstats->stats[0].timer), &timer); fstats->stats[0].total += MAX(*nbytes, new_nbytes); if (0 == new_nbytes) fstats->stats[0].errors += *nbytes; #endif - if(0 == new_nbytes) { + if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { - if((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") + if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) + HGOTO_ERROR (H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; } failed |= (unsigned)1 << idx; - H5E_clear_stack(NULL); + H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } @@ -1320,7 +1354,8 @@ done: * * Purpose: Get pointer to filter info for pipeline * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ H5Z_filter_info_t * @@ -1331,17 +1366,17 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx >= pline->nused) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") + if (idx >= pline->nused) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ ret_value = &pline->filter[idx]; @@ -1365,21 +1400,21 @@ done: htri_t H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) { - size_t idx; /* Index of filter in pipeline */ - htri_t ret_value = TRUE; /* Return value */ + size_t idx; /* Index of filter in pipeline */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) break; /* Check if the filter was not already in the pipeline */ - if(idx >= pline->nused) + if (idx >= pline->nused) ret_value = FALSE; done: @@ -1394,30 +1429,31 @@ done: * Purpose: Verify that all the filters in a pipeline are currently * available (i.e. registered) * - * Return: Non-negative (TRUE/FALSE) on success/Negative on failure + * Return: Non-negative (TRUE/FALSE) on success + * Negative on failure *------------------------------------------------------------------------- */ htri_t H5Z_all_filters_avail(const H5O_pline_t *pline) { - size_t i,j; /* Local index variable */ - htri_t ret_value=TRUE; /* Return value */ + size_t i, j; /* Local index variable */ + htri_t ret_value = TRUE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); + HDassert (pline); /* Iterate through all the filters in pipeline */ - for(i = 0; i < pline->nused; i++) { + for (i = 0; i < pline->nused; i++) { /* Look for each filter in the list of registered filters */ - for(j = 0; j < H5Z_table_used_g; j++) - if(H5Z_table_g[j].id == pline->filter[i].id) + for (j = 0; j < H5Z_table_used_g; j++) + if (H5Z_table_g[j].id == pline->filter[i].id) break; /* Check if we didn't find the filter */ - if(j == H5Z_table_used_g) - HGOTO_DONE(FALSE) + if (j == H5Z_table_used_g) + HGOTO_DONE (FALSE) } /* end for */ done: @@ -1432,7 +1468,8 @@ done: * Purpose: Delete filter FILTER from pipeline PLINE; * deletes all filters if FILTER is H5Z_FILTER_NONE * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success + * Negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1443,52 +1480,52 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert(pline); - HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert (pline); + HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ - if(pline->nused == 0) - HGOTO_DONE(SUCCEED) + if (pline->nused == 0) + HGOTO_DONE (SUCCEED) /* Delete all filters */ - if(H5Z_FILTER_ALL == filter) { - if(H5O_msg_reset(H5O_PLINE_ID, pline) < 0) + if (H5Z_FILTER_ALL == filter) { + if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") } /* end if */ /* Delete filter */ else { - size_t idx; /* Index of filter in pipeline */ - hbool_t found = FALSE; /* Indicate filter was found in pipeline */ + size_t idx; /* Index of filter in pipeline */ + hbool_t found = FALSE; /* Indicate filter was found in pipeline */ /* Locate the filter in the pipeline */ - for(idx = 0; idx < pline->nused; idx++) - if(pline->filter[idx].id == filter) { + for (idx = 0; idx < pline->nused; idx++) + if (pline->filter[idx].id == filter) { found = TRUE; break; } /* end if */ /* filter was not found in the pipeline */ - if(!found) - HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + if (!found) + HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ - if(pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); - if(pline->filter[idx].name != pline->filter[idx]._name) + if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) + HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); - if(pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); - if(pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) + HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); /* Remove filter from pipeline array */ - if((idx + 1) < pline->nused) { + if ((idx + 1) < pline->nused) { /* Copy filters down & fix up any client data value arrays using internal storage */ - for(; (idx + 1) < pline->nused; idx++) { + for (; (idx + 1) < pline->nused; idx++) { pline->filter[idx] = pline->filter[idx + 1]; - if(pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) + if (pline->filter[idx].name && (HDstrlen(pline->filter[idx].name) + 1) <= H5Z_COMMON_NAME_LEN) pline->filter[idx].name = pline->filter[idx]._name; - if(pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) + if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; } /* end for */ } /* end if */ @@ -1497,7 +1534,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->nused--; /* Reset information for previous last filter in pipeline */ - HDmemset(&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); + HDmemset (&pline->filter[pline->nused], 0, sizeof(H5Z_filter_info_t)); } /* end else */ done: @@ -1510,6 +1547,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1521,8 +1561,8 @@ H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) H5TRACE2("e", "Zf*Iu", filter, filter_config_flags); /* Get the filter info */ - if(H5Z_get_filter_info(filter, filter_config_flags) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") + if (H5Z_get_filter_info(filter, filter_config_flags) < 0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "Filter info not retrieved") done: FUNC_LEAVE_API(ret_value) @@ -1534,6 +1574,9 @@ done: * * Purpose: Gets information about a pipeline data filter and stores it * in filter_config_flags. + * + * Return: zero on success + * negative on failure *------------------------------------------------------------------------- */ herr_t @@ -1545,16 +1588,16 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) FUNC_ENTER_NOAPI(FAIL) /* Look up the filter class info */ - if(NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + if (NULL == (fclass = H5Z_find(filter))) + HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ - if(filter_config_flags != NULL) { + if (filter_config_flags != NULL) { *filter_config_flags = 0; - if(fclass->encoder_present) + if (fclass->encoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_ENCODE_ENABLED; - if(fclass->decoder_present) + if (fclass->decoder_present) *filter_config_flags |= H5Z_FILTER_CONFIG_DECODE_ENABLED; } /* end if */ -- cgit v0.12 From fbae544330037bdaec14238a6486e8d0677eae4b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 16 Nov 2017 15:00:13 -0600 Subject: Fix typo --- src/H5PLint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index e969cbf..33dda96 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -372,7 +372,7 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v done: if (!success && handle) - if (*plugin_info) { + if (*plugin_info) *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") -- cgit v0.12 From 6019c126c40d836a53a7b0eeb9b6873683206319 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 13:59:57 -0600 Subject: HDFFV-10328 - remove allocation changes --- src/H5PLint.c | 21 +-------------------- src/H5PLplugin_cache.c | 22 +--------------------- src/H5Z.c | 33 ++++----------------------------- 3 files changed, 6 insertions(+), 70 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index 33dda96..c887f86 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -342,38 +342,19 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v /* Check if the filter IDs match */ if (info->id == id) { - H5Z_class2_t *plugin_copy = NULL; /* Store the plugin in the cache */ if (H5PL__add_plugin(type, id, handle)) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") - /* allocate local copy of plugin info */ - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = (const void *)info; - - plugin_copy->version = info->version; - plugin_copy->id = info->id; - plugin_copy->encoder_present = info->encoder_present; - plugin_copy->decoder_present = info->decoder_present; - plugin_copy->can_apply = info->can_apply; - plugin_copy->set_local = info->set_local; - plugin_copy->filter = info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *success = TRUE; + *plugin_info = (const void *)info; } } done: if (!success && handle) - if (*plugin_info) - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index ec14159..e483e01 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -280,7 +280,6 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; - H5Z_class2_t *plugin_copy = NULL; /* Get the "get plugin info" function from the plugin. */ if (NULL == (get_plugin_info_function = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC((H5PL_cache_g[u]).handle, "H5PLget_plugin_info"))) @@ -290,24 +289,9 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info_function)())) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") - if (NULL == (plugin_copy = (H5Z_class2_t *)H5MM_calloc(sizeof(H5Z_class2_t)))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for plugin info") - /* Set the plugin info to return */ - *plugin_info = plugin_copy; - - plugin_copy->version = filter_info->version; - plugin_copy->id = filter_info->id; - plugin_copy->encoder_present = filter_info->encoder_present; - plugin_copy->decoder_present = filter_info->decoder_present; - plugin_copy->can_apply = filter_info->can_apply; - plugin_copy->set_local = filter_info->set_local; - plugin_copy->filter = filter_info->filter; - /* copy the user's string into the property */ - if(NULL == (plugin_copy->name = (char *)H5MM_xstrdup(filter_info->name))) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "can't allocate memory for plugin info name") - /* Set output parameters */ *found = TRUE; + *plugin_info = filter_info; /* No need to continue processing */ break; @@ -317,10 +301,6 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f } /* end for */ done: - /* unallocate local copy of plugin info on failure */ - if (FAIL == ret_value && *plugin_info) { - *plugin_info = (H5Z_class2_t *)H5MM_xfree(*plugin_info); - } FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ #pragma GCC diagnostic pop diff --git a/src/H5Z.c b/src/H5Z.c index e7574cd..1f1a905 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -123,7 +123,6 @@ int H5Z_term_package(void) { int n = 0; - size_t i; FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -131,6 +130,7 @@ H5Z_term_package(void) #ifdef H5Z_DEBUG char comment[16], bandwidth[32]; int dir, nprint = 0; + size_t i; if(H5DEBUG(Z)) { for(i = 0; i < H5Z_table_used_g; i++) { @@ -179,12 +179,6 @@ H5Z_term_package(void) } /* end for */ } /* end if */ #endif /* H5Z_DEBUG */ - for (i = 0; i < H5Z_table_used_g; i++) { - H5Z_class2_t *cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (cls->name) - cls->name = (char *)H5MM_xfree(cls->name); - } /* Free the table of filters */ if(H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); @@ -325,20 +319,14 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); - H5Z_table_g[i].name = (char *)H5MM_xstrdup(cls->name); #ifdef H5Z_DEBUG HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { - H5Z_class2_t *old_cls = (H5Z_class2_t *)(H5Z_table_g+i); - /* deallocate plugin info name */ - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Replace old contents */ - HDmemcpy (old_cls, cls, sizeof(H5Z_class2_t)); - old_cls->name = (char *)H5MM_xstrdup(cls->name); + HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -394,7 +382,6 @@ H5Z_unregister(H5Z_filter_t filter_id) size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; herr_t ret_value = SUCCEED; /* Return value */ - H5Z_class2_t *old_cls = NULL; FUNC_ENTER_NOAPI(FAIL) @@ -431,10 +418,6 @@ H5Z_unregister(H5Z_filter_t filter_id) if (H5I_iterate(H5I_FILE, H5Z__flush_file_cb, NULL, FALSE) < 0) HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed") - /* deallocate plugin info name */ - old_cls = (H5Z_class2_t *)(H5Z_table_g+filter_index); - if (old_cls->name) - old_cls->name = (char *)H5MM_xfree(old_cls->name); /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); @@ -658,11 +641,7 @@ H5Z_filter_avail(H5Z_filter_t id) HGOTO_DONE (TRUE) if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + if (H5Z_register (filter_info) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") HGOTO_DONE (TRUE) } @@ -1245,11 +1224,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Try loading the filter */ if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ - herr_t status = H5Z_register(filter_info); - if (filter_info->name) - filter_info->name = (char *)H5MM_xfree(filter_info->name); - filter_info = (H5Z_class2_t *)H5MM_xfree(filter_info); - if (status < 0) + if (H5Z_register(filter_info < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ -- cgit v0.12 From 7aad737c9613712429ffb956d15938c34ee6363e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:02:07 -0600 Subject: HDFFV-10328 remove allocation note --- release_docs/RELEASE.txt | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9e3c3a9..a1b59b1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -160,8 +160,7 @@ Bug Fixes since HDF5-1.10.1 release - filter plugin handling in H5PL.c and H5Z.c It was discovered that the dynamic loading process used by - filter plugins had issues with memory allocation and library - dependencies. + filter plugins had issues with library dependencies. CMake build process changed to use LINK INTERFACE keywords, which allowed HDF5 C library to make dependent libraries private. The @@ -169,13 +168,6 @@ Bug Fixes since HDF5-1.10.1 release (such as szip or zlib) to be available. (ADB - 2017/11/16, HDFFV-10328) - The H5Z_class2_t structure returned by the filter plugins are - now dynamically allocated in H5Zregister function. Access to - the functions in the filter library now always use the dynamic - library API. - - (ADB - 2017/11/16, HDFFV-10329) - - H5Zfilter_avail in H5Z.c The public function checked for plugins, while the private -- cgit v0.12 From 459e214ed5c48cdee335fe02f4534ab48ac49e3e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 17 Nov 2017 14:20:14 -0600 Subject: HDFFV-10328 - fix typos --- src/H5Z.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 1f1a905..a9f7336 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -1219,12 +1219,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; - H5Z_class2_t *filter_info; + const H5Z_class2_t *filter_info; /* Try loading the filter */ if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { /* Register the filter we loaded */ - if (H5Z_register(filter_info < 0) + if (H5Z_register(filter_info) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, issue_error = TRUE; /* Check for error */ - if(issue_error) { + if (issue_error) { /* Print out the filter name to give more info. But the name is optional for * the filter */ if (pline->filter[idx].name) @@ -1269,9 +1269,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, failed |= (unsigned)1 << idx; H5E_clear_stack (NULL); } - else { + else *nbytes = new_nbytes; - } } } else if (pline) { /* Write */ -- cgit v0.12 From d5b70b549e41a1a48e3745cb2c076e8953b60a71 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 17 Nov 2017 15:21:49 -0800 Subject: Brings H5Z and H5PL packages in sync with VOL integration branch. --- src/H5PLint.c | 62 +++-- src/H5PLpath.c | 4 +- src/H5PLpkg.h | 8 +- src/H5PLplugin_cache.c | 14 +- src/H5PLprivate.h | 7 +- src/H5PLpublic.h | 6 +- src/H5Z.c | 173 ++++++------ test/error_test.c | 416 ++++++++++++++--------------- test/testfiles/error_test_1 | 2 +- tools/test/h5dump/errfiles/filter_fail.err | 2 +- 10 files changed, 352 insertions(+), 342 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index c887f86..b190746 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -235,11 +235,11 @@ done: *------------------------------------------------------------------------- */ const void * -H5PL_load(H5PL_type_t type, int id) +H5PL_load(H5PL_type_t type, H5PL_key_t key) { - H5PL_search_params_t search_params; + H5PL_search_params_t search_params; /* Plugin search parameters */ hbool_t found = FALSE; /* Whether the plugin was found */ - const void *plugin_info = NULL; + const void *plugin_info = NULL; /* Information from the plugin */ const void *ret_value = NULL; FUNC_ENTER_NOAPI(NULL) @@ -248,18 +248,17 @@ H5PL_load(H5PL_type_t type, int id) switch (type) { case H5PL_TYPE_FILTER: if ((H5PL_plugin_control_mask_g & H5PL_FILTER_PLUGIN) == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "filter plugins disabled") break; - case H5PL_TYPE_ERROR: case H5PL_TYPE_NONE: default: - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin '%d' is not valid", id) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "Invalid plugin type specified") } /* Set up the search parameters */ search_params.type = type; - search_params.id = id; + search_params.key.id = key.id; /* Search in the table of already loaded plugin libraries */ if(H5PL__find_plugin_in_cache(&search_params, &found, &plugin_info) < 0) @@ -304,11 +303,11 @@ done: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpedantic" herr_t -H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const void **plugin_info) +H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, hbool_t *success, const void **plugin_info) { H5PL_HANDLE handle = NULL; H5PL_get_plugin_info_t get_plugin_info = NULL; - htri_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE @@ -326,35 +325,46 @@ H5PL__open(const char *path, H5PL_type_t type, int id, hbool_t *success, const v */ if (NULL == (handle = H5PL_OPEN_DLIB(path))) { H5PL_CLR_ERROR; /* clear error */ - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) } /* Return a handle for the function H5PLget_plugin_info in the dynamic library. * The plugin library is suppose to define this function. */ - if (NULL != (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) { - - const H5Z_class2_t *info; + if (NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) + HGOTO_DONE(SUCCEED) - /* Get the plugin info */ - if (NULL == (info = (const H5Z_class2_t *)(*get_plugin_info)())) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get plugin info") + /* Get the plugin information */ + switch (type) { + case H5PL_TYPE_FILTER: + { + const H5Z_class2_t *filter_info; - /* Check if the filter IDs match */ - if (info->id == id) { + /* Get the plugin info */ + if (NULL == (filter_info = (const H5Z_class2_t *)(*get_plugin_info)())) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get filter info from plugin") - /* Store the plugin in the cache */ - if (H5PL__add_plugin(type, id, handle)) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") + /* If the filter IDs match, we're done. Set the output parameters. */ + if (filter_info->id == key.id) { + *plugin_info = (const void *)filter_info; + *success = TRUE; + } - /* Set output parameters */ - *success = TRUE; - *plugin_info = (const void *)info; + break; } - } + case H5PL_TYPE_ERROR: + case H5PL_TYPE_NONE: + default: + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "Invalid plugin type specified") + } /* end switch */ + + /* If we found the correct plugin, store it in the cache */ + if (*success) + if (H5PL__add_plugin(type, key, handle)) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTINSERT, FAIL, "unable to add new plugin to plugin cache") done: - if (!success && handle) + if (!(*success) && handle) if (H5PL__close(handle) < 0) HDONE_ERROR(H5E_PLUGIN, H5E_CLOSEERROR, FAIL, "can't close dynamic library") diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 435802a..d8e82f8 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -689,7 +689,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 0d1c271..dfaa4af 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -115,8 +115,8 @@ /* Data used to search for plugins */ typedef struct H5PL_search_params_t { - H5PL_type_t type; - int id; + H5PL_type_t type; + H5PL_key_t key; } H5PL_search_params_t; @@ -134,13 +134,13 @@ H5_DLL herr_t H5PL__get_plugin_control_mask(unsigned int *mask /*out*/); H5_DLL herr_t H5PL__set_plugin_control_mask(unsigned int mask); /* Plugin search and manipulation */ -H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, int id, hbool_t *success /*out*/, const void **plugin_info /*out*/); +H5_DLL herr_t H5PL__open(const char *libname, H5PL_type_t type, H5PL_key_t key, hbool_t *success /*out*/, const void **plugin_info /*out*/); H5_DLL herr_t H5PL__close(H5PL_HANDLE handle); /* Plugin cache calls */ H5_DLL herr_t H5PL__create_plugin_cache(void); H5_DLL herr_t H5PL__close_plugin_cache(hbool_t *already_closed /*out*/); -H5_DLL herr_t H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle); +H5_DLL herr_t H5PL__add_plugin(H5PL_type_t type, H5PL_key_t key, H5PL_HANDLE handle); H5_DLL herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found /*out*/, const void **plugin_info /*out*/); /* Plugin search path calls */ diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index e483e01..e905ac2 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -56,9 +56,9 @@ /* Type for the list of info for opened plugin libraries */ typedef struct H5PL_plugin_t { - H5PL_type_t type; /* Plugin type */ - int id; /* ID for the plugin */ - H5PL_HANDLE handle; /* Plugin handle */ + H5PL_type_t type; /* Plugin type */ + H5PL_key_t key; /* Unique key to identify the plugin */ + H5PL_HANDLE handle; /* Plugin handle */ } H5PL_plugin_t; @@ -209,14 +209,14 @@ done: /*------------------------------------------------------------------------- * Function: H5PL__add_plugin * - * Purpose: Add a plugin to the plugin cached. + * Purpose: Add a plugin to the plugin cache. * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) +H5PL__add_plugin(H5PL_type_t type, H5PL_key_t key, H5PL_HANDLE handle) { herr_t ret_value = SUCCEED; @@ -229,7 +229,7 @@ H5PL__add_plugin(H5PL_type_t type, int id, H5PL_HANDLE handle) /* Store the plugin info and bump the # of plugins */ H5PL_cache_g[H5PL_num_plugins_g].type = type; - H5PL_cache_g[H5PL_num_plugins_g].id = id; + H5PL_cache_g[H5PL_num_plugins_g].key = key; H5PL_cache_g[H5PL_num_plugins_g].handle = handle; H5PL_num_plugins_g++; @@ -276,7 +276,7 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f for (u = 0; u < H5PL_num_plugins_g; u++) { /* If the plugin type (filter, etc.) and ID match, query the plugin for its info */ - if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->id == (H5PL_cache_g[u]).id)) { + if ((search_params->type == (H5PL_cache_g[u]).type) && (search_params->key.id == (H5PL_cache_g[u]).key.id)) { H5PL_get_plugin_info_t get_plugin_info_function; const H5Z_class2_t *filter_info; diff --git a/src/H5PLprivate.h b/src/H5PLprivate.h index bc12e64..cc2e258 100644 --- a/src/H5PLprivate.h +++ b/src/H5PLprivate.h @@ -33,6 +33,11 @@ /* Library Private Typedefs */ /****************************/ +/* The key that will be used to find the plugin */ +typedef union H5PL_key_t { + int id; /* filters */ +} H5PL_key_t; + /*****************************/ /* Library-private Variables */ @@ -44,7 +49,7 @@ /***************************************/ /* Internal API routines */ -H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, int type_id); +H5_DLL const void *H5PL_load(H5PL_type_t plugin_type, H5PL_key_t key); #endif /* _H5PLprivate_H */ diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 3b36ccd..fe5bdfb 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -30,9 +30,9 @@ /* Plugin type used by the plugin library */ typedef enum H5PL_type_t { - H5PL_TYPE_ERROR = -1, /* Error */ - H5PL_TYPE_FILTER = 0, /* Filter */ - H5PL_TYPE_NONE = 1 /* This must be last! */ + H5PL_TYPE_ERROR = -1, /* Error */ + H5PL_TYPE_FILTER = 0, /* Filter */ + H5PL_TYPE_NONE = 1 /* This must be last! */ } H5PL_type_t; /* Common dynamic plugin type flags used by the set/get_loading_state functions */ diff --git a/src/H5Z.c b/src/H5Z.c index a9f7336..1e7cd79 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -86,24 +86,24 @@ H5Z__init_package(void) FUNC_ENTER_PACKAGE /* Internal filters */ - if (H5Z_register (H5Z_SHUFFLE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") - if (H5Z_register (H5Z_FLETCHER32) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") - if (H5Z_register (H5Z_NBIT) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") - if (H5Z_register (H5Z_SCALEOFFSET) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + if (H5Z_register(H5Z_SHUFFLE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register(H5Z_FLETCHER32) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register(H5Z_NBIT) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register(H5Z_SCALEOFFSET) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE - if (H5Z_register (H5Z_DEFLATE) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") + if (H5Z_register(H5Z_DEFLATE) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_register (H5Z_SZIP) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + if (H5Z_register(H5Z_SZIP) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ done: @@ -180,7 +180,7 @@ H5Z_term_package(void) } /* end if */ #endif /* H5Z_DEBUG */ /* Free the table of filters */ - if(H5Z_table_g) { + if (H5Z_table_g) { H5Z_table_g = (H5Z_class2_t *)H5MM_xfree(H5Z_table_g); #ifdef H5Z_DEBUG H5Z_stat_table_g = (H5Z_stats_t *)H5MM_xfree(H5Z_stat_table_g); @@ -191,7 +191,7 @@ H5Z_term_package(void) } /* end if */ /* Mark interface as closed */ - if(0 == n) + if (0 == n) H5_PKG_INIT_VAR = FALSE; } /* end if */ @@ -219,7 +219,7 @@ H5Zregister(const void *cls) /* Check args */ if (cls_real==NULL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter class") /* Check H5Z_class_t version number; this is where a function to convert * from an outdated version should be called. @@ -251,20 +251,20 @@ H5Zregister(const void *cls) #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Deprecated symbols not allowed, throw an error */ - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid H5Z_class_t version number"); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end if */ if (cls_real->id < 0 || cls_real->id > H5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if (cls_real->id < H5Z_FILTER_RESERVED) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to modify predefined filters") if (cls_real->filter == NULL) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no filter function specified") /* Do it */ - if (H5Z_register (cls_real) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + if (H5Z_register(cls_real) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") done: FUNC_LEAVE_API(ret_value) @@ -289,8 +289,8 @@ H5Z_register (const H5Z_class2_t *cls) FUNC_ENTER_NOAPI(FAIL) - HDassert (cls); - HDassert (cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); + HDassert(cls); + HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) @@ -306,11 +306,11 @@ H5Z_register (const H5Z_class2_t *cls) H5Z_stats_t *stat_table = (H5Z_stats_t *)H5MM_realloc(H5Z_stat_table_g, n * sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ if (!table) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter table") H5Z_table_g = table; #ifdef H5Z_DEBUG if (!stat_table) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to extend filter statistics table") H5Z_stat_table_g = stat_table; #endif /* H5Z_DEBUG */ H5Z_table_alloc_g = n; @@ -318,15 +318,15 @@ H5Z_register (const H5Z_class2_t *cls) /* Initialize */ i = H5Z_table_used_g++; - HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); #ifdef H5Z_DEBUG - HDmemset (H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); + HDmemset(H5Z_stat_table_g+i, 0, sizeof(H5Z_stats_t)); #endif /* H5Z_DEBUG */ } /* end if */ /* Filter already registered */ else { /* Replace old contents */ - HDmemcpy (H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); + HDmemcpy(H5Z_table_g+i, cls, sizeof(H5Z_class2_t)); } /* end else */ done: @@ -420,9 +420,9 @@ H5Z_unregister(H5Z_filter_t filter_id) /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove (&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_table_g[filter_index], &H5Z_table_g[filter_index+1], sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove (&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); + HDmemmove(&H5Z_stat_table_g[filter_index], &H5Z_stat_table_g[filter_index+1], sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -450,11 +450,11 @@ H5Z__check_unregister(hid_t ocpl_id, H5Z_filter_t filter_id) /* Get the plist structure of object creation */ if (NULL == (plist = H5P_object_verify(ocpl_id, H5P_OBJECT_CREATE))) - HGOTO_ERROR (H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") + HGOTO_ERROR(H5E_PLINE, H5E_BADATOM, FAIL, "can't find object for ID") /* Check if the object creation property list uses the filter */ if ((ret_value = H5P_filter_in_pline(plist, filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") done: FUNC_LEAVE_NOAPI(ret_value) @@ -487,11 +487,11 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void /* Get the group creation property */ if ((ocpl_id = H5G_get_create_plist((H5G_t *)obj_ptr)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get group creation property list") /* Check if the filter is in the group creation property list */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -504,7 +504,7 @@ H5Z__check_unregister_group_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_group_cb() */ @@ -536,11 +536,11 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * /* Get the dataset creation property */ if ((ocpl_id = H5D_get_create_plist((H5D_t *)obj_ptr)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get dataset creation property list") /* Check if the filter is in the dataset creation property list */ if ((filter_in_pline = H5Z__check_unregister(ocpl_id, object->filter_id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't check filter in pipeline") /* H5I_iterate expects TRUE to stop the loop over objects. Stop the loop and * let H5Z_unregister return failure. @@ -553,7 +553,7 @@ H5Z__check_unregister_dset_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void * done: if (ocpl_id > 0) if (H5I_dec_app_ref(ocpl_id) < 0) - HDONE_ERROR (H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") + HDONE_ERROR(H5E_PLINE, H5E_CANTDEC, FAIL, "can't release plist") FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__check_unregister_dset_cb() */ @@ -582,7 +582,7 @@ H5Z__flush_file_cb(void *obj_ptr, hid_t H5_ATTR_UNUSED obj_id, void H5_ATTR_UNUS * if the file is opened for write */ if (H5F_ACC_RDWR & H5F_INTENT((H5F_t *)obj_ptr)) { if (H5F_flush_mounts((H5F_t *)obj_ptr, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") + HGOTO_ERROR(H5E_PLINE, H5E_CANTFLUSH, FAIL, "unable to flush file hierarchy") } /* end if */ done: @@ -608,10 +608,10 @@ H5Zfilter_avail(H5Z_filter_t id) /* Check args */ if (id < 0 || id > H5Z_FILTER_MAX) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid filter identification number") if ((ret_value = H5Z_filter_avail(id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "unable to check the availability of the filter") done: FUNC_LEAVE_API(ret_value) @@ -629,22 +629,25 @@ done: htri_t H5Z_filter_avail(H5Z_filter_t id) { - size_t i; /* Local index variable */ - H5Z_class2_t *filter_info; - htri_t ret_value = FALSE; /* Return value */ + H5PL_key_t key; /* Key for finding a plugin */ + const H5Z_class2_t *filter_info; /* Filter information */ + size_t i; /* Local index variable */ + htri_t ret_value = FALSE; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* Is the filter already registered? */ for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE (TRUE) + HGOTO_DONE(TRUE) - if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)id))) { - if (H5Z_register (filter_info) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") - HGOTO_DONE (TRUE) + key.id = (int)id; + if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { + if (H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register loaded filter") + HGOTO_DONE(TRUE) } + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_avail() */ @@ -683,7 +686,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, if (pline->filter[u].flags & H5Z_FLAG_OPTIONAL) H5E_clear_stack (NULL); else - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ else { /* Make correct callback */ @@ -691,7 +694,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, case H5Z_PRELUDE_CAN_APPLY: /* Check if filter is configured to be able to encode */ if (!fclass->encoder_present) - HGOTO_ERROR (H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); + HGOTO_ERROR(H5E_PLINE, H5E_NOENCODER, FAIL, "Filter present but encoding is disabled."); /* Check if there is a "can apply" callback */ @@ -716,7 +719,7 @@ H5Z_prelude_callback(const H5O_pline_t *pline, hid_t dcpl_id, hid_t type_id, /* Make callback to filter's "set local" function */ if ((fclass->set_local)(dcpl_id, type_id, space_id) < 0) /* Indicate error during filter callback */ - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "error during user callback") } /* end if */ break; @@ -753,8 +756,8 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type FUNC_ENTER_NOAPI_NOINIT - HDassert (H5I_GENPROP_LST == H5I_get_type(dcpl_id)); - HDassert (H5I_DATATYPE == H5I_get_type(type_id)); + HDassert(H5I_GENPROP_LST == H5I_get_type(dcpl_id)); + HDassert(H5I_DATATYPE == H5I_get_type(type_id)); /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { @@ -834,7 +837,7 @@ H5Z_can_apply(hid_t dcpl_id, hid_t type_id) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -865,7 +868,7 @@ H5Z_set_local(hid_t dcpl_id, hid_t type_id) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prepare_prelude_callback_dcpl(dcpl_id, type_id, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -894,7 +897,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") + HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: FUNC_LEAVE_NOAPI(ret_value) @@ -927,7 +930,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") + HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: FUNC_LEAVE_NOAPI(ret_value) @@ -952,10 +955,10 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -964,7 +967,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, /* Check if the filter was not already in the pipeline */ if (idx > pline->nused) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Change parameters for filter */ pline->filter[idx].flags = flags; @@ -982,7 +985,7 @@ H5Z_modify(const H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter parameters") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1017,10 +1020,10 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); - HDassert (0 == cd_nelmts || cd_values); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(0 == (flags & ~((unsigned)H5Z_FLAG_DEFMASK))); + HDassert(0 == cd_nelmts || cd_values); /* * Check filter limit. We do it here for early warnings although we may @@ -1052,13 +1055,13 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, x.nalloc = MAX(H5Z_MAX_NFILTERS, 2 * pline->nalloc); x.filter = (H5Z_filter_info_t *)H5MM_realloc(pline->filter, x.nalloc * sizeof(x.filter[0])); if (NULL == x.filter) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter pipeline") /* Fix pointers in previous filters that need to point to their own * internal data. */ - for(n = 0; n < pline->nalloc; ++n) - if(x.filter[n].cd_values == (void *) ~((size_t) NULL)) + for (n = 0; n < pline->nalloc; ++n) + if (x.filter[n].cd_values == (void *) ~((size_t) NULL)) x.filter[n].cd_values = x.filter[n]._cd_values; /* Point to newly allocated buffer */ @@ -1079,7 +1082,7 @@ H5Z_append(H5O_pline_t *pline, H5Z_filter_t filter, unsigned flags, if (cd_nelmts > H5Z_COMMON_CD_VALUES) { pline->filter[idx].cd_values = (unsigned *)H5MM_malloc(cd_nelmts * sizeof(unsigned)); if (NULL == pline->filter[idx].cd_values) - HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for filter") } /* end if */ else pline->filter[idx].cd_values = pline->filter[idx]._cd_values; @@ -1118,7 +1121,7 @@ H5Z_find_idx(H5Z_filter_t id) for (i = 0; i < H5Z_table_used_g; i++) if (H5Z_table_g[i].id == id) - HGOTO_DONE ((int)i) + HGOTO_DONE((int)i) done: FUNC_LEAVE_NOAPI(ret_value) @@ -1145,10 +1148,10 @@ H5Z_find(H5Z_filter_t id) /* Get the index in the global table */ if ((idx = H5Z_find_idx(id)) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "required filter %d is not registered", id) /* Set return value */ - ret_value = H5Z_table_g+idx; + ret_value = H5Z_table_g + idx; done: FUNC_LEAVE_NOAPI(ret_value) @@ -1219,13 +1222,15 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) { hbool_t issue_error = FALSE; + H5PL_key_t key; const H5Z_class2_t *filter_info; /* Try loading the filter */ - if (NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)(pline->filter[idx].id)))) { + key.id = (int)(pline->filter[idx].id); + if(NULL != (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, key))) { /* Register the filter we loaded */ - if (H5Z_register(filter_info) < 0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") + if(H5Z_register(filter_info) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter") /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) @@ -1263,7 +1268,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if (0 == new_nbytes) { if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR (H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") + HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; failed |= (unsigned)1 << idx; @@ -1303,7 +1308,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *nbytes, cb_struct.op_data))) || !cb_struct.func) - HGOTO_ERROR (H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") + HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "filter returned failure") *nbytes = *buf_size; } @@ -1350,7 +1355,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) /* Check if the filter was not already in the pipeline */ if (idx >= pline->nused) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, NULL, "filter not in pipeline") /* Set return value */ ret_value = &pline->filter[idx]; @@ -1427,7 +1432,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) /* Check if we didn't find the filter */ if (j == H5Z_table_used_g) - HGOTO_DONE (FALSE) + HGOTO_DONE(FALSE) } /* end for */ done: @@ -1480,7 +1485,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* filter was not found in the pipeline */ if (!found) - HGOTO_ERROR (H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") + HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter not in pipeline") /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) @@ -1563,7 +1568,7 @@ H5Z_get_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags) /* Look up the filter class info */ if (NULL == (fclass = H5Z_find(filter))) - HGOTO_ERROR (H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") + HGOTO_ERROR(H5E_PLINE, H5E_BADVALUE, FAIL, "Filter not defined") /* Set the filter config flags for the application */ if (filter_config_flags != NULL) { diff --git a/test/error_test.c b/test/error_test.c index 9c39065..5356fa7 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -82,35 +82,33 @@ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, /*------------------------------------------------------------------------- - * Function: test_error + * Function: test_error * - * Purpose: Test error API functions + * Purpose: Test error API functions * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_error(hid_t file) { - hid_t dataset, space; - hid_t estack_id; + hid_t dataset = -1; + hid_t space = -1; + hid_t estack_id = -1; hsize_t dims[2]; const char *FUNC_test_error = "test_error"; H5E_auto2_t old_func; - void *old_data; + void *old_data = NULL; HDfprintf(stderr, "\nTesting error API based on data I/O\n"); /* Create the data space */ dims[0] = DIM0; dims[1] = DIM1; - if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; + if ((space = H5Screate_simple(2, dims, NULL)) < 0) + TEST_ERROR; /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { @@ -118,40 +116,40 @@ test_error(hid_t file) } H5E_END_TRY; /* Create the dataset */ - if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { + if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "H5Dcreate2 failed"); goto error; - } /* end if */ + } /* Test enabling and disabling default printing */ - if(H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) - TEST_ERROR; - if(old_data != NULL) - TEST_ERROR; + if (H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0) + TEST_ERROR; + if (old_data != NULL) + TEST_ERROR; #ifdef H5_USE_16_API if (old_func != (H5E_auto_t)H5Eprint) - TEST_ERROR; + TEST_ERROR; #else /* H5_USE_16_API */ if (old_func != (H5E_auto2_t)H5Eprint2) - TEST_ERROR; + TEST_ERROR; #endif /* H5_USE_16_API */ - if(H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) + if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) TEST_ERROR; /* Make H5Dwrite fail, verify default print is disabled */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite shouldn't succeed"); goto error; - } /* end if */ + } - if(H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) + if (H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0) TEST_ERROR; /* Test saving and restoring the current error stack */ - if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { + if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite failed as supposed to"); estack_id = H5Eget_current_stack(); @@ -159,10 +157,11 @@ test_error(hid_t file) H5Sclose(space); H5Eset_current_stack(estack_id); goto error; - } /* end if */ + } /* In case program comes to this point, close dataset */ - if(H5Dclose(dataset) < 0) TEST_ERROR; + if(H5Dclose(dataset) < 0) + TEST_ERROR; TEST_ERROR; @@ -172,16 +171,12 @@ test_error(hid_t file) /*------------------------------------------------------------------------- - * Function: init_error + * Function: init_error * - * Purpose: Initialize error information. + * Purpose: Initialize error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -194,46 +189,46 @@ init_error(void) char *msg = NULL; H5E_type_t msg_type; - if(NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) + if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1))) TEST_ERROR - if(NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) + if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1))) TEST_ERROR - if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) + if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0) TEST_ERROR; - if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) + if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if(HDstrcmp(ERR_CLS_NAME, cls_name)) + if (HDstrcmp(ERR_CLS_NAME, cls_name)) TEST_ERROR; - if((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) + if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) + if ((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0) TEST_ERROR; - if((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) + if ((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) + if ((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) + if ((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) + if ((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) + if ((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0) TEST_ERROR; - if((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) + if ((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0) TEST_ERROR; - if(msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) + if (msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1) TEST_ERROR; - if(msg_type != H5E_MINOR) + if (msg_type != H5E_MINOR) TEST_ERROR; - if(HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) + if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG)) TEST_ERROR; /* Register another class for later testing. */ - if((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) + if ((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0) TEST_ERROR; HDfree(cls_name); @@ -242,9 +237,9 @@ init_error(void) return 0; error: - if(cls_name) + if (cls_name) HDfree(cls_name); - if(msg) + if (msg) HDfree(msg); return -1; @@ -252,16 +247,12 @@ error: /*------------------------------------------------------------------------- - * Function: error_stack - * - * Purpose: Manipulates current error stack. + * Function: error_stack * - * Return: Success: 0 + * Purpose: Manipulates current error stack. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 14, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -271,23 +262,23 @@ error_stack(void) ssize_t err_num; const char *FUNC_error_stack = "error_stack"; - if((err_num = H5Eget_num(H5E_DEFAULT)) < 0) + if ((err_num = H5Eget_num(H5E_DEFAULT)) < 0) TEST_ERROR; - if(err_num) + if (err_num) TEST_ERROR; - if((ERR_STACK = H5Eget_current_stack()) < 0) + if ((ERR_STACK = H5Eget_current_stack()) < 0) TEST_ERROR; /* Make it push error, force this function to fail */ - if((err_num = H5Eget_num(ERR_STACK)) == 0) { + if ((err_num = H5Eget_num(ERR_STACK)) == 0) { H5Epush(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM, "Get number test failed, returned %d", (int)err_num); goto error; - } /* end if */ + } /* In case program falls through here, close the stack and let it fail. */ - if(H5Eclose_stack(ERR_STACK) < 0) + if (H5Eclose_stack(ERR_STACK) < 0) TEST_ERROR; return -1; @@ -300,14 +291,10 @@ error: /*------------------------------------------------------------------------- * Function: long_desc_cb * - * Purpose: Callback function to help test long description handling - * - * Return: Success: 0 + * Purpose: Callback function to help test long description handling * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -316,24 +303,20 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie { char *real_desc = (char *)client_data; - if(err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) - return(0); + if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0) + return 0; else - return(-1); + return -1; } /* end long_desc_cb() */ /*------------------------------------------------------------------------- - * Function: test_long_desc + * Function: test_long_desc * - * Purpose: Test long error description handling + * Purpose: Test long error description handling * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Quincey Koziol - * January 19, 2005 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -347,56 +330,59 @@ test_long_desc(void) const char *test_FUNC = "test_long_desc"; /* Allocate space for the error description info */ - if(NULL == (long_desc = (char*)HDmalloc(LONG_DESC_SIZE))) TEST_ERROR; - if(NULL == (full_desc = (char*)HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR; + if (NULL == (long_desc = (char *)HDmalloc(LONG_DESC_SIZE))) + TEST_ERROR; + if (NULL == (full_desc = (char *)HDmalloc(LONG_DESC_SIZE + 128))) + TEST_ERROR; /* Create the long part of the error description */ - for(u = 0; u < LONG_DESC_SIZE; u++) + for (u = 0; u < LONG_DESC_SIZE; u++) long_desc[u] = (char)('A' + (u % 26)); long_desc[LONG_DESC_SIZE - 1] = '\0'; /* Clear the default error stack */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) + TEST_ERROR; /* Create the string that should be in the description. Must use HDsnprintf here - * because snprintf is _snprintf on Windows */ + * because snprintf is _snprintf on Windows + */ HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc); /* Make certain that the description is correct */ - if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR; + if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) + TEST_ERROR; /* Clear the default error stack again */ - if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR; + if (H5Eclear2(H5E_DEFAULT) < 0) + TEST_ERROR; HDfree(long_desc); HDfree(full_desc); - return(0); + return 0; error: - if(long_desc) + if (long_desc) HDfree(long_desc); - if(full_desc) + if (full_desc) HDfree(full_desc); - return(-1); + return -1; } /* end test_long_desc() */ /*------------------------------------------------------------------------- * Function: dump_error * - * Purpose: Prints error stack in default and customized ways. + * Purpose: Prints error stack in default and customized ways. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -405,12 +391,12 @@ dump_error(hid_t estack) { /* Print errors in library default way */ HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); - if(H5Eprint2(estack, stderr) < 0) + if (H5Eprint2(estack, stderr) < 0) TEST_ERROR; /* Customized way to print errors */ HDfprintf(stderr, "\n********* Print error stack in customized way *********\n"); - if(H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) + if (H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0) TEST_ERROR; return 0; @@ -423,34 +409,30 @@ error: /*------------------------------------------------------------------------- * Function: custom_print_cb * - * Purpose: Callback function to print error stack in customized way. - * - * Return: Success: 0 + * Purpose: Callback function to print error stack in customized way. * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) { - FILE *stream = (FILE *)client_data; + FILE *stream = (FILE *)client_data; char maj[MSG_SIZE]; char min[MSG_SIZE]; char cls[MSG_SIZE]; - const int indent = 4; + const int indent = 4; /* Get descriptions for the major and minor error numbers */ - if(H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) + if (H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0) TEST_ERROR; - if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) + if (H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0) TEST_ERROR; HDfprintf(stream, "%*serror #%03d: %s in %s(): line %u\n", @@ -468,54 +450,58 @@ error: /*------------------------------------------------------------------------- - * Function: test_create - * - * Purpose: Test creating an empty error stack + * Function: test_create * - * Return: Success: 0 - * Failure: -1 + * Purpose: Test creating an empty error stack * - * Programmer: Quincey Koziol - * November 1, 2007 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ static herr_t test_create(void) { - const char *err_func = "test_create"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ + const char *err_func = "test_create"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ /* Create an empty error stack */ - if((estack_id = H5Ecreate_stack()) < 0) TEST_ERROR + if ((estack_id = H5Ecreate_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Push an error with a long description */ - if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Clear the error stack */ - if(H5Eclear2(estack_id) < 0) TEST_ERROR + if (H5Eclear2(estack_id) < 0) + TEST_ERROR /* Check the number of errors on stack */ err_num = H5Eget_num(estack_id); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Close error stack */ - if(H5Eclose_stack(estack_id) < 0) TEST_ERROR + if(H5Eclose_stack(estack_id) < 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_create() */ /*------------------------------------------------------------------------- @@ -526,70 +512,72 @@ error: * Return: Success: 0 * Failure: -1 * - * Programmer: Allen Byrne - * February 18, 2010 - * *------------------------------------------------------------------------- */ static herr_t test_copy(void) { - const char *err_func = "test_copy"; /* Function name for pushing error */ - const char *err_msg = "Error message"; /* Error message for pushing error */ - ssize_t err_num; /* Number of errors on stack */ - hid_t estack_id; /* Error stack ID */ - herr_t ret; /* Generic return value */ + const char *err_func = "test_copy"; /* Function name for pushing error */ + const char *err_msg = "Error message"; /* Error message for pushing error */ + ssize_t err_num; /* Number of errors on stack */ + hid_t estack_id = -1; /* Error stack ID */ + herr_t ret; /* Generic return value */ /* Push an error with a long description */ - if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR; + if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) + TEST_ERROR; /* Check the number of errors on stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Copy error stack, which clears the original */ - if((estack_id = H5Eget_current_stack()) < 0) TEST_ERROR + if ((estack_id = H5Eget_current_stack()) < 0) + TEST_ERROR /* Check the number of errors on stack copy */ err_num = H5Eget_num(estack_id); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Check the number of errors on original stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 0) TEST_ERROR + if (err_num != 0) + TEST_ERROR /* Put the stack copy as the default. It closes the stack copy, too. */ - if(H5Eset_current_stack(estack_id) < 0) TEST_ERROR + if (H5Eset_current_stack(estack_id) < 0) + TEST_ERROR /* Check the number of errors on default stack */ err_num = H5Eget_num(H5E_DEFAULT); - if(err_num != 1) TEST_ERROR + if (err_num != 1) + TEST_ERROR /* Try to close error stack copy. Should fail because - * the current H5Eset_current_stack closes the stack to be set.*/ + * the current H5Eset_current_stack closes the stack to be set. + */ H5E_BEGIN_TRY { ret = H5Eclose_stack(estack_id); } H5E_END_TRY - if(ret >= 0) TEST_ERROR + if (ret >= 0) + TEST_ERROR - return(0); + return 0; error: - return(-1); + return -1; } /* end test_copy() */ /*------------------------------------------------------------------------- - * Function: close_error + * Function: close_error * - * Purpose: Closes error information. + * Purpose: Closes error information. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -597,19 +585,19 @@ static herr_t close_error(void) { /* Close major errors, let H5Eunregister_class close minor errors */ - if(H5Eclose_msg(ERR_MAJ_TEST) < 0) + if (H5Eclose_msg(ERR_MAJ_TEST) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_IO) < 0) + if (H5Eclose_msg(ERR_MAJ_IO) < 0) TEST_ERROR; - if(H5Eclose_msg(ERR_MAJ_API) < 0) + if (H5Eclose_msg(ERR_MAJ_API) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS) < 0) + if (H5Eunregister_class(ERR_CLS) < 0) TEST_ERROR; - if(H5Eunregister_class(ERR_CLS2) < 0) + if (H5Eunregister_class(ERR_CLS2) < 0) TEST_ERROR; return 0; @@ -620,19 +608,15 @@ error: /*------------------------------------------------------------------------- - * Function: test_filter_error + * Function: test_filter_error * - * Purpose: Make sure the error message prints out the filter name + * Purpose: Make sure the error message prints out the filter name * when the existent file is opened but the filter isn't * registered. The existent file was created with * gen_filters.c. * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * 2 June 2011 + * Return: Success: 0 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -640,71 +624,72 @@ static herr_t test_filter_error(const char *fname) { const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */ - hid_t file, dataset; /* handles */ + hid_t file = -1; + hid_t dataset = -1; int buf[20]; HDfprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n"); /* Open the file */ - if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) + if ((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR; /* Open the regular dataset */ - if((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) + if ((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0) TEST_ERROR; - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) - TEST_ERROR; + if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0) + TEST_ERROR; /* Close/release resources */ - if(H5Dclose(dataset) < 0) + if (H5Dclose(dataset) < 0) TEST_ERROR - if(H5Fclose(file) < 0) + if (H5Fclose(file) < 0) TEST_ERROR return 0; error: return -1; -} +} /* end test_filter_error() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test error API. - * - * Programmer: Raymond Lu - * July 10, 2003 + * Purpose: Test error API. * *------------------------------------------------------------------------- */ int main(void) { - hid_t file, fapl; - hid_t estack_id; - char filename[1024]; - const char *FUNC_main = "main"; + hid_t file = -1; + hid_t fapl = -1; + hid_t estack_id = -1; + char filename[1024]; + const char *FUNC_main = "main"; HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n"); /* Initialize errors */ - if(init_error() < 0) + if (init_error() < 0) TEST_ERROR; - fapl = h5_fileaccess(); + if ((fapl = h5_fileaccess()) < 0) + TEST_ERROR; - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - TEST_ERROR; + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); + if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + TEST_ERROR; /* Test error stack */ - if(error_stack() < 0) { + if (error_stack() < 0) { /* Push an error onto error stack */ - if(H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, - "Error stack test failed") < 0) TEST_ERROR; + if (H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, + "Error stack test failed") < 0) + TEST_ERROR; /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); @@ -724,34 +709,39 @@ main(void) } /* end if */ /* Test error API */ - if(test_error(file) < 0) { + if (test_error(file) < 0) { H5Epush(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed, %s", "it's wrong"); estack_id = H5Eget_current_stack(); H5Eprint2(estack_id, stderr); H5Eclose_stack(estack_id); - } /* end if */ + } /* Test pushing a very long error description */ - if(test_long_desc() < 0) TEST_ERROR; + if (test_long_desc() < 0) + TEST_ERROR; /* Test creating a new error stack */ - if(test_create() < 0) TEST_ERROR; + if (test_create() < 0) + TEST_ERROR; /* Test copying a new error stack */ - if(test_copy() < 0) TEST_ERROR; + if (test_copy() < 0) + TEST_ERROR; - if(H5Fclose(file) < 0) TEST_ERROR; + if (H5Fclose(file) < 0) + TEST_ERROR; /* Close error information */ - if(close_error() < 0) + if (close_error() < 0) TEST_ERROR; /* Test error message during data reading when filter isn't registered * Use default FAPL to avoid some VFD drivers by the check-vfd test because - * the test file was pre-generated. */ + * the test file was pre-generated. + */ h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename); - if(test_filter_error(filename) < 0) + if (test_filter_error(filename) < 0) TEST_ERROR; h5_clean_files(FILENAME, fapl); diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 0acd288..5b68002 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -53,7 +53,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '305' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err index db21044..5276ab0 100644 --- a/tools/test/h5dump/errfiles/filter_fail.err +++ b/tools/test/h5dump/errfiles/filter_fail.err @@ -14,7 +14,7 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered major: Data filters minor: Read failed - #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '312' is not available + #005: (file name) line (number) in H5PL_load(): filter plugins disabled major: Plugin for dynamically loaded library minor: Unable to load metadata into cache h5dump error: unable to print data -- cgit v0.12 From 5c472f5d7bbaa7cad6ec29fa531fea4257a5fc39 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 01:22:21 -0800 Subject: Fixed Windows code in H5PLpath.c --- src/H5PLpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PLpath.c b/src/H5PLpath.c index d8e82f8..972f1d0 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -755,7 +755,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, hbool_t *fo continue; /* attempt to open the dynamic library as a filter library */ - if (H5PL__open(path, search_params->type, search_params->search_key.id, found, plugin_info) < 0) + if (H5PL__open(path, search_params->type, search_params->key, found, plugin_info) < 0) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "search in directory failed") if (*found) HGOTO_DONE(SUCCEED) -- cgit v0.12 From 2b7f23a33323f68011540f31ecf4900415b17f56 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 10:38:15 -0800 Subject: Fixed an uninitialized filter callback struct in H5Dchunk.c and unified the naming and initialization of said struct throughout the library. This was causing a crash on VS2015 in debug mode when the debug heap complained. Fixes HDFFV-10330. --- release_docs/RELEASE.txt | 15 +++++++++ src/H5Dchunk.c | 76 ++++++++++++++++++++++------------------- src/H5HFcache.c | 88 +++++++++++++++++++++++++++--------------------- src/H5HFhuge.c | 12 +++++-- src/H5Z.c | 62 +++++++++++++++++----------------- src/H5Zpublic.h | 20 +++++------ 6 files changed, 159 insertions(+), 114 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a1b59b1..7498d01 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -179,6 +179,21 @@ Bug Fixes since HDF5-1.10.1 release (ADB - 2017/10/10, HDFFV-10297, HDFFV-10319) + - An uninitialized struct could cause a memory access error when using + variable-length or reference types in a compressed, chunked dataset. + + A struct containing a callback function pointer and a pointer to some + associated data was used before initialization. This could cause a + memory access error and system crash. This could only occur under + unusual conditions when using variable-lenth and reference types in + a compressed, chunked dataset. + + On recent versions of Visual Studio, when built in debug mode, the + debug heap will complain and cause a crash if the code in question + is executed (this will cause the objcopy test to fail). + + (DER - 2017/11/21, HDFFV-10330) + Configuration ------------- - cmake diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 0d7fcc9..be3b678 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -5661,7 +5661,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* needed for commpressed variable length data */ hbool_t must_filter = FALSE; /* Whether chunk must be filtered during copy */ size_t nbytes; /* Size of chunk in file (in bytes) */ - H5Z_cb_t cb_struct; /* Filter failure callback struct */ + H5Z_cb_t filter_cb; /* Filter failure callback struct */ int ret_value = H5_ITER_CONT; /* Return value */ @@ -5670,6 +5670,10 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Get 'size_t' local value for number of bytes in chunk */ H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Check for filtered chunks */ /* Check for an edge chunk that is not filtered */ if(pline && pline->nused) { @@ -5716,7 +5720,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) HDassert(!H5F_addr_defined(chunk_rec->chunk_addr)); HDmemcpy(buf, udata->chunk, nbytes); udata->chunk = NULL; - } else { + } + else { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ unsigned idx; /* Index of chunk in cache, if present */ unsigned u; /* Counter */ @@ -5748,7 +5753,8 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, shared_fo->layout.u.chunk.size, uint32_t); HDmemcpy(buf, ent->chunk, nbytes); - } else { + } + else { /* read chunk data from the source file */ if(H5F_block_read(udata->file_src, H5FD_MEM_DRAW, chunk_rec->chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") @@ -5759,8 +5765,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) if(must_filter && (is_vlen || fix_ref) && !udata->chunk_in_cache) { unsigned filter_mask = chunk_rec->filter_mask; - cb_struct.func = NULL; /* no callback function when failed */ - if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) + if(H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "data pipeline read failed") } /* end if */ @@ -5822,7 +5827,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Need to compress variable-length or reference data elements or a chunk found in cache before writing to file */ if(must_filter && (is_vlen || fix_ref || udata->chunk_in_cache) ) { - if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, cb_struct, &nbytes, &buf_size, &buf) < 0) + if(H5Z_pipeline(pline, 0, &(udata_dst.filter_mask), H5Z_NO_EDC, filter_cb, &nbytes, &buf_size, &buf) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ @@ -6707,46 +6712,49 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) H5_CHECKED_ASSIGN(nbytes, size_t, chunk_rec->nbytes, uint32_t); chunk_addr = chunk_rec->chunk_addr; - if(new_idx_info->pline->nused && + if (new_idx_info->pline->nused && (new_idx_info->layout->flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (H5D__chunk_is_partial_edge_chunk(udata->dset_ndims, new_idx_info->layout->dim, chunk_rec->scaled, udata->dset_dims))) { - /* This is a partial non-filtered edge chunk */ - /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - unsigned filter_mask = chunk_rec->filter_mask; - H5Z_cb_t cb_struct; /* Filter failure callback struct */ - size_t read_size = nbytes; /* Bytes to read */ + /* This is a partial non-filtered edge chunk */ + /* Convert the chunk to a filtered edge chunk for v1 B-tree chunk index */ - HDassert(read_size == new_idx_info->layout->size); + unsigned filter_mask = chunk_rec->filter_mask; + H5Z_cb_t filter_cb; /* Filter failure callback struct */ + size_t read_size = nbytes; /* Bytes to read */ + + HDassert(read_size == new_idx_info->layout->size); - cb_struct.func = NULL; /* no callback function when failed */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ - /* Allocate buffer for chunk data */ - if(NULL == (buf = H5MM_malloc(read_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") + /* Allocate buffer for chunk data */ + if (NULL == (buf = H5MM_malloc(read_size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed for raw data chunk") - /* Read the non-filtered edge chunk */ - if(H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") + /* Read the non-filtered edge chunk */ + if (H5F_block_read(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, read_size, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_IO, H5E_READERROR, H5_ITER_ERROR, "unable to read raw data chunk") - /* Pass the chunk through the pipeline */ - if(H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, cb_struct, &nbytes, &read_size, &buf) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") + /* Pass the chunk through the pipeline */ + if (H5Z_pipeline(new_idx_info->pline, 0, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &buf) < 0) + HGOTO_ERROR(H5E_PLINE, H5E_CANTFILTER, H5_ITER_ERROR, "output pipeline failed") #if H5_SIZEOF_SIZE_T > 4 /* Check for the chunk expanding too much to encode in a 32-bit value */ - if(nbytes > ((size_t)0xffffffff)) - HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") + if (nbytes > ((size_t)0xffffffff)) + HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, H5_ITER_ERROR, "chunk too large for 32-bit length") #endif /* H5_SIZEOF_SIZE_T > 4 */ - /* Allocate space for the filtered chunk */ - if((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") - HDassert(H5F_addr_defined(chunk_addr)); + /* Allocate space for the filtered chunk */ + if ((chunk_addr = H5MF_alloc(new_idx_info->f, H5FD_MEM_DRAW, new_idx_info->dxpl_id, (hsize_t)nbytes)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_DATASET, H5E_NOSPACE, H5_ITER_ERROR, "file allocation failed for filtered chunk") + HDassert(H5F_addr_defined(chunk_addr)); - /* Write the filtered chunk to disk */ - if(H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") + /* Write the filtered chunk to disk */ + if (H5F_block_write(new_idx_info->f, H5FD_MEM_DRAW, chunk_addr, nbytes, H5AC_rawdata_dxpl_id, buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to write raw data to file") } /* end if */ /* Set up chunk information for insertion to chunk index */ @@ -6758,11 +6766,11 @@ H5D__chunk_format_convert_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) insert_udata.common.storage = new_idx_info->storage; /* Insert chunk into the v1 B-tree chunk index */ - if((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) + if ((new_idx_info->storage->ops->insert)(new_idx_info, &insert_udata, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, H5_ITER_ERROR, "unable to insert chunk addr into index") done: - if(buf) + if (buf) H5MM_xfree(buf); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5HFcache.c b/src/H5HFcache.c index f957e2e..069bf17 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -1671,9 +1671,13 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) HGOTO_DONE(TRUE); if(hdr->filter_len > 0) { - size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ - unsigned filter_mask; /* Excluded filters for direct block */ - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ + unsigned filter_mask; /* Excluded filters for direct block */ + H5Z_cb_t filter_cb; /* Filter callback structure */ + + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ /* Allocate buffer to perform I/O filtering on and copy image into * it. Must do this as H5Z_pipeline() may re-size the buffer @@ -1682,17 +1686,17 @@ H5HF__cache_dblock_verify_chksum(const void *_image, size_t len, void *_udata) if(NULL == (read_buf = H5MM_malloc(len))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer") - /* Set up parameters for filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; + /* Set up parameters for filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, FAIL, "output pipeline failed") /* Update info about direct block */ - udata->decompressed = TRUE; + udata->decompressed = TRUE; len = nbytes; } /* end if */ else @@ -1818,45 +1822,49 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, udata->dblk = NULL; } /* end if */ else { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used in buffer, after applying reverse filters */ unsigned filter_mask; /* Excluded filters for direct block */ /* Sanity check */ - HDassert(udata->dblk == NULL); + HDassert(udata->dblk == NULL); - /* Allocate buffer to perform I/O filtering on and copy image into - * it. Must do this as H5Z_pipeline() may resize the buffer - * provided to it. - */ - if(NULL == (read_buf = H5MM_malloc(len))) - HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + + /* Allocate buffer to perform I/O filtering on and copy image into + * it. Must do this as H5Z_pipeline() may resize the buffer + * provided to it. + */ + if (NULL == (read_buf = H5MM_malloc(len))) + HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "memory allocation failed for pipeline buffer") /* Copy compressed image into buffer */ - HDmemcpy(read_buf, image, len); + HDmemcpy(read_buf, image, len); - /* Push direct block data through I/O filter pipeline */ - nbytes = len; - filter_mask = udata->filter_mask; - if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") + /* Push direct block data through I/O filter pipeline */ + nbytes = len; + filter_mask = udata->filter_mask; + if (H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_ENABLE_EDC, filter_cb, &nbytes, &len, &read_buf) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFILTER, NULL, "output pipeline failed") - /* Sanity check */ - HDassert(nbytes == dblock->size); + /* Sanity check */ + HDassert(nbytes == dblock->size); - /* Copy un-filtered data into block's buffer */ - HDmemcpy(dblock->blk, read_buf, dblock->size); - } /* end if */ + /* Copy un-filtered data into block's buffer */ + HDmemcpy(dblock->blk, read_buf, dblock->size); + } /* end if */ } /* end if */ else { /* Sanity checks */ - HDassert(udata->dblk == NULL); - HDassert(!udata->decompressed); + HDassert(udata->dblk == NULL); + HDassert(!udata->decompressed); - /* Allocate block buffer */ -/* XXX: Change to using free-list factories */ - if(NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + /* Allocate block buffer */ + /* XXX: Change to using free-list factories */ + if (NULL == (dblock->blk = H5FL_BLK_MALLOC(direct_block, (size_t)dblock->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy image to dblock->blk */ HDassert(dblock->size == len); @@ -1895,9 +1903,9 @@ H5HF__cache_dblock_deserialize(const void *_image, size_t len, void *_udata, /* Decode checksum on direct block, if requested */ if(hdr->checksum_dblocks) { - uint32_t stored_chksum; /* Metadata checksum value */ + uint32_t stored_chksum; /* Metadata checksum value */ - /* checksum verification already done in verify_chksum cb */ + /* checksum verification already done in verify_chksum cb */ /* Metadata checksum */ UINT32DECODE(image, stored_chksum); @@ -2188,10 +2196,14 @@ H5HF__cache_dblock_pre_serialize(H5F_t *f, hid_t dxpl_id, void *_thing, /* Check for I/O filters on this heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ unsigned filter_mask = 0; /* Filter mask for block */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = dblock->size; if(NULL == (write_buf = H5MM_malloc(write_size))) diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index b2a1e68..350100e 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -345,9 +345,13 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* Allocate buffer to perform I/O filtering on */ write_size = obj_size; if(NULL == (write_buf = H5MM_malloc(write_size))) @@ -773,10 +777,14 @@ H5HF_huge_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Check for I/O pipeline filter on heap */ if(hdr->filter_len > 0) { - H5Z_cb_t filter_cb = {NULL, NULL}; /* Filter callback structure */ + H5Z_cb_t filter_cb; /* Filter callback structure */ size_t read_size; /* Object's size in the file */ size_t nbytes; /* Number of bytes used */ + /* Initialize the filter callback struct */ + filter_cb.op_data = NULL; + filter_cb.func = NULL; /* no callback function when failed */ + /* De-filter the object */ read_size = nbytes = obj_size; if(H5Z_pipeline(&(hdr->pline), H5Z_FLAG_REVERSE, &filter_mask, H5Z_NO_EDC, filter_cb, &nbytes, &read_size, &read_buf) < 0) diff --git a/src/H5Z.c b/src/H5Z.c index 1e7cd79..89c97d4 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -275,7 +275,7 @@ done: * Function: H5Z_register * * Purpose: Same as the public version except this one allows filters - * to be set for predefined method numbers nused > 0); + HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) @@ -926,7 +926,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline->nused > 0); + HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ if (H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) @@ -1200,12 +1200,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, FUNC_ENTER_NOAPI(FAIL) - HDassert (0 == (flags & ~((unsigned)H5Z_FLAG_INVMASK))); - HDassert (filter_mask); - HDassert (nbytes && *nbytes>0); - HDassert (buf_size && *buf_size>0); - HDassert (buf && *buf); - HDassert (!pline || pline->nused0); + HDassert(buf_size && *buf_size>0); + HDassert(buf && *buf); + HDassert(!pline || pline->nused < H5Z_MAX_NFILTERS); if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i = pline->nused; i > 0; --i) { @@ -1235,7 +1235,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, /* Search in the table of registered filters again to find the dynamic filter just loaded and registered */ if ((fclass_idx = H5Z_find_idx(pline->filter[idx].id)) < 0) issue_error = TRUE; - } /* end if */ + } else issue_error = TRUE; @@ -1247,7 +1247,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter '%s' is not registered", pline->filter[idx].name) else HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "required filter (name unavailable) is not registered") - } /* end if */ + } } /* end if */ fclass = &H5Z_table_g[fclass_idx]; @@ -1263,11 +1263,12 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #ifdef H5Z_DEBUG H5_timer_end (&(fstats->stats[1].timer), &timer); fstats->stats[1].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) fstats->stats[1].errors += *nbytes; + if (0 == new_nbytes) + fstats->stats[1].errors += *nbytes; #endif if (0 == new_nbytes) { - if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func (pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) + if ((cb_struct.func && (H5Z_CB_FAIL == cb_struct.func(pline->filter[idx].id, *buf, *buf_size, cb_struct.op_data))) || !cb_struct.func) HGOTO_ERROR(H5E_PLINE, H5E_READERROR, FAIL, "filter returned failure during read") *nbytes = *buf_size; @@ -1303,7 +1304,8 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, #ifdef H5Z_DEBUG H5_timer_end (&(fstats->stats[0].timer), &timer); fstats->stats[0].total += MAX(*nbytes, new_nbytes); - if (0 == new_nbytes) fstats->stats[0].errors += *nbytes; + if (0 == new_nbytes) + fstats->stats[0].errors += *nbytes; #endif if (0 == new_nbytes) { if (0 == (pline->filter[idx].flags & H5Z_FLAG_OPTIONAL)) { @@ -1345,8 +1347,8 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(NULL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1384,8 +1386,8 @@ H5Z_filter_in_pline(const H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* Locate the filter in the pipeline */ for (idx = 0; idx < pline->nused; idx++) @@ -1421,7 +1423,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); + HDassert(pline); /* Iterate through all the filters in pipeline */ for (i = 0; i < pline->nused; i++) { @@ -1459,8 +1461,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) FUNC_ENTER_NOAPI(FAIL) /* Check args */ - HDassert (pline); - HDassert (filter >= 0 && filter <= H5Z_FILTER_MAX); + HDassert(pline); + HDassert(filter >= 0 && filter <= H5Z_FILTER_MAX); /* if the pipeline has no filters, just return */ if (pline->nused == 0) @@ -1470,7 +1472,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (H5Z_FILTER_ALL == filter) { if (H5O_msg_reset(H5O_PLINE_ID, pline) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANTFREE, FAIL, "can't release pipeline info") - } /* end if */ + } /* Delete filter */ else { size_t idx; /* Index of filter in pipeline */ @@ -1481,7 +1483,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) if (pline->filter[idx].id == filter) { found = TRUE; break; - } /* end if */ + } /* filter was not found in the pipeline */ if (!found) @@ -1489,11 +1491,11 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) /* Free information for deleted filter */ if (pline->filter[idx].name && pline->filter[idx].name != pline->filter[idx]._name) - HDassert ((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); + HDassert((HDstrlen(pline->filter[idx].name) + 1) > H5Z_COMMON_NAME_LEN); if (pline->filter[idx].name != pline->filter[idx]._name) pline->filter[idx].name = (char *)H5MM_xfree(pline->filter[idx].name); if (pline->filter[idx].cd_values && pline->filter[idx].cd_values != pline->filter[idx]._cd_values) - HDassert (pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); + HDassert(pline->filter[idx].cd_nelmts > H5Z_COMMON_CD_VALUES); if (pline->filter[idx].cd_values != pline->filter[idx]._cd_values) pline->filter[idx].cd_values = (unsigned *)H5MM_xfree(pline->filter[idx].cd_values); @@ -1506,8 +1508,8 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) pline->filter[idx].name = pline->filter[idx]._name; if (pline->filter[idx].cd_nelmts <= H5Z_COMMON_CD_VALUES) pline->filter[idx].cd_values = pline->filter[idx]._cd_values; - } /* end for */ - } /* end if */ + } + } /* Decrement number of used filters */ pline->nused--; diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index f6b313e..fcb2d37 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -129,8 +129,8 @@ typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void* buf, /* Structure for filter callback property */ typedef struct H5Z_cb_t { - H5Z_filter_func_t func; - void* op_data; + H5Z_filter_func_t func; + void *op_data; } H5Z_cb_t; #ifdef __cplusplus @@ -206,14 +206,14 @@ typedef size_t (*H5Z_func_t)(unsigned int flags, size_t cd_nelmts, * contain a pointers to the filter function and timing statistics. */ typedef struct H5Z_class2_t { - int version; /* Version number of the H5Z_class_t struct */ - H5Z_filter_t id; /* Filter ID number */ - unsigned encoder_present; /* Does this filter have an encoder? */ - unsigned decoder_present; /* Does this filter have a decoder? */ - const char *name; /* Comment for debugging */ - H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ - H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ - H5Z_func_t filter; /* The actual filter function */ + int version; /* Version number of the H5Z_class_t struct */ + H5Z_filter_t id; /* Filter ID number */ + unsigned encoder_present; /* Does this filter have an encoder? */ + unsigned decoder_present; /* Does this filter have a decoder? */ + const char *name; /* Comment for debugging */ + H5Z_can_apply_func_t can_apply; /* The "can apply" callback for a filter */ + H5Z_set_local_func_t set_local; /* The "set local" callback for a filter */ + H5Z_func_t filter; /* The actual filter function */ } H5Z_class2_t; H5_DLL herr_t H5Zregister(const void *cls); -- cgit v0.12 From e432a23f8bf7461ea4775986fd8c0b802ba67af9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 21 Nov 2017 13:20:33 -0800 Subject: Made a dcpl layout struct in H5Z.c dynamic to quiet a stack size warning. --- src/H5Z.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/H5Z.c b/src/H5Z.c index 89c97d4..6f173b2 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -752,6 +752,7 @@ static herr_t H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { hid_t space_id = -1; /* ID for dataspace describing chunk */ + H5O_layout_t *dcpl_layout = NULL; /* Dataset's layout information */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -761,19 +762,22 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type /* Check if the property list is non-default */ if (dcpl_id != H5P_DATASET_CREATE_DEFAULT) { - H5P_genplist_t *dc_plist; /* Dataset creation property list object */ - H5O_layout_t dcpl_layout; /* Dataset's layout information */ + H5P_genplist_t *dc_plist; /* Dataset creation property list object */ + + /* Get memory for the layout */ + if (NULL == (dcpl_layout = (H5O_layout_t *)H5MM_calloc(sizeof(H5O_layout_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate dcpl layout buffer") /* Get dataset creation property list object */ if (NULL == (dc_plist = (H5P_genplist_t *)H5I_object(dcpl_id))) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Peek at the layout information */ - if (H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, &dcpl_layout) < 0) + if (H5P_peek(dc_plist, H5D_CRT_LAYOUT_NAME, dcpl_layout) < 0) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve layout") /* Check if the dataset is chunked */ - if (H5D_CHUNKED == dcpl_layout.type) { + if (H5D_CHUNKED == dcpl_layout->type) { H5O_pline_t dcpl_pline; /* Object's I/O pipeline information */ /* Get I/O pipeline information */ @@ -787,28 +791,31 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type size_t u; /* Local index variable */ /* Create a dataspace for a chunk & set the extent */ - for (u = 0; u < dcpl_layout.u.chunk.ndims; u++) - chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; - if (NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) + for (u = 0; u < dcpl_layout->u.chunk.ndims; u++) + chunk_dims[u] = dcpl_layout->u.chunk.dim[u]; + if (NULL == (space = H5S_create_simple(dcpl_layout->u.chunk.ndims, chunk_dims, NULL))) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace") /* Get ID for dataspace to pass to filter routines */ if ((space_id = H5I_register(H5I_DATASPACE, space, FALSE)) < 0) { - (void)H5S_close (space); + (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") - } /* end if */ + } /* Make the callbacks */ if (H5Z_prelude_callback(&dcpl_pline, dcpl_id, type_id, space_id, prelude_type) < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") - } /* end if */ - } /* end if */ - } /* end if */ + } + } + } done: if (space_id > 0 && H5I_dec_ref(space_id) < 0) HDONE_ERROR(H5E_PLINE, H5E_CANTRELEASE, FAIL, "unable to close dataspace") + if (dcpl_layout) + dcpl_layout = (H5O_layout_t *)H5MM_xfree(dcpl_layout); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_prepare_prelude_callback_dcpl() */ -- cgit v0.12 From abd2ab411a68d95d122b17ef04447adb2be0794b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 26 Nov 2017 18:13:18 -0800 Subject: Fixed misc Warnings flagged by VS2017. --- examples/h5_cmprss.c | 1 - src/H5Dio.c | 4 +- src/H5MF.c | 5 +- src/H5Tdbg.c | 227 +++++++++++++++++++++++++-------------------------- src/H5system.c | 2 +- test/cache_tagging.c | 13 +-- test/tarray.c | 24 +++--- test/tattr.c | 14 ++-- test/tchecksum.c | 2 +- test/testhdf5.h | 1 + test/tfile.c | 6 +- test/th5o.c | 4 +- test/theap.c | 30 +++---- test/tid.c | 18 ++-- test/titerate.c | 18 ++-- test/tmisc.c | 36 ++++---- test/trefstr.c | 26 +++--- test/tselect.c | 130 ++++++++++++++--------------- test/tskiplist.c | 142 ++++++++++++++++---------------- test/ttst.c | 18 ++-- test/tvltypes.c | 6 +- 21 files changed, 364 insertions(+), 363 deletions(-) diff --git a/examples/h5_cmprss.c b/examples/h5_cmprss.c index ebc7712..b51ec44 100644 --- a/examples/h5_cmprss.c +++ b/examples/h5_cmprss.c @@ -36,7 +36,6 @@ int main () { hsize_t dims[2]; hsize_t cdims[2]; - int idx; int i,j, numfilt; int buf[DIM0][DIM1]; int rbuf [DIM0][DIM1]; diff --git a/src/H5Dio.c b/src/H5Dio.c index 104a632..280d602 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -962,7 +962,9 @@ const io_info->using_mpi_vfd = H5F_HAS_FEATURE(dset->oloc.file, H5FD_FEAT_HAS_MPI); #endif /* H5_HAVE_PARALLEL */ -done: +#ifdef H5_DEBUG_BUILD + done: +#endif /* H5_DEBUG_BUILD */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__ioinfo_init() */ diff --git a/src/H5MF.c b/src/H5MF.c index 49c7b77..7e06654 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -3247,7 +3247,6 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) /* for self referential FSMs */ haddr_t eoa_post_fsm_fsalloc; /* eoa post file space allocation */ /* for self referential FSMs */ - H5FS_stat_t fs_stat; /* Information for hdr FSM */ H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ hbool_t reset_ring = FALSE; /* Whether we set the ring */ @@ -3310,6 +3309,9 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) reset_ring = TRUE; #ifndef NDEBUG +{ + H5FS_stat_t fs_stat; /* Information for hdr FSM */ + /* Verify that sm_hdr_fspace is floating if it exists */ if(sm_hdr_fspace) { /* Query free space manager info for this type */ @@ -3357,6 +3359,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hid_t dxpl_id, hbool_t *fsm_settled) HDassert(fs_stat.alloc_sect_size == 0); } /* end if */ } /* end if */ +} #endif /* NDEBUG */ /* Free the space in the metadata aggregator. Do this via the diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index f434543..eb648f3 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -32,9 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -74,28 +74,21 @@ /*------------------------------------------------------------------------- - * Function: H5T__print_stats + * Function: H5T__print_stats * - * Purpose: Print statistics about a conversion path. Statistics are - * printed only if all the following conditions are true: + * Purpose: Print statistics about a conversion path. Statistics are + * printed only if all the following conditions are true: * - * 1. The library was compiled with H5T_DEBUG defined. - * 2. Data type debugging is turned on at run time. - * 3. The path was called at least one time. + * 1. The library was compiled with H5T_DEBUG defined. + * 2. Data type debugging is turned on at run time. + * 3. The path was called at least one time. * - * The optional NPRINT argument keeps track of the number of - * conversions paths for which statistics have been shown. If - * its value is zero then table headers are printed before the - * first line of output. + * The optional NPRINT argument keeps track of the number of + * conversions paths for which statistics have been shown. If + * its value is zero then table headers are printed before the + * first line of output. * - * Return: Success: non-negative - * - * Failure: negative - * - * Programmer: Robb Matzke - * Monday, December 14, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -110,34 +103,34 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG - if(H5DEBUG(T) && path->stats.ncalls > 0) { - if(nprint && 0 == (*nprint)++) { - HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); - } - if(path->src && path->dst) + if (H5DEBUG(T) && path->stats.ncalls > 0) { + if (nprint && 0 == (*nprint)++) { + HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "Conversion", "Elmts", "Calls", "User", + "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", + "----------", "-----", "-----", "----", + "------", "-------", "---------"); + } + if (path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); - else if(path->src) + else if (path->src) nbytes = H5T_get_size(path->src); - else if(path->dst) + else if (path->dst) nbytes = H5T_get_size(path->dst); else nbytes = 0; - nbytes *= path->stats.nelmts; - H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); - HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", - path->name, - path->stats.nelmts, - path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, - path->stats.timer.etime, - bandwidth); + nbytes *= path->stats.nelmts; + H5_bandwidth(bandwidth, (double)nbytes, path->stats.timer.etime); + HDfprintf(H5DEBUG(T), " %-16s %10Hd %10d %8.2f %8.2f %8.2f %10s\n", + path->name, + path->stats.nelmts, + path->stats.ncalls, + path->stats.timer.utime, + path->stats.timer.stime, + path->stats.timer.etime, + bandwidth); } #endif FUNC_LEAVE_NOAPI(SUCCEED) @@ -145,24 +138,20 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* /*------------------------------------------------------------------------- - * Function: H5T_debug - * - * Purpose: Prints information about a data type. + * Function: H5T_debug * - * Return: Non-negative on success/Negative on failure + * Purpose: Prints information about a data type. * - * Programmer: Robb Matzke - * Wednesday, January 7, 1998 - * - * Modifications: + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5T_debug(const H5T_t *dt, FILE *stream) { - const char *s1 = "", *s2 = ""; - unsigned i; + const char *s1 = ""; + const char *s2 = ""; + unsigned i; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -171,7 +160,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDassert(dt); HDassert(stream); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -221,9 +210,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = ""; break; - } /* end switch */ + } /* end switch */ - switch(dt->shared->state) { + switch (dt->shared->state) { case H5T_STATE_TRANSIENT: s2 = "[transient]"; break; @@ -245,14 +234,14 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; default: HDassert(0 && "This Should never be executed!"); - } /* end switch */ + } /* end switch */ - fprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); + HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); - if(H5T_IS_ATOMIC(dt->shared)) { - uint64_t tmp; + if (H5T_IS_ATOMIC(dt->shared)) { + uint64_t tmp; - switch(dt->shared->u.atomic.order) { + switch (dt->shared->u.atomic.order) { case H5T_ORDER_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "order error"); break; @@ -277,17 +266,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = "order?"; break; - } /* end switch */ + } /* end switch */ + + HDfprintf(stream, ", %s", s1); - fprintf(stream, ", %s", s1); + if (dt->shared->u.atomic.offset) + HDfprintf(stream, ", offset=%lu", (unsigned long) (dt->shared->u.atomic.offset)); + if (dt->shared->u.atomic.prec != 8 * dt->shared->size) + HDfprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); - if(dt->shared->u.atomic.offset) - fprintf(stream, ", offset=%lu", - (unsigned long) (dt->shared->u.atomic.offset)); - if(dt->shared->u.atomic.prec != 8 * dt->shared->size) - fprintf(stream, ", prec=%lu", - (unsigned long) (dt->shared->u.atomic.prec)); - switch(dt->shared->type) { + switch (dt->shared->type) { case H5T_NO_CLASS: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "no class"); break; @@ -313,7 +301,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end switch */ if(s1) - fprintf(stream, ", %s", s1); + HDfprintf(stream, ", %s", s1); break; case H5T_FLOAT: @@ -339,23 +327,24 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - fprintf(stream, ", sign=%lu+1", + HDfprintf(stream, ", sign=%lu+1", (unsigned long)(dt->shared->u.atomic.u.f.sign)); - fprintf(stream, ", mant=%lu+%lu (%s)", + HDfprintf(stream, ", mant=%lu+%lu (%s)", (unsigned long)(dt->shared->u.atomic.u.f.mpos), (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); - fprintf(stream, ", exp=%lu+%lu", + HDfprintf(stream, ", exp=%lu+%lu", (unsigned long)(dt->shared->u.atomic.u.f.epos), (unsigned long)(dt->shared->u.atomic.u.f.esize)); tmp = dt->shared->u.atomic.u.f.ebias >> 32; - if(tmp) { + if (tmp) { size_t hi = (size_t)tmp; size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx%08lx", + HDfprintf(stream, " bias=0x%08lx%08lx", (unsigned long)hi, (unsigned long)lo); - } else { + } + else { size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - fprintf(stream, " bias=0x%08lx", (unsigned long)lo); + HDfprintf(stream, " bias=0x%08lx", (unsigned long)lo); } break; @@ -372,69 +361,73 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: /* No additional info */ break; - } /* end switch */ - } else if(H5T_COMPOUND == dt->shared->type) { - /* Compound data type */ - for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - fprintf(stream, "\n\"%s\" @%lu", - dt->shared->u.compnd.memb[i].name, - (unsigned long)(dt->shared->u.compnd.memb[i].offset)); - fprintf(stream, " "); - H5T_debug(dt->shared->u.compnd.memb[i].type, stream); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_VLEN == dt->shared->type) { - switch(dt->shared->u.vlen.loc) { + } /* end switch */ + } + else if (H5T_COMPOUND == dt->shared->type) { + /* Compound data type */ + for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { + HDfprintf(stream, "\n\"%s\" @%lu", + dt->shared->u.compnd.memb[i].name, + (unsigned long)(dt->shared->u.compnd.memb[i].offset)); + HDfprintf(stream, " "); + H5T_debug(dt->shared->u.compnd.memb[i].type, stream); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_VLEN == dt->shared->type) { + switch (dt->shared->u.vlen.loc) { case H5T_LOC_BADLOC: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype location"); break; case H5T_LOC_MEMORY: - fprintf(stream, ", loc=memory"); + HDfprintf(stream, ", loc=memory"); break; case H5T_LOC_DISK: - fprintf(stream, ", loc=disk"); + HDfprintf(stream, ", loc=disk"); break; case H5T_LOC_MAXLOC: default: - fprintf(stream, ", loc=UNKNOWN"); + HDfprintf(stream, ", loc=UNKNOWN"); break; } /* end switch */ - if(H5T_IS_VL_STRING(dt->shared)) + if (H5T_IS_VL_STRING(dt->shared)) /* Variable length string datatype */ - fprintf(stream, ", variable-length"); + HDfprintf(stream, ", variable-length"); else { /* Variable length sequence datatype */ - fprintf(stream, " VLEN "); + HDfprintf(stream, " VLEN "); H5T_debug(dt->shared->parent, stream); - fprintf(stream, "\n"); + HDfprintf(stream, "\n"); } /* end else */ - } else if(H5T_ENUM == dt->shared->type) { + } + else if (H5T_ENUM == dt->shared->type) { size_t base_size; - /* Enumeration data type */ - fprintf(stream, " "); - H5T_debug(dt->shared->parent, stream); - base_size = dt->shared->parent->shared->size; - for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { + /* Enumeration data type */ + HDfprintf(stream, " "); + H5T_debug(dt->shared->parent, stream); + base_size = dt->shared->parent->shared->size; + for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { size_t k; - fprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); - for(k = 0; k < base_size; k++) - fprintf(stream, "%02lx", - (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); - } /* end for */ - fprintf(stream, "\n"); - } else if(H5T_OPAQUE == dt->shared->type) { - fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); - } else { - /* Unknown */ - fprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); + HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); + for (k = 0; k < base_size; k++) + HDfprintf(stream, "%02lx", (unsigned long)(dt->shared->u.enumer.value + (i * base_size) + k)); + } /* end for */ + HDfprintf(stream, "\n"); + } + else if (H5T_OPAQUE == dt->shared->type) { + HDfprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); + } + else { + /* Unknown */ + HDfprintf(stream, "unknown class %d\n", (int)(dt->shared->type)); } - fprintf(stream, "}"); + HDfprintf(stream, "}"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5system.c b/src/H5system.c index a1cdf19..a8726c2 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -977,7 +977,7 @@ Wround(double arg) float Wroundf(float arg) { - return arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F); + return (float)(arg < 0.0F ? HDceil(arg - 0.5F) : HDfloor(arg + 0.5F)); } #endif /* H5_HAVE_WIN32_API */ diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 99ab49c..9c79968 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3631,11 +3631,14 @@ error: static unsigned check_invalid_tag_application(void) { +#if H5C_DO_TAGGING_SANITY_CHECKS /* Variables */ H5F_t * f = NULL; - hid_t fid, dxpl_id = -1; + hid_t fid = -1; + hid_t dxpl_id = -1; haddr_t addr; H5HL_t * lheap = NULL; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ /* Testing Macro */ TESTING("failure on invalid tag application"); @@ -3683,8 +3686,8 @@ check_invalid_tag_application(void) PASSED(); #else SKIPPED(); - printf(" test skipped because sanity checking on tag value is disabled.\n"); -#endif + HDprintf(" test skipped because sanity checking on tag value is disabled.\n"); +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 0; @@ -3791,10 +3794,10 @@ main(void) HDremove(FILENAME2); /* Return Errors */ - return(nerrs > 0); + return nerrs > 0; error: /* Return with Error */ - return(1); + return 1; } /* main */ diff --git a/test/tarray.c b/test/tarray.c index a35b8a3..b2e0ee7 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -679,7 +679,7 @@ test_array_compound_atomic(void) /* Check the 1st field's name */ mname = H5Tget_member_name(tid2, 0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "i") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -698,7 +698,7 @@ test_array_compound_atomic(void) /* Check the 2nd field's name */ mname = H5Tget_member_name(tid2, 1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname, "f") != 0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname); H5free_memory(mname); @@ -897,7 +897,7 @@ test_array_compound_array(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid2,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -916,7 +916,7 @@ test_array_compound_array(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid2,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1604,7 +1604,7 @@ test_array_bkg(void) /* Initialize the data */ /* ------------------- */ dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo)); - CHECK(dtsinfo, NULL, "HDmalloc"); + CHECK_PTR(dtsinfo, "HDmalloc"); HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo)); for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { @@ -1927,7 +1927,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1946,7 +1946,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -1965,7 +1965,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); H5free_memory(mname); @@ -2009,7 +2009,7 @@ test_compat(void) /* Check the 1st field's name */ mname=H5Tget_member_name(tid1,0); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"i")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2028,7 +2028,7 @@ test_compat(void) /* Check the 2nd field's name */ mname=H5Tget_member_name(tid1,1); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"f")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2073,7 +2073,7 @@ test_compat(void) /* Check the 3rd field's name */ mname=H5Tget_member_name(tid1,2); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"l")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); @@ -2118,7 +2118,7 @@ test_compat(void) /* Check the 4th field's name */ mname=H5Tget_member_name(tid1,3); - CHECK(mname, NULL, "H5Tget_member_name"); + CHECK_PTR(mname, "H5Tget_member_name"); if(mname && HDstrcmp(mname,"d")!=0) TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname); if(mname) H5free_memory(mname); diff --git a/test/tattr.c b/test/tattr.c index 3786d0d..2d333e9 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -277,7 +277,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name); @@ -313,7 +313,7 @@ test_attr_basic_write(hid_t fapl) if(attr_name_size > 0) { attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - CHECK(attr_name, NULL, "HDcalloc"); + CHECK_PTR(attr_name, "HDcalloc"); if(attr_name) { ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name); @@ -6862,7 +6862,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) /* Allocate the "visited link" array */ iter_info.max_visit = max_compact * 2; visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit); - CHECK(visited, NULL, "HDmalloc"); + CHECK_PTR(visited, "HDmalloc"); iter_info.visited = visited; /* Loop over operating on different indices on link fields */ @@ -8040,7 +8040,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8371,7 +8371,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -8817,7 +8817,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ @@ -9186,7 +9186,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Allocate & initialize "big" attribute data */ big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned)); - CHECK(big_value, NULL, "HDmalloc"); + CHECK_PTR(big_value, "HDmalloc"); HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3)); /* Create dataspace for dataset */ diff --git a/test/tchecksum.c b/test/tchecksum.c index febaacc..ffbab45 100644 --- a/test/tchecksum.c +++ b/test/tchecksum.c @@ -187,7 +187,7 @@ test_chksum_large(void) /* Allocate the buffer */ large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN); - CHECK(large_buf, NULL, "HDmalloc"); + CHECK_PTR(large_buf, "HDmalloc"); /* Initialize buffer w/known data */ for(u = 0; u < BUF_LEN; u++) diff --git a/test/testhdf5.h b/test/testhdf5.h index 2cbe6c6..41675cf 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -54,6 +54,7 @@ } \ } +/* Check that a pointer is valid (i.e.: not NULL) */ #define CHECK_PTR(ret,where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ diff --git a/test/tfile.c b/test/tfile.c index 027ad62..80ba4da 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1072,7 +1072,7 @@ test_get_obj_ids(void) VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in @@ -1135,7 +1135,7 @@ test_get_obj_ids(void) VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t)); - CHECK(oid_list, NULL, "HDcalloc"); + CHECK_PTR(oid_list, "HDcalloc"); /* Get the list of all opened objects */ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); @@ -2667,7 +2667,7 @@ cal_chksum(const char *file, uint32_t *chksum) /* Allocate space for the file data */ file_data = HDmalloc((size_t)sb.st_size); - CHECK(file_data, NULL, "HDmalloc"); + CHECK_PTR(file_data, "HDmalloc"); if(file_data) { /* Read file's data into memory */ diff --git a/test/th5o.c b/test/th5o.c index 4baac20..144ea4c 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -783,9 +783,9 @@ test_h5o_link(void) /* Allocate memory buffers */ /* (These are treated as 2-D buffers) */ wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int)); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); /* Initialize the raw data */ for(i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++) diff --git a/test/theap.c b/test/theap.c index 3c23025..cdb423e 100644 --- a/test/theap.c +++ b/test/theap.c @@ -88,11 +88,11 @@ test_heap_init(void) /* Allocate arrays */ rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(rand_num, NULL, "HDmalloc"); + CHECK_PTR(rand_num, "HDmalloc"); inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(inc_sort_num, NULL, "HDmalloc"); + CHECK_PTR(inc_sort_num, "HDmalloc"); dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS); - CHECK(dec_sort_num, NULL, "HDmalloc"); + CHECK_PTR(dec_sort_num, "HDmalloc"); /* Create randomized set of numbers */ curr_time = HDtime(NULL); @@ -127,7 +127,7 @@ test_heap_create(void) /* Try creating a maximum Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -135,7 +135,7 @@ test_heap_create(void) /* Try creating a minimum Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Try closing the heap */ ret=H5HP_close(heap); @@ -163,7 +163,7 @@ test_heap_insert_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -237,7 +237,7 @@ test_heap_insert_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -325,7 +325,7 @@ test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, i /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -405,7 +405,7 @@ test_heap_remove_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -479,7 +479,7 @@ test_heap_remove_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -567,7 +567,7 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz /* Create a Heap */ heap=H5HP_create(heap_type); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -714,7 +714,7 @@ test_heap_change_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -788,7 +788,7 @@ test_heap_change_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -880,7 +880,7 @@ test_heap_incdec_min(void) /* Create a Heap */ heap=H5HP_create(H5HP_MIN_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); @@ -955,7 +955,7 @@ test_heap_incdec_max(void) /* Create a Heap */ heap=H5HP_create(H5HP_MAX_HEAP); - CHECK(heap, NULL, "H5HP_create"); + CHECK_PTR(heap, "H5HP_create"); /* Check that the heap has no elements */ num=H5HP_count(heap); diff --git a/test/tid.c b/test/tid.c index 494ee60..375ef69 100644 --- a/test/tid.c +++ b/test/tid.c @@ -57,7 +57,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -65,7 +65,7 @@ static int basic_id_test(void) testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -118,7 +118,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -126,14 +126,14 @@ static int basic_id_test(void) testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; /* Remove an ID and make sure we can't access it */ testPtr = (int*) H5Iremove_verify(arrayID, myType); - CHECK(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR(testPtr, "H5Iremove_verify"); if(testPtr == NULL) goto out; @@ -141,7 +141,7 @@ static int basic_id_test(void) testPtr = (int*) H5Iobject_verify(arrayID, myType); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; @@ -263,7 +263,7 @@ static int id_predefined_test(void ) testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Isearch"); + CHECK_PTR_NULL(testPtr, "H5Isearch"); if(testPtr != NULL) goto out; @@ -301,7 +301,7 @@ static int id_predefined_test(void ) testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iremove_verify"); + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); if(testPtr != NULL) goto out; @@ -309,7 +309,7 @@ static int id_predefined_test(void ) testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); H5E_END_TRY - VERIFY(testPtr, NULL, "H5Iobject_verify"); + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); if(testPtr != NULL) goto out; diff --git a/test/titerate.c b/test/titerate.c index aad62c9..231bd2e 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -159,7 +159,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) /* Keep a copy of the dataset names around for later */ lnames[i] = HDstrdup(name); - CHECK(lnames[i], NULL, "strdup"); + CHECK_PTR(lnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -170,13 +170,13 @@ test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Gcreate2"); lnames[NDATASETS] = HDstrdup("grp"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); lnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(lnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(lnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -412,7 +412,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) /* Keep a copy of the attribute names around for later */ anames[i] = HDstrdup(name); - CHECK(anames[i], NULL, "strdup"); + CHECK_PTR(anames[i], "strdup"); ret = H5Aclose(attribute); CHECK(ret, FAIL, "H5Aclose"); @@ -596,7 +596,7 @@ test_iter_group_large(hid_t fapl) /* Allocate & initialize array */ names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2)); - CHECK(names, NULL, "HDcalloc"); + CHECK_PTR(names, "HDcalloc"); /* Output message about test being performed */ MESSAGE(5, ("Testing Large Group Iteration Functionality\n")); @@ -733,7 +733,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ dnames[i] = HDstrdup(name); - CHECK(dnames[i], NULL, "strdup"); + CHECK_PTR(dnames[i], "strdup"); ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -744,13 +744,13 @@ static void test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Gcreate2"); dnames[NDATASETS] = HDstrdup("grp"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); dnames[NDATASETS + 1] = HDstrdup("dtype"); - CHECK(dnames[NDATASETS], NULL, "strdup"); + CHECK_PTR(dnames[NDATASETS], "strdup"); /* Close everything up */ ret = H5Tclose(datatype); @@ -797,7 +797,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Keep a copy of the dataset names around for later */ obj_names[i] = HDstrdup(dataset_name); - CHECK(obj_names[i], NULL, "strdup"); + CHECK_PTR(obj_names[i], "strdup"); ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info_by_idx"); diff --git a/test/tmisc.c b/test/tmisc.c index 6da4589..f0e595b 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -723,7 +723,7 @@ create_struct3(void) herr_t ret; /* For error checking */ str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl)); - CHECK(str3hndl,NULL,"malloc"); + CHECK_PTR(str3hndl, "malloc"); str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate"); @@ -766,7 +766,7 @@ create_struct2(void) herr_t ret; /* For error checking */ str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl)); - CHECK(str2hndl, NULL, "malloc"); + CHECK_PTR(str2hndl, "HDmalloc"); str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); @@ -775,7 +775,7 @@ create_struct2(void) CHECK(ret, FAIL, "H5Tinsert"); str2hndl->st2h_st3hndl = create_struct3(); - CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); + CHECK_PTR(str2hndl->st2h_st3hndl, "create_struct3"); ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -811,7 +811,7 @@ set_struct2(misc5_struct2 *buf) buf->st2_el2.len = MISC5_DBGNELM3; buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3)); - CHECK(buf->st2_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st2_el2.p, "HDmalloc"); for(i=0; i<(buf->st2_el2.len); i++) set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i])); @@ -832,7 +832,7 @@ create_struct1(void) herr_t ret; /* For error checking */ str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl)); - CHECK(str1hndl, NULL, "malloc"); + CHECK_PTR(str1hndl, "HDmalloc"); str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); @@ -841,7 +841,7 @@ create_struct1(void) CHECK(ret, FAIL, "H5Tinsert"); str1hndl->st1h_st2hndl=create_struct2(); - CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); + CHECK_PTR(str1hndl->st1h_st2hndl, "create_struct2"); ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id); CHECK(ret,FAIL,"H5Tinsert"); @@ -877,7 +877,7 @@ set_struct1(misc5_struct1 *buf) buf->st1_el2.len=MISC5_DBGNELM2; buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2)); - CHECK(buf->st1_el2.p,NULL,"malloc"); + CHECK_PTR(buf->st1_el2.p, "HDmalloc"); for(i=0; i<(buf->st1_el2.len); i++) set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i])); @@ -913,7 +913,7 @@ test_misc5(void) /* Create the memory structure to write */ str1hndl = create_struct1(); - CHECK(str1hndl, NULL, "create_struct1"); + CHECK_PTR(str1hndl, "create_struct1"); /* Create the dataspace */ dims[0] = MISC5_NELMTOPLVL; @@ -927,7 +927,7 @@ test_misc5(void) /* Create the variable-length buffer */ buf.len = MISC5_DBGNELM1; buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1)); - CHECK(buf.p, NULL, "malloc"); + CHECK_PTR(buf.p, "HDmalloc"); /* Create the top-level VL information */ for(i = 0; i < MISC5_DBGNELM1; i++) @@ -1253,10 +1253,10 @@ test_misc8(void) /* Allocate space for the data to write & read */ wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(wdata,NULL,"malloc"); + CHECK_PTR(wdata, "HDmalloc"); #ifdef VERIFY_DATA rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1); - CHECK(rdata,NULL,"malloc"); + CHECK_PTR(rdata, "HDmalloc"); #endif /* VERIFY_DATA */ /* Initialize values */ @@ -2144,7 +2144,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data) /* Create a data buffer for the dataset read */ read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(read_data, NULL, "HDcalloc"); + CHECK_PTR(read_data, "HDcalloc"); /* Open the contiguous dataset in the root group */ dsid = H5Dopen2(loc_id, name, H5P_DEFAULT); @@ -2270,14 +2270,14 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Allocate space for the user block */ user_block = HDcalloc(size, (size_t)1); - CHECK(user_block, NULL, "HDcalloc"); + CHECK_PTR(user_block, "HDcalloc"); /* Copy in the user block data */ HDmemcpy(user_block, str, strlen(str)); /* Open the new file */ new_fp = HDfopen(new_name,"wb"); - CHECK(new_fp, NULL, "HDfopen"); + CHECK_PTR(new_fp, "HDfopen"); /* Write the user block to the new file */ written = HDfwrite(user_block, (size_t)1, size, new_fp); @@ -2285,11 +2285,11 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char /* Open the old file */ old_fp = HDfopen(old_name,"rb"); - CHECK(old_fp, NULL, "HDfopen"); + CHECK_PTR(old_fp, "HDfopen"); /* Allocate space for the copy buffer */ copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); - CHECK(copy_buf, NULL, "HDmalloc"); + CHECK_PTR(copy_buf, "HDmalloc"); /* Copy data from the old file to the new file */ while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { @@ -2439,7 +2439,7 @@ test_misc13(void) /* Create a data buffer for the datasets */ data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned)); - CHECK(data, NULL, "HDcalloc"); + CHECK_PTR(data, "HDcalloc"); /* Initialize data to write */ misc13_init_data(data); @@ -3446,7 +3446,7 @@ test_misc19(void) /* Get a VFD class to register */ vfd_cls = h5_get_dummy_vfd_class(); - CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class"); + CHECK_PTR(vfd_cls, "h5_get_dummy_vfd_class"); /* Register a virtual file driver */ vfdid = H5FDregister(vfd_cls); diff --git a/test/trefstr.c b/test/trefstr.c index 40ce344..f55ede0 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -67,7 +67,7 @@ test_refstr_create(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -97,7 +97,7 @@ test_refstr_count(void) /* Try creating a ref-counted string */ rs=H5RS_create("foo"); - CHECK(rs, NULL, "H5RS_create"); + CHECK_PTR(rs, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs); @@ -144,7 +144,7 @@ test_refstr_dup(void) /* Try creating a ref-counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Get the reference count on the string */ count=H5RS_get_count(rs1); @@ -152,7 +152,7 @@ test_refstr_dup(void) /* Duplicate r-string */ rs2=H5RS_dup(rs1); - CHECK(rs2, NULL, "H5RS_dup"); + CHECK_PTR(rs2, "H5RS_dup"); /* Get the reference count on the strings */ count=H5RS_get_count(rs1); @@ -194,11 +194,11 @@ test_refstr_cmp(void) /* Create first reference counted string */ rs1=H5RS_create("foo"); - CHECK(rs1, NULL, "H5RS_create"); + CHECK_PTR(rs1, "H5RS_create"); /* Create second reference counted string */ rs2=H5RS_create("foo2"); - CHECK(rs2, NULL, "H5RS_create"); + CHECK_PTR(rs2, "H5RS_create"); /* Compare the strings in various ways */ cmp=H5RS_cmp(rs1,rs1); @@ -246,11 +246,11 @@ test_refstr_wrap(void) /* Wrap ref-counted string around existing buffer */ rs=H5RS_wrap(buf); - CHECK(rs, NULL, "H5RS_wrap"); + CHECK_PTR(rs, "H5RS_wrap"); /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); VERIFY(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -264,7 +264,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); - CHECK(s, NULL, "H5RS_get_str"); + CHECK_PTR(s, "H5RS_get_str"); CHECK(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); if(cmp<=0) @@ -299,16 +299,16 @@ test_refstr_own(void) /* Initialize buffer */ s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1); - CHECK(s, NULL, "H5FL_BLK_MALLOC"); + CHECK_PTR(s, "H5FL_BLK_MALLOC"); HDstrcpy(s, "foo"); /* Transfer ownership of dynamically allocated string to ref-counted string */ rs=H5RS_own(s); - CHECK(rs, NULL, "H5RS_own"); + CHECK_PTR(rs, "H5RS_own"); /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -322,7 +322,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); - CHECK(t, NULL, "H5RS_get_str"); + CHECK_PTR(t, "H5RS_get_str"); VERIFY(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tselect.c b/test/tselect.c index 85c21bb..2022a11 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -228,9 +228,9 @@ test_select_hyper(hid_t xfer_plist) /* Allocate write & read buffers */ wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); - CHECK(wbuf, NULL, "HDmalloc"); + CHECK_PTR(wbuf, "HDmalloc"); rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); - CHECK(rbuf, NULL, "HDcalloc"); + CHECK_PTR(rbuf, "HDcalloc"); /* Initialize write buffer */ for(i=0, tbuf=wbuf; islist, &j); - CHECK(obj_ret, NULL, "H5SL_remove"); + CHECK_PTR(obj_ret, "H5SL_remove"); obj_ret->nfrees++; obj_list->nobjs_rem--; } /* end else */ @@ -1324,7 +1324,7 @@ test_skiplist_try_free_safe(void) /* Create a skip list */ obj_list.slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(obj_list.slist, NULL, "H5SL_create"); + CHECK_PTR(obj_list.slist, "H5SL_create"); /* Init obj_list.list */ obj_list.list = list; @@ -1396,7 +1396,7 @@ test_skiplist_less(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u=0; u<10; u++) { @@ -1430,7 +1430,7 @@ test_skiplist_less(void) VERIFY(*found_item,5,"H5SL_less"); find_item=4; found_item=(unsigned *)H5SL_less(slist,&find_item); - VERIFY(found_item,NULL,"H5SL_less"); + CHECK_PTR_NULL(found_item, "H5SL_less"); /* Close the skip list */ ret=H5SL_close(slist); @@ -1460,7 +1460,7 @@ test_skiplist_greater(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1488,7 +1488,7 @@ test_skiplist_greater(void) VERIFY(*found_item, 90, "H5SL_greater"); find_item = 100; found_item = (unsigned *)H5SL_greater(slist, &find_item); - VERIFY(found_item, NULL, "H5SL_greater"); + CHECK_PTR_NULL(found_item, "H5SL_greater"); find_item = 6; found_item = (unsigned *)H5SL_greater(slist, &find_item); VERIFY(*found_item, 10, "H5SL_greater"); @@ -1525,7 +1525,7 @@ test_skiplist_below(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1536,44 +1536,44 @@ test_skiplist_below(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 90; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); find_item = 5; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_below"); /* Find item less than a missing key, in various positions */ find_item = 19; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 15, "H5SL_below"); find_item = 89; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 80, "H5SL_below"); find_item = 100; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_below"); find_item = 9; node = H5SL_below(slist, &find_item); - CHECK(node, NULL, "H5SL_below"); + CHECK_PTR(node, "H5SL_below"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_below"); find_item = 4; node = (H5SL_node_t *)H5SL_less(slist, &find_item); - VERIFY(node, NULL, "H5SL_below"); + CHECK_PTR_NULL(node, "H5SL_below"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1604,7 +1604,7 @@ test_skiplist_above(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1615,42 +1615,42 @@ test_skiplist_above(void) /* Check for exact match of items in various positions */ find_item = 20; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 90; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); find_item = 5; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, find_item, "H5SL_above"); /* Find item greater than a missing key, in various positions */ find_item = 19; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 20, "H5SL_above"); find_item = 89; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 90, "H5SL_above"); find_item = 100; node = H5SL_above(slist, &find_item); - VERIFY(node, NULL, "H5SL_above"); + CHECK_PTR_NULL(node, "H5SL_above"); find_item = 6; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 10, "H5SL_above"); find_item = 4; node = H5SL_above(slist, &find_item); - CHECK(node, NULL, "H5SL_above"); + CHECK_PTR(node, "H5SL_above"); found_item = (unsigned *)H5SL_item(node); VERIFY(*found_item, 5, "H5SL_above"); @@ -1681,7 +1681,7 @@ test_skiplist_remove_first(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < 10; u++) { @@ -1697,7 +1697,7 @@ test_skiplist_remove_first(void) /* Check for removing object from empty list */ found_item = (unsigned *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); @@ -1725,7 +1725,7 @@ test_skiplist_remove_first_many(void) /* Create a skip list */ slist = H5SL_create(H5SL_TYPE_INT, NULL); - CHECK(slist, NULL, "H5SL_create"); + CHECK_PTR(slist, "H5SL_create"); /* Insert objects into the skip list */ for(u = 0; u < NUM_ELEMS; u++) { @@ -1742,7 +1742,7 @@ test_skiplist_remove_first_many(void) /* Check for removing object from empty list */ found_item = (int *)H5SL_remove_first(slist); - VERIFY(found_item, NULL, "H5SL_remove_first"); + CHECK_PTR_NULL(found_item, "H5SL_remove_first"); /* Close the skip list */ ret = H5SL_close(slist); diff --git a/test/ttst.c b/test/ttst.c index b26d582..c5912c5 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -157,7 +157,7 @@ test_tst_create(void) /* Try creating a TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Try closing a real tree */ ret=H5ST_close(tree); @@ -186,7 +186,7 @@ test_tst_insert(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,uniq_words[u])) TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]); obj=H5ST_locate(tree,uniq_words[u]); - CHECK(obj, NULL, "H5ST_locate"); + CHECK_PTR(obj, "H5ST_locate"); if(HDstrcmp((const char *)obj,uniq_words[u])) TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]); @@ -246,7 +246,7 @@ test_tst_iterate(void) /* Create the TST */ tree=H5ST_create(); - CHECK(tree, NULL, "H5ST_create"); + CHECK_PTR(tree, "H5ST_create"); /* Insert unique words into TST, in random order */ for(u=0; ueqkid,rand_uniq_words[u])) diff --git a/test/tvltypes.c b/test/tvltypes.c index 5121a66..0c4cb9d 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -1015,9 +1015,9 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(wdata, NULL, "HDmalloc"); + CHECK_PTR(wdata, "HDmalloc"); rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1); - CHECK(rdata, NULL, "HDmalloc"); + CHECK_PTR(rdata, "HDmalloc"); for(i = 0; i < SPACE3_DIM1; i++) { wdata[i].i = (int)(i * 10); wdata[i].f = (float)(i * 20) / 3.0F; @@ -2503,7 +2503,7 @@ test_vltypes_fill_value(void) /* Allocate space for the buffer to read data */ rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct)); - CHECK(rbuf, NULL, "HDmalloc"); + CHECK_PTR(rbuf, "HDmalloc"); /* Create the small & large dataspaces to use */ -- cgit v0.12 From fd5531e302aeff22f94f380bebc8a380a21cb120 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 08:57:26 -0800 Subject: Added CHECK_PTR_EQ macro to testhdf5 to quiet cast warnings on Windows. --- test/testhdf5.h | 208 +++++++++++++++++---------------- test/theap.c | 12 +- test/tid.c | 342 ++++++++++++++++++++++++++++--------------------------- test/trefstr.c | 6 +- test/tskiplist.c | 14 +-- 5 files changed, 300 insertions(+), 282 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 41675cf..6244524 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -30,131 +30,147 @@ /* Use %ld to print the value because long should cover most cases. */ /* Used to make certain a return value _is_not_ a value */ -#define CHECK(ret, val, where) do { \ - if (VERBOSE_HI) print_func(" Call to routine: %15s at line %4d " \ - "in %s returned %ld \n", \ - where, (int)__LINE__, __FILE__, \ - (long)(ret)); \ - if ((ret) == (val)) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK(ret, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d " \ + "in %s returned %ld \n", \ + where, (int)__LINE__, __FILE__, \ + (long)(ret)); \ + } \ + if ((ret) == (val)) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) -#define CHECK_I(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ - (where), (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if ((ret)<0) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ - (where), (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_I(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \ + (where), (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if ((ret)<0) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \ + (where), (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Check that a pointer is valid (i.e.: not NULL) */ -#define CHECK_PTR(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (!(ret)) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define CHECK_PTR(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (!(ret)) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } -#define CHECK_PTR_NULL(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (ret) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +/* Check that a pointer is NULL */ +#define CHECK_PTR_NULL(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ +} + +/* Check that two pointers are equal */ +#define CHECK_PTR_EQ(ret, val, where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret != val) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ + (where), ret, val, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } /* Used to make certain a return value _is_ a value */ -#define VERIFY(_x, _val, where) do { \ - long __x = (long)_x, __val = (long)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY(_x, _val, where) do { \ + long __x = (long)_x, __val = (long)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%ld \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a (non-'long' type's) return value _is_ a value */ -#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ - _type __x = (_type)_x, __val = (_type)_val; \ - if(VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - _format " \n", (where), (int)__LINE__, __FILE__, __x); \ - } \ - if((__x) != (__val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ - "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \ + _type __x = (_type)_x, __val = (_type)_val; \ + if(VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + _format " \n", (where), (int)__LINE__, __FILE__, __x); \ + } \ + if((__x) != (__val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \ + "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to make certain a string return value _is_ a value */ -#define VERIFY_STR(x, val, where) do { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s had value " \ - "%s \n", (where), (int)__LINE__, __FILE__, x); \ - } \ - if (HDstrcmp(x, val)) { \ - TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ - "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define VERIFY_STR(x, val, where) do { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s had value " \ + "%s \n", (where), (int)__LINE__, __FILE__, x); \ + } \ + if (HDstrcmp(x, val)) { \ + TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \ + "in %s\n", where, val, x, (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test and to check for errors */ -#define RESULT(ret,func) do { \ - if (VERBOSE_MED) { \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ - } \ - if (VERBOSE_HI) \ - H5Eprint2(H5E_DEFAULT, stdout); \ - if ((ret) == FAIL) { \ - TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ - "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ +#define RESULT(ret,func) do { \ + if (VERBOSE_MED) { \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \ + } \ + if (VERBOSE_HI) \ + H5Eprint2(H5E_DEFAULT, stdout); \ + if ((ret) == FAIL) { \ + TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \ + "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ } while(0) /* Used to document process through a test */ #if defined(H5_HAVE_PARALLEL) && defined(H5_PARALLEL_TEST) -#define MESSAGE(V,A) { \ - int mpi_rank; \ - \ - MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ - if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ - print_func A ; \ +#define MESSAGE(V,A) { \ + int mpi_rank; \ + \ + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \ + if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \ + print_func A ; \ } #else /* H5_HAVE_PARALLEL */ #define MESSAGE(V,A) {if (HDGetTestVerbosity() > (V)) print_func A;} #endif /* H5_HAVE_PARALLEL */ /* Used to indicate an error that is complex to check for */ -#define ERROR(where) do { \ - if(VERBOSE_HI) \ - print_func(" Call to routine: %15s at line %4d in %s returned " \ - "invalid result\n", where, (int)__LINE__, __FILE__); \ - TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ - where, (int)__LINE__, __FILE__); \ +#define ERROR(where) do { \ + if(VERBOSE_HI) \ + print_func(" Call to routine: %15s at line %4d in %s returned " \ + "invalid result\n", where, (int)__LINE__, __FILE__); \ + TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \ + where, (int)__LINE__, __FILE__); \ } while(0) /* definitions for command strings */ diff --git a/test/theap.c b/test/theap.c index cdb423e..7b2fadb 100644 --- a/test/theap.c +++ b/test/theap.c @@ -434,19 +434,19 @@ test_heap_remove_min(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); @@ -508,19 +508,19 @@ test_heap_remove_max(void) ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 20, "H5HP_remove"); - VERIFY(ptr, &obj3, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove"); /* Remove second maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 10, "H5HP_remove"); - VERIFY(ptr, &obj1, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove"); /* Remove third maximum value from heap */ ret=H5HP_remove(heap,&val,&ptr); CHECK(ret, FAIL, "H5HP_remove"); VERIFY(val, 5, "H5HP_remove"); - VERIFY(ptr, &obj2, "H5HP_remove"); + CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove"); /* Try removing an object from an empty heap */ ret=H5HP_remove(heap,&val,&ptr); diff --git a/test/tid.c b/test/tid.c index 375ef69..7d6757f 100644 --- a/test/tid.c +++ b/test/tid.c @@ -16,223 +16,225 @@ #include "testhdf5.h" #include "hdf5.h" - /* Include H5Ipkg.h to calculate max number of groups */ +/* Include H5Ipkg.h to calculate max number of groups */ #define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" - /* Test basic functionality of registering and deleting types and IDs */ +/* Test basic functionality of registering and deleting types and IDs */ static int basic_id_test(void) { - H5I_type_t myType = H5I_BADID; - hid_t arrayID = H5I_INVALID_HID; - void* testObj = NULL; - void* testPtr = NULL; - char nameString[10]; - hid_t testID; - ssize_t testSize = -1; - herr_t err; - int num_ref; - hsize_t num_members; - + H5I_type_t myType = H5I_BADID; + hid_t arrayID = H5I_INVALID_HID; + void* testObj = NULL; + void* testPtr = NULL; + char nameString[10]; + hid_t testID; + ssize_t testSize = -1; + herr_t err; + int num_ref; + hsize_t num_members; + + + /* Try to register an ID with ficticious types */ + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) 420, testObj); + H5E_END_TRY - /* Try to register an ID with ficticious types */ - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) 420, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + arrayID = H5Iregister((H5I_type_t) -1, testObj); + H5E_END_TRY - H5E_BEGIN_TRY - arrayID = H5Iregister((H5I_type_t) -1, testObj); - H5E_END_TRY + VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID != H5I_INVALID_HID) + goto out; - VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID != H5I_INVALID_HID) - goto out; + /* Try to access IDs with ficticious types */ + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); + H5E_END_TRY - /* Try to access IDs with ficticious types */ - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Register a type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - /* Register a type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + /* Register an ID and retrieve the object it points to. + * Once the ID has been registered, testObj will be freed when + * its ID type is destroyed. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - /* Register an ID and retrieve the object it points to. - * Once the ID has been registered, testObj will be freed when - * its ID type is destroyed. */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + testPtr = (int *)H5Iobject_verify(arrayID, myType); - testPtr = (int *) H5Iobject_verify(arrayID, myType); + CHECK_PTR_EQ(testPtr, testObj, "H5Iobject_verify"); + if(testPtr != testObj) + goto out; - VERIFY(testPtr, testObj, "H5Iobject_verify"); - if(testPtr != testObj) - goto out; + /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this + * is an hid_t for the wrong kind of object + */ + H5E_BEGIN_TRY + testID = H5Iget_file_id(arrayID); + H5E_END_TRY - /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this - * is an hid_t for the wrong kind of object */ - H5E_BEGIN_TRY - testID = H5Iget_file_id(arrayID); - H5E_END_TRY + VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); + if(testID != H5I_INVALID_HID) + goto out; - VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id"); - if(testID != H5I_INVALID_HID) - goto out; + H5E_BEGIN_TRY + testSize = H5Iget_name(arrayID, nameString, (size_t)9); + H5E_END_TRY - H5E_BEGIN_TRY - testSize = H5Iget_name(arrayID, nameString, (size_t)9); - H5E_END_TRY + VERIFY(testSize, -1, "H5Iget_name"); + if(testSize != -1) + goto out; - VERIFY(testSize, -1, "H5Iget_name"); - if(testSize != -1) - goto out; + /* Make sure H5Iremove_verify catches objects of the wrong type */ + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); + H5E_END_TRY - /* Make sure H5Iremove_verify catches objects of the wrong type */ - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1)); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + /* Remove an ID and make sure we can't access it */ + testPtr = (int*) H5Iremove_verify(arrayID, myType); - /* Remove an ID and make sure we can't access it */ - testPtr = (int*) H5Iremove_verify(arrayID, myType); + CHECK_PTR(testPtr, "H5Iremove_verify"); + if(testPtr == NULL) + goto out; - CHECK_PTR(testPtr, "H5Iremove_verify"); - if(testPtr == NULL) - goto out; + H5E_BEGIN_TRY + testPtr = (int*) H5Iobject_verify(arrayID, myType); + H5E_END_TRY - H5E_BEGIN_TRY - testPtr = (int*) H5Iobject_verify(arrayID, myType); - H5E_END_TRY + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + /* Delete the type and make sure we can't access objects within it */ + arrayID = H5Iregister(myType, testObj); - /* Delete the type and make sure we can't access objects within it */ - arrayID = H5Iregister(myType, testObj); + err = H5Idestroy_type(myType); + VERIFY(err, 0, "H5Idestroy_type"); + if( err != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if(H5Itype_exists(myType) != 0) + goto out; - err = H5Idestroy_type(myType); - VERIFY(err, 0, "H5Idestroy_type"); - if( err != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if(H5Itype_exists(myType) != 0) + H5E_BEGIN_TRY + VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); + if(H5Inmembers(myType, NULL) != -1) goto out; + H5E_END_TRY - H5E_BEGIN_TRY - VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers"); - if(H5Inmembers(myType, NULL) != -1) - goto out; - H5E_END_TRY - - /* Register another type and another object in that type */ - myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); + /* Register another type and another object in that type */ + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); - CHECK(myType, H5I_BADID, "H5Iregister_type"); - if(myType == H5I_BADID) - goto out; + CHECK(myType, H5I_BADID, "H5Iregister_type"); + if(myType == H5I_BADID) + goto out; - /* The memory that testObj pointed to should already have been - * freed when the previous type was destroyed. Allocate new - * memory for it. - */ - testObj = HDmalloc(7 * sizeof(int)); - arrayID = H5Iregister(myType, testObj); + /* The memory that testObj pointed to should already have been + * freed when the previous type was destroyed. Allocate new + * memory for it. + */ + testObj = HDmalloc(7 * sizeof(int)); + arrayID = H5Iregister(myType, testObj); - CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); - if(arrayID == H5I_INVALID_HID) - { - HDfree(testObj); - goto out; - } + CHECK(arrayID, H5I_INVALID_HID, "H5Iregister"); + if(arrayID == H5I_INVALID_HID) { + HDfree(testObj); + goto out; + } - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* Increment references to type and ensure that dec_type_ref - doesn't destroy the type */ - num_ref = H5Iinc_type_ref(myType); - VERIFY(num_ref, 2, "H5Iinc_type_ref"); - if( num_ref != 2) - goto out; - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 1, "H5Idec_type_ref"); - if(num_ref != 1) - goto out; - err = H5Inmembers(myType, &num_members); - CHECK(err, -1, "H5Inmembers"); - if (err < 0) - goto out; - VERIFY(num_members, 1, "H5Inmembers"); - if(num_members != 1) - goto out; + /* Increment references to type and ensure that dec_type_ref + * doesn't destroy the type + */ + num_ref = H5Iinc_type_ref(myType); + VERIFY(num_ref, 2, "H5Iinc_type_ref"); + if( num_ref != 2) + goto out; + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 1, "H5Idec_type_ref"); + if(num_ref != 1) + goto out; + err = H5Inmembers(myType, &num_members); + CHECK(err, -1, "H5Inmembers"); + if (err < 0) + goto out; + VERIFY(num_members, 1, "H5Inmembers"); + if(num_members != 1) + goto out; - /* This call to dec_type_ref should destroy the type */ - num_ref = H5Idec_type_ref(myType); - VERIFY(num_ref, 0, "H5Idec_type_ref"); - if(num_ref != 0) - goto out; - VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); - if (H5Itype_exists(myType) != 0) - goto out; + /* This call to dec_type_ref should destroy the type */ + num_ref = H5Idec_type_ref(myType); + VERIFY(num_ref, 0, "H5Idec_type_ref"); + if(num_ref != 0) + goto out; + VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists"); + if (H5Itype_exists(myType) != 0) + goto out; - H5E_BEGIN_TRY + H5E_BEGIN_TRY err = H5Inmembers(myType, &num_members); - if(err >= 0) - goto out; - H5E_END_TRY + if(err >= 0) + goto out; + H5E_END_TRY - return 0; + return 0; out: - /* Clean up type if it has been allocated and free memory used - * by testObj */ - if(myType >= 0) - H5Idestroy_type(myType); + /* Clean up type if it has been allocated and free memory used + * by testObj + */ + if(myType >= 0) + H5Idestroy_type(myType); - return -1; + return -1; } diff --git a/test/trefstr.c b/test/trefstr.c index f55ede0..83e2951 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -251,7 +251,7 @@ test_refstr_wrap(void) /* Get pointer to raw string in ref-counted string */ s=H5RS_get_str(rs); CHECK_PTR(s, "H5RS_get_str"); - VERIFY(s, buf, "wrapping"); + CHECK_PTR_EQ(s, buf, "wrapping"); cmp=HDstrcmp(s,buf); VERIFY(cmp, 0, "HDstrcmp"); @@ -309,7 +309,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(s,t); VERIFY(cmp, 0, "HDstrcmp"); @@ -323,7 +323,7 @@ test_refstr_own(void) /* Get pointer to raw string in ref-counted string */ t=H5RS_get_str(rs); CHECK_PTR(t, "H5RS_get_str"); - VERIFY(t, s, "transferring"); + CHECK_PTR_EQ(t, s, "transferring"); cmp=HDstrcmp(t,s); VERIFY(cmp, 0, "HDstrcmp"); diff --git a/test/tskiplist.c b/test/tskiplist.c index 12320ea..2806afe 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -322,17 +322,17 @@ test_skiplist_remove(void) search_key=key1; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key1, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key1, "H5SL_remove"); search_key=key2; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key2, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key2, "H5SL_remove"); search_key=key3; found_item=(int *)H5SL_remove(slist,&search_key); CHECK_PTR(found_item, "H5SL_remove"); - VERIFY(found_item, &key3, "H5SL_remove"); + CHECK_PTR_EQ(found_item, &key3, "H5SL_remove"); /* Check that the skip list has no elements */ num=H5SL_count(slist); @@ -1210,8 +1210,8 @@ static herr_t test_tfs_iter(void *_obj, void *key, void *_udata) { test_tfs_it_ud_t *udata = (test_tfs_it_ud_t *)_udata; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Increment number of calls */ udata->ncalls++; @@ -1236,8 +1236,8 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) { htri_t ret_value; /* Check consistency */ - VERIFY((void *)&obj->idx, key, "obj->idx"); - VERIFY(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); + CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx"); + CHECK_PTR_EQ(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]"); /* Mark this object as freed (to make sure it isn't recursively freed, that * is not something we support, we will undo this if we decide later not to -- cgit v0.12 From eeb1802055922417ca281ecc7822fbef50975f6d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:11:53 -0800 Subject: Casted pointers to void to quiet warnings on Linux. --- test/testhdf5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index 6244524..c36c4e1 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -90,7 +90,7 @@ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), ret, val, (int)__LINE__, __FILE__); \ + (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 796cc17f414b35708ae51e06f75f5a7d0205881b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Nov 2017 09:15:45 -0800 Subject: Changed casts to const void * --- test/testhdf5.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testhdf5.h b/test/testhdf5.h index c36c4e1..127c687 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -86,11 +86,11 @@ #define CHECK_PTR_EQ(ret, val, where) { \ if (VERBOSE_HI) { \ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ + (where), (int)__LINE__, __FILE__, (const void *)(ret)); \ } \ if (ret != val) { \ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \ - (where), (void *)(ret), (void *)(val), (int)__LINE__, __FILE__); \ + (where), (const void *)(ret), (const void *)(val), (int)__LINE__, __FILE__); \ H5Eprint2(H5E_DEFAULT, stdout); \ } \ } -- cgit v0.12 From 04f22540e239103f468ed48c2349b8ffe8f3b476 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 27 Nov 2017 13:06:10 -0600 Subject: Update macros --- config/cmake_ext_mod/HDFMacros.cmake | 1 + fortran/src/H5f90global.F90 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 602b6bf..192a5c8 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -108,6 +108,7 @@ macro (HDF_SET_LIB_OPTIONS libtarget libname libtype) set_target_properties (${libtarget} PROPERTIES + OUTPUT_NAME ${LIB_RELEASE_NAME} OUTPUT_NAME_DEBUG ${LIB_DEBUG_NAME} OUTPUT_NAME_RELEASE ${LIB_RELEASE_NAME} OUTPUT_NAME_MINSIZEREL ${LIB_RELEASE_NAME} diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index d4a9008..4a04971 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -83,7 +83,8 @@ MODULE H5GLOBAL INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in - ! both h5open_f and in h5close_f + ! both h5open_f and in h5close_f; initialize to fix linking issues + ! on OSX and Intel compilers. INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 @@ -437,7 +438,6 @@ MODULE H5GLOBAL INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F - CONTAINS ! Copy a c string to a Fortran string -- cgit v0.12 From d60ec508bcce1e6970bcf7f46ef81c87c6f420f0 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 15:24:27 -0600 Subject: initialized integer constants --- fortran/src/H5f90global.F90 | 126 ++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 4a04971..8d17ff0 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -89,50 +89,50 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_INTEGER - INTEGER(HID_T) :: H5T_NATIVE_REAL - INTEGER(HID_T) :: H5T_NATIVE_DOUBLE - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER - INTEGER(HID_T) :: H5T_STD_REF_OBJ - INTEGER(HID_T) :: H5T_STD_REF_DSETREG - INTEGER(HID_T) :: H5T_IEEE_F32BE - INTEGER(HID_T) :: H5T_IEEE_F32LE - INTEGER(HID_T) :: H5T_IEEE_F64BE - INTEGER(HID_T) :: H5T_IEEE_F64LE - INTEGER(HID_T) :: H5T_STD_I8BE - INTEGER(HID_T) :: H5T_STD_I8LE - INTEGER(HID_T) :: H5T_STD_I16BE - INTEGER(HID_T) :: H5T_STD_I16LE - INTEGER(HID_T) :: H5T_STD_I32BE - INTEGER(HID_T) :: H5T_STD_I32LE - INTEGER(HID_T) :: H5T_STD_I64BE - INTEGER(HID_T) :: H5T_STD_I64LE - INTEGER(HID_T) :: H5T_STD_U8BE - INTEGER(HID_T) :: H5T_STD_U8LE - INTEGER(HID_T) :: H5T_STD_U16BE - INTEGER(HID_T) :: H5T_STD_U16LE - INTEGER(HID_T) :: H5T_STD_U32BE - INTEGER(HID_T) :: H5T_STD_U32LE - INTEGER(HID_T) :: H5T_STD_U64BE - INTEGER(HID_T) :: H5T_STD_U64LE - INTEGER(HID_T) :: H5T_STRING - INTEGER(HID_T) :: H5T_STD_B8BE - INTEGER(HID_T) :: H5T_STD_B8LE - INTEGER(HID_T) :: H5T_STD_B16BE - INTEGER(HID_T) :: H5T_STD_B16LE - INTEGER(HID_T) :: H5T_STD_B32BE - INTEGER(HID_T) :: H5T_STD_B32LE - INTEGER(HID_T) :: H5T_STD_B64BE - INTEGER(HID_T) :: H5T_STD_B64LE - INTEGER(HID_T) :: H5T_NATIVE_B8 - INTEGER(HID_T) :: H5T_NATIVE_B16 - INTEGER(HID_T) :: H5T_NATIVE_B32 - INTEGER(HID_T) :: H5T_NATIVE_B64 - INTEGER(HID_T) :: H5T_FORTRAN_S1 - INTEGER(HID_T) :: H5T_C_S1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_INTEGER = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL = -1 + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE = -1 + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER = -1 + INTEGER(HID_T) :: H5T_STD_REF_OBJ = -1 + INTEGER(HID_T) :: H5T_STD_REF_DSETREG = -1 + INTEGER(HID_T) :: H5T_IEEE_F32BE = -1 + INTEGER(HID_T) :: H5T_IEEE_F32LE = -1 + INTEGER(HID_T) :: H5T_IEEE_F64BE = -1 + INTEGER(HID_T) :: H5T_IEEE_F64LE = -1 + INTEGER(HID_T) :: H5T_STD_I8BE = -1 + INTEGER(HID_T) :: H5T_STD_I8LE = -1 + INTEGER(HID_T) :: H5T_STD_I16BE = -1 + INTEGER(HID_T) :: H5T_STD_I16LE = -1 + INTEGER(HID_T) :: H5T_STD_I32BE = -1 + INTEGER(HID_T) :: H5T_STD_I32LE = -1 + INTEGER(HID_T) :: H5T_STD_I64BE = -1 + INTEGER(HID_T) :: H5T_STD_I64LE = -1 + INTEGER(HID_T) :: H5T_STD_U8BE = -1 + INTEGER(HID_T) :: H5T_STD_U8LE = -1 + INTEGER(HID_T) :: H5T_STD_U16BE = -1 + INTEGER(HID_T) :: H5T_STD_U16LE = -1 + INTEGER(HID_T) :: H5T_STD_U32BE = -1 + INTEGER(HID_T) :: H5T_STD_U32LE = -1 + INTEGER(HID_T) :: H5T_STD_U64BE = -1 + INTEGER(HID_T) :: H5T_STD_U64LE = -1 + INTEGER(HID_T) :: H5T_STRING = -1 + INTEGER(HID_T) :: H5T_STD_B8BE = -1 + INTEGER(HID_T) :: H5T_STD_B8LE = -1 + INTEGER(HID_T) :: H5T_STD_B16BE = -1 + INTEGER(HID_T) :: H5T_STD_B16LE = -1 + INTEGER(HID_T) :: H5T_STD_B32BE = -1 + INTEGER(HID_T) :: H5T_STD_B32LE = -1 + INTEGER(HID_T) :: H5T_STD_B64BE = -1 + INTEGER(HID_T) :: H5T_STD_B64LE = -1 + INTEGER(HID_T) :: H5T_NATIVE_B8 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B16 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B32 = -1 + INTEGER(HID_T) :: H5T_NATIVE_B64 = -1 + INTEGER(HID_T) :: H5T_FORTRAN_S1 = -1 + INTEGER(HID_T) :: H5T_C_S1 = -1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -156,25 +156,25 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! - INTEGER :: H5F_ACC_RDWR_F - INTEGER :: H5F_ACC_RDONLY_F - INTEGER :: H5F_ACC_TRUNC_F - INTEGER :: H5F_ACC_EXCL_F - INTEGER :: H5F_ACC_DEBUG_F - INTEGER :: H5F_SCOPE_LOCAL_F - INTEGER :: H5F_SCOPE_GLOBAL_F - INTEGER :: H5F_CLOSE_DEFAULT_F - INTEGER :: H5F_CLOSE_WEAK_F - INTEGER :: H5F_CLOSE_SEMI_F - INTEGER :: H5F_CLOSE_STRONG_F - INTEGER :: H5F_OBJ_FILE_F - INTEGER :: H5F_OBJ_DATASET_F - INTEGER :: H5F_OBJ_GROUP_F - INTEGER :: H5F_OBJ_DATATYPE_F - INTEGER :: H5F_OBJ_ALL_F - INTEGER :: H5F_LIBVER_EARLIEST_F - INTEGER :: H5F_LIBVER_LATEST_F - INTEGER :: H5F_UNLIMITED_F + INTEGER :: H5F_ACC_RDWR_F = -1 + INTEGER :: H5F_ACC_RDONLY_F = -1 + INTEGER :: H5F_ACC_TRUNC_F = -1 + INTEGER :: H5F_ACC_EXCL_F = -1 + INTEGER :: H5F_ACC_DEBUG_F = -1 + INTEGER :: H5F_SCOPE_LOCAL_F = -1 + INTEGER :: H5F_SCOPE_GLOBAL_F = -1 + INTEGER :: H5F_CLOSE_DEFAULT_F = -1 + INTEGER :: H5F_CLOSE_WEAK_F = -1 + INTEGER :: H5F_CLOSE_SEMI_F = -1 + INTEGER :: H5F_CLOSE_STRONG_F = -1 + INTEGER :: H5F_OBJ_FILE_F = -1 + INTEGER :: H5F_OBJ_DATASET_F = -1 + INTEGER :: H5F_OBJ_GROUP_F = -1 + INTEGER :: H5F_OBJ_DATATYPE_F = -1 + INTEGER :: H5F_OBJ_ALL_F = -1 + INTEGER :: H5F_LIBVER_EARLIEST_F = -1 + INTEGER :: H5F_LIBVER_LATEST_F = -1 + INTEGER :: H5F_UNLIMITED_F = -1 ! ! H5G flags declaration ! -- cgit v0.12 From d37c9b1cb03fa04aadf08bb51fd45aa570016797 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Wed, 29 Nov 2017 16:34:20 -0600 Subject: export var. --- fortran/src/H5f90global.F90 | 128 ++++++++++++++++++------------------- fortran/src/hdf5_fortrandll.def.in | 2 + 2 files changed, 66 insertions(+), 64 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 8d17ff0..0247ad8 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -89,50 +89,50 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 ! - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_INTEGER = -1 - INTEGER(HID_T) :: H5T_NATIVE_REAL = -1 - INTEGER(HID_T) :: H5T_NATIVE_DOUBLE = -1 - INTEGER(HID_T) :: H5T_NATIVE_CHARACTER = -1 - INTEGER(HID_T) :: H5T_STD_REF_OBJ = -1 - INTEGER(HID_T) :: H5T_STD_REF_DSETREG = -1 - INTEGER(HID_T) :: H5T_IEEE_F32BE = -1 - INTEGER(HID_T) :: H5T_IEEE_F32LE = -1 - INTEGER(HID_T) :: H5T_IEEE_F64BE = -1 - INTEGER(HID_T) :: H5T_IEEE_F64LE = -1 - INTEGER(HID_T) :: H5T_STD_I8BE = -1 - INTEGER(HID_T) :: H5T_STD_I8LE = -1 - INTEGER(HID_T) :: H5T_STD_I16BE = -1 - INTEGER(HID_T) :: H5T_STD_I16LE = -1 - INTEGER(HID_T) :: H5T_STD_I32BE = -1 - INTEGER(HID_T) :: H5T_STD_I32LE = -1 - INTEGER(HID_T) :: H5T_STD_I64BE = -1 - INTEGER(HID_T) :: H5T_STD_I64LE = -1 - INTEGER(HID_T) :: H5T_STD_U8BE = -1 - INTEGER(HID_T) :: H5T_STD_U8LE = -1 - INTEGER(HID_T) :: H5T_STD_U16BE = -1 - INTEGER(HID_T) :: H5T_STD_U16LE = -1 - INTEGER(HID_T) :: H5T_STD_U32BE = -1 - INTEGER(HID_T) :: H5T_STD_U32LE = -1 - INTEGER(HID_T) :: H5T_STD_U64BE = -1 - INTEGER(HID_T) :: H5T_STD_U64LE = -1 - INTEGER(HID_T) :: H5T_STRING = -1 - INTEGER(HID_T) :: H5T_STD_B8BE = -1 - INTEGER(HID_T) :: H5T_STD_B8LE = -1 - INTEGER(HID_T) :: H5T_STD_B16BE = -1 - INTEGER(HID_T) :: H5T_STD_B16LE = -1 - INTEGER(HID_T) :: H5T_STD_B32BE = -1 - INTEGER(HID_T) :: H5T_STD_B32LE = -1 - INTEGER(HID_T) :: H5T_STD_B64BE = -1 - INTEGER(HID_T) :: H5T_STD_B64LE = -1 - INTEGER(HID_T) :: H5T_NATIVE_B8 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B16 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B32 = -1 - INTEGER(HID_T) :: H5T_NATIVE_B64 = -1 - INTEGER(HID_T) :: H5T_FORTRAN_S1 = -1 - INTEGER(HID_T) :: H5T_C_S1 = -1 + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_INTEGER + INTEGER(HID_T) :: H5T_NATIVE_REAL + INTEGER(HID_T) :: H5T_NATIVE_DOUBLE + INTEGER(HID_T) :: H5T_NATIVE_CHARACTER + INTEGER(HID_T) :: H5T_STD_REF_OBJ + INTEGER(HID_T) :: H5T_STD_REF_DSETREG + INTEGER(HID_T) :: H5T_IEEE_F32BE + INTEGER(HID_T) :: H5T_IEEE_F32LE + INTEGER(HID_T) :: H5T_IEEE_F64BE + INTEGER(HID_T) :: H5T_IEEE_F64LE + INTEGER(HID_T) :: H5T_STD_I8BE + INTEGER(HID_T) :: H5T_STD_I8LE + INTEGER(HID_T) :: H5T_STD_I16BE + INTEGER(HID_T) :: H5T_STD_I16LE + INTEGER(HID_T) :: H5T_STD_I32BE + INTEGER(HID_T) :: H5T_STD_I32LE + INTEGER(HID_T) :: H5T_STD_I64BE + INTEGER(HID_T) :: H5T_STD_I64LE + INTEGER(HID_T) :: H5T_STD_U8BE + INTEGER(HID_T) :: H5T_STD_U8LE + INTEGER(HID_T) :: H5T_STD_U16BE + INTEGER(HID_T) :: H5T_STD_U16LE + INTEGER(HID_T) :: H5T_STD_U32BE + INTEGER(HID_T) :: H5T_STD_U32LE + INTEGER(HID_T) :: H5T_STD_U64BE + INTEGER(HID_T) :: H5T_STD_U64LE + INTEGER(HID_T) :: H5T_STRING + INTEGER(HID_T) :: H5T_STD_B8BE + INTEGER(HID_T) :: H5T_STD_B8LE + INTEGER(HID_T) :: H5T_STD_B16BE + INTEGER(HID_T) :: H5T_STD_B16LE + INTEGER(HID_T) :: H5T_STD_B32BE + INTEGER(HID_T) :: H5T_STD_B32LE + INTEGER(HID_T) :: H5T_STD_B64BE + INTEGER(HID_T) :: H5T_STD_B64LE + INTEGER(HID_T) :: H5T_NATIVE_B8 + INTEGER(HID_T) :: H5T_NATIVE_B16 + INTEGER(HID_T) :: H5T_NATIVE_B32 + INTEGER(HID_T) :: H5T_NATIVE_B64 + INTEGER(HID_T) :: H5T_FORTRAN_S1 + INTEGER(HID_T) :: H5T_C_S1 INTEGER, PARAMETER :: NUM_NATIVE_INTEGER_KIND = 5 ! INTEGER*1, INTEGER*2, INTEGER*4, INTEGER*8, INTEGER*16 @@ -156,25 +156,25 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! - INTEGER :: H5F_ACC_RDWR_F = -1 - INTEGER :: H5F_ACC_RDONLY_F = -1 - INTEGER :: H5F_ACC_TRUNC_F = -1 - INTEGER :: H5F_ACC_EXCL_F = -1 - INTEGER :: H5F_ACC_DEBUG_F = -1 - INTEGER :: H5F_SCOPE_LOCAL_F = -1 - INTEGER :: H5F_SCOPE_GLOBAL_F = -1 - INTEGER :: H5F_CLOSE_DEFAULT_F = -1 - INTEGER :: H5F_CLOSE_WEAK_F = -1 - INTEGER :: H5F_CLOSE_SEMI_F = -1 - INTEGER :: H5F_CLOSE_STRONG_F = -1 - INTEGER :: H5F_OBJ_FILE_F = -1 - INTEGER :: H5F_OBJ_DATASET_F = -1 - INTEGER :: H5F_OBJ_GROUP_F = -1 - INTEGER :: H5F_OBJ_DATATYPE_F = -1 - INTEGER :: H5F_OBJ_ALL_F = -1 - INTEGER :: H5F_LIBVER_EARLIEST_F = -1 - INTEGER :: H5F_LIBVER_LATEST_F = -1 - INTEGER :: H5F_UNLIMITED_F = -1 + INTEGER :: H5F_ACC_RDWR_F + INTEGER :: H5F_ACC_RDONLY_F + INTEGER :: H5F_ACC_TRUNC_F + INTEGER :: H5F_ACC_EXCL_F + INTEGER :: H5F_ACC_DEBUG_F + INTEGER :: H5F_SCOPE_LOCAL_F + INTEGER :: H5F_SCOPE_GLOBAL_F + INTEGER :: H5F_CLOSE_DEFAULT_F + INTEGER :: H5F_CLOSE_WEAK_F + INTEGER :: H5F_CLOSE_SEMI_F + INTEGER :: H5F_CLOSE_STRONG_F + INTEGER :: H5F_OBJ_FILE_F + INTEGER :: H5F_OBJ_DATASET_F + INTEGER :: H5F_OBJ_GROUP_F + INTEGER :: H5F_OBJ_DATATYPE_F + INTEGER :: H5F_OBJ_ALL_F + INTEGER :: H5F_LIBVER_EARLIEST_F + INTEGER :: H5F_LIBVER_LATEST_F + INTEGER :: H5F_UNLIMITED_F ! ! H5G flags declaration ! @@ -258,7 +258,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F + INTEGER :: H5FD_MEM_NTYPES_F=-1 INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 3a5a91f..43a802c 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,4 +1,6 @@ EXPORTS +; H5GLOBAL +H5GLOBAL_mp_H5FD_MEM_NTYPES_F ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From c0021b348d01e4c87645224fc308697e39c95029 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 30 Nov 2017 09:56:43 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 65 +++----------------- src/H5A.c | 62 ++++++------------- src/H5Aint.c | 69 +++++++++++---------- src/H5Aprivate.h | 4 +- src/H5Dio.c | 15 ++--- src/H5Dpkg.h | 2 + src/H5F.c | 167 +++++++++++++++++++++++--------------------------- src/H5FD.c | 18 +++--- src/H5Fint.c | 64 ++++++++++---------- src/H5I.c | 76 ++++++++++------------- src/H5Oflush.c | 2 +- src/H5Pfapl.c | 24 ++++---- src/H5Tcommit.c | 17 +++--- src/H5Tprivate.h | 6 +- src/H5private.h | 181 +++++++++++++++++++++++++++++-------------------------- src/H5public.h | 1 + src/H5trace.c | 30 ++++----- 17 files changed, 355 insertions(+), 448 deletions(-) diff --git a/src/H5.c b/src/H5.c index 59984dc..965c2e1 100644 --- a/src/H5.c +++ b/src/H5.c @@ -80,9 +80,9 @@ hbool_t H5_libterm_g = FALSE; /* Library isn't being shutdown */ hbool_t H5_MPEinit_g = FALSE; /* MPE Library hasn't been initialized */ #endif -char H5_lib_vers_info_g[] = H5_VERS_INFO; +char H5_lib_vers_info_g[] = H5_VERS_INFO; static hbool_t H5_dont_atexit_g = FALSE; -H5_debug_t H5_debug_g; /*debugging info */ +H5_debug_t H5_debug_g; /* debugging info */ /*******************/ @@ -243,11 +243,6 @@ done: * * Return: void * - * Programmer: Robb Matzke - * Friday, November 20, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -281,11 +276,11 @@ H5_term_library(void) */ #define DOWN(F) \ (((n = H5##F##_term_package()) && (at + 8) < sizeof loop)? \ - (sprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ + (HDsprintf(loop + at, "%s%s", (at ? "," : ""), #F), \ at += HDstrlen(loop + at), \ n): \ ((n > 0 && (at + 5) < sizeof loop) ? \ - (sprintf(loop + at, "..."), \ + (HDsprintf(loop + at, "..."), \ at += HDstrlen(loop + at), \ n) : n)) @@ -364,8 +359,8 @@ H5_term_library(void) if(pending) { /* Only display the error message if the user is interested in them. */ if(func) { - fprintf(stderr, "HDF5: infinite loop closing library\n"); - fprintf(stderr, " %s\n", loop); + HDfprintf(stderr, "HDF5: infinite loop closing library\n"); + HDfprintf(stderr, " %s\n", loop); #ifndef NDEBUG HDabort(); #endif /* NDEBUG */ @@ -440,11 +435,6 @@ done: * Failure: negative if this function is called more than * once or if it is called too late. * - * Programmer: Robb Matzke - * Friday, November 20, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -479,11 +469,6 @@ H5dont_atexit(void) * * Failure: negative * - * Programmer: Quincey Koziol - * Saturday, March 11, 2000 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -528,13 +513,6 @@ done: * * Failure: negative * - * Programmer: Quincey Koziol - * Wednesday, August 2, 2000 - * - * Modifications: Neil Fortner - * Wednesday, April 8, 2009 - * Added support for factory free lists - * *------------------------------------------------------------------------- */ herr_t @@ -578,9 +556,6 @@ done: * * Return: void * - * Programmer: Robb Matzke - * Wednesday, August 19, 1998 - * *------------------------------------------------------------------------- */ static void @@ -632,7 +607,7 @@ H5_debug_mask(const char *s) } /* end if */ } /* end for */ if (i>=(size_t)H5_NPKGS) - fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); + HDfprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name); } /* end if-else */ } else if (HDisdigit(*s)) { @@ -672,8 +647,6 @@ H5_debug_mask(const char *s) * * Return: MPI_SUCCESS * - * Programmer: Mohamad Chaarawi, February 2015 - * *------------------------------------------------------------------------- */ static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED keyval, void H5_ATTR_UNUSED *attr_val, int H5_ATTR_UNUSED *flag) @@ -698,13 +671,6 @@ static int H5_mpi_delete_cb(MPI_Comm H5_ATTR_UNUSED comm, int H5_ATTR_UNUSED key * * Return: Non-negative on success/Negative on failure * - * Programmer: Unknown - * - * Modifications: - * Robb Matzke, 4 Mar 1998 - * Now use "normal" data types for the interface. Any of the arguments - * may be null pointers - * *------------------------------------------------------------------------- */ herr_t @@ -738,13 +704,6 @@ done: * * Failure: abort() * - * Programmer: Robb Matzke - * Tuesday, April 21, 1998 - * - * Modifications: - * Albert Cheng, May 12, 2001 - * Added verification of H5_VERS_INFO. - * *------------------------------------------------------------------------- */ #define VERSION_MISMATCH_WARNING \ @@ -869,11 +828,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Tuesday, December 9, 1997 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -896,11 +850,6 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Robb Matzke - * Friday, January 30, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5A.c b/src/H5A.c index cf48232..1b80612 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -717,8 +717,7 @@ hid_t H5Aget_space(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ - H5S_t *ds = NULL; - hid_t ret_value; + hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", attr_id); @@ -727,19 +726,9 @@ H5Aget_space(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if(NULL == (ds = H5A_get_space(attr))) + if((ret_value = H5A_get_space(attr)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute") - - /* Atomize */ - if((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom") - done: - if(ret_value < 0) { - if(ds && (H5S_close(ds) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") - } /* end if */ - FUNC_LEAVE_API(ret_value) } /* H5Aget_space() */ @@ -764,7 +753,6 @@ hid_t H5Aget_type(hid_t attr_id) { H5A_t *attr; /* Attribute object for ID */ - H5T_t *dt = NULL; hid_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) @@ -774,19 +762,9 @@ H5Aget_type(hid_t attr_id) if(NULL == (attr = (H5A_t *)H5I_object_verify(attr_id, H5I_ATTR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute") - if(NULL == (dt = H5A_get_type(attr))) - HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get space ID of attribute") - - /* Create an atom */ - if((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype") - + if((ret_value = H5A_get_type(attr)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get datatype ID of attribute") done: - if(ret_value < 0) { - if(dt && (H5T_close(dt) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") - } /* end if */ - FUNC_LEAVE_API(ret_value) } /* H5Aget_type() */ @@ -1685,12 +1663,12 @@ H5Aexists(hid_t obj_id, const char *attr_name) H5TRACE2("t", "i*s", obj_id, attr_name); /* check arguments */ - if(H5I_ATTR == H5I_get_type(obj_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!attr_name || !*attr_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") + if (H5I_ATTR == H5I_get_type(obj_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if (H5G_loc(obj_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if (!attr_name || !*attr_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Check if the attribute exists */ if((ret_value = H5O_attr_exists(loc.oloc, attr_name, H5AC_ind_read_dxpl_id)) < 0) @@ -1726,20 +1704,20 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5TRACE4("t", "i*s*si", loc_id, obj_name, attr_name, lapl_id); /* check arguments */ - if(H5I_ATTR == H5I_get_type(loc_id)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(H5G_loc(loc_id, &loc) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - if(!obj_name || !*obj_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") - if(!attr_name || !*attr_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") + if (H5I_ATTR == H5I_get_type(loc_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if (H5G_loc(loc_id, &loc) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + if (!obj_name || !*obj_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name") + if (!attr_name || !*attr_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) + if (H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - if((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) + if ((ret_value = H5A_exists_by_name(loc, obj_name, attr_name, lapl_id, dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists") done: diff --git a/src/H5Aint.c b/src/H5Aint.c index 160c7fb..a661a89 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -735,86 +735,89 @@ H5A__get_name(H5A_t *attr, size_t buf_size, char *buf) /*------------------------------------------------------------------------- - * Function: H5A_get_space + * Function: H5A_get_space * - * Purpose: Returns dataspace of the attribute. + * Purpose: Returns dataspace of the attribute. * - * Return: Success: dataspace + * Return: Success: A valid ID for the dataspace of an attribute * - * Failure: NULL - * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Failure: H5I_INVALID_ID * *------------------------------------------------------------------------- */ -H5S_t * +hid_t H5A_get_space(H5A_t *attr) { - H5S_t *ret_value = NULL; + H5S_t *ds = NULL; + hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_NOAPI_NOINIT HDassert(attr); /* Copy the attribute's dataspace */ - if(NULL == (ret_value = H5S_copy(attr->shared->ds, FALSE, TRUE))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy dataspace") + if (NULL == (ds = H5S_copy(attr->shared->ds, FALSE, TRUE))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy dataspace") + + /* Atomize */ + if ((ret_value = H5I_register(H5I_DATASPACE, ds, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register dataspace atom") done: + if (H5I_INVALID_HID == ret_value && ds && H5S_close(ds) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release dataspace") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_space() */ /*------------------------------------------------------------------------- - * Function: H5A_get_type + * Function: H5A_get_type * - * Purpose: Returns datatype of the dataset. + * Purpose: Returns an ID for the datatype of an attribute * - * Return: Success: datatype + * Return: Success: A valid ID for the datatype of an attribute * - * Failure: NULL - * - * Programmer: Mohamad Chaarawi - * March, 2012 + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ -H5T_t * +hid_t H5A_get_type(H5A_t *attr) { H5T_t *dt = NULL; - H5T_t *ret_value = NULL; + hid_t ret_value = H5I_INVALID_HID; FUNC_ENTER_NOAPI_NOINIT HDassert(attr); /* Patch the datatype's "top level" file pointer */ - if(H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to patch datatype's file pointer") + if (H5T_patch_file(attr->shared->dt, attr->oloc.file) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to patch datatype's file pointer") - /* - * Copy the attribute's datatype. If the type is a named type then + /* Copy the attribute's datatype. If the type is a named type then * reopen the type before returning it to the user. Make the type * read-only. */ - if(NULL == (dt = H5T_copy(attr->shared->dt, H5T_COPY_REOPEN))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, NULL, "unable to copy datatype") + if (NULL == (dt = H5T_copy(attr->shared->dt, H5T_COPY_REOPEN))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to copy datatype") /* Mark any datatypes as being in memory now */ - if(H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location") + if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "invalid datatype location") /* Lock copied type */ - if(H5T_lock(dt, FALSE) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to lock transient datatype") + if (H5T_lock(dt, FALSE) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5I_INVALID_HID, "unable to lock transient datatype") - ret_value = dt; + /* Atomize */ + if ((ret_value = H5I_register(H5I_DATATYPE, dt, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register datatype") done: - if(!ret_value && dt && (H5T_close(dt) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") + if (H5I_INVALID_HID == ret_value && dt && (H5T_close(dt) < 0)) + HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "unable to release datatype") FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_get_type() */ diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index b285920..9826859 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -76,8 +76,8 @@ typedef struct H5A_attr_iter_op_t { H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr); H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr); H5_DLL H5T_t *H5A_type(const H5A_t *attr); -H5_DLL H5T_t *H5A_get_type(H5A_t *attr); -H5_DLL H5S_t *H5A_get_space(H5A_t *attr); +H5_DLL hid_t H5A_get_type(H5A_t *attr); +H5_DLL hid_t H5A_get_space(H5A_t *attr); H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); diff --git a/src/H5Dio.c b/src/H5Dio.c index 280d602..4ab0b37 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -49,10 +49,6 @@ /* Local Prototypes */ /********************/ -/* Internal I/O routines */ -static herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, - const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); - /* Setup/teardown routines */ static herr_t H5D__ioinfo_init(H5D_t *dset, #ifndef H5_HAVE_PARALLEL @@ -324,18 +320,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5D__pre_write - * - * Purpose: Preparation for writing data. + * Function: H5D__pre_write * - * Return: Non-negative on success/Negative on failure + * Purpose: Preparation for writing data. * - * Programmer: Raymond Lu - * 2 November 2012 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf) diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index beb1089..542abd0 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -598,6 +598,8 @@ H5_DLL herr_t H5D_set_io_info_dxpls(H5D_io_info_t *io_info, hid_t dxpl_id); H5_DLL herr_t H5D__format_convert(H5D_t *dataset, hid_t dxpl_id); /* Internal I/O routines */ +H5_DLL herr_t H5D__pre_write(H5D_t *dset, hbool_t direct_write, hid_t mem_type_id, + const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf); H5_DLL herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, void *buf/*out*/); diff --git a/src/H5F.c b/src/H5F.c index 4b40248..f435502 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -21,20 +21,20 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ -#include "H5Tprivate.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5Aprivate.h" /* Attributes */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5Tprivate.h" /* Datatypes */ /****************/ @@ -377,83 +377,82 @@ done: /*------------------------------------------------------------------------- * Function: H5Fcreate * - * Purpose: This is the primary function for creating HDF5 files . The - * flags parameter determines whether an existing file will be - * overwritten or not. All newly created files are opened for - * both reading and writing. All flags may be combined with the - * bit-wise OR operator (`|') to change the behavior of the file - * create call. + * Purpose: This is the primary function for creating HDF5 files . The + * flags parameter determines whether an existing file will be + * overwritten or not. All newly created files are opened for + * both reading and writing. All flags may be combined with the + * bit-wise OR operator (`|') to change the behavior of the file + * create call. * - * The more complex behaviors of a file's creation and access - * are controlled through the file-creation and file-access - * property lists. The value of H5P_DEFAULT for a template - * value indicates that the library should use the default - * values for the appropriate template. + * The more complex behaviors of a file's creation and access + * are controlled through the file-creation and file-access + * property lists. The value of H5P_DEFAULT for a template + * value indicates that the library should use the default + * values for the appropriate template. * * See also: H5Fpublic.h for the list of supported flags. H5Ppublic.h for - * the list of file creation and file access properties. + * the list of file creation and file access properties. * - * Return: Success: A file ID - * Failure: FAIL + * Return: Success: A file ID + * Failure: FAIL *------------------------------------------------------------------------- */ hid_t H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, hid_t fapl_id) { - H5F_t *new_file = NULL; /*file struct for new file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /*dxpl used by library */ - hid_t ret_value; /*return value */ + H5F_t *new_file = NULL; /* file struct for new file */ + hid_t dxpl_id = H5AC_ind_read_dxpl_id;/* dxpl used by library */ + hid_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE4("i", "*sIuii", filename, flags, fcpl_id, fapl_id); /* Check/fix arguments */ - if(!filename || !*filename) + if (!filename || !*filename) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file name") + /* In this routine, we only accept the following flags: * H5F_ACC_EXCL, H5F_ACC_TRUNC and H5F_ACC_SWMR_WRITE */ - if(flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) + if (flags & ~(H5F_ACC_EXCL | H5F_ACC_TRUNC | H5F_ACC_SWMR_WRITE)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid flags") + /* The H5F_ACC_EXCL and H5F_ACC_TRUNC flags are mutually exclusive */ - if((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) + if ((flags & H5F_ACC_EXCL) && (flags & H5F_ACC_TRUNC)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mutually exclusive flags for file creation") /* Check file creation property list */ - if(H5P_DEFAULT == fcpl_id) + if (H5P_DEFAULT == fcpl_id) fcpl_id = H5P_FILE_CREATE_DEFAULT; else - if(TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) + if (TRUE != H5P_isa_class(fcpl_id, H5P_FILE_CREATE)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not file create property list") /* Verify access property list and get correct dxpl */ - if(H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) + if (H5P_verify_apl_and_dxpl(&fapl_id, H5P_CLS_FACC, &dxpl_id, H5I_INVALID_HID, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - /* - * Adjust bit flags by turning on the creation bit and making sure that + /* Adjust bit flags by turning on the creation bit and making sure that * the EXCL or TRUNC bit is set. All newly-created files are opened for * reading and writing. */ - if (0==(flags & (H5F_ACC_EXCL|H5F_ACC_TRUNC))) - flags |= H5F_ACC_EXCL; /*default*/ + if (0 == (flags & (H5F_ACC_EXCL | H5F_ACC_TRUNC))) + flags |= H5F_ACC_EXCL; /*default*/ flags |= H5F_ACC_RDWR | H5F_ACC_CREAT; - /* - * Create a new file or truncate an existing file. - */ - if(NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) + /* Create a new file or truncate an existing file. */ + if (NULL == (new_file = H5F_open(filename, flags, fcpl_id, fapl_id, dxpl_id))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to create file") /* Get an atom for the file */ - if((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) + if ((ret_value = H5I_register(H5I_FILE, new_file, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file") /* Keep this ID in file object structure */ new_file->file_id = ret_value; done: - if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) + if (ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") FUNC_LEAVE_API(ret_value) @@ -463,46 +462,28 @@ done: /*------------------------------------------------------------------------- * Function: H5Fopen * - * Purpose: This is the primary function for accessing existing HDF5 - * files. The FLAGS argument determines whether writing to an - * existing file will be allowed or not. All flags may be - * combined with the bit-wise OR operator (`|') to change the - * behavior of the file open call. The more complex behaviors - * of a file's access are controlled through the file-access - * property list. - * - * See Also: H5Fpublic.h for a list of possible values for FLAGS. - * - * Return: Success: A file ID - * Failure: FAIL - * - * Modifications: - * Robb Matzke, 1997-07-18 - * File struct creation and destruction is through H5F_new() and - * H5F__dest(). Reading the root symbol table entry is done with - * H5G_decode(). - * - * Robb Matzke, 1997-09-23 - * Most of the work is now done by H5F_open() since H5Fcreate() - * and H5Fopen() originally contained almost identical code. - * - * Robb Matzke, 1998-02-18 - * Added better error checking for the flags and the file access - * property list. It used to be possible to make the library - * dump core by passing an object ID that was not a file access - * property list. - * - * Robb Matzke, 1999-08-02 - * The file access property list is passed to the H5F_open() as - * object IDs. + * Purpose: This is the primary function for accessing existing HDF5 + * files. The FLAGS argument determines whether writing to an + * existing file will be allowed or not. All flags may be + * combined with the bit-wise OR operator (`|') to change the + * behavior of the file open call. The more complex behaviors + * of a file's access are controlled through the file-access + * property list. + * + * See Also: H5Fpublic.h for a list of possible values for FLAGS. + * + * Return: Success: A file ID + * + * Failure: FAIL + * *------------------------------------------------------------------------- */ hid_t H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) { - H5F_t *new_file = NULL; /* file struct for new file */ - hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ - hid_t ret_value; /* return value */ + H5F_t *new_file = NULL; /* file struct for new file */ + hid_t dxpl_id = H5AC_ind_read_dxpl_id; /* dxpl used by library */ + hid_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "*sIui", filename, flags, fapl_id); @@ -685,28 +666,28 @@ H5Fclose(hid_t file_id) H5TRACE1("e", "i", file_id); /* Check/fix arguments. */ - if(H5I_FILE != H5I_get_type(file_id)) + if (H5I_FILE != H5I_get_type(file_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file ID") /* Flush file if this is the last reference to this id and we have write * intent, unless it will be flushed by the "shared" file being closed. * This is only necessary to replicate previous behaviour, and could be - * disabled by an option/property to improve performance. */ - if(NULL == (f = (H5F_t *)H5I_object(file_id))) + * disabled by an option/property to improve performance. + */ + if (NULL == (f = (H5F_t *)H5I_object(file_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") - if((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { - if((nref = H5I_get_ref(file_id, FALSE)) < 0) + if ((f->shared->nrefs > 1) && (H5F_INTENT(f) & H5F_ACC_RDWR)) { + if ((nref = H5I_get_ref(file_id, FALSE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") - if(nref == 1) - if(H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) + if (nref == 1) + if (H5F__flush(f, H5AC_ind_read_dxpl_id, H5AC_rawdata_dxpl_id, FALSE) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") - } /* end if */ + } - /* - * Decrement reference count on atom. When it reaches zero the file will + /* Decrement reference count on atom. When it reaches zero the file will * be closed. */ - if(H5I_dec_app_ref(file_id) < 0) + if (H5I_dec_app_ref(file_id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCLOSEFILE, FAIL, "decrementing file ID failed") done: diff --git a/src/H5FD.c b/src/H5FD.c index 9f62065..405e2d8 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -119,7 +119,7 @@ H5FD__init_package(void) FUNC_ENTER_PACKAGE if(H5I_register_type(H5I_VFL_CLS) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Reset the file serial numbers */ H5FD_file_serial_no_g = 0; @@ -151,18 +151,18 @@ H5FD_term_package(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_PKG_INIT_VAR) { - if(H5I_nmembers(H5I_VFL) > 0) { - (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); + if(H5I_nmembers(H5I_VFL) > 0) { + (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); n++; /*H5I*/ - } /* end if */ + } /* end if */ else { - /* Destroy the VFL driver id group */ - n += (H5I_dec_type_ref(H5I_VFL) > 0); + /* Destroy the VFL driver ID group */ + n += (H5I_dec_type_ref(H5I_VFL) > 0); - /* Mark closed */ + /* Mark closed */ if(0 == n) H5_PKG_INIT_VAR = FALSE; - } /* end else */ + } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) @@ -247,7 +247,7 @@ H5FDregister(const H5FD_class_t *cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") /* Create the new class ID */ - if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) + if((ret_value = H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") done: diff --git a/src/H5Fint.c b/src/H5Fint.c index a48e41c..0eb1ea9 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -409,39 +409,39 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) H5O_loc_t *oloc; /* Group entry info for object */ switch(olist->obj_type) { - case H5I_ATTR: - oloc = H5A_oloc((H5A_t *)obj_ptr); - break; - - case H5I_GROUP: - oloc = H5G_oloc((H5G_t *)obj_ptr); - break; - - case H5I_DATASET: - oloc = H5D_oloc((H5D_t *)obj_ptr); - break; - - case H5I_DATATYPE: - if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) - oloc = H5T_oloc((H5T_t*)obj_ptr); - else - oloc = NULL; - break; - - case H5I_UNINIT: - case H5I_BADID: - case H5I_FILE: - case H5I_DATASPACE: - case H5I_REFERENCE: - case H5I_VFL: - case H5I_GENPROP_CLS: - case H5I_GENPROP_LST: - case H5I_ERROR_CLASS: - case H5I_ERROR_MSG: - case H5I_ERROR_STACK: - case H5I_NTYPES: + case H5I_ATTR: + oloc = H5A_oloc((H5A_t *)obj_ptr); + break; + + case H5I_GROUP: + oloc = H5G_oloc((H5G_t *)obj_ptr); + break; + + case H5I_DATASET: + oloc = H5D_oloc((H5D_t *)obj_ptr); + break; + + case H5I_DATATYPE: + if(H5T_is_named((H5T_t*)obj_ptr)==TRUE) + oloc = H5T_oloc((H5T_t*)obj_ptr); + else + oloc = NULL; + break; + + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "unknown data object") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5_ITER_ERROR, "unknown or invalid data object") } /* end switch */ if((olist->file_info.local && diff --git a/src/H5I.c b/src/H5I.c index b8e47a2..3bd9c4d 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -12,25 +12,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * FILE: H5I.c - Internal storage routines for handling "IDs" + * FILE: H5I.c - Internal storage routines for handling "IDs" * - * REMARKS: ID's which allow objects (void *'s currently) to be bundled - * into "types" for more general storage. + * REMARKS: IDs which allow objects (void * currently) to be bundled + * into "types" for more general storage. * - * DESIGN: The types are stored in an array of pointers to store each - * type in an element. Each "type" node contains a link to a - * hash table to manage the IDs in each type. Allowed types are - * values within the range 1 to H5I_MAX_NUM_TYPES and are given out - * at run-time. Types used by the library are stored in global - * variables defined in H5Ipublic.h. - * - * AUTHOR: Quincey Koziol - * - * MODIFICATIONS: - * 1/3/96 - Starting writing specs & coding prototype - * 1/7/96 - Finished coding prototype - * 6/10/97 - Moved into HDF5 library - * 5/18/04 - Expanded to allow registration of new types at run-time + * DESIGN: The types are stored in an array of pointers to store each + * type in an element. Each "type" node contains a link to a + * hash table to manage the IDs in each type. Allowed types are + * values within the range 1 to H5I_MAX_NUM_TYPES and are given out + * at run-time. Types used by the library are stored in global + * variables defined in H5Ipublic.h. */ #include "H5Imodule.h" /* This source code file is part of the H5I module */ @@ -724,58 +716,54 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_register - * - * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. - * This routine does _not_ check for unique-ness of the objects, - * if you register an object twice, you will get two different - * IDs for it. This routine does make certain that each ID in a - * type is unique. IDs are created by getting a unique number - * for the type the ID is in and incorporating the type into - * the ID which is returned to the user. + * Function: H5I_register * - * Return: Success: New object id. - * Failure: Negative + * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. + * This routine does _not_ check for unique-ness of the objects, + * if you register an object twice, you will get two different + * IDs for it. This routine does make certain that each ID in a + * type is unique. IDs are created by getting a unique number + * for the type the ID is in and incorporating the type into + * the ID which is returned to the user. * - * Programmer: Unknown + * Return: Success: New object id + * Failure: Negative * *------------------------------------------------------------------------- */ hid_t H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *id_ptr; /*ptr to the new ID information */ - hid_t new_id; /*new ID */ - hid_t ret_value = SUCCEED; /*return value */ + H5I_id_type_t *type_ptr = NULL; /* ptr to the type */ + H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID information */ + hid_t new_id = -1; /* new ID */ + hid_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; - if(NULL == type_ptr || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - if(NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) + if ((NULL == type_ptr) || (type_ptr->init_count <= 0)) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") - /* Create the struct & it's ID */ + /* Create the struct & its ID */ new_id = H5I_MAKE(type, type_ptr->nextid); id_ptr->id = new_id; - id_ptr->count = 1; /*initial reference count*/ + id_ptr->count = 1; /* initial reference count */ id_ptr->app_count = !!app_ref; id_ptr->obj_ptr = object; /* Insert into the type */ - if(H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) + if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") type_ptr->id_count++; type_ptr->nextid++; - /* - * Sanity check for the 'nextid' getting too large and wrapping around. - */ + /* Sanity check for the 'nextid' getting too large and wrapping around */ HDassert(type_ptr->nextid <= ID_MASK); /* Set return value */ diff --git a/src/H5Oflush.c b/src/H5Oflush.c index 9764f56..b1592dd 100644 --- a/src/H5Oflush.c +++ b/src/H5Oflush.c @@ -405,7 +405,7 @@ H5O_refresh_metadata_reopen(hid_t oid, H5G_loc_t *obj_loc, hid_t dxpl_id, hbool_ case H5I_ERROR_STACK: case H5I_NTYPES: default: - HGOTO_ERROR(H5E_ARGS, H5E_CANTRELEASE, FAIL, "not a valid file object ID (dataset, group, or datatype)") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a valid file object ID (dataset, group, or datatype)") break; } /* end switch */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 1b0a4b9..6beee6f 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -14,8 +14,6 @@ /*------------------------------------------------------------------------- * * Created: H5Pfapl.c - * February 26 1998 - * Robb Matzke * * Purpose: File access property list class routines * @@ -32,21 +30,21 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* Files */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* Files */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory Management */ -#include "H5Ppkg.h" /* Property lists */ +#include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ -#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ +#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */ +#include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ +#include "H5FDwindows.h" /* Win32 I/O */ #endif diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index c28b508..30fbeeb 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -26,14 +26,15 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FOprivate.h" /* File objects */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FOprivate.h" /* File objects */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory Management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h index 17cdc49..9171e1e 100644 --- a/src/H5Tprivate.h +++ b/src/H5Tprivate.h @@ -27,9 +27,9 @@ typedef struct H5T_t H5T_t; #include "H5MMpublic.h" /* Memory management */ /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Rprivate.h" /* References */ +#include "H5private.h" /* Generic Functions */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Rprivate.h" /* References */ /* Macro for size of temporary buffers to contain a single element */ #define H5T_ELEM_BUF_SIZE 256 diff --git a/src/H5private.h b/src/H5private.h index ca4ebcf..2f33cff 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -53,7 +53,6 @@ # include # include # include -# include # include # include # include @@ -1688,25 +1687,25 @@ extern char *strdup(const char *s); * information about the package in H5_init_library(). */ typedef enum { - H5_PKG_A, /*Attributes */ - H5_PKG_AC, /*Meta data cache */ - H5_PKG_B, /*B-trees */ - H5_PKG_D, /*Datasets */ - H5_PKG_E, /*Error handling */ - H5_PKG_F, /*Files */ - H5_PKG_G, /*Groups */ - H5_PKG_HG, /*Global heap */ - H5_PKG_HL, /*Local heap */ - H5_PKG_I, /*Interface */ - H5_PKG_MF, /*File memory management */ - H5_PKG_MM, /*Core memory management */ - H5_PKG_O, /*Object headers */ - H5_PKG_P, /*Property lists */ - H5_PKG_S, /*Data spaces */ - H5_PKG_T, /*Data types */ - H5_PKG_V, /*Vector functions */ - H5_PKG_Z, /*Raw data filters */ - H5_NPKGS /*Must be last */ + H5_PKG_A, /* Attributes */ + H5_PKG_AC, /* Metadata cache */ + H5_PKG_B, /* B-trees */ + H5_PKG_D, /* Datasets */ + H5_PKG_E, /* Error handling */ + H5_PKG_F, /* Files */ + H5_PKG_G, /* Groups */ + H5_PKG_HG, /* Global heaps */ + H5_PKG_HL, /* Local heaps */ + H5_PKG_I, /* IDs */ + H5_PKG_MF, /* File memory management */ + H5_PKG_MM, /* Core memory management */ + H5_PKG_O, /* Object headers */ + H5_PKG_P, /* Property lists */ + H5_PKG_S, /* Dataspaces */ + H5_PKG_T, /* Datatypes */ + H5_PKG_V, /* Vector functions */ + H5_PKG_Z, /* Raw data filters */ + H5_NPKGS /* Must be last */ } H5_pkg_t; typedef struct H5_debug_open_stream_t { @@ -1735,76 +1734,90 @@ extern H5_debug_t H5_debug_g; extern char H5libhdf5_settings[]; /* embedded library information */ /*------------------------------------------------------------------------- - * Purpose: These macros are inserted automatically just after the - * FUNC_ENTER() macro of API functions and are used to trace - * application program execution. Unless H5_DEBUG_API has been - * defined they are no-ops. + * Purpose: These macros are inserted automatically just after the + * FUNC_ENTER() macro of API functions and are used to trace + * application program execution. Unless H5_DEBUG_API has been + * defined they are no-ops. * - * Arguments: R - Return type encoded as a string - * T - Argument types encoded as a string - * A0-An - Arguments. The number at the end of the macro name - * indicates the number of arguments. + * Arguments: R - Return type encoded as a string + * T - Argument types encoded as a string + * A0-An - Arguments. The number at the end of the macro name + * indicates the number of arguments. * - * Programmer: Robb Matzke - * - * Modifications: *------------------------------------------------------------------------- */ #ifdef H5_DEBUG_API -#define H5TRACE_DECL const char *RTYPE=NULL; \ - double CALLTIME; -#define H5TRACE0(R,T) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T) -#define H5TRACE1(R,T,A0) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0) -#define H5TRACE2(R,T,A0,A1) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1) -#define H5TRACE3(R,T,A0,A1,A2) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2) -#define H5TRACE4(R,T,A0,A1,A2,A3) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3) -#define H5TRACE5(R,T,A0,A1,A2,A3,A4) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4) -#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5) -#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6) -#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7) -#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8) -#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8,#A9,A9) -#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) RTYPE=R; \ - CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3, \ - #A4,A4,#A5,A5,#A6,A6,#A7,A7,#A8,A8,#A9,A9, \ - #A10,A10) -#define H5TRACE_RETURN(V) if (RTYPE) { \ - H5_trace(&CALLTIME,FUNC,RTYPE,NULL,V); \ - RTYPE=NULL; \ - } + +#define H5TRACE_DECL \ + const char *RTYPE = NULL; \ + double CALLTIME; + +#define H5TRACE0(R,T) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T) +#define H5TRACE1(R,T,A0) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0) +#define H5TRACE2(R,T,A0,A1) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1) +#define H5TRACE3(R,T,A0,A1,A2) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2) +#define H5TRACE4(R,T,A0,A1,A2,A3) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3) +#define H5TRACE5(R,T,A0,A1,A2,A3,A4) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4) +#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5) +#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6) +#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7) +#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8) +#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8,#A9,A9) +#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8,#A9,A9,#A10,A10) +#define H5TRACE12(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11) \ + RTYPE=R; \ + CALLTIME=H5_trace(NULL,FUNC,T,#A0,A0,#A1,A1,#A2,A2,#A3,A3,#A4,A4,#A5,A5,#A6,A6,#A7,A7, \ + #A8,A8,#A9,A9,#A10,A10,#A11,A11) + +#define H5TRACE_RETURN(V) \ + if (RTYPE) { \ + H5_trace(&CALLTIME, FUNC, RTYPE, NULL, V); \ + RTYPE = NULL; \ + } #else -#define H5TRACE_DECL /*void*/ -#define H5TRACE0(R,T) /*void*/ -#define H5TRACE1(R,T,A0) /*void*/ -#define H5TRACE2(R,T,A0,A1) /*void*/ -#define H5TRACE3(R,T,A0,A1,A2) /*void*/ -#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/ -#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/ -#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/ -#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) /*void*/ -#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) /*void*/ -#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) /*void*/ -#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) /*void*/ -#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) /*void*/ -#define H5TRACE_RETURN(V) /*void*/ -#endif +#define H5TRACE_DECL /*void*/ +#define H5TRACE0(R,T) /*void*/ +#define H5TRACE1(R,T,A0) /*void*/ +#define H5TRACE2(R,T,A0,A1) /*void*/ +#define H5TRACE3(R,T,A0,A1,A2) /*void*/ +#define H5TRACE4(R,T,A0,A1,A2,A3) /*void*/ +#define H5TRACE5(R,T,A0,A1,A2,A3,A4) /*void*/ +#define H5TRACE6(R,T,A0,A1,A2,A3,A4,A5) /*void*/ +#define H5TRACE7(R,T,A0,A1,A2,A3,A4,A5,A6) /*void*/ +#define H5TRACE8(R,T,A0,A1,A2,A3,A4,A5,A6,A7) /*void*/ +#define H5TRACE9(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8) /*void*/ +#define H5TRACE10(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9) /*void*/ +#define H5TRACE11(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) /*void*/ +#define H5TRACE12(R,T,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11) /*void*/ +#define H5TRACE_RETURN(V) /*void*/ +#endif /* H5_DEBUG_API */ H5_DLL double H5_trace(const double *calltime, const char *func, const char *type, ...); diff --git a/src/H5public.h b/src/H5public.h index 40e6e6e..58d0cd1 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -39,6 +39,7 @@ #endif #ifdef H5_STDC_HEADERS # include /*for H5T_NATIVE_CHAR defn in H5Tpublic.h */ +# include /*for variadic functions in H5VLpublic.h */ #endif #ifndef __cplusplus # ifdef H5_HAVE_STDINT_H diff --git a/src/H5trace.c b/src/H5trace.c index 930002f..7bc2724 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -226,9 +226,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) * name is the null pointer then don't print the argument or the * following `='. This is used for return values. */ - argname = va_arg(ap, char *); /*lint !e64 Type mismatch not really occuring */ + argname = va_arg(ap, char *); if(argname) { - unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname) - 3); /*lint !e666 Allow expression with side effects */ + unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname) - 3); if(!HDstrcmp(argname + n, "_id")) { HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n)); @@ -242,7 +242,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) /* The value */ if(ptr) - vp = va_arg(ap, void *); /*lint !e64 Type mismatch not really occuring */ + vp = va_arg(ap, void *); switch(type[0]) { case 'a': if(ptr) { @@ -252,7 +252,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - haddr_t addr = va_arg(ap, haddr_t); /*lint !e732 Loss of sign not really occuring */ + haddr_t addr = va_arg(ap, haddr_t); HDfprintf(out, "%a", addr); } /* end else */ @@ -807,7 +807,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - H5E_error2_t *error = va_arg(ap, H5E_error2_t *); /*lint !e64 Type mismatch not really occuring */ + H5E_error2_t *error = va_arg(ap, H5E_error2_t *); fprintf(out, "0x%lx", (unsigned long)error); } /* end else */ @@ -1093,7 +1093,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); /*lint !e64 Type mismatch not really occuring */ + H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); fprintf(out, "0x%lx", (unsigned long)statbuf); } @@ -1127,7 +1127,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - hsize_t hsize = va_arg(ap, hsize_t); /*lint !e732 Loss of sign not really occuring */ + hsize_t hsize = va_arg(ap, hsize_t); if(H5S_UNLIMITED == hsize) HDfprintf(out, "H5S_UNLIMITED"); @@ -1553,7 +1553,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - unsigned iu = va_arg(ap, unsigned); /*lint !e732 Loss of sign not really occuring */ + unsigned iu = va_arg(ap, unsigned); fprintf(out, "%u", iu); asize[argno] = iu; @@ -1797,7 +1797,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - hobj_ref_t ref = va_arg(ap, hobj_ref_t); /*lint !e732 Loss of sign not really occuring */ + hobj_ref_t ref = va_arg(ap, hobj_ref_t); HDfprintf(out, "Reference Object=%a", ref); } /* end else */ @@ -1995,7 +1995,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - const char *str = va_arg(ap, const char *); /*lint !e64 Type mismatch not really occuring */ + const char *str = va_arg(ap, const char *); fprintf(out, "\"%s\"", str); } /* end else */ @@ -2422,7 +2422,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - unsigned long iul = va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ + unsigned long iul = va_arg(ap, unsigned long); fprintf(out, "%lu", iul); asize[argno] = (hssize_t)iul; @@ -2446,7 +2446,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - unsigned long long iull = va_arg(ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */ + unsigned long long iull = va_arg(ap, unsigned long long); fprintf(out, "%llu", iull); asize[argno] = (hssize_t)iull; @@ -2480,7 +2480,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - vp = va_arg (ap, void *); /*lint !e64 Type mismatch not really occuring */ + vp = va_arg (ap, void *); if(vp) fprintf(out, "0x%lx", (unsigned long)vp); @@ -2506,7 +2506,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - size_t size = va_arg(ap, size_t); /*lint !e732 Loss of sign not really occuring */ + size_t size = va_arg(ap, size_t); HDfprintf(out, "%Zu", size); asize[argno] = (hssize_t)size; @@ -2553,7 +2553,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) fprintf(out, "NULL"); } /* end if */ else { - H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); /*lint !e64 Type mismatch not really occuring */ + H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); fprintf(out, "0x%lx", (unsigned long)filter); } /* end else */ -- cgit v0.12 From bbb512bb55b430977713b4f8c662d6a918a456e9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 30 Nov 2017 17:12:37 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 1 + src/H5A.c | 4 +- src/H5Aint.c | 16 +- src/H5Dio.c | 2 +- src/H5Fprivate.h | 11 +- src/H5Gdeprec.c | 61 +++--- src/H5I.c | 657 ++++++++++++++++++++++++------------------------------- src/H5L.c | 114 +++------- src/H5Lprivate.h | 49 +++++ src/H5Opkg.h | 18 +- src/H5Oprivate.h | 5 +- src/H5Pfapl.c | 4 +- src/H5Tbit.c | 395 ++++++++++++++++----------------- src/H5Tconv.c | 90 +++++--- 14 files changed, 674 insertions(+), 753 deletions(-) diff --git a/src/H5.c b/src/H5.c index 965c2e1..f0a222d 100644 --- a/src/H5.c +++ b/src/H5.c @@ -24,6 +24,7 @@ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ +#include "H5FSprivate.h" /* File free space */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ diff --git a/src/H5A.c b/src/H5A.c index 1b80612..07aca92 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -1150,7 +1150,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) if(HDstrcmp(old_name, new_name)) { H5G_loc_t loc; /* Object location */ - if(H5G_loc(loc_id, & loc) < 0) + if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Call private attribute rename routine */ @@ -1205,7 +1205,7 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, TRUE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access and transfer property lists") - if(H5G_loc(loc_id, & loc) < 0) + if(H5G_loc(loc_id, &loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") /* Call private attribute rename routine */ diff --git a/src/H5Aint.c b/src/H5Aint.c index a661a89..f1dd41e 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -33,14 +33,14 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Apkg.h" /* Attributes */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ -#include "H5SMprivate.h" /* Shared Object Header Messages */ +#include "H5private.h" /* Generic Functions */ +#include "H5Apkg.h" /* Attributes */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Opkg.h" /* Object headers */ +#include "H5SMprivate.h" /* Shared Object Header Messages */ /****************/ diff --git a/src/H5Dio.c b/src/H5Dio.c index 4ab0b37..aee3c35 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -322,7 +322,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D__pre_write * - * Purpose: Preparation for writing data. + * Purpose: Preparation for writing data. * * Return: SUCCEED/FAIL * diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index eba48de..18d0460 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -18,6 +18,9 @@ #ifndef _H5Fprivate_H #define _H5Fprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5F_t H5F_t; + /* Include package's public header */ #include "H5Fpublic.h" @@ -475,8 +478,8 @@ #define H5F_ACS_SIEVE_BUF_SIZE_NAME "sieve_buf_size" /* Maximum sieve buffer size (when data sieving is allowed by file driver) */ #define H5F_ACS_SDATA_BLOCK_SIZE_NAME "sdata_block_size" /* Minimum "small data" allocation block size (when aggregating "small" raw data allocations) */ #define H5F_ACS_GARBG_COLCT_REF_NAME "gc_ref" /* Garbage-collect references */ -#define H5F_ACS_FILE_DRV_NAME "driver-id/info" /* File driver ID & info */ -#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */ +#define H5F_ACS_FILE_DRV_NAME "vfd_info" /* File driver ID & info */ +#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */ #define H5F_ACS_FAMILY_OFFSET_NAME "family_offset" /* Offset position in file for family file driver */ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */ @@ -484,7 +487,7 @@ #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ -#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ +#define H5F_ACS_OBJECT_FLUSH_CB_NAME "object_flush_cb" /* Object flush callback */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ #define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags" /* Whether to clear superblock status_flags (private property only used by h5clear) */ @@ -652,12 +655,12 @@ struct H5B_class_t; struct H5UC_t; struct H5O_loc_t; struct H5HG_heap_t; +struct H5VL_class_t; struct H5P_genplist_t; /* Forward declarations for anonymous H5F objects */ /* Main file structures */ -typedef struct H5F_t H5F_t; typedef struct H5F_file_t H5F_file_t; /* Block aggregation structure */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 228fb9c..1cc7e15 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -695,29 +695,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5Giterate + * Function: H5Giterate * - * Purpose: Iterates over the entries of a group. The LOC_ID and NAME - * identify the group over which to iterate and IDX indicates - * where to start iterating (zero means at the beginning). The - * OPERATOR is called for each member and the iteration - * continues until the operator returns non-zero or all members - * are processed. The operator is passed a group ID for the - * group being iterated, a member name, and OP_DATA for each - * member. + * Purpose: Iterates over the entries of a group. The LOC_ID and NAME + * identify the group over which to iterate and IDX indicates + * where to start iterating (zero means at the beginning). The + * OPERATOR is called for each member and the iteration + * continues until the operator returns non-zero or all members + * are processed. The operator is passed a group ID for the + * group being iterated, a member name, and OP_DATA for each + * member. * - * Note: Deprecated in favor of H5Literate + * NOTE: Deprecated in favor of H5Literate * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * Programmer: Robb Matzke - * Monday, March 23, 1998 + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. * *------------------------------------------------------------------------- */ @@ -725,21 +722,21 @@ herr_t H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, void *op_data) { - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_obj; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - herr_t ret_value; + H5G_link_iterate_t lnk_op; /* Link operator */ + hsize_t last_obj; /* Index of last object looked at */ + hsize_t idx; /* Internal location to hold index */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE5("e", "i*s*Isx*x", loc_id, name, idx_p, op, op_data); /* Check args */ - if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") - if(idx_p && *idx_p < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") - if(!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") + if (!name || !*name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + if (idx_p && *idx_p < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index specified") + if (!op) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") /* Set number of objects looked at to zero */ last_obj = 0; @@ -750,11 +747,11 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_iterate_t op, lnk_op.op_func.op_old = op; /* Call private function. */ - if((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") + if ((ret_value = H5G_iterate(loc_id, name, H5_INDEX_NAME, H5_ITER_INC, idx, &last_obj, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "group iteration failed") /* Set the index we stopped at */ - if(idx_p) + if (idx_p) *idx_p = (int)last_obj; done: diff --git a/src/H5I.c b/src/H5I.c index 3bd9c4d..99f944d 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -28,24 +28,24 @@ #include "H5Imodule.h" /* This source code file is part of the H5I module */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Ipkg.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5SLprivate.h" /* Skip Lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Ipkg.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5SLprivate.h" /* Skip Lists */ /* Define this to compile in support for dumping ID information */ /* #define H5I_DEBUG_OUTPUT */ #ifndef H5I_DEBUG_OUTPUT -#include "H5Gprivate.h" /* Groups */ +#include "H5Gprivate.h" /* Groups */ #else /* H5I_DEBUG_OUTPUT */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Tprivate.h" /* Datatypes */ +#define H5G_FRIEND /* Suppress error about including H5Gpkg */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Tprivate.h" /* Datatypes */ #endif /* H5I_DEBUG_OUTPUT */ /* Local Macros */ @@ -186,23 +186,19 @@ H5I_term_package(void) /*------------------------------------------------------------------------- - * Function: H5Iregister_type + * Function: H5Iregister_type * - * Purpose: Public interface to H5I_register_type. Creates a new type - * of ID's to give out. A specific number (RESERVED) of type - * entries may be reserved to enable "constant" values to be handed - * out which are valid IDs in the type, but which do not map to any - * data structures and are not allocated dynamically later. HASH_SIZE is - * the minimum hash table size to use for the type. FREE_FUNC is - * called with an object pointer when the object is removed from - * the type. + * Purpose: Public interface to H5I_register_type. Creates a new type + * of ID's to give out. A specific number (RESERVED) of type + * entries may be reserved to enable "constant" values to be handed + * out which are valid IDs in the type, but which do not map to any + * data structures and are not allocated dynamically later. HASH_SIZE is + * the minimum hash table size to use for the type. FREE_FUNC is + * called with an object pointer when the object is removed from + * the type. * - * Return: Success: Type ID of the new type - * Failure: H5I_BADID - * - * Programmers: Nathaniel Furrer - * James Laird - * Friday, April 30, 2004 + * Return: Success: Type ID of the new type + * Failure: H5I_BADID * *------------------------------------------------------------------------- */ @@ -270,18 +266,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_register_type + * Function: H5I_register_type * - * Purpose: Creates a new type of ID's to give out. - * The class is initialized or its reference count is incremented + * Purpose: Creates a new type of ID's to give out. + * The class is initialized or its reference count is incremented * (if it is already initialized). * - * Return: Success: Type ID of the new type - * Failure: H5I_BADID - * - * Programmers: Nathaniel Furrer - * James Laird - * Friday, April 30, 2004 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -335,17 +326,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Itype_exists + * Function: H5Itype_exists * * Purpose: Query function to inform the user if a given type is * currently registered with the library. * - * Return: Success: 1 if the type is registered, 0 if it is not - * Failure: Negative - * - * Programmer: James Laird - * Nathaniel Furrer - * Tuesday, June 29, 2004 + * Return: Success: 1 if the type is registered, 0 if it is not + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -357,10 +344,10 @@ H5Itype_exists(H5I_type_t type) FUNC_ENTER_API(FAIL) H5TRACE1("t", "It", type); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") - if(NULL == H5I_id_type_list_g[type]) + if (NULL == H5I_id_type_list_g[type]) ret_value = FALSE; done: @@ -401,9 +388,9 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) * an error when the supplied type does not exist. */ if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") if(NULL == H5I_id_type_list_g[type]) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") if(num_members) { int64_t members; @@ -685,15 +672,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iregister + * Function: H5Iregister * - * Purpose: Public interface to H5I_register. + * Purpose: Public interface to H5I_register. * - * Return: Success: New object id. - * Failure: Negative - * - * Programmer: Nathaniel Furrer - * James Laird + * Return: Success: New object id. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -727,7 +711,7 @@ done: * the ID which is returned to the user. * * Return: Success: New object id - * Failure: Negative + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ @@ -737,18 +721,18 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) H5I_id_type_t *type_ptr = NULL; /* ptr to the type */ H5I_id_info_t *id_ptr = NULL; /* ptr to the new ID information */ hid_t new_id = -1; /* new ID */ - hid_t ret_value = SUCCEED; /* return value */ + hid_t ret_value = H5I_INVALID_HID; /* return value */ FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if (type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid type number") type_ptr = H5I_id_type_list_g[type]; if ((NULL == type_ptr) || (type_ptr->init_count <= 0)) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, H5I_INVALID_HID, "invalid type") if (NULL == (id_ptr = H5FL_MALLOC(H5I_id_info_t))) - HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, FAIL, "memory allocation failed") + HGOTO_ERROR(H5E_ATOM, H5E_NOSPACE, H5I_INVALID_HID, "memory allocation failed") /* Create the struct & its ID */ new_id = H5I_MAKE(type, type_ptr->nextid); @@ -759,7 +743,7 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) /* Insert into the type */ if (H5SL_insert(type_ptr->ids, id_ptr, &id_ptr->id) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, FAIL, "can't insert ID node into skip list") + HGOTO_ERROR(H5E_ATOM, H5E_CANTINSERT, H5I_INVALID_HID, "can't insert ID node into skip list") type_ptr->id_count++; type_ptr->nextid++; @@ -777,27 +761,23 @@ done: /*------------------------------------------------------------------------- * Function: H5I_register_with_id * - * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. - * This routine will check to ensure the supplied ID is not already - * in use, and ensure that it is a valid ID for the given type, - * but will NOT check to ensure the OBJECT is not already - * registered (thus, it is possible to register one object under - * multiple IDs). - * - * Return: Success: 0 - * Failure: -1 + * Purpose: Registers an OBJECT in a TYPE with the supplied ID for it. + * This routine will check to ensure the supplied ID is not already + * in use, and ensure that it is a valid ID for the given type, + * but will NOT check to ensure the OBJECT is not already + * registered (thus, it is possible to register one object under + * multiple IDs). * - * Programmer: Mike McGreevy - * Wednesday, July 21, 2010 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5I_register_with_id(H5I_type_t type, const void *object, hbool_t app_ref, hid_t id) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - H5I_id_info_t *id_ptr; /*ptr to the new ID information */ - herr_t ret_value = SUCCEED; /*return value */ + H5I_id_type_t *type_ptr; /* ptr to the type */ + H5I_id_info_t *id_ptr; /* ptr to the new ID information */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1187,10 +1167,10 @@ H5I_remove(hid_t id) /* Check arguments */ type = H5I_TYPE(id); if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; if(type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") /* Remove the node from the type */ if(NULL == (ret_value = H5I__remove_common(type_ptr, id))) @@ -1226,7 +1206,7 @@ H5Idec_ref(hid_t id) /* Check arguments */ if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") /* Do actual decrement operation */ if((ret_value = H5I_dec_app_ref(id)) < 0) @@ -1359,16 +1339,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_dec_app_ref_always_close + * Function: H5I_dec_app_ref_always_close * - * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID, - * even when the free routine fails + * Purpose: H5I_dec_app_ref wrapper for case of always closing the ID, + * even when the free routine fails * - * Return: Success: New app. reference count. - * Failure: Negative - * - * Programmer: Quincey Koziol - * Sept 16, 2010 + * Return: Success: New app. reference count. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1386,7 +1363,7 @@ H5I_dec_app_ref_always_close(hid_t id) ret_value = H5I_dec_app_ref(id); /* Check for failure */ - if(ret_value < 0) { + if (ret_value < 0) { /* * If an object is closing, we can remove the ID even though the free * method might fail. This can happen when a mandatory filter fails to @@ -1396,7 +1373,7 @@ H5I_dec_app_ref_always_close(hid_t id) H5I_remove(id); HGOTO_ERROR(H5E_ATOM, H5E_CANTDEC, FAIL, "can't decrement ID ref count") - } /* end if */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1404,15 +1381,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iinc_ref - * - * Purpose: Increments the number of references outstanding for an ID. + * Function: H5Iinc_ref * - * Return: Success: New reference count - * Failure: Negative + * Purpose: Increments the number of references outstanding for an ID. * - * Programmer: Quincey Koziol - * Dec 7, 2003 + * Return: Success: New reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1425,11 +1399,11 @@ H5Iinc_ref(hid_t id) H5TRACE1("Is", "i", id); /* Check arguments */ - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") + if (id < 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") /* Do actual increment operation */ - if((ret_value = H5I_inc_ref(id, TRUE)) < 0) + if ((ret_value = H5I_inc_ref(id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID ref count") done: @@ -1438,15 +1412,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_inc_ref + * Function: H5I_inc_ref * - * Purpose: Increment the reference count for an object. + * Purpose: Increment the reference count for an object. * - * Return: Success: The new reference count. - * Failure: Negative - * - * Programmer: Robb Matzke - * Thursday, July 29, 1999 + * Return: Success: The new reference count. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1462,8 +1433,8 @@ H5I_inc_ref(hid_t id, hbool_t app_ref) HDassert(id >= 0); /* General lookup of the ID */ - if(NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") + if (NULL == (id_ptr = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* Adjust reference counts */ ++(id_ptr->count); @@ -1479,15 +1450,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_ref + * Function: H5Iget_ref * - * Purpose: Retrieves the number of references outstanding for an ID. - * - * Return: Success: Reference count - * Failure: Negative + * Purpose: Retrieves the number of references outstanding for an ID. * - * Programmer: Quincey Koziol - * Dec 7, 2003 + * Return: Success: Reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1500,11 +1468,11 @@ H5Iget_ref(hid_t id) H5TRACE1("Is", "i", id); /* Check arguments */ - if(id < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") + if (id < 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID") /* Do actual retrieve operation */ - if((ret_value = H5I_get_ref(id, TRUE)) < 0) + if ((ret_value = H5I_get_ref(id, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID ref count") done: @@ -1513,15 +1481,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_get_ref + * Function: H5I_get_ref * - * Purpose: Retrieve the reference count for an object. + * Purpose: Retrieve the reference count for an object. * - * Return: Success: The reference count. - * Failure: Negative - * - * Programmer: Quincey Koziol - * Saturday, Decemeber 6, 2003 + * Return: Success: The reference count. + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1537,8 +1502,8 @@ H5I_get_ref(hid_t id, hbool_t app_ref) HDassert(id >= 0); /* General lookup of the ID */ - if(NULL == (id_ptr = H5I__find_id(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") + if (NULL == (id_ptr = H5I__find_id(id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID") /* Set return value */ ret_value = (int)(app_ref ? id_ptr->app_count : id_ptr->count); @@ -1549,16 +1514,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iinc_type_ref + * Function: H5Iinc_type_ref * - * Purpose: Increments the number of references outstanding for an ID type. + * Purpose: Increments the number of references outstanding for an ID type. * - * Return: Success: New reference count - * Failure: Negative - * - * Programmer: Nat Furrer - * James Laird - * April 30, 2004 + * Return: Success: New reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1571,14 +1532,14 @@ H5Iinc_type_ref(H5I_type_t type) H5TRACE1("Is", "It", type); /* Check arguments */ - if(type <= 0 || type >= H5I_next_type) + if (type <= 0 || type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID type") - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") /* Do actual increment operation */ - if((ret_value = H5I__inc_type_ref(type)) < 0) + if ((ret_value = H5I__inc_type_ref(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, FAIL, "can't increment ID type ref count") done: @@ -1587,16 +1548,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__inc_type_ref + * Function: H5I__inc_type_ref * - * Purpose: Increment the reference count for an ID type. + * Purpose: Increment the reference count for an ID type. * - * Return: Success: The new reference count. - * Failure: Negative - * - * Programmer: James Laird - * Nat Furrer - * Friday, April 30, 2004 + * Return: Success: The new reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1613,8 +1570,8 @@ H5I__inc_type_ref(H5I_type_t type) /* Check arguments */ type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + if (!type_ptr) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") /* Set return value */ ret_value = (int)(++(type_ptr->init_count)); @@ -1625,24 +1582,26 @@ done: /*------------------------------------------------------------------------- - * Function: H5Idec_type_ref - * - * Purpose: Decrements the reference count on an entire type of IDs. - * If the type reference count becomes zero then the type is - * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling - * the free-func for each ID's object and then adding the ID - * struct to the ID free list. Public interface to - * H5I_dec_type_ref. - * Returns the number of references to the type on success; a - * return value of 0 means that the type will have to be - * re-initialized before it can be used again (and should probably - * be set to H5I_UNINIT). - * - * Return: Number of references to type on success/Negative on failure - * - * Programmer: Nathaniel Furrer - * James Laird + * Function: H5Idec_type_ref + * + * Purpose: Decrements the reference count on an entire type of IDs. + * If the type reference count becomes zero then the type is + * destroyed along with all atoms in that type regardless of + * their reference counts. Destroying IDs involves calling + * the free-func for each ID's object and then adding the ID + * struct to the ID free list. Public interface to + * H5I_dec_type_ref. + * Returns the number of references to the type on success; a + * return value of 0 means that the type will have to be + * re-initialized before it can be used again (and should probably + * be set to H5I_UNINIT). + * + * NOTE: Using an error type to also represent a count is semantially + * incorrect. We should consider fixing this in a future major + * release (DER). + * + * Return: Success: Number of references to type + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1654,7 +1613,7 @@ H5Idec_type_ref(H5I_type_t type) FUNC_ENTER_API(FAIL) H5TRACE1("e", "It", type); - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") ret_value = H5I_dec_type_ref(type); @@ -1665,22 +1624,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_dec_type_ref - * - * Purpose: Decrements the reference count on an entire type of IDs. - * If the type reference count becomes zero then the type is - * destroyed along with all atoms in that type regardless of - * their reference counts. Destroying IDs involves calling - * the free-func for each ID's object and then adding the ID - * struct to the ID free list. - * Returns the number of references to the type on success; a - * return value of 0 means that the type will have to be - * re-initialized before it can be used again (and should probably - * be set to H5I_UNINIT). - * - * Return: Number of references to type on success/Negative on failure - * - * Programmer: Unknown + * Function: H5I_dec_type_ref + * + * Purpose: Decrements the reference count on an entire type of IDs. + * If the type reference count becomes zero then the type is + * destroyed along with all atoms in that type regardless of + * their reference counts. Destroying IDs involves calling + * the free-func for each ID's object and then adding the ID + * struct to the ID free list. + * Returns the number of references to the type on success; a + * return value of 0 means that the type will have to be + * re-initialized before it can be used again (and should probably + * be set to H5I_UNINIT). + * + * Return: Success: Number of references to type + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1692,27 +1650,26 @@ H5I_dec_type_ref(H5I_type_t type) FUNC_ENTER_NOAPI(FAIL) - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; - if(type_ptr == NULL || type_ptr->init_count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") + if (type_ptr == NULL || type_ptr->init_count <= 0) + HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") - /* - * Decrement the number of users of the atomic type. If this is the + /* Decrement the number of users of the atomic type. If this is the * last user of the type then release all atoms from the type and * free all memory it used. The free function is invoked for each atom * being freed. */ - if(1 == type_ptr->init_count) { + if (1 == type_ptr->init_count) { H5I__destroy_type(type); ret_value = 0; - } /* end if */ + } else { --(type_ptr->init_count); ret_value = (herr_t)type_ptr->init_count; - } /* end else */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -1720,16 +1677,12 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_type_ref + * Function: H5Iget_type_ref * - * Purpose: Retrieves the number of references outstanding for a type. - * - * Return: Success: Reference count - * Failure: Negative + * Purpose: Retrieves the number of references outstanding for a type. * - * Programmer: Nat Furrer - * James Laird - * April 30, 2004 + * Return: Success: Reference count + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1742,14 +1695,14 @@ H5Iget_type_ref(H5I_type_t type) H5TRACE1("Is", "It", type); /* Check arguments */ - if(type <= 0 || type >= H5I_next_type) + if (type <= 0 || type >= H5I_next_type) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "invalid ID type") - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "cannot call public function on library type") /* Do actual retrieve operation */ - if((ret_value = H5I__get_type_ref(type)) < 0) + if ((ret_value = H5I__get_type_ref(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get ID type ref count") done: @@ -1758,25 +1711,21 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__get_type_ref + * Function: H5I__get_type_ref * - * Purpose: Retrieve the reference count for an ID type. + * Purpose: Retrieve the reference count for an ID type. * - * Return: Success: The reference count. + * Return: Success: The reference count. * - * Failure: Negative - * - * Programmer: Nat Furrer - * James Laird - * April 30, 2004 + * Failure: Negative * *------------------------------------------------------------------------- */ static int H5I__get_type_ref(H5I_type_t type) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - int ret_value = -1; /* Return value */ + H5I_id_type_t *type_ptr; /* Pointer to the type */ + int ret_value = -1; /* Return value */ FUNC_ENTER_STATIC @@ -1785,7 +1734,7 @@ H5I__get_type_ref(H5I_type_t type) /* Check arguments */ type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr) + if (!type_ptr) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type") /* Set return value */ @@ -1797,17 +1746,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iis_valid + * Function: H5Iis_valid * - * Purpose: Check if the given id is valid. An id is valid if it is in + * Purpose: Check if the given id is valid. An id is valid if it is in * use and has an application reference count of at least 1. * - * Return: Success: TRUE if the id is valid, FALSE otherwise. - * - * Failure: Negative (never fails currently) + * Return: Success: TRUE if the id is valid, FALSE otherwise. * - * Programmer: Neil Fortner - * Friday, October 31, 2008 (boo) + * Failure: Negative (never fails currently) * *------------------------------------------------------------------------- */ @@ -1823,9 +1769,7 @@ H5Iis_valid(hid_t id) /* Find the ID */ if (NULL == (id_ptr = H5I__find_id(id))) ret_value = FALSE; - - /* Check if the found id is an internal id */ - else if (!id_ptr->app_count) + else if (!id_ptr->app_count) /* Check if the found id is an internal id */ ret_value = FALSE; done: @@ -1834,19 +1778,16 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__search_cb + * Function: H5I__search_cb * - * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate. - * Calls "user" callback search function, and then sets return - * value, based on the result of that callback. - * - * Return: Success: The first object in the type for which FUNC - * returns non-zero. NULL if FUNC returned zero - * for every object in the type. - * Failure: NULL + * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate. + * Calls "user" callback search function, and then sets return + * value, based on the result of that callback. * - * Programmer: Quincey Koziol - * Friday, March 30, 2012 + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -1859,7 +1800,7 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) FUNC_ENTER_STATIC_NOERR ret_value = (*udata->app_cb)(obj, id, udata->app_key); - if(ret_value > 0) + if (ret_value > 0) udata->ret_obj = obj; FUNC_LEAVE_NOAPI(ret_value) @@ -1867,26 +1808,22 @@ H5I__search_cb(void *obj, hid_t id, void *_udata) /*------------------------------------------------------------------------- - * Function: H5Isearch + * Function: H5Isearch * - * Purpose: Apply function FUNC to each member of type TYPE and return a - * pointer to the first object for which FUNC returns non-zero. - * The FUNC should take a pointer to the object and the KEY as - * arguments and return non-zero to terminate the search (zero - * to continue). Public interface to H5I_search. + * Purpose: Apply function FUNC to each member of type TYPE and return a + * pointer to the first object for which FUNC returns non-zero. + * The FUNC should take a pointer to the object and the KEY as + * arguments and return non-zero to terminate the search (zero + * to continue). Public interface to H5I_search. * - * Limitation: Currently there is no way to start searching from where a - * previous search left off. + * Limitation: Currently there is no way to start searching from where a + * previous search left off. * - * Return: Success: The first object in the type for which FUNC - * returns non-zero. NULL if FUNC returned zero - * for every object in the type. + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. * - * Failure: NULL - * - * Programmer: James Laird - * Nathaniel Furrer - * Friday, April 23, 2004 + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -1900,7 +1837,7 @@ H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) H5TRACE3("*x", "Itx*x", type, func, key); /* Check arguments */ - if(H5I_IS_LIB_TYPE(type)) + if (H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") /* Set up udata struct */ @@ -1922,17 +1859,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__iterate_cb + * Function: H5I__iterate_cb * - * Purpose: Callback routine for H5I_iterate, invokes "user" callback + * Purpose: Callback routine for H5I_iterate, invokes "user" callback * function, and then sets return value, based on the result of * that callback. * - * Return: Success: Non-negative on success - * Failure: Negative - * - * Programmer: Quincey Koziol - * Thursday, October 3, 2013 + * Return: Success: Non-negative on success + * Failure: Negative * *------------------------------------------------------------------------- */ @@ -1964,29 +1898,25 @@ H5I__iterate_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) /*------------------------------------------------------------------------- * Function: H5I_iterate * - * Purpose: Apply function FUNC to each member of type TYPE (with - * non-zero application reference count if app_ref is TRUE). - * Stop if FUNC returns a non zero value (i.e. anything - * other than H5_ITER_CONT). + * Purpose: Apply function FUNC to each member of type TYPE (with + * non-zero application reference count if app_ref is TRUE). + * Stop if FUNC returns a non zero value (i.e. anything + * other than H5_ITER_CONT). * - * If FUNC returns a positive value (i.e. H5_ITER_STOP), - * return SUCCEED. + * If FUNC returns a positive value (i.e. H5_ITER_STOP), + * return SUCCEED. * - * If FUNC returns a negative value (i.e. H5_ITER_ERROR), - * return FAIL. + * If FUNC returns a negative value (i.e. H5_ITER_ERROR), + * return FAIL. * - * The FUNC should take a pointer to the object and the - * udata as arguments and return non-zero to terminate - * siteration, and zero to continue. + * The FUNC should take a pointer to the object and the + * udata as arguments and return non-zero to terminate + * siteration, and zero to continue. * - * Limitation: Currently there is no way to start the iteration from - * where a previous iteration left off. + * Limitation: Currently there is no way to start the iteration from + * where a previous iteration left off. * - * Return: Success: SUCCEED - * Failure: FAIL - * - * Programmer: John Mainzer - * Monday, December 6, 2011 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -1999,12 +1929,12 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; /* Only iterate through ID list if it is initialized and there are IDs in type */ - if(type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { + if (type_ptr && type_ptr->init_count > 0 && type_ptr->id_count > 0) { H5I_iterate_ud_t iter_udata; /* User data for iteration callback */ herr_t iter_status; /* Iteration status */ @@ -2014,9 +1944,9 @@ H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_re iter_udata.app_ref = app_ref; /* Iterate over IDs */ - if((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) + if ((iter_status = H5SL_iterate(type_ptr->ids, H5I__iterate_cb, &iter_udata)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "iteration failed") - } /* end if */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -2024,16 +1954,14 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__find_id - * - * Purpose: Given an object ID find the info struct that describes the - * object. + * Function: H5I__find_id * - * Return: Success: Ptr to the object's info struct. + * Purpose: Given an object ID find the info struct that describes the + * object. * - * Failure: NULL + * Return: Success: A pointer to the object's info struct. * - * Programmer: Unknown + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -2048,12 +1976,12 @@ H5I__find_id(hid_t id) /* Check arguments */ type = H5I_TYPE(id); - if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_DONE(NULL) + if (type <= H5I_BADID || type >= H5I_next_type) + HGOTO_DONE(NULL) type_ptr = H5I_id_type_list_g[type]; - if(!type_ptr || type_ptr->init_count <= 0) - HGOTO_DONE(NULL) + if (!type_ptr || type_ptr->init_count <= 0) + HGOTO_DONE(NULL) /* Locate the ID node for the ID */ ret_value = (H5I_id_info_t *)H5SL_search(type_ptr->ids, &id); @@ -2064,17 +1992,13 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_name - * - * Purpose: Gets a name of an object from its ID. + * Function: H5Iget_name * - * Return: Success: The length of name. + * Purpose: Gets a name of an object from its ID. * - * Failure: -1 + * Return: Success: The length of the name * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: July 26, 2002 + * Failure: -1 * * Comments: Public function * If `name' is non-NULL then write up to `size' bytes into that @@ -2098,12 +2022,12 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size) H5TRACE3("Zs", "ixz", id, name, size); /* Get object location */ - if(H5G_loc(id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") + if (H5G_loc(id, &loc) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object location") /* Call internal group routine to retrieve object's name */ - if((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") + if ((ret_value = H5G_get_name(&loc, name, size, NULL, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve object name") done: FUNC_LEAVE_API(ret_value) @@ -2111,30 +2035,27 @@ done: /*------------------------------------------------------------------------- - * Function: H5Iget_file_id + * Function: H5Iget_file_id * - * Purpose: The public version of H5I_get_file_id(), obtains the file + * Purpose: The public version of H5I_get_file_id(), obtains the file * ID given an object ID. User has to close this ID. * - * Return: Success: file ID - * - * Failure: a negative value + * Return: Success: The file ID associated with the object * - * Programmer: Raymond Lu - * Oct 27, 2003 + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ hid_t H5Iget_file_id(hid_t obj_id) { - hid_t ret_value; /* Return value */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE1("i", "i", obj_id); - if((ret_value = H5I_get_file_id(obj_id, TRUE)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't retrieve file ID") + if ((ret_value = H5I_get_file_id(obj_id, TRUE)) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't retrieve file ID") done: FUNC_LEAVE_API(ret_value) @@ -2142,50 +2063,48 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_get_file_id + * Function: H5I_get_file_id * - * Purpose: The private version of H5Iget_file_id(), obtains the file + * Purpose: The private version of H5Iget_file_id(), obtains the file * ID given an object ID. * - * Return: Success: file ID - * Failure: a negative value + * Return: Success: The file ID associated with the object * - * Programmer: Raymond Lu - * Oct 27, 2003 + * Failure: H5I_INVALID_HID * *------------------------------------------------------------------------- */ hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref) { - H5I_type_t type; /* ID type */ - hid_t ret_value = H5I_INVALID_HID; /* Return value */ + H5I_type_t type; /* ID type */ + hid_t ret_value = H5I_INVALID_HID; /* Return value */ FUNC_ENTER_NOAPI_NOINIT /* Get object type */ type = H5I_TYPE(obj_id); - if(type == H5I_FILE) { + if (type == H5I_FILE) { /* Increment reference count on file ID */ if(H5I_inc_ref(obj_id, app_ref) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") + HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, H5I_INVALID_HID, "incrementing file ID failed") /* Set return value */ ret_value = obj_id; - } /* end if */ - else if(type == H5I_DATATYPE || type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) { + } + else if (type == H5I_DATATYPE || type == H5I_GROUP || type == H5I_DATASET || type == H5I_ATTR) { H5G_loc_t loc; /* Location of object */ /* Get the object location information */ if(H5G_loc(obj_id, &loc) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get object location") + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't get object location") /* Get the file ID for the object */ if((ret_value = H5F_get_id(loc.oloc->file, app_ref)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, FAIL, "can't get file ID") - } /* end if */ + HGOTO_ERROR(H5E_ATOM, H5E_CANTGET, H5I_INVALID_HID, "can't get file ID") + } else - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, H5I_INVALID_HID, "invalid object ID") done: FUNC_LEAVE_NOAPI(ret_value) @@ -2194,34 +2113,29 @@ done: #ifdef H5I_DEBUG_OUTPUT /*------------------------------------------------------------------------- - * Function: H5I__debug_cb + * Function: H5I__debug_cb * - * Purpose: Dump the contents of an ID to stderr for debugging. + * Purpose: Dump the contents of an ID to stderr for debugging. * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ static herr_t H5I__debug_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) { - H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ - H5G_name_t *path = NULL; - int ret_value = H5_ITER_CONT; /* Return value */ + H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ + H5I_type_t type = *(H5I_type_t *)_udata; /* User data */ + H5G_name_t *path = NULL; FUNC_ENTER_STATIC_NOERR - fprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); - fprintf(stderr, " count = %u\n", item->count); - fprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr)); + HDfprintf(stderr, " id = %lu\n", (unsigned long)(item->id)); + HDfprintf(stderr, " count = %u\n", item->count); + HDfprintf(stderr, " obj = 0x%08lx\n", (unsigned long)(item->obj_ptr)); /* Get the group location, so we get get the name */ - switch(type) { + switch (type) { case H5I_GROUP: path = H5G_nameof((H5G_t*)item->obj_ptr); break; @@ -2234,31 +2148,40 @@ H5I__debug_cb(void *_item, void H5_ATTR_UNUSED *_key, void *_udata) path = H5T_nameof((H5T_t*)item->obj_ptr); break; + case H5I_UNINIT: + case H5I_BADID: + case H5I_FILE: + case H5I_DATASPACE: + case H5I_ATTR: + case H5I_REFERENCE: + case H5I_VFL: + case H5I_GENPROP_CLS: + case H5I_GENPROP_LST: + case H5I_ERROR_CLASS: + case H5I_ERROR_MSG: + case H5I_ERROR_STACK: + case H5I_NTYPES: default: break; /* Other types of IDs are not stored in files */ - } /* end switch*/ + } - if(path) { - if(path->user_path_r) - fprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r)); - if(path->full_path_r) - fprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r)); - } /* end if */ + if (path) { + if (path->user_path_r) + HDfprintf(stderr, " user_path = %s\n", H5RS_get_str(path->user_path_r)); + if (path->full_path_r) + HDfprintf(stderr, " full_path = %s\n", H5RS_get_str(path->full_path_r)); + } FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5I__debug_cb() */ /*------------------------------------------------------------------------- - * Function: H5I__debug - * - * Purpose: Dump the contents of a type to stderr for debugging. + * Function: H5I__debug * - * Return: Success: Non-negative - * Failure: Negative + * Purpose: Dump the contents of a type to stderr for debugging. * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ @@ -2269,17 +2192,17 @@ H5I__debug(H5I_type_t type) FUNC_ENTER_STATIC_NOERR - fprintf(stderr, "Dumping ID type %d\n", (int)type); + HDfprintf(stderr, "Dumping ID type %d\n", (int)type); type_ptr = H5I_id_type_list_g[type]; /* Header */ - fprintf(stderr, " init_count = %u\n", type_ptr->init_count); - fprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); - fprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); - fprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); + HDfprintf(stderr, " init_count = %u\n", type_ptr->init_count); + HDfprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); + HDfprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); + HDfprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); /* List */ - fprintf(stderr, " List:\n"); + HDfprintf(stderr, " List:\n"); H5SL_iterate(type_ptr->ids, H5I__debug_cb, &type); FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5L.c b/src/H5L.c index 469a86c..afd033a 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -50,18 +50,6 @@ typedef struct { hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_gi_t; -/* User data for path traversal routine for getting link info by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ - - /* Out */ - H5L_info_t *linfo; /* Buffer to return to user */ -} H5L_trav_gibi_t; - /* User data for path traversal callback to creating a link */ typedef struct { H5F_t *file; /* Pointer to the file */ @@ -108,47 +96,11 @@ typedef struct { void *buf; /* User buffer */ } H5L_trav_gv_t; -/* User data for path traversal routine for getting link value by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ - size_t size; /* Size of user buffer */ - - /* Out */ - void *buf; /* User buffer */ -} H5L_trav_gvbi_t; - /* User data for path traversal routine for removing link */ typedef struct { hid_t dxpl_id; /* DXPL to use in callback */ } H5L_trav_rm_t; -/* User data for path traversal routine for removing link by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - hid_t dxpl_id; /* DXPL to use in callback */ -} H5L_trav_rmbi_t; - -/* User data for path traversal routine for getting name by index */ -typedef struct { - /* In */ - H5_index_t idx_type; /* Index to use */ - H5_iter_order_t order; /* Order to iterate in index */ - hsize_t n; /* Offset of link within index */ - size_t size; /* Size of name buffer */ - hid_t dxpl_id; /* DXPL to use in callback */ - - /* Out */ - char *name; /* Buffer to return name to user */ - ssize_t name_len; /* Length of full name */ -} H5L_trav_gnbi_t; - /********************/ /* Local Prototypes */ /********************/ @@ -185,8 +137,6 @@ static herr_t H5L__exists_final_cb(H5G_loc_t *grp_loc/*in*/, const char *name, static herr_t H5L__exists_inter_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); -static htri_t H5L__exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, - hid_t dxpl_id); static herr_t H5L_get_info_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, H5G_loc_t *obj_loc, void *_udata/*in,out*/, H5G_own_loc_t *own_loc/*out*/); @@ -866,17 +816,17 @@ H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id) /* Check arguments */ if(H5G_loc(loc_id, &loc)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if(!name || !*name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name specified") /* Verify access property list and get correct dxpl */ if(H5P_verify_apl_and_dxpl(&lapl_id, H5P_CLS_LACC, &dxpl_id, loc_id, FALSE) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTSET, FAIL, "can't set access and transfer property lists") /* Check for the existence of the link */ - if((ret_value = H5L__exists(&loc, name, lapl_id, dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") + if((ret_value = H5L_exists(&loc, name, lapl_id, dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to get link info") done: FUNC_LEAVE_API(ret_value) @@ -1181,24 +1131,20 @@ done: /*------------------------------------------------------------------------- - * Function: H5Literate + * Function: H5Literate * - * Purpose: Iterates over links in a group, with user callback routine, + * Purpose: Iterates over links in a group, with user callback routine, * according to the order within an index. * * Same pattern of behavior as H5Giterate. * - * Return: Success: The return value of the first operator that - * returns non-zero, or zero if all members were - * processed with no operator returning non-zero. + * Return: Success: The return value of the first operator that + * returns non-zero, or zero if all members were + * processed with no operator returning non-zero. * - * Failure: Negative if something goes wrong within the - * library, or the negative value returned by one - * of the operators. - * - * - * Programmer: Quincey Koziol - * Thursday, November 16, 2006 + * Failure: Negative if something goes wrong within the + * library, or the negative value returned by one + * of the operators. * *------------------------------------------------------------------------- */ @@ -1206,25 +1152,25 @@ herr_t H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate_t op, void *op_data) { - H5I_type_t id_type; /* Type of ID */ - H5G_link_iterate_t lnk_op; /* Link operator */ - hsize_t last_lnk; /* Index of last object looked at */ - hsize_t idx; /* Internal location to hold index */ - herr_t ret_value; /* Return value */ + H5I_type_t id_type; /* Type of ID */ + H5G_link_iterate_t lnk_op; /* Link operator */ + hsize_t last_lnk; /* Index of last object looked at */ + hsize_t idx; /* Internal location to hold index */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE6("e", "iIiIo*hx*x", grp_id, idx_type, order, idx_p, op, op_data); /* Check arguments */ id_type = H5I_get_type(grp_id); - if(!(H5I_GROUP == id_type || H5I_FILE == id_type)) + if (!(H5I_GROUP == id_type || H5I_FILE == id_type)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument") - if(idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") - if(order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") - if(!op) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") + if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified") + if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified") + if (!op) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no operator specified") /* Set up iteration beginning/end info */ idx = (idx_p == NULL ? 0 : *idx_p); @@ -1235,8 +1181,8 @@ H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, lnk_op.op_func.op_new = op; /* Iterate over the links */ - if((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) - HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") + if ((ret_value = H5G_iterate(grp_id, ".", idx_type, order, idx, &last_lnk, &lnk_op, op_data, H5P_DEFAULT, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "link iteration failed") /* Set the index we stopped at */ if(idx_p) @@ -2930,7 +2876,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5L__exists + * Function: H5L_exists * * Purpose: Returns whether a link exists in a group * @@ -2944,8 +2890,8 @@ done: * *------------------------------------------------------------------------- */ -static htri_t -H5L__exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) +htri_t +H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) { H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ @@ -2966,7 +2912,7 @@ H5L__exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5L__exists() */ +} /* H5L_exists() */ /*------------------------------------------------------------------------- diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index dd243a6..8a2bd34 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -48,6 +48,54 @@ /* Library Private Typedefs */ /****************************/ +/* User data for path traversal routine for getting link value by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + hid_t dxpl_id; /* DXPL to use in callback */ + size_t size; /* Size of user buffer */ + + /* Out */ + void *buf; /* User buffer */ +} H5L_trav_gvbi_t; + +/* User data for path traversal routine for getting link info by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + hid_t dxpl_id; /* DXPL to use in callback */ + + /* Out */ + H5L_info_t *linfo; /* Buffer to return to user */ +} H5L_trav_gibi_t; + +/* User data for path traversal routine for getting name by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + size_t size; /* Size of name buffer */ + hid_t dxpl_id; /* DXPL to use in callback */ + + /* Out */ + char *name; /* Buffer to return name to user */ + ssize_t name_len; /* Length of full name */ +} H5L_trav_gnbi_t; + +/* User data for path traversal routine for removing link by index */ +typedef struct { + /* In */ + H5_index_t idx_type; /* Index to use */ + H5_iter_order_t order; /* Order to iterate in index */ + hsize_t n; /* Offset of link within index */ + hid_t dxpl_id; /* DXPL to use in callback */ +} H5L_trav_rmbi_t; + /* Structure for external link traversal callback property */ typedef struct H5L_elink_cb_t { H5L_elink_traverse_t func; @@ -81,6 +129,7 @@ H5_DLL herr_t H5L_move(H5G_loc_t *src_loc, const char *src_name, hid_t lcpl_id, hid_t lapl_id, hid_t dxpl_id); H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id); +H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linkbuf/*out*/, hid_t lapl_id, hid_t dxpl_id); H5_DLL herr_t H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, diff --git a/src/H5Opkg.h b/src/H5Opkg.h index b0c67d1..109d273 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -247,20 +247,20 @@ struct H5O_msg_class_t { }; struct H5O_mesg_t { - const H5O_msg_class_t *type; /*type of message */ - hbool_t dirty; /*raw out of date wrt native */ - uint8_t flags; /*message flags */ - H5O_msg_crt_idx_t crt_idx; /*message creation index */ - unsigned chunkno; /*chunk number for this mesg */ - void *native; /*native format message */ - uint8_t *raw; /*ptr to raw data */ - size_t raw_size; /*size with alignment */ + const H5O_msg_class_t *type; /* type of message */ + hbool_t dirty; /* raw out of date wrt native */ + uint8_t flags; /* message flags */ + H5O_msg_crt_idx_t crt_idx; /* message creation index */ + unsigned chunkno; /* chunk number for this mesg */ + void *native; /* native format message */ + uint8_t *raw; /* pointer to raw data */ + size_t raw_size; /* size with alignment */ }; /* Struct for storing information about "best" message to move to new chunk */ typedef struct H5O_msg_alloc_info_t { int msgno; /* Index in message array */ - unsigned id; /* Message type ID on disk */ + unsigned id; /* Message type ID on disk */ unsigned chunkno; /* Index in chunk array */ size_t gap_size; /* Size of any "gap" in the chunk immediately after message */ size_t null_size; /* Size of any null message in the chunk immediately after message */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index e87c148..4b74d8f 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -26,6 +26,7 @@ /* Early typedefs to avoid circular dependencies */ typedef struct H5O_t H5O_t; +typedef struct H5O_fill_t H5O_fill_t; /* Include the public header file for this API */ #include "H5Opublic.h" /* Object header functions */ @@ -308,7 +309,7 @@ typedef struct H5O_linfo_t { * message if it's shared. */ -typedef struct H5O_fill_t { +struct H5O_fill_t { H5O_shared_t sh_loc; /* Shared message info (must be first) */ unsigned version; /* Encoding version number */ @@ -318,7 +319,7 @@ typedef struct H5O_fill_t { H5D_alloc_time_t alloc_time; /* time to allocate space */ H5D_fill_time_t fill_time; /* time to write fill value */ hbool_t fill_defined; /* whether fill value is defined */ -} H5O_fill_t; +}; /* * Link message. diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 6beee6f..915aa38 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -389,8 +389,8 @@ static const unsigned H5F_def_page_buf_min_raw_perc_g = H5F_ACS_PAGE_BUFFER_MIN_ static herr_t H5P__facc_reg_prop(H5P_genclass_t *pclass) { - const H5FD_driver_prop_t def_driver_prop = H5F_ACS_FILE_DRV_DEF; /* Default VFL driver ID & info (initialized from a variable) */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5FD_driver_prop_t def_driver_prop = H5F_ACS_FILE_DRV_DEF; /* Default VFL driver ID & info (initialized from a variable) */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 12d1fd1..df6d2c3 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -11,10 +11,9 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Module Info: Operations on bit vectors. A bit vector is an array of bytes - * with the least-significant bits in the first byte. That is, - * the bytes are in little-endian order. +/* Module Info: Operations on bit vectors. A bit vector is an array of bytes + * with the least-significant bits in the first byte. That is, + * the bytes are in little-endian order. */ #include "H5Tmodule.h" /* This source code file is part of the H5T module */ @@ -29,14 +28,11 @@ /*------------------------------------------------------------------------- - * Function: H5T__bit_copy + * Function: H5T__bit_copy * - * Purpose: Copies bits from one vector to another. + * Purpose: Copies bits from one vector to another. * - * Return: void - * - * Programmer: Robb Matzke - * Wednesday, June 10, 1998 + * Return: void * *------------------------------------------------------------------------- */ @@ -50,8 +46,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, FUNC_ENTER_PACKAGE_NOERR - /* - * Normalize the offset to be a byte number and a bit offset within that + /* Normalize the offset to be a byte number and a bit offset within that * byte. */ s_idx = src_offset / 8; @@ -59,8 +54,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, src_offset %= 8; dst_offset %= 8; - /* - * Get things rolling. This means copying bits until we're aligned on a + /* Get things rolling. This means copying bits until we're aligned on a * source byte. This the following example, five bits are copied to the * destination. * @@ -75,30 +69,29 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * ...+---------------+---------------+ * dst[d_idx+1] dst[d_idx] */ - while(src_offset && size > 0) { - size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); - size_t mask = ((size_t)1 << nbits) - 1; - - dst[d_idx] &= (uint8_t)~(mask << dst_offset); - dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); - - src_offset += nbits; - if(src_offset >= 8) { - s_idx++; - src_offset %= 8; - } /* end if */ - - dst_offset += nbits; - if(dst_offset >= 8) { - d_idx++; - dst_offset %= 8; - } /* end if */ - - size -= nbits; - } /* end while */ - - /* - * The middle bits. We are aligned on a source byte which needs to be + while (src_offset && size > 0) { + size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; + + dst[d_idx] &= (uint8_t)~(mask << dst_offset); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); + + src_offset += nbits; + if (src_offset >= 8) { + s_idx++; + src_offset %= 8; + } + + dst_offset += nbits; + if (dst_offset >= 8) { + d_idx++; + dst_offset %= 8; + } + + size -= nbits; + } + + /* The middle bits. We are aligned on a source byte which needs to be * copied to two (or one in the degenerate case) destination bytes. * * src[s_idx] @@ -122,48 +115,48 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, mask_lo = ((size_t)1 << (8 - shift)) - 1; mask_hi = (~mask_lo) & 0xff; - for(/*void*/; size > 8; size -= 8, d_idx++, s_idx++) { - if(shift) { - dst[d_idx + 0] &= (uint8_t)(~(mask_lo << shift)); - dst[d_idx + 0] |= (uint8_t)((src[s_idx] & mask_lo) << shift); - dst[d_idx + 1] &= (uint8_t)(~(mask_hi >> (8 - shift))); - dst[d_idx + 1] |= (uint8_t)((src[s_idx] & mask_hi) >> (8 - shift)); - } /* end if */ + for (/*void*/; size > 8; size -= 8, d_idx++, s_idx++) { + if (shift) { + dst[d_idx + 0] &= (uint8_t)(~(mask_lo << shift)); + dst[d_idx + 0] |= (uint8_t)((src[s_idx] & mask_lo) << shift); + dst[d_idx + 1] &= (uint8_t)(~(mask_hi >> (8 - shift))); + dst[d_idx + 1] |= (uint8_t)((src[s_idx] & mask_hi) >> (8 - shift)); + } else - dst[d_idx] = src[s_idx]; - } /* end for */ + dst[d_idx] = src[s_idx]; + } /* Finish up */ - while(size > 0) { - size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset); - size_t mask = ((size_t)1 << nbits) - 1; + while (size > 0) { + size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; - dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); - dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); + dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); + dst[d_idx] = (uint8_t)(dst[d_idx] | (((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset)); - src_offset += nbits; - if(src_offset >= 8) { - s_idx++; - src_offset %= 8; - } /* end if */ + src_offset += nbits; + if (src_offset >= 8) { + s_idx++; + src_offset %= 8; + } - dst_offset += nbits; - if(dst_offset >= 8) { - d_idx++; - dst_offset %= 8; - } /* end if */ + dst_offset += nbits; + if (dst_offset >= 8) { + d_idx++; + dst_offset %= 8; + } - size -= nbits; - } /* end while */ + size -= nbits; + } FUNC_LEAVE_NOAPI_VOID } /* end H5T__bit_copy() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_shift + * Function: H5T__bit_shift * - * Purpose: Simulation of hardware shifting. Shifts a bit vector + * Purpose: Simulation of hardware shifting. Shifts a bit vector * in a way similar to shifting a variable value, like * value <<= 3, or value >>= 16. SHIFT_DIST is positive for * left shift, negative for right shift. The bit vector starts @@ -173,10 +166,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * For example, if we have a bit sequence 00011100, offset=2, * size=3, shift_dist=2, the result will be 00010000. * - * Return: void - * - * Programmer: Raymond Lu - * Monday, April 12, 2004 + * Return: void * *------------------------------------------------------------------------- */ @@ -193,25 +183,25 @@ H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) HDassert(buf); HDassert(size); - if(shift_dist) { + if (shift_dist) { size_t abs_shift_dist = (size_t)ABS(shift_dist); - if(abs_shift_dist >= size) + if (abs_shift_dist >= size) H5T__bit_set(buf, offset, size, 0); else { size_t buf_size = (size / 8) + 1; /* Size of shift buffer needed */ uint8_t *shift_buf; /* Pointer to shift buffer */ /* Wrap the local buffer for serialized header info */ - if(NULL == (wb = H5WB_wrap(tmp_buf, sizeof(tmp_buf)))) + if (NULL == (wb = H5WB_wrap(tmp_buf, sizeof(tmp_buf)))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't wrap buffer") /* Get a pointer to a buffer that's large enough */ - if(NULL == (shift_buf = (uint8_t *)H5WB_actual(wb, buf_size))) + if (NULL == (shift_buf = (uint8_t *)H5WB_actual(wb, buf_size))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "can't get actual buffer") /* Shift vector by making copies */ - if(shift_dist > 0) { /* left shift */ + if (shift_dist > 0) { /* left shift */ /* Copy part to be shifted to a temporary buffer */ H5T__bit_copy(shift_buf, (size_t)0, buf, offset, size - abs_shift_dist); @@ -220,18 +210,18 @@ H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) /* Zero-set the left part*/ H5T__bit_set(buf, offset, abs_shift_dist, 0); - } /* end if */ + } else { /* right shift */ H5T__bit_copy(shift_buf, (size_t)0, buf, offset + abs_shift_dist, size - abs_shift_dist); H5T__bit_copy(buf, offset, shift_buf, (size_t)0, size - abs_shift_dist); H5T__bit_set(buf, offset + size - abs_shift_dist, abs_shift_dist, 0); - } /* end else */ + } } /* end else */ } /* end if */ done: /* Release resources */ - if(wb && H5WB_unwrap(wb) < 0) + if (wb && H5WB_unwrap(wb) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) @@ -239,27 +229,24 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__bit_get_d + * Function: H5T__bit_get_d * - * Purpose: Return a small bit sequence as a number. Bit vector starts + * Purpose: Return a small bit sequence as a number. Bit vector starts * at OFFSET and is SIZE bits long. * - * Return: Success: The bit sequence interpretted as an unsigned - * integer. - * - * Failure: 0 + * Return: Success: The bit sequence interpretted as an unsigned + * integer. * - * Programmer: Robb Matzke - * Tuesday, June 23, 1998 + * Failure: 0 * *------------------------------------------------------------------------- */ uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) { - uint64_t val = 0; - size_t i, hs; - uint64_t ret_value = 0; /* Return value */ + uint64_t val = 0; + size_t i, hs; + uint64_t ret_value = 0; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -271,11 +258,11 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) break; case H5T_ORDER_BE: - for(i = 0, hs = sizeof(val) / 2; i < hs; i++) { + for (i = 0, hs = sizeof(val) / 2; i < hs; i++) { uint8_t tmp = ((uint8_t*)&val)[i]; ((uint8_t*)&val)[i] = ((uint8_t*)&val)[sizeof(val) - (i + 1)]; ((uint8_t*)&val)[sizeof(val) - (i + 1)] = tmp; - } /* end for */ + } break; case H5T_ORDER_ERROR: @@ -285,7 +272,7 @@ H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) default: /* Unknown endianness. Bail out. */ HGOTO_DONE(UFAIL) - } /* end switch */ + } /* Set return value */ ret_value = val; @@ -296,14 +283,11 @@ done: /*------------------------------------------------------------------------- - * Function: H5T__bit_set_d + * Function: H5T__bit_set_d * - * Purpose: Sets part of a bit vector to the specified unsigned value. + * Purpose: Sets part of a bit vector to the specified unsigned value. * - * Return: void - * - * Programmer: Robb Matzke - * Wednesday, June 24, 1998 + * Return: void * *------------------------------------------------------------------------- */ @@ -321,11 +305,11 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) break; case H5T_ORDER_BE: - for(i = 0, hs = sizeof(val) / 2; i < hs; i++) { + for (i = 0, hs = sizeof(val) / 2; i < hs; i++) { uint8_t tmp = ((uint8_t *)&val)[i]; ((uint8_t *)&val)[i] = ((uint8_t *)&val)[sizeof(val) - (i + 1)]; ((uint8_t *)&val)[sizeof(val) - (i + 1)] = tmp; - } /* end for */ + } break; case H5T_ORDER_ERROR: @@ -334,7 +318,7 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) case H5T_ORDER_MIXED: default: HDabort(); - } /* end switch */ + } H5T__bit_copy(buf, offset, (uint8_t*)&val, (size_t)0, size); @@ -343,24 +327,19 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) /*------------------------------------------------------------------------- - * Function: H5T__bit_set + * Function: H5T__bit_set * - * Purpose: Sets or clears bits in a contiguous region of a vector - * beginning at bit OFFSET and continuing for SIZE bits. + * Purpose: Sets or clears bits in a contiguous region of a vector + * beginning at bit OFFSET and continuing for SIZE bits. * - * Return: void - * - * Programmer: Robb Matzke - * Wednesday, June 10, 1998 - * - * Modifications: + * Return: void * *------------------------------------------------------------------------- */ void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) { - int idx; + int idx; FUNC_ENTER_PACKAGE_NOERR @@ -369,54 +348,51 @@ H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) offset %= 8; /* The first partial byte */ - if(size && offset % 8) { - size_t nbits = MIN(size, 8 - offset); - unsigned mask = ((unsigned)1 << nbits) - 1; + if (size && offset % 8) { + size_t nbits = MIN(size, 8 - offset); + unsigned mask = ((unsigned)1 << nbits) - 1; - if(value) - buf[idx] = (uint8_t)(buf[idx] | (mask << offset)); - else - buf[idx] &= (uint8_t)(~(mask << offset)); + if (value) + buf[idx] = (uint8_t)(buf[idx] | (mask << offset)); + else + buf[idx] &= (uint8_t)(~(mask << offset)); - idx++; - size -= nbits; - } /* end if */ + idx++; + size -= nbits; + } /* The middle bytes */ - while(size >= 8) { - buf[idx++] = value ? 0xff : 0x00; - size -= 8; - } /* end while */ + while (size >= 8) { + buf[idx++] = value ? 0xff : 0x00; + size -= 8; + } /* The last partial byte */ - if(size) { - if(value) - buf[idx] |= (uint8_t)(((unsigned)1 << size) - 1); - else - buf[idx] &= (uint8_t)(~(((unsigned)1 << size) - 1)); - } /* end if */ + if (size) { + if (value) + buf[idx] |= (uint8_t)(((unsigned)1 << size) - 1); + else + buf[idx] &= (uint8_t)(~(((unsigned)1 << size) - 1)); + } FUNC_LEAVE_NOAPI_VOID } /* end H5T__bit_set() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_find + * Function: H5T__bit_find * - * Purpose: Finds the first bit with the specified VALUE within a region - * of a bit vector. The region begins at OFFSET and continues - * for SIZE bits, but the region can be searched from the least - * significat end toward the most significant end(H5T_BIT_LSB - * as DIRECTION), or from the most significant end to the least - * significant end(H5T_BIT_MSB as DIRECTION). + * Purpose: Finds the first bit with the specified VALUE within a region + * of a bit vector. The region begins at OFFSET and continues + * for SIZE bits, but the region can be searched from the least + * significat end toward the most significant end(H5T_BIT_LSB + * as DIRECTION), or from the most significant end to the least + * significant end(H5T_BIT_MSB as DIRECTION). * - * Return: Success: The position of the bit found, relative to - * the offset. + * Return: Success: The position of the bit found, relative to + * the offset. * - * Failure: -1 - * - * Programmer: Robb Matzke - * Wednesday, June 10, 1998 + * Failure: -1 * *------------------------------------------------------------------------- */ @@ -424,9 +400,9 @@ ssize_t H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value) { - ssize_t base = (ssize_t)offset; - ssize_t idx, i; - size_t iu; + ssize_t base = (ssize_t)offset; + ssize_t idx, i; + size_t iu; ssize_t ret_value = (-1); /* Return value */ /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ @@ -435,16 +411,16 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, /* Some functions call this with value=TRUE */ HDassert(TRUE == 1); - switch(direction) { + switch (direction) { case H5T_BIT_LSB: /* Calculate index */ idx = (ssize_t)(offset / 8); offset %= 8; /* Beginning */ - if(offset) { - for(iu = offset; iu < 8 && size > 0; iu++, size--) - if(value == (hbool_t)((buf[idx] >> iu) & 0x01)) + if (offset) { + for (iu = offset; iu < 8 && size > 0; iu++, size--) + if (value == (hbool_t)((buf[idx] >> iu) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)iu - base); offset = 0; @@ -452,10 +428,10 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* end if */ /* Middle */ - while(size >= 8) { - if((value ? 0x00 : 0xff) != buf[idx]) - for(i = 0; i < 8; i++) - if(value == (hbool_t)((buf[idx] >> i) & 0x01)) + while (size >= 8) { + if ((value ? 0x00 : 0xff) != buf[idx]) + for (i = 0; i < 8; i++) + if (value == (hbool_t)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); size -= 8; @@ -463,8 +439,8 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* end while */ /* End */ - for(i = 0; i < (ssize_t)size; i++) - if(value == (hbool_t)((buf[idx] >> i) & 0x01)) + for (i = 0; i < (ssize_t)size; i++) + if (value == (hbool_t)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); break; @@ -474,19 +450,19 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, offset %= 8; /* Beginning */ - if(size > 8 - offset && (offset + size) % 8) { - for(iu = (offset + size) % 8; iu > 0; --iu, --size) - if(value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) + if (size > 8 - offset && (offset + size) % 8) { + for (iu = (offset + size) % 8; iu > 0; --iu, --size) + if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base); --idx; } /* end if */ /* Middle */ - while(size >= 8) { - if((value ? 0x00 : 0xff) != buf[idx]) { - for(i = 7; i >= 0; --i) - if(value == (hbool_t)((buf[idx] >> i) & 0x01)) + while (size >= 8) { + if ((value ? 0x00 : 0xff) != buf[idx]) { + for (i = 7; i >= 0; --i) + if (value == (hbool_t)((buf[idx] >> i) & 0x01)) HGOTO_DONE(8 * idx + i - base); } /* end if */ @@ -495,11 +471,11 @@ H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } /* end while */ /* End */ - if(size > 0) { - for(iu = offset + size; iu > offset; --iu) - if(value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) + if (size > 0) { + for (iu = offset + size; iu > offset; --iu) + if (value == (hbool_t)((buf[idx] >> (iu - 1)) & 0x01)) HGOTO_DONE(8 * idx + (ssize_t)(iu - 1) - base); - } /* end if */ + } break; default: @@ -519,17 +495,14 @@ done: * * Return: The carry-out value. TRUE if overflows, FALSE otherwise. * - * Programmer: Robb Matzke - * Friday, June 26, 1998 - * *------------------------------------------------------------------------- */ hbool_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size) { - size_t idx = start / 8; - unsigned carry = 1; - unsigned acc, mask; + size_t idx = start / 8; + unsigned carry = 1; + unsigned acc, mask; /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR @@ -539,7 +512,7 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) start %= 8; /* The first partial byte */ - if(start) { + if (start) { if(size + start < 8) mask = ((unsigned)1 << size) - 1; else @@ -552,34 +525,34 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) size -= MIN(size, 8 - start); start = 0; idx++; - } /* end if */ + } /* The middle */ - while(carry && size >= 8) { + while (carry && size >= 8) { acc = buf[idx]; acc++; carry = acc & 0x100; buf[idx] = acc & 0xff; idx++; size -= 8; - } /* end while */ + } /* The last bits */ - if(carry && size > 0) { + if (carry && size > 0) { mask = ((unsigned)1 << size) - 1; acc = buf[idx] & mask; acc++; carry = acc & ((unsigned)1 << size); buf[idx] &= (uint8_t)(~mask); buf[idx] |= (uint8_t)(acc & mask); - } /* end if */ + } FUNC_LEAVE_NOAPI(carry ? TRUE : FALSE) } /* end H5T__bit_inc() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_dec + * Function: H5T__bit_dec * * Purpose: Decrement part of a bit field by substracting 1. The bit * field starts with bit position START and is SIZE bits long. @@ -587,18 +560,15 @@ H5T__bit_inc(uint8_t *buf, size_t start, size_t size) * Return: The "borrow-in" value. It's TRUE if underflows, FALSE * otherwise. * - * Programmer: Raymond Lu - * March 17, 2004 - * *------------------------------------------------------------------------- */ hbool_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size) { - size_t idx = start / 8; + size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp; - unsigned borrow = 0; + unsigned borrow = 0; /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ FUNC_ENTER_PACKAGE_NOERR @@ -607,71 +577,72 @@ H5T__bit_dec(uint8_t *buf, size_t start, size_t size) HDassert(size); /* The first partial byte */ - if((size + start - 1) / 8 > idx) { /*bit sequence doesn't end in the same byte as starts*/ + if ((size + start - 1) / 8 > idx) { + /* The bit sequence doesn't end in the same byte as starts */ + /* Example: a sequence like 11000100 and start = 3. We substract 00001000 from * it and get 10111100. If a sequence is 00000111, we do right shift for START * bits and get 00000000. So we need to borrow from higher byte when we substract * 00001000. */ - if(!(buf[idx] >> pos)) + if (!(buf[idx] >> pos)) borrow = 1; buf[idx] = (uint8_t)(buf[idx] - (1 << pos)); idx++; size -= (8 - pos); /* The middle bytes */ - while(borrow && size >= 8) { - if(buf[idx]) + while (borrow && size >= 8) { + if (buf[idx]) borrow = 0; buf[idx]--; idx++; size -= 8; - } /* end while */ + } /* The last partial byte */ - if(borrow && size > 0) { + if (borrow && size > 0) { /* Similar to the first byte case, where sequence ends in the same byte as starts */ tmp = buf[idx]; buf[idx]--; - if((buf[idx] >> size) != tmp >> size) + if ((buf[idx] >> size) != tmp >> size) buf[idx] = (uint8_t)(buf[idx] + (1 << size)); - } /* end if */ - } /* end if */ - else { /* bit sequence ends in the same byte as starts */ + } + } + else { + /* The bit sequence ends in the same byte as starts */ + /* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000 * and get 10111100. A bit is borrowed from 6th bit(buf[idx]>>6=00000010, tmp>>6=00000011, * not equal). We need to put this bit back by increment 1000000. */ tmp = buf[idx]; buf[idx] = (uint8_t)(buf[idx] - (1 << pos)); - if((buf[idx] >> (pos + size)) != tmp >> (pos + size)) { + if ((buf[idx] >> (pos + size)) != tmp >> (pos + size)) { buf[idx] = (uint8_t)(buf[idx] + (1 << (pos + size))); borrow = 1; - } /* end if */ - } /* end else */ + } + } FUNC_LEAVE_NOAPI(borrow ? TRUE : FALSE) } /* end H5T__bit_dec() */ /*------------------------------------------------------------------------- - * Function: H5T__bit_neg - * - * Purpose: negate part of a bit sequence. The bit - * field starts with bit position START and is SIZE bits long. + * Function: H5T__bit_neg * - * Return: void + * Purpose: Negate part of a bit sequence. The bit field starts with + * bit position START and is SIZE bits long. * - * Programmer: Raymond Lu - * March 19, 2004 + * Return: void * *------------------------------------------------------------------------- */ void H5T__bit_neg(uint8_t *buf, size_t start, size_t size) { - size_t idx = start / 8; + size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp[1]; @@ -695,17 +666,19 @@ H5T__bit_neg(uint8_t *buf, size_t start, size_t size) buf[idx] = (uint8_t)~(buf[idx]); idx++; size -= 8; - } /* end while */ + } /* The last partial byte */ if(size > 0) { /* Similar to the first byte case, where sequence ends in the same byte as starts */ tmp[0] = (uint8_t)~buf[idx]; H5T__bit_copy(&(buf[idx]), (size_t)0, tmp, (size_t)0, size); - } /* end if */ - } /* end if */ - else /* bit sequence ends in the same byte as starts */ + } + } + else { + /* bit sequence ends in the same byte as starts */ H5T__bit_copy(&(buf[idx]), pos, tmp, pos, size); + } FUNC_LEAVE_NOAPI_VOID } /* end H5T__bit_neg() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 84a997e..3f4b489 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -4079,13 +4079,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, sp = dp = (uint8_t*)buf; direction = 1; olap = nelmts; - } else if (src_p->shared->size>=dst_p->shared->size) { + } + else if (src_p->shared->size>=dst_p->shared->size) { double olap_d = HDceil((double)(dst_p->shared->size)/ (double)(src_p->shared->size-dst_p->shared->size)); olap = (size_t)olap_d; sp = dp = (uint8_t*)buf; direction = 1; - } else { + } + else { double olap_d = HDceil((double)(src_p->shared->size)/ (double)(dst_p->shared->size-src_p->shared->size)); olap = (size_t)olap_d; @@ -4127,7 +4129,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (direction>0) { s = sp; d = elmtno= nelmts ? dbuf : dp; } @@ -4136,7 +4139,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (d==dbuf) { HDassert((dp>=sp && dpshared->size) || (sp>=dp && spshared->size)); - } else { + } + else { HDassert((dpshared->size<=sp) || (spshared->size<=dp)); } @@ -4154,7 +4158,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s[src_p->shared->size-(i+1)] = s[i]; s[i] = tmp1; } - } else if (H5T_ORDER_VAX==src.order) { + } + else if (H5T_ORDER_VAX==src.order) { tsize = src_p->shared->size; HDassert(0 == tsize % 2); @@ -4187,7 +4192,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, FALSE); H5T__bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); goto padding; - } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, + } + else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -4210,16 +4216,19 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T__bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); - } else if(except_ret == H5T_CONV_HANDLED) { + } + else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; goto next; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; } - } else if (H5T_NORM_NONE==src.u.f.norm && H5T__bit_find (s, src.u.f.mpos, src.u.f.msize-1, + } + else if (H5T_NORM_NONE==src.u.f.norm && H5T__bit_find (s, src.u.f.mpos, src.u.f.msize-1, H5T_BIT_LSB, TRUE)<0 && H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. @@ -4246,11 +4255,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T__bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); - } else if(except_ret == H5T_CONV_HANDLED) { + } + else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; goto next; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; @@ -4259,7 +4270,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * still need to handle legacy VAX files so this code must * remain in place. */ - } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, + } + else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -4275,11 +4287,13 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, TRUE); - } else if(except_ret == H5T_CONV_HANDLED) { + } + else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; goto next; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") goto padding; @@ -4292,7 +4306,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ expo = (int64_t)H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); - if(expo==0) + if (expo==0) denormalized=TRUE; /* @@ -4302,16 +4316,19 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 1; mpos = src.u.f.mpos; mrsh = 0; - if(0 == expo || H5T_NORM_NONE == src.u.f.norm) { - if((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { + if (0 == expo || H5T_NORM_NONE == src.u.f.norm) { + if ((bitno = H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE)) > 0) { msize = (size_t)bitno; - } else if (0==bitno) { + } + else if (0==bitno) { msize = 1; H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); } - } else if (H5T_NORM_IMPLIED==src.u.f.norm) { + } + else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; - } else { + } + else { HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } @@ -4328,9 +4345,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (0==expo || H5T_NORM_NONE==src.u.f.norm) { HDassert(bitno>=0); expo -= (int64_t)((src.u.f.ebias - 1) + (src.u.f.msize - (size_t)bitno)); - } else if (H5T_NORM_IMPLIED==src.u.f.norm) { + } + else if (H5T_NORM_IMPLIED==src.u.f.norm) { expo -= (int64_t)src.u.f.ebias; - } else { + } + else { HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "normalization method not implemented yet") } @@ -4353,7 +4372,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, expo = 0; H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; - } else if (expo<=0) { + } + else if (expo<=0) { /* * The exponent is too small to fit in the exponent field, * but by shifting the mantissa to the right we can @@ -4363,7 +4383,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, mrsh += (size_t)(1 - expo); expo = 0; denormalized=TRUE; - } else if (expo>=expo_max) { + } + else if (expo>=expo_max) { /* * The exponent is too large to fit in the available region * or it results in the maximum possible value. Use positive @@ -4383,7 +4404,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, expo = expo_max; H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) { reverse = FALSE; @@ -4410,7 +4432,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(carry) implied = 2; } - } else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) + } + else if(H5T__bit_get_d(s, (mpos + (size_t)bitno) - 1, (size_t)1) && denormalized) /* For either source or destination, denormalized value doesn't increment carry.*/ H5T__bit_inc(s, mpos + (size_t)bitno - 1, 1 + msize - (size_t)bitno); } @@ -4422,13 +4445,16 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if (mrsh>dst.u.f.msize+1) { H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); - } else if (mrsh==dst.u.f.msize+1) { + } + else if (mrsh==dst.u.f.msize+1) { H5T__bit_set(d, dst.u.f.mpos+1, dst.u.f.msize-1, FALSE); H5T__bit_set(d, dst.u.f.mpos, (size_t)1, TRUE); - } else if (mrsh==dst.u.f.msize) { + } + else if (mrsh==dst.u.f.msize) { H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); H5T__bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), (hsize_t)implied); - } else { + } + else { if (mrsh>0) { H5T__bit_set(d, dst.u.f.mpos+dst.u.f.msize-mrsh, mrsh, FALSE); @@ -4439,7 +4465,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_copy(d, dst.u.f.mpos, s, (mpos+msize+mrsh-dst.u.f.msize), dst.u.f.msize-mrsh); - } else { + } + else { H5T__bit_copy(d, dst.u.f.mpos+dst.u.f.msize-(mrsh+msize), s, mpos, msize); H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize-(mrsh+msize), @@ -4469,7 +4496,8 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); - } else if(except_ret == H5T_CONV_ABORT) + } + else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) { reverse = FALSE; -- cgit v0.12 From 2e80fbbfcc5a15c296c16e4a4295ce77a9af6587 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 30 Nov 2017 17:25:39 -0800 Subject: Fixed an incorrect FUNC_ENTER macro. --- src/H5L.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5L.c b/src/H5L.c index afd033a..07f3cdb 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -2896,7 +2896,7 @@ H5L_exists(const H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id) H5L_trav_le_t udata; /* User data for traversal */ htri_t ret_value = FAIL; /* Return value */ - FUNC_ENTER_STATIC + FUNC_ENTER_NOAPI(FAIL) /* A path of "/" will always exist in a file */ if(0 == HDstrcmp(name, "/")) -- cgit v0.12 From e416d374935430e94ebc8d7f3917b2a0b1f82967 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 12:18:13 -0600 Subject: exported global variables for windows --- fortran/src/H5f90global.F90 | 4 +- fortran/src/hdf5_fortrandll.def.in | 329 +++++++++++++++++++++++++++++++++++++ 2 files changed, 331 insertions(+), 2 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 0247ad8..9054522 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -139,7 +139,7 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:NUM_NATIVE_INTEGER_KIND) :: H5T_NATIVE_INTEGER_KIND INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- - + ! ! H5generic flags declaration ! INTEGER :: H5_INDEX_UNKNOWN_F @@ -258,7 +258,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F=-1 + INTEGER :: H5FD_MEM_NTYPES_F INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 43a802c..3903c8b 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,6 +1,335 @@ EXPORTS ; H5GLOBAL +H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT +H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_INTEGER +H5GLOBAL_mp_H5T_NATIVE_REAL +H5GLOBAL_mp_H5T_NATIVE_DOUBLE +H5GLOBAL_mp_H5T_NATIVE_CHARACTER +H5GLOBAL_mp_H5T_STD_REF_OBJ +H5GLOBAL_mp_H5T_STD_REF_DSETREG +H5GLOBAL_mp_H5T_IEEE_F32BE +H5GLOBAL_mp_H5T_IEEE_F32LE +H5GLOBAL_mp_H5T_IEEE_F64BE +H5GLOBAL_mp_H5T_IEEE_F64LE +H5GLOBAL_mp_H5T_STD_I8BE +H5GLOBAL_mp_H5T_STD_I8LE +H5GLOBAL_mp_H5T_STD_I16BE +H5GLOBAL_mp_H5T_STD_I16LE +H5GLOBAL_mp_H5T_STD_I32BE +H5GLOBAL_mp_H5T_STD_I32LE +H5GLOBAL_mp_H5T_STD_I64BE +H5GLOBAL_mp_H5T_STD_I64LE +H5GLOBAL_mp_H5T_STD_U8BE +H5GLOBAL_mp_H5T_STD_U8LE +H5GLOBAL_mp_H5T_STD_U16BE +H5GLOBAL_mp_H5T_STD_U16LE +H5GLOBAL_mp_H5T_STD_U32BE +H5GLOBAL_mp_H5T_STD_U32LE +H5GLOBAL_mp_H5T_STD_U64BE +H5GLOBAL_mp_H5T_STD_U64LE +H5GLOBAL_mp_H5T_STRING +H5GLOBAL_mp_H5T_STD_B8BE +H5GLOBAL_mp_H5T_STD_B8LE +H5GLOBAL_mp_H5T_STD_B16BE +H5GLOBAL_mp_H5T_STD_B16LE +H5GLOBAL_mp_H5T_STD_B32BE +H5GLOBAL_mp_H5T_STD_B32LE +H5GLOBAL_mp_H5T_STD_B64BE +H5GLOBAL_mp_H5T_STD_B64LE +H5GLOBAL_mp_H5T_NATIVE_B8 +H5GLOBAL_mp_H5T_NATIVE_B16 +H5GLOBAL_mp_H5T_NATIVE_B32 +H5GLOBAL_mp_H5T_NATIVE_B64 +H5GLOBAL_mp_H5T_FORTRAN_S1 +H5GLOBAL_mp_H5T_C_S1 +H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 +; +; H5generic flags declaration +; +H5GLOBAL_mp_H5_INDEX_UNKNOWN_F +H5GLOBAL_mp_H5_INDEX_NAME_F +H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F +H5GLOBAL_mp_H5_INDEX_N_F +H5GLOBAL_mp_H5_ITER_UNKNOWN_F +H5GLOBAL_mp_H5_ITER_INC_F +H5GLOBAL_mp_H5_ITER_DEC_F +H5GLOBAL_mp_H5_ITER_NATIVE_F +H5GLOBAL_mp_H5_ITER_N_F +H5GLOBAL_mp_HADDR_UNDEF_F +; +; H5F flags declaration +; +H5GLOBAL_mp_H5F_ACC_RDWR_F +H5GLOBAL_mp_H5F_ACC_RDONLY_F +H5GLOBAL_mp_H5F_ACC_TRUNC_F +H5GLOBAL_mp_H5F_ACC_EXCL_F +H5GLOBAL_mp_H5F_ACC_DEBUG_F +H5GLOBAL_mp_H5F_SCOPE_LOCAL_F +H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F +H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F +H5GLOBAL_mp_H5F_CLOSE_WEAK_F +H5GLOBAL_mp_H5F_CLOSE_SEMI_F +H5GLOBAL_mp_H5F_CLOSE_STRONG_F +H5GLOBAL_mp_H5F_OBJ_FILE_F +H5GLOBAL_mp_H5F_OBJ_DATASET_F +H5GLOBAL_mp_H5F_OBJ_GROUP_F +H5GLOBAL_mp_H5F_OBJ_DATATYPE_F +H5GLOBAL_mp_H5F_OBJ_ALL_F +H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F +H5GLOBAL_mp_H5F_LIBVER_LATEST_F +H5GLOBAL_mp_H5F_UNLIMITED_F +; +; H5G flags declaration +; +H5GLOBAL_mp_H5G_UNKNOWN_F +H5GLOBAL_mp_H5G_GROUP_F +H5GLOBAL_mp_H5G_DATASET_F +H5GLOBAL_mp_H5G_TYPE_F +H5GLOBAL_mp_H5G_LINK_F +H5GLOBAL_mp_H5G_UDLINK_F +H5GLOBAL_mp_H5G_SAME_LOC_F +H5GLOBAL_mp_H5G_LINK_ERROR_F +H5GLOBAL_mp_H5G_LINK_HARD_F +H5GLOBAL_mp_H5G_LINK_SOFT_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F +H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F +; +; H5D flags declaration +; +H5GLOBAL_mp_H5D_COMPACT_F +H5GLOBAL_mp_H5D_CONTIGUOUS_F +H5GLOBAL_mp_H5D_CHUNKED_F +H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F +H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F +H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F +H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F +H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F +H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F +H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F +H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F +H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F +H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F +H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F +H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F +H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F +H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F +H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F +H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F +H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F +H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F +H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F +H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F +H5GLOBAL_mp_H5D_VDS_ERROR_F +H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F +H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F +H5GLOBAL_mp_H5D_VIRTUAL_F +; +; H5E flags declaration +; +H5GLOBAL_mp_H5E_DEFAULT_F +H5GLOBAL_mp_H5E_MAJOR_F +H5GLOBAL_mp_H5E_MINOR_F +H5GLOBAL_mp_H5E_WALK_UPWARD_F +H5GLOBAL_mp_H5E_WALK_DOWNWARD_F +; +; H5FD file drivers flags declaration +; +H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F +H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F +H5GLOBAL_mp_H5FD_MEM_NOLIST_F +H5GLOBAL_mp_H5FD_MEM_DEFAULT_F +H5GLOBAL_mp_H5FD_MEM_SUPER_F +H5GLOBAL_mp_H5FD_MEM_BTREE_F +H5GLOBAL_mp_H5FD_MEM_DRAW_F +H5GLOBAL_mp_H5FD_MEM_GHEAP_F +H5GLOBAL_mp_H5FD_MEM_LHEAP_F +H5GLOBAL_mp_H5FD_MEM_OHDR_F H5GLOBAL_mp_H5FD_MEM_NTYPES_F +H5GLOBAL_mp_H5FD_CORE_F +H5GLOBAL_mp_H5FD_FAMILY_F +H5GLOBAL_mp_H5FD_LOG_F +H5GLOBAL_mp_H5FD_MPIO_F +H5GLOBAL_mp_H5FD_MULTI_F +H5GLOBAL_mp_H5FD_SEC2_F +H5GLOBAL_mp_H5FD_STDIO_F +; +; H5I flags declaration +; +H5GLOBAL_mp_H5I_FILE_F +H5GLOBAL_mp_H5I_GROUP_F +H5GLOBAL_mp_H5I_DATATYPE_F +H5GLOBAL_mp_H5I_DATASPACE_F +H5GLOBAL_mp_H5I_DATASET_F +H5GLOBAL_mp_H5I_ATTR_F +H5GLOBAL_mp_H5I_BADID_F +; +; H5L flags declaration +; +H5GLOBAL_mp_H5L_TYPE_ERROR_F +H5GLOBAL_mp_H5L_TYPE_HARD_F +H5GLOBAL_mp_H5L_TYPE_SOFT_F +H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F +H5GLOBAL_mp_H5L_SAME_LOC_F +H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F +; +; H5O flags declaration +; +H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO +H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE +H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER +H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE +H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F +H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F +H5GLOBAL_mp_H5O_COPY_ALL_F +H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F +H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F +H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE +H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** +H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F +H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F +H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F +H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F +H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F +H5GLOBAL_mp_H5O_TYPE_GROUP_F +H5GLOBAL_mp_H5O_TYPE_DATASET_F +H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F +H5GLOBAL_mp_H5O_TYPE_NTYPES_F +; +; H5P flags declaration +; +H5GLOBAL_mp_H5P_FILE_CREATE_F +H5GLOBAL_mp_H5P_FILE_ACCESS_F +H5GLOBAL_mp_H5P_DATASET_CREATE_F +H5GLOBAL_mp_H5P_DATASET_XFER_F +H5GLOBAL_mp_H5P_FILE_MOUNT_F +H5GLOBAL_mp_H5P_DEFAULT_F +H5GLOBAL_mp_H5P_ROOT_F +H5GLOBAL_mp_H5P_OBJECT_CREATE_F +H5GLOBAL_mp_H5P_DATASET_ACCESS_F +H5GLOBAL_mp_H5P_GROUP_CREATE_F +H5GLOBAL_mp_H5P_GROUP_ACCESS_F +H5GLOBAL_mp_H5P_DATATYPE_CREATE_F +H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F +H5GLOBAL_mp_H5P_STRING_CREATE_F +H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F +H5GLOBAL_mp_H5P_OBJECT_COPY_F +H5GLOBAL_mp_H5P_LINK_CREATE_F +H5GLOBAL_mp_H5P_LINK_ACCESS_F +H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F +H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F +; +; H5R flags declaration +; +H5GLOBAL_mp_H5R_OBJECT_F +H5GLOBAL_mp_H5R_DATASET_REGION_F +; +; H5S flags declaration +; +H5GLOBAL_mp_H5S_UNLIMITED_F +H5GLOBAL_mp_H5S_ALL_F +H5GLOBAL_mp_H5S_SCALAR_F +H5GLOBAL_mp_H5S_SIMPLE_F +H5GLOBAL_mp_H5S_NULL_F +H5GLOBAL_mp_H5S_SELECT_NOOP_F +H5GLOBAL_mp_H5S_SELECT_SET_F +H5GLOBAL_mp_H5S_SELECT_OR_F +H5GLOBAL_mp_H5S_SELECT_AND_F +H5GLOBAL_mp_H5S_SELECT_XOR_F +H5GLOBAL_mp_H5S_SELECT_NOTB_F +H5GLOBAL_mp_H5S_SELECT_NOTA_F +H5GLOBAL_mp_H5S_SELECT_APPEND_F +H5GLOBAL_mp_H5S_SELECT_PREPEND_F +H5GLOBAL_mp_H5S_SELECT_INVALID_F +H5GLOBAL_mp_H5S_SEL_ERROR_F +H5GLOBAL_mp_H5S_SEL_NONE_F +H5GLOBAL_mp_H5S_SEL_POINTS_F +H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F +H5GLOBAL_mp_H5S_SEL_ALL_F +; +; H5T flags declaration +; +H5GLOBAL_mp_H5T_NO_CLASS_F +H5GLOBAL_mp_H5T_INTEGER_F +H5GLOBAL_mp_H5T_FLOAT_F +H5GLOBAL_mp_H5T_TIME_F +H5GLOBAL_mp_H5T_STRING_F +H5GLOBAL_mp_H5T_BITFIELD_F +H5GLOBAL_mp_H5T_OPAQUE_F +H5GLOBAL_mp_H5T_COMPOUND_F +H5GLOBAL_mp_H5T_REFERENCE_F +H5GLOBAL_mp_H5T_ENUM_F +H5GLOBAL_mp_H5T_VLEN_F +H5GLOBAL_mp_H5T_ARRAY_F +H5GLOBAL_mp_H5T_ORDER_LE_F +H5GLOBAL_mp_H5T_ORDER_BE_F +H5GLOBAL_mp_H5T_ORDER_VAX_F +H5GLOBAL_mp_H5T_ORDER_NONE_F +H5GLOBAL_mp_H5T_ORDER_MIXED_F +H5GLOBAL_mp_H5T_PAD_ZERO_F +H5GLOBAL_mp_H5T_PAD_ONE_F +H5GLOBAL_mp_H5T_PAD_BACKGROUND_F +H5GLOBAL_mp_H5T_PAD_ERROR_F +H5GLOBAL_mp_H5T_SGN_NONE_F +H5GLOBAL_mp_H5T_SGN_2_F +H5GLOBAL_mp_H5T_SGN_ERROR_F +H5GLOBAL_mp_H5T_NORM_IMPLIED_F +H5GLOBAL_mp_H5T_NORM_MSBSET_F +H5GLOBAL_mp_H5T_NORM_NONE_F +H5GLOBAL_mp_H5T_CSET_ASCII_F +H5GLOBAL_mp_H5T_CSET_UTF8_F +H5GLOBAL_mp_H5T_STR_NULLTERM_F +H5GLOBAL_mp_H5T_STR_NULLPAD_F +H5GLOBAL_mp_H5T_STR_SPACEPAD_F +H5GLOBAL_mp_H5T_STR_ERROR_F +H5GLOBAL_mp_H5T_DIR_ASCEND_F +H5GLOBAL_mp_H5T_DIR_DESCEND_F +; +; H5Z flags declaration +; +H5GLOBAL_mp_H5Z_FILTER_ERROR_F +H5GLOBAL_mp_H5Z_FILTER_NONE_F +H5GLOBAL_mp_H5Z_FILTER_ALL_F +H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F +H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F +H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F +H5GLOBAL_mp_H5Z_FILTER_SZIP_F +H5GLOBAL_mp_H5Z_ERROR_EDC_F +H5GLOBAL_mp_H5Z_DISABLE_EDC_F +H5GLOBAL_mp_H5Z_ENABLE_EDC_F +H5GLOBAL_mp_H5Z_NO_EDC_F +H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F +H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F +H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F +H5GLOBAL_mp_H5Z_FILTER_NBIT_F +H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F +H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F +H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F +H5GLOBAL_mp_H5Z_SO_INT_F +H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F +; +; H5 Library flags declaration +; +H5GLOBAL_mp_H5_SZIP_EC_OM_F +H5GLOBAL_mp_H5_SZIP_NN_OM_F +; +; PROCEDURES +; -------------- +; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From e33d677636b860f8f6b95c0ee3736395541a2610 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 4 Dec 2017 12:21:12 -0600 Subject: Various code cleanup Description: - Replaced H5Location::exists with H5Location::nameExists and marked H5Location::exists as deprecated. - Miscellaneous test cleanup for consistency. Platforms tested: Linux/32 2.6 (jam) Linux/64 (jelly) Darwin (osx1010test) --- c++/src/H5DataType.cpp | 2 +- c++/src/H5DataType.h | 11 +- c++/src/H5IntType.cpp | 2 +- c++/src/H5Location.cpp | 44 ++++++- c++/src/H5Location.h | 5 + c++/test/dsets.cpp | 70 +++-------- c++/test/h5cpputil.cpp | 9 -- c++/test/tarray.cpp | 58 ++++----- c++/test/tattr.cpp | 320 +++++++++++++++++++++++++++++-------------------- c++/test/tcompound.cpp | 34 +----- c++/test/tdspl.cpp | 22 +++- c++/test/tfile.cpp | 49 ++++---- c++/test/tfilter.cpp | 33 ++--- c++/test/th5s.cpp | 38 +++--- c++/test/titerate.cpp | 59 ++++----- c++/test/tlinks.cpp | 20 ++-- c++/test/tobject.cpp | 57 +++++---- c++/test/trefer.cpp | 116 +++++++++--------- c++/test/ttypes.cpp | 51 +++----- c++/test/tvlstr.cpp | 64 +++++----- 20 files changed, 521 insertions(+), 543 deletions(-) diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index d2bfbda..444a77a 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -899,7 +899,7 @@ hid_t DataType::p_opentype(const H5Location& loc, const char *dtype_name) const // Call C function to open the named datatype at this location hid_t ret_value = H5Topen2(loc.getId(), dtype_name, H5P_DEFAULT); if (ret_value < 0) - throw DataTypeIException("DataType constructor", "H5Topen2 failed"); + throw DataTypeIException(inMemFunc("constructor"), "H5Topen2 failed"); return(ret_value); } diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 5b8f924..906ccef 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -36,6 +36,10 @@ class H5_DLLCPP DataType : public H5Object { // Creates a copy of a predefined type DataType(const PredType& pred_type); + // Constructors to open a generic named datatype at a given location. + DataType(const H5Location& loc, const char* name); + DataType(const H5Location& loc, const H5std_string& name); + // Creates a datatype by way of dereference. DataType(const H5Location& loc, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); // DataType(const Attribute& attr, const void* ref, H5R_type_t ref_type = H5R_OBJECT, const PropList& plist = PropList::DEFAULT); @@ -124,13 +128,6 @@ class H5_DLLCPP DataType : public H5Object { ///\brief Returns this class name. virtual H5std_string fromClass () const { return("DataType"); } -// From CommonFG then H5Location - // Constructors to open a generic named datatype at a given location. - DataType(const H5Location& loc, const char* name); - DataType(const H5Location& loc, const H5std_string& name); - -// End of From CommonFG then H5Location - // Creates a copy of an existing DataType using its id DataType(const hid_t type_id); diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index ef4e1a9..f68e858 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -117,7 +117,7 @@ IntType::IntType(const H5Location& loc, const char *dtype_name) : AtomType() // Programmer Binh-Minh Ribler - Dec 2016 // Description // In 1.10.1, this constructor was introduced and may replace the -// existing function CommonFG::openArrayType(const H5std_string&) +// existing function CommonFG::openIntType(const H5std_string&) // to improve usability. // -BMR, Dec 2016 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.cpp b/c++/src/H5Location.cpp index a00e181..d0b5f9d 100644 --- a/c++/src/H5Location.cpp +++ b/c++/src/H5Location.cpp @@ -76,15 +76,15 @@ H5Location::H5Location() : IdComponent() {} #endif // DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- -// Function: H5Location::exists +// Function: H5Location::nameExists ///\brief Checks if a link of a given name exists in a location ///\param name - IN: Searched name ///\param lapl - IN: Link access property list ///\exception H5::LocationException -// Programmer Binh-Minh Ribler - Nov, 2016 // Modification +// Renamed from exists() in 1.10.2 -BMR //-------------------------------------------------------------------------- -bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const +bool H5Location::nameExists(const char* name, const LinkAccPropList& lapl) const { htri_t ret_value = H5Lexists(getId(), name, lapl.getId()); if (ret_value > 0) @@ -93,22 +93,54 @@ bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const return false; else // Raise exception when H5Lexists returns a negative value { - throw LocationException(inMemFunc("exists"), "H5Lexists failed"); + throw LocationException(inMemFunc("nameExists"), "H5Lexists failed"); } } //-------------------------------------------------------------------------- -// Function: H5Location::exists +// Function: H5Location::nameExists ///\brief Checks if a link of a given name exists in a location ///\param name - IN: Searched name ///\param lapl - IN: Link access property list ///\exception H5::LocationException +// Modification +// Renamed from exists() in 1.10.2 -BMR +//-------------------------------------------------------------------------- +bool H5Location::nameExists(const H5std_string& name, const LinkAccPropList& lapl) const +{ + return(nameExists(name.c_str(), lapl)); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::exists - Deprecated +// Purpose Checks if a link of a given name exists in a location +///\brief Deprecated in favor of nameExists +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException +// Programmer Binh-Minh Ribler - Nov, 2016 +// Modification +// Renamed to nameExists() in 1.10.2 -BMR +//-------------------------------------------------------------------------- +bool H5Location::exists(const char* name, const LinkAccPropList& lapl) const +{ + return(nameExists(name, lapl)); +} + +//-------------------------------------------------------------------------- +// Function: H5Location::exists - Deprecated +// Purpose Checks if a link of a given name exists in a location +///\brief Deprecated in favor of nameExists +///\param name - IN: Searched name +///\param lapl - IN: Link access property list +///\exception H5::LocationException // Programmer Binh-Minh Ribler - Dec, 2016 // Modification +// Renamed to nameExists() in 1.10.2 -BMR //-------------------------------------------------------------------------- bool H5Location::exists(const H5std_string& name, const LinkAccPropList& lapl) const { - return(exists(name.c_str(), lapl)); + return(nameExists(name.c_str(), lapl)); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Location.h b/c++/src/H5Location.h index 2631169..e5fbc84 100644 --- a/c++/src/H5Location.h +++ b/c++/src/H5Location.h @@ -31,6 +31,11 @@ namespace H5 { class H5_DLLCPP H5Location : public IdComponent { public: // Checks if a link of a given name exists in a location + bool nameExists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + bool nameExists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; + + // Checks if a link of a given name exists in a location + // Deprecated in favor of nameExists for better name. bool exists(const char* name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; bool exists(const H5std_string& name, const LinkAccPropList& lapl = LinkAccPropList::DEFAULT) const; diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index a765fb1..250ce90 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -66,13 +66,9 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_create( H5File& file) +static herr_t test_create( H5File& file) { SUBTEST("Create, open, close"); @@ -198,13 +194,9 @@ test_create( H5File& file) * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_simple_io( H5File& file) +static herr_t test_simple_io( H5File& file) { SUBTEST("Simple I/O"); @@ -284,13 +276,9 @@ test_simple_io( H5File& file) * * Programmer Binh-Minh Ribler * Thursday, March 22, 2012 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_datasize(FileAccPropList &fapl) +static herr_t test_datasize(FileAccPropList &fapl) { SUBTEST("DataSet::getInMemDataSize()"); try @@ -354,13 +342,9 @@ test_datasize(FileAccPropList &fapl) * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_tconv(H5File& file) +static herr_t test_tconv(H5File& file) { // Prepare buffers for input/output char *out=NULL, *in=NULL; @@ -437,6 +421,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; + /*------------------------------------------------------------------------- * Function: bogus * @@ -448,13 +433,9 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * * Programmer Robb Matzke * Tuesday, April 21, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static size_t -filter_bogus(unsigned int flags, size_t cd_nelmts, +static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[], size_t nbytes, size_t *buf_size, void **buf) // H5_ATTR_UNUSED variables caused warning, but taking them out caused failure. @@ -477,13 +458,9 @@ filter_bogus(unsigned int flags, size_t cd_nelmts, * * Programmer Binh-Minh Ribler (using C version) * Friday, January 5, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_compression(H5File& file) +static herr_t test_compression(H5File& file) { #ifndef H5_HAVE_FILTER_DEFLATE const char *not_supported; @@ -764,9 +741,10 @@ test_compression(H5File& file) * *------------------------------------------------------------------------- */ -const H5std_string DSET_NBIT_NAME("nbit_dataset"); +const H5std_string DSET_NBIT_NAME("nbit_dataset"); const hsize_t DIM1 = 2; const hsize_t DIM2 = 5; + static herr_t test_nbit_compression(H5File& file) { typedef struct { @@ -880,13 +858,9 @@ static herr_t test_nbit_compression(H5File& file) * * Programmer Binh-Minh Ribler (using C version) * Saturday, February 17, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_multiopen (H5File& file) +static herr_t test_multiopen (H5File& file) { SUBTEST("Multi-open with extending"); @@ -963,13 +937,9 @@ test_multiopen (H5File& file) * * Programmer Binh-Minh Ribler (using C version) * February 17, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ -static herr_t -test_types(H5File& file) +static herr_t test_types(H5File& file) { SUBTEST("Various datatypes"); @@ -1148,23 +1118,21 @@ test_types(H5File& file) /*------------------------------------------------------------------------- * Function: test_virtual * - * Purpose: Tests fixed, unlimited, and printf selections in the same + * Purpose Tests fixed, unlimited, and printf selections in the same * VDS * - * Return: Success: 0 + * Return Success: 0 * * Failure: number of errors * - * Programmer: Binh-Minh Ribler + * Programmer Binh-Minh Ribler * Friday, March 10, 2017 * - * Modifications: - * *------------------------------------------------------------------------- */ const int RANK = 2; -static herr_t -test_virtual() + +static herr_t test_virtual() { SUBTEST("DSetCreatPropList::setVirtual"); @@ -1293,17 +1261,15 @@ void test_dset() cleanup_dsets(); } // test_dset + /*------------------------------------------------------------------------- * Function: cleanup_dsets * * Purpose Cleanup temporary test files * - * Return none + * Return None * * Programmer (use C version) - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index f0c403c..f271eed 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -47,9 +47,6 @@ using namespace H5; * * Programmer Binh-Minh Ribler (using C code segment for reporting tests) * Friday, February 6, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ int test_report( int nerrors, const H5std_string& testname ) @@ -135,9 +132,6 @@ void issue_fail_msg(const char* where, int line, const char* file_name, * * Programmer Binh-Minh Ribler (using C code segment for checking values) * Friday, February 6, 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ int check_values (hsize_t i, hsize_t j, int apoint, int acheck) @@ -191,9 +185,6 @@ void check_values(const char *value, const char* msg, int line, const char* file * * Programmer Binh-Minh Ribler * May 2, 2010 - * - * Modifications: - * *------------------------------------------------------------------------- */ void verify_val(const char* x, const char* value, const char* where, int line, const char* file_name) diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp index a1de9c5..6bd4ca6 100644 --- a/c++/test/tarray.cpp +++ b/c++/test/tarray.cpp @@ -53,13 +53,10 @@ typedef enum int_t { * * Purpose Tests 1-D array of compound datatypes (with array fields) * - * Return None. + * Return None * * Programmer Binh-Minh Ribler (using C version) * January, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_compound_array() @@ -280,35 +277,33 @@ static void test_array_compound_array() } // end test_array_compound_array() +/* + * Helper routine to demonstrate the issue in HDFFV-9562 + */ +H5::DataType getArr() +{ + hsize_t *dims = new hsize_t; + *dims = 5; + H5::ArrayType ret; + ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); + delete[] dims; + return ret; +} + /*------------------------------------------------------------------------- * Function: test_array_assignment * * Purpose Tests the operator= * - * Return None. + * Return None * * Programmer Binh-Minh Ribler (using C version) * March, 2016 * * Description: * Used user's sample code in HDFFV-9562 - * - * Modifications: - * *------------------------------------------------------------------------- */ -/* - * Helper routine to demonstrate the issue in HDFFV-9562 - */ -H5::DataType getArr() -{ - hsize_t *dims = new hsize_t; - *dims = 5; - H5::ArrayType ret; - ret = H5::ArrayType(H5::PredType::NATIVE_INT, 1, dims); - delete[] dims; - return ret; } - static void test_array_assignment() { hsize_t sdims1[] = {SPACE1_DIM1}; @@ -359,13 +354,10 @@ static void test_array_assignment() * * Purpose Tests getting array information using the const methods. * - * Return None. + * Return None * * Programmer Binh-Minh Ribler * April, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_array_info() @@ -477,11 +469,14 @@ static void test_array_info() } // end test_array_info() -/**************************************************************** -** -** test_array(): Main datatypes testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_array + * + * Purpose Main datatypes testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_array() { @@ -505,13 +500,10 @@ void test_array() * * Purpose Cleanup temporary test files * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * January, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index d1a0d67..5aa4bf5 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -101,12 +101,15 @@ float attr_data5 = (float)-5.123; // Test data for 5th attribute const H5std_string ATTR1A_NAME("Attr1_a"); int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; -/**************************************************************** -** -** test_attr_basic_write(): Test basic write attribute. -** Tests integer attributes on both datasets and groups -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_basic_write + * + * Purpose Test basic write attribute on both datasets and groups. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_basic_write() { hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; @@ -233,29 +236,34 @@ static void test_attr_basic_write() } } // test_attr_basic_write() -/**************************************************************** -** -** test_attr_getname(): Test getting attribute name functions. -** -** Test these functions: -** A. ssize_t Attribute::getName(char* attr_name, size_t buf_size) -** 1. With arbitrary buf_size that is larger than the name size -** 2. With arbitrary buf_size that is smaller than the name's length. -** 3. With a buf_size that equals the name's length. -** -** B. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) -** 1. With buffer smaller than the actual name -** 2. Same test but with retiring overloaded function -** ssize_t Attribute::getName(size_t buf_size, H5std_string& attr_name) -** -** C. H5std_string Attribute::getName() -** -** D. H5std_string Attribute::getName(size_t len) -** -** E. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) -** With buffer size equals the name's length, i.e., buf_size=0 -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_getname + * + * Purpose Test getting attribute name. + * + * Description + * Test these functions: + * A. ssize_t Attribute::getName(char* attr_name, size_t buf_size) + * 1. With arbitrary buf_size that is larger than the name size + * 2. With arbitrary buf_size that is smaller than the name's length. + * 3. With a buf_size that equals the name's length. + * + * B. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) + * 1. With buffer smaller than the actual name + * 2. Same test but with retiring overloaded function + * ssize_t Attribute::getName(size_t buf_size, H5std_string& attr_name) + * + * C. H5std_string Attribute::getName() + * + * D. H5std_string Attribute::getName(size_t len) + * + * E. ssize_t Attribute::getName(H5std_string& attr_name, size_t buf_size) + * With buffer size equals the name's length, i.e., buf_size=0 + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_getname() { // Output message about test being performed @@ -368,11 +376,15 @@ static void test_attr_getname() } } // test_attr_getname() -/**************************************************************** -** -** test_attr_rename(): Test renaming attribute function. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_rename + * + * Purpose Test renaming attribute function. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_rename() { int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute @@ -479,11 +491,15 @@ static void test_attr_rename() } } // test_attr_rename() -/******************************************************************** -** -** test_attr_basic_read(): Test basic read attribute. -** -********************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_basic_read + * + * Purpose Test basic read attribute. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_basic_read() { hsize_t i, j; @@ -548,11 +564,15 @@ static void test_attr_basic_read() } } // test_attr_basic_read() -/**************************************************************** -** -** test_attr_compound_write(): Tests compound datatype attributes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_compound_write + * + * Purpose Test writing attributes with compound datatype. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_compound_write() { @@ -608,11 +628,15 @@ static void test_attr_compound_write() } } // test_attr_compound_write() -/**************************************************************** -** -** test_attr_compound_read(): Test basic H5A (attribute) code. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_compound_read + * + * Purpose Test reading attributes with compound datatype. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_compound_read() { hsize_t dims[ATTR_MAX_DIMS]; // Attribute dimensions @@ -760,11 +784,15 @@ static void test_attr_compound_read() } } // test_attr_compound_read() -/**************************************************************** -** -** test_attr_scalar_write(): Test scalar attribute writing functionality. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_scalar_write + * + * Purpose Test scalar attribute writing functionality. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_scalar_write() { // Output message about test being performed @@ -815,11 +843,15 @@ static void test_attr_scalar_write() } } // test_attr_scalar_write() -/**************************************************************** -** -** test_attr_scalar_read(): Test scalar attribute reading functionality. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_scalar_read + * + * Purpose Test scalar attribute reading functionality. + * + * Return None + *------------------------------------------------------------------------- + */ /* Epsilon for floating-point comparisons */ #define FP_EPSILON 0.000001F @@ -864,11 +896,15 @@ static void test_attr_scalar_read() } } // test_attr_scalar_read() -/**************************************************************** -** -** test_attr_mult_write(): Test multiple attributes -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_mult_write + * + * Purpose Test writing multiple attributes. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_mult_write() { // Output message about test being performed @@ -937,11 +973,15 @@ static void test_attr_mult_write() } } // test_attr_mult_write() -/**************************************************************** -** -** test_attr_mult_read(): Test reading multiple attributes. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_mult_read + * + * Purpose Test reading multiple attributes. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_mult_read() { int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute @@ -1128,12 +1168,15 @@ static void test_attr_mult_read() } } // test_attr_mult_read() -/**************************************************************** -** -** test_attr_delete(): Test deleting attribute from different -** hdf5 objects. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_delete + * + * Purpose Test deleting attribute from different hdf5 objects. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_delete() { H5std_string attr_name; // Buffer for attribute names @@ -1245,20 +1288,23 @@ static void test_attr_delete() } } // test_attr_delete() -/**************************************************************** -** -** test_attr_dtype_shared(): Test code for using shared datatypes -** in attributes. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_dtype_shared + * + * Purpose Test accessing attributes using shared datatypes. + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_dtype_shared() { - int data=8; /* Data to write */ - int rdata=0; /* Read read in */ + int data=8; // Data to write + int rdata=0; // Data read in #ifndef H5_NO_DEPRECATED_SYMBOLS - H5G_stat_t statbuf; /* Object's information */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - h5_stat_size_t filesize; /* Size of file after modifications */ + H5G_stat_t statbuf; // Object's information +#endif + h5_stat_size_t filesize; // Size of file after modifications // Output message about test being performed SUBTEST("Shared Datatypes with Attributes"); @@ -1294,7 +1340,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 1, "DataType::getObjinfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Create dataspace for dataset DataSpace dspace; @@ -1305,7 +1351,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 2, "H5File::getObjinfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Create attribute on dataset Attribute attr = dset.createAttribute(ATTR1_NAME,dtype,dspace); @@ -1314,7 +1360,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::getObjinfo", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Close attribute attr.close(); @@ -1326,7 +1372,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 2, "DataSet::getObjinfo after DataSet::removeAttr", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Create attribute on dataset attr = dset.createAttribute(ATTR1_NAME,dtype,dspace); @@ -1335,7 +1381,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::createAttribute", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Write data into the attribute attr.write(PredType::NATIVE_INT,&data); @@ -1372,7 +1418,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 3, "DataSet::openAttribute", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif } // end of second enclosing // Unlink the dataset @@ -1382,7 +1428,7 @@ static void test_attr_dtype_shared() // Check reference count on named datatype fid1.getObjinfo(TYPE1_NAME, statbuf); verify_val((int)statbuf.nlink, 1, "H5File::unlink", __LINE__, __FILE__); -#endif /* H5_NO_DEPRECATED_SYMBOLS */ +#endif // Unlink the named datatype fid1.unlink(TYPE1_NAME); @@ -1403,12 +1449,15 @@ static void test_attr_dtype_shared() } } // test_attr_dtype_shared() -/**************************************************************** -** -** test_string_attr(): Test read/write string attribute. -** Tests string attributes on groups. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_string_attr + * + * Purpose Test read/write string attribute. + * + * Return None + *------------------------------------------------------------------------- + */ /* Info for a string attribute */ const H5std_string ATTR1_FL_STR_NAME("String_attr 1"); const H5std_string ATTR2_FL_STR_NAME("String_attr 2"); @@ -1528,12 +1577,18 @@ static void test_string_attr() } } // test_string_attr() -/**************************************************************** -** -** test_attr_exists(): Test checking for attribute existence. -** (additional attrExists tests are in test_attr_rename()) -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_exists + * + * Purpose Test checking for attribute existence. + * + * Return None + * + * Note + * Additional attrExists tests are in test_attr_rename(). + *------------------------------------------------------------------------- + */ static void test_attr_exists() { // Output message about test being performed @@ -1577,12 +1632,15 @@ static void test_attr_exists() } } // test_attr_exists() -/**************************************************************** -** -** test_attr_dense_create(): Test phase change properties -** Tests "dense" attribute storage creation -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_dense_create + * + * Purpose Test phase change properties + * + * Return None + *------------------------------------------------------------------------- + */ const H5std_string FILE_CRTPROPS("tattr_crt_properties.h5"); const int NAME_BUF_SIZE = 1024; const unsigned MAX_COMPACT_DEF = 8; @@ -1686,12 +1744,15 @@ static void test_attr_dense_create(FileCreatPropList& fcpl, } } // test_attr_dense_create() -/**************************************************************** -** -** test_attr_corder_create_basic(): Test creation order properties -** Tests creating an object w/attribute creation order info -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr_corder_create_basic + * + * Purpose Test creation order properties + * + * Return None + *------------------------------------------------------------------------- + */ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, FileAccPropList& fapl) { @@ -1771,11 +1832,15 @@ static void test_attr_corder_create_basic(FileCreatPropList& fcpl, } } // test_attr_corder_create_basic() -/**************************************************************** -** -** test_attr(): Main attribute testing routine. -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_attr + * + * Purpose Main attribute testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_attr() { @@ -1858,19 +1923,14 @@ void test_attr() issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_attr() + /*------------------------------------------------------------------------- - * Function cleanup_attr + * Function: cleanup_attr * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer Albert Cheng - * July 2, 1998 - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 3af78c5..55d4744 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -49,9 +49,6 @@ typedef struct complex_t { * * Programmer Binh-Minh Ribler (using C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_1() @@ -86,9 +83,6 @@ static void test_compound_1() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_2() @@ -211,9 +205,6 @@ static void test_compound_2() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_3() @@ -333,9 +324,6 @@ static void test_compound_3() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_4() @@ -466,9 +454,6 @@ static void test_compound_4() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_5() @@ -569,9 +554,6 @@ static void test_compound_5() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_6() @@ -651,6 +633,7 @@ static void test_compound_6() } } // test_compound_6() + /*------------------------------------------------------------------------- * Function: test_compound_7 * @@ -661,9 +644,6 @@ static void test_compound_6() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_compound_7() @@ -717,6 +697,7 @@ static void test_compound_7() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } } // test_compound_7() + /*------------------------------------------------------------------------- * Function: test_compound_set_size @@ -727,12 +708,10 @@ static void test_compound_7() * * Programmer Binh-Minh Ribler (use partial C version test_ooo_order) * March, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string COMPFILE("tcompound_types.h5"); + static void test_compound_set_size() { typedef struct { @@ -807,6 +786,7 @@ static void test_compound_set_size() issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } } // test_compound_set_size() + /*------------------------------------------------------------------------- * Function: test_compound @@ -817,9 +797,6 @@ static void test_compound_set_size() * * Programmer Binh-Minh Ribler * January 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -845,9 +822,6 @@ void test_compound() * Purpose Cleanup temporary test files - nothing at this time. * * Return none - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp index 4aaa93a..438f385 100644 --- a/c++/test/tdspl.cpp +++ b/c++/test/tdspl.cpp @@ -111,11 +111,14 @@ static void test_transfplist() } -/**************************************************************** -** -** test_dsproplist(): Main dataset property list testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_dsproplist + * + * Purpose Main dataset property list testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_dsproplist() { @@ -126,6 +129,15 @@ void test_dsproplist() } // test_dsproplist() + +/*------------------------------------------------------------------------- + * Function: cleanup_dsproplist + * + * Purpose Cleanup temporary test files + * + * Return none + *------------------------------------------------------------------------- + */ extern "C" void cleanup_dsproplist() { diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index 51682a3..ba5b486 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -78,7 +78,6 @@ const H5std_string FILE4("tfile4.h5"); * passed to verify_val to 'long' as well. If problems * arises later, this will have to be specificly handled * with a special routine. - * *------------------------------------------------------------------------- */ static void test_file_create() @@ -285,7 +284,6 @@ static void test_file_create() * passed to verify_val to 'long' as well. If problems * arises later, this will have to be specificly handled * with a special routine. - * *------------------------------------------------------------------------- */ static void test_file_open() @@ -360,9 +358,6 @@ static void test_file_open() * * Programmer Raymond Lu * June, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_file_size() @@ -425,9 +420,6 @@ static void test_file_size() * * Programmer Binh-Minh Ribler * July, 2004 - * - * Modifications: - * *------------------------------------------------------------------------- */ const int RANK = 2; @@ -507,6 +499,15 @@ static void test_file_name() } // test_file_name() +/*------------------------------------------------------------------------- + * + * Function: test_file_attribute + * + * Purpose Test file attributes + * + * Return None + *------------------------------------------------------------------------- + */ const int RANK1 = 1; const int ATTR1_DIM1 = 3; const H5std_string FILE5("tfattrs.h5"); @@ -618,11 +619,6 @@ static void test_file_attribute() } // test_file_attribute() -const H5std_string FILE6("tfile5.h5"); -const H5std_string ROOTGROUP("/"); -const H5std_string GROUP1("/G1"); -const H5std_string SUBGROUP3("/G1/G3"); - /*------------------------------------------------------------------------- * Function: test_libver_bounds_real * @@ -634,9 +630,13 @@ const H5std_string SUBGROUP3("/G1/G3"); * * Programmer Binh-Minh Ribler (use C version) * March, 2015 - * *------------------------------------------------------------------------- */ +const H5std_string FILE6("tfile5.h5"); +const H5std_string ROOTGROUP("/"); +const H5std_string GROUP1("/G1"); +const H5std_string SUBGROUP3("/G1/G3"); + static void test_libver_bounds_real( H5F_libver_t libver_create, unsigned oh_vers_create, H5F_libver_t libver_mod, unsigned oh_vers_mod) @@ -707,6 +707,7 @@ static void test_libver_bounds_real( } /* end test_libver_bounds_real() */ + /*------------------------------------------------------------------------- * * Function: test_libver_bounds @@ -718,7 +719,6 @@ static void test_libver_bounds_real( * * Programmer Binh-Minh Ribler (use C version) * March 2015 - * *------------------------------------------------------------------------- */ static void test_libver_bounds() @@ -731,9 +731,10 @@ static void test_libver_bounds() test_libver_bounds_real(H5F_LIBVER_LATEST, H5O_VERSION_2, H5F_LIBVER_EARLIEST, H5O_VERSION_2); PASSED(); } /* end test_libver_bounds() */ + /*------------------------------------------------------------------------- - * Function: test_commonfg + * Function: test_commonfg * * Purpose Verify that H5File works as a root group. * @@ -741,7 +742,6 @@ static void test_libver_bounds() * * Programmer Binh-Minh Ribler (use C version) * March, 2015 - * *------------------------------------------------------------------------- */ static void test_commonfg() @@ -793,9 +793,8 @@ static void test_commonfg() } } /* end test_commonfg() */ - -const H5std_string FILE7("tfile7.h5"); + /*------------------------------------------------------------------------- * Function: test_file_info * @@ -807,11 +806,12 @@ const H5std_string FILE7("tfile7.h5"); * * Programmer Binh-Minh Ribler * February, 2017 - * *------------------------------------------------------------------------- */ +const H5std_string FILE7("tfile7.h5"); const hsize_t FSP_SIZE_DEF = 4096; const hsize_t FSP_SIZE512 = 512; + static void test_file_info() { // Output message about test being performed @@ -932,6 +932,7 @@ static void test_file_info() issue_fail_msg("test_filespace_info()", __LINE__, __FILE__, E.getCDetailMsg()); } } /* test_file_info() */ + /*------------------------------------------------------------------------- * Function: test_file @@ -942,9 +943,6 @@ static void test_file_info() * * Programmer Binh-Minh Ribler (use C version) * January 2001 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -970,11 +968,6 @@ void test_file() * Purpose Cleanup temporary test files * * Return none - * - * Programmer (use C version) - * - * Modifications: - * *------------------------------------------------------------------------- */ #ifdef __cplusplus diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 5de6590..5a493ac 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -65,6 +65,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ (H5Z_func_t)filter_bogus, /* The actual filter function */ }}; + /*------------------------------------------------------------------------- * Function: filter_bogus * @@ -76,9 +77,6 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ * * Programmer Robb Matzke * Tuesday, April 21, 1998 - * - * Modifications: - * *------------------------------------------------------------------------- */ static size_t @@ -92,6 +90,7 @@ filter_bogus(size_t nbytes) return nbytes; } + /*------------------------------------------------------------------------- * Function: test_null_filter * @@ -104,11 +103,8 @@ filter_bogus(size_t nbytes) * * Modifications: * Note: H5Z interface is not implemented yet. - * *------------------------------------------------------------------------- */ - -// Chunk dimensions const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; static void test_null_filter() @@ -144,6 +140,7 @@ static void test_null_filter() } } // test_null_filter + /*------------------------------------------------------------------------- * Function: test_szip_filter * @@ -156,11 +153,9 @@ static void test_null_filter() * * Modifications: * Note: H5Z interface is not implemented yet. - * *------------------------------------------------------------------------- */ - -const H5std_string DSET_SZIP_NAME("szipped dataset"); +const H5std_string DSET_SZIP_NAME("szipped dataset"); static void test_szip_filter(H5File& file1) { @@ -242,11 +237,14 @@ static void test_szip_filter(H5File& file1) } // test_szip_filter -/**************************************************************** -** -** test_filters(): Main routine for testing filters. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_filters + * + * Purpose Main routine for testing filters + * + * Return None + *------------------------------------------------------------------------- + */ const H5std_string FILE1("tfilters.h5"); extern "C" void test_filters() @@ -274,18 +272,13 @@ void test_filters() } } // test_filters() + /*------------------------------------------------------------------------- * Function: cleanup_filters * * Purpose Cleanup temporary test files * * Return none - * - * Programmer Quincey Koziol - * September 10, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index e99ce99..9c92b64 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -82,13 +82,13 @@ struct space4_struct { /* Null dataspace */ int space5_data = 7; + /*------------------------------------------------------------------------- - * * Function: test_h5s_basic * * Purpose Test basic H5S (dataspace) code * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -214,13 +214,13 @@ static void test_h5s_basic() } } // test_h5s_basic() + /*------------------------------------------------------------------------- - * * Function: test_h5s_scalar_write * * Purpose Test scalar H5S (dataspace) writing code * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -278,13 +278,13 @@ static void test_h5s_scalar_write() } } // test_h5s_scalar_write() + /*------------------------------------------------------------------------- - * * Function: test_h5s_scalar_read * * Purpose Test scalar H5S (dataspace) reading code * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -340,13 +340,13 @@ static void test_h5s_scalar_read() } // test_h5s_scalar_read() + /*------------------------------------------------------------------------- - * * Function: test_h5s_null * * Purpose Test null H5S (dataspace) code * - * Return none + * Return None * * Programmer Raymond Lu (using C version) * May 18, 2004 @@ -394,14 +394,14 @@ static void test_h5s_null() } } // test_h5s_null() + /*------------------------------------------------------------------------- - * * Function: test_h5s_compound_scalar_write * * Purpose Test scalar H5S (dataspace) writing for compound * datatypes * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -467,14 +467,14 @@ static void test_h5s_compound_scalar_write() } } // test_h5s_compound_scalar_write() + /*------------------------------------------------------------------------- - * * Function: test_h5s_compound_scalar_read * * Purpose Test scalar H5S (dataspace) reading for compound * datatypes * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 @@ -541,18 +541,16 @@ static void test_h5s_compound_scalar_read() } } // test_h5s_compound_scalar_read() + /*------------------------------------------------------------------------- - * * Function: test_h5s * * Purpose Main dataspace testing routine * - * Return none + * Return None * * Programmer Binh-Minh Ribler (using C version) * Mar 2001 - * - * Modifications: *------------------------------------------------------------------------- */ extern "C" @@ -575,13 +573,7 @@ void test_h5s() * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer Albert Cheng - * July 2, 1998 - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index 5c760f3..e77ebcc 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -78,23 +78,25 @@ typedef struct { int iter_strcmp(const void *s1, const void *s2); -/**************************************************************** -** -** iter_strcmp(): String comparison routine for qsort -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: iter_strcmp + * + * Purpose String comparison routine for qsort + *------------------------------------------------------------------------- + */ int iter_strcmp(const void *s1, const void *s2) { return(HDstrcmp(*(const char * const *)s1,*(const char * const *)s2)); } -/**************************************************************** -** -** liter_cb(): Custom link iteration callback routine. -** -****************************************************************/ -static herr_t -liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data) +/*------------------------------------------------------------------------- + * Function: liter_cb + * + * Purpose Custom link iteration callback routine + *------------------------------------------------------------------------- + */ +static herr_t liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data) { iter_info *info = (iter_info *)op_data; static int count = 0; @@ -123,6 +125,7 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_ } /* end switch */ } /* end liter_cb() */ + /*------------------------------------------------------------------------- * Function: test_iter_group * @@ -133,9 +136,6 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_ * * Programmer Binh-Minh Ribler * Friday, September 9, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_iter_group(FileAccPropList& fapl) @@ -348,13 +348,13 @@ static void test_iter_group(FileAccPropList& fapl) #endif } /* test_iter_group() */ - -/**************************************************************** -** -** printelems(): Open an attribute and verify that it has a -** the correct name -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: printelems + * + * Purpose Open an attribute and verify that it has a the correct name + *------------------------------------------------------------------------- + */ const H5std_string FILE_NAME("titerate.h5"); const H5std_string GRP_NAME("/Group_A"); const H5std_string FDATASET_NAME("file dset"); @@ -386,6 +386,7 @@ void printelems(const Group& group, const H5std_string& dsname, const H5std_stri } } + /*------------------------------------------------------------------------- * Function: test_HDFFV_9920 * @@ -393,9 +394,6 @@ void printelems(const Group& group, const H5std_string& dsname, const H5std_stri * * Programmer Binh-Minh Ribler * Friday, September 9, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_HDFFV_9920() @@ -444,7 +442,7 @@ static void test_HDFFV_9920() } } - + /*------------------------------------------------------------------------- * Function: test_iterate * @@ -455,9 +453,6 @@ static void test_HDFFV_9920() * * Programmer Binh-Minh Ribler * Tuesday, September 6, 2016 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -476,17 +471,13 @@ void test_iterate() } // test_iterate + /*------------------------------------------------------------------------- * Function: cleanup_iterate * * Purpose Cleanup temporary test files * * Return none - * - * Programmer (use C version) - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp index dc592b3..e348d64 100644 --- a/c++/test/tlinks.cpp +++ b/c++/test/tlinks.cpp @@ -328,9 +328,6 @@ static const char *FILENAME[] = { * * Programmer Binh-Minh Ribler * October 16, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_basic_links(hid_t fapl_id, hbool_t new_format) @@ -414,6 +411,11 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) H5File file(filename, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, fapl); // Verify link existence + if(file.nameExists("dset1", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "dset1 doesn't exist"); + if(file.nameExists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) + throw InvalidActionException("H5File::nameExists", "grp1/soft doesn't exist"); + // Deprecated if(file.exists("dset1", LinkAccPropList::DEFAULT) != TRUE) throw InvalidActionException("H5File::exists", "dset1 doesn't exist"); if(file.exists("grp1/soft", LinkAccPropList::DEFAULT) != TRUE) @@ -446,9 +448,6 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format) * * Programmer Binh-Minh Ribler * October 16, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_num_links(hid_t fapl_id, hbool_t new_format) @@ -483,6 +482,7 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) issue_fail_msg("test_num_links()", __LINE__, __FILE__, E.getCDetailMsg()); } } // test_num_links + /*------------------------------------------------------------------------- * Function: test_links @@ -493,7 +493,6 @@ static void test_num_links(hid_t fapl_id, hbool_t new_format) * * Programmer Binh-Minh Ribler * October 16, 2009 - * *------------------------------------------------------------------------- */ extern "C" @@ -671,18 +670,13 @@ void test_links() } + /*------------------------------------------------------------------------- * Function: cleanup_links * * Purpose Cleanup temporary test files * * Return none - * - * Programmer Binh-Minh Ribler - * October 16, 2009 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index d9f4075..9980ce0 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -45,6 +45,7 @@ const H5std_string DSET_IN_GRP1_PATH("/Top Group/Dataset_in_Group_1"); const H5std_string DSET_IN_GRP1_2("Dataset_in_Group_1.2"); const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_in_Group_1.2"); + /*------------------------------------------------------------------------- * Function: test_get_objname * @@ -65,9 +66,6 @@ const H5std_string DSET_IN_GRP1_2_PATH("/Top Group/Sub-Group 1.2/Dataset_ * * Programmer Binh-Minh Ribler * Friday, March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objname() @@ -153,6 +151,7 @@ static void test_get_objname() } } // test_get_objname + /*------------------------------------------------------------------------- * Function: test_existance * @@ -173,9 +172,6 @@ static void test_get_objname() * * Programmer Binh-Minh Ribler * Friday, March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_existance() @@ -187,18 +183,30 @@ static void test_existance() H5File file(FILE_OBJECTS, H5F_ACC_RDONLY); // Check if GROUP1 exists in the file - bool exists = file.exists(GROUP1); + bool exists = file.nameExists(GROUP1); + verify_val(exists, TRUE, "Group::nameExists GROUP1_1", __LINE__, __FILE__); + // Deprecated + exists = file.exists(GROUP1); + verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); // Open GROUP1 Group grp1 = file.openGroup(GROUP1); // Check if GROUP1_1 and GROUP1_2 exist in GROUP1 + exists = grp1.nameExists(GROUP1_1); + verify_val(exists, TRUE, "Group::nameExists GROUP1_1", __LINE__, __FILE__); + exists = grp1.nameExists(GROUP1_2); + verify_val(exists, TRUE, "Group::nameExists GROUP1_2", __LINE__, __FILE__); + // Deprecated exists = grp1.exists(GROUP1_1); verify_val(exists, TRUE, "Group::exists GROUP1_1", __LINE__, __FILE__); exists = grp1.exists(GROUP1_2); verify_val(exists, TRUE, "Group::exists GROUP1_2", __LINE__, __FILE__); // Check if DSET_IN_GRP1 exists in GROUP1 + exists = grp1.nameExists(DSET_IN_GRP1); + verify_val(exists, TRUE, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); + // Deprecated exists = grp1.exists(DSET_IN_GRP1); verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); @@ -206,14 +214,22 @@ static void test_existance() Group grp1_2 = grp1.openGroup(GROUP1_2); // Check if DSET_IN_GRP1_2 exists in GROUP1_2 + exists = grp1_2.nameExists(DSET_IN_GRP1_2); + verify_val(exists, TRUE, "Group::nameExists DSET_IN_GRP1_2", __LINE__, __FILE__); + // Deprecated exists = grp1_2.exists(DSET_IN_GRP1_2); verify_val(exists, TRUE, "Group::exists DSET_IN_GRP1_2", __LINE__, __FILE__); // Check if a dataset exists given dataset as location with full path name DataSet dset1 = file.openDataSet(DSET_IN_FILE); + exists = dset1.nameExists("/Top Group/Dataset_in_Group_1"); + verify_val(exists, TRUE, "Group::nameExists given dataset with full path name", __LINE__, __FILE__); + + exists = grp1_2.nameExists(DSET_IN_GRP1); + verify_val(exists, FALSE, "Group::nameExists DSET_IN_GRP1", __LINE__, __FILE__); + // Deprecated exists = dset1.exists("/Top Group/Dataset_in_Group_1"); verify_val(exists, TRUE, "Group::exists given dataset with full path name", __LINE__, __FILE__); - exists = grp1_2.exists(DSET_IN_GRP1); verify_val(exists, FALSE, "Group::exists DSET_IN_GRP1", __LINE__, __FILE__); @@ -229,6 +245,7 @@ static void test_existance() } } // test_existance + /*------------------------------------------------------------------------- * Function: test_get_objname_ontypes * @@ -239,9 +256,6 @@ static void test_existance() * * Programmer Binh-Minh Ribler * March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objname_ontypes() @@ -330,6 +344,7 @@ static void test_get_objname_ontypes() } } // test_get_objname_ontypes + /*------------------------------------------------------------------------- * Function: test_get_objtype * @@ -340,9 +355,6 @@ static void test_get_objname_ontypes() * * Programmer Binh-Minh Ribler * Friday, March 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_get_objtype() @@ -394,6 +406,7 @@ static void test_get_objtype() issue_fail_msg("test_get_objtype", __LINE__, __FILE__); } } // test_get_objtype + /*------------------------------------------------------------------------- * Function: test_open_object_header @@ -404,9 +417,6 @@ static void test_get_objtype() * * Programmer Binh-Minh Ribler (use C version) * March, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string GROUPNAME("group"); @@ -416,6 +426,7 @@ const H5std_string DSETNAME("dataset"); #define RANK 2 #define DIM0 5 #define DIM1 10 + static void test_open_object_header() { hsize_t dims[2]; @@ -513,6 +524,7 @@ static void test_open_object_header() issue_fail_msg("test_file_name()", __LINE__, __FILE__, E.getCDetailMsg()); } } /* test_open_object_header() */ + /*------------------------------------------------------------------------- * Function: test_objects @@ -524,9 +536,6 @@ static void test_open_object_header() * * Programmer Binh-Minh Ribler * Friday, Mar 4, 2014 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" @@ -543,17 +552,13 @@ void test_object() } // test_objects + /*------------------------------------------------------------------------- * Function: cleanup_objects * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer (use C version) - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index 9074154..bb09616 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -61,14 +61,16 @@ typedef struct s1_t { float c; } s1_t; -/**************************************************************** -** -** test_reference_params(): Test basic H5R (reference) parameters -** for correct processing -** -****************************************************************/ -static void -test_reference_params(void) + +/*------------------------------------------------------------------------- + * Function: test_reference_params + * + * Purpose Test basic H5R (reference) parameters for correct processing + * + * Return None + *------------------------------------------------------------------------- + */ +static void test_reference_params() { const char *write_comment = "Foo!"; /* Comments for group */ @@ -177,13 +179,17 @@ test_reference_params(void) delete file1; } /* test_reference_param() */ -/**************************************************************** -** -** test_reference_obj(): Test basic object reference functions -** to various kinds of objects -** -****************************************************************/ -static void test_reference_obj(void) + +/*------------------------------------------------------------------------- + * Function: test_reference_obj + * + * Purpose Test basic object reference functions to various kinds + * of objects + * + * Return None + *------------------------------------------------------------------------- + */ +static void test_reference_obj() { int i; // counting variables const H5std_string write_comment="Foo!"; // Comments for group @@ -369,14 +375,15 @@ static void test_reference_obj(void) delete file1; } // test_reference_obj() - -/**************************************************************** -** -** test_reference_group(): Test object reference functionality -** Tests for correct behavior of various routines on -** dereferenced group -** -****************************************************************/ + +/*------------------------------------------------------------------------- + * Function: test_reference_group + * + * Purpose Test object reference functionality on group. + * + * Return None + *------------------------------------------------------------------------- + */ #define GROUPNAME "/group" #define GROUPNAME2 "group2" #define GROUPNAME3 "group3" @@ -384,8 +391,7 @@ static void test_reference_obj(void) #define DSETNAME2 "dset2" #define NAME_SIZE 16 -static void -test_reference_group(void) +static void test_reference_group() { hobj_ref_t wref; /* Reference to write */ hobj_ref_t rref; /* Reference to read */ @@ -498,14 +504,16 @@ test_reference_group(void) delete file1; } /* test_reference_group() */ -/**************************************************************** -** -** test_reference_region_1D(): Test 1-D reference functionality -** Tests 1-D references to various kinds of objects -** -****************************************************************/ -static void -test_reference_region_1D(void) + +/*------------------------------------------------------------------------- + * Function: test_reference_region_1D + * + * Purpose Test 1-D reference functionality on various kinds of objects. + * + * Return None + *------------------------------------------------------------------------- + */ +static void test_reference_region_1D() { hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ @@ -787,26 +795,14 @@ test_reference_region_1D(void) } } /* test_reference_region_1D() */ - -/**************************************************************** -** -** test_reference_compat(): Test basic object reference functionality. -** Tests references to various kinds of objects using deprecated API. -** -****************************************************************/ -static void test_reference_compat(void) -{ - // Not yet -} // test_reference_compat() - - -/**************************************************************** -** -** test_reference(): Main reference testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * + * test_reference(): Main reference testing routine. + * + *------------------------------------------------------------------------- + */ extern "C" -void test_reference(void) +void test_reference() { // Output message about test being performed MESSAGE(5, ("Testing References\n")); @@ -815,18 +811,20 @@ void test_reference(void) test_reference_obj(); // Test basic object reference functionality test_reference_group(); // Test group reference functionality test_reference_region_1D(); // Test 1-D reference functionality - test_reference_compat(); // Tests deprecated reference routines (not yet) } // test_reference() -/**************************************************************** -** Function: cleanup_reference -** Purpose Cleanup temporary test files -** Return none -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: cleanup_reference + * + * Purpose Cleanup temporary test files + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" -void cleanup_reference(void) +void cleanup_reference() { HDremove(FILE1.c_str()); HDremove(FILE2.c_str()); diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index 3cf0920..a2bd561 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -87,6 +87,7 @@ typedef struct { long c; double d; } src_typ_t; + /*------------------------------------------------------------------------- * Function: test_classes @@ -97,9 +98,6 @@ typedef struct { * * Programmer Binh-Minh Ribler (using C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_classes() @@ -126,6 +124,7 @@ static void test_classes() issue_fail_msg("test_classes", __LINE__, __FILE__, E.getCDetailMsg()); } } + /*------------------------------------------------------------------------- * Function: test_copy @@ -136,9 +135,6 @@ static void test_classes() * * Programmer Binh-Minh Ribler (using C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_copy() @@ -192,9 +188,6 @@ static void test_copy() * * Programmer Binh-Minh Ribler (using C version) * August, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ typedef struct { /* Struct with atomic fields */ @@ -390,9 +383,6 @@ static void test_detect_type_class() * * Programmer Binh-Minh Ribler (use C version) * August, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ static void test_vltype() @@ -465,12 +455,8 @@ static void test_vltype() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ - const H5std_string CompT_NAME("Compound_type"); const H5std_string EnumT_NAME("Enum_type"); @@ -591,12 +577,10 @@ static void test_query() * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ const char* filename1 = "dtypes1.h5"; + static void test_transient () { static hsize_t ds_size[2] = {10, 20}; @@ -668,12 +652,10 @@ static void test_transient () * * Programmer Binh-Minh Ribler (use C version) * January, 2007 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string filename2("dtypes2.h5"); + static void test_named () { static hsize_t ds_size[2] = {10, 20}; @@ -831,14 +813,12 @@ static void test_named () * * Programmer Binh-Minh Ribler (using C version) * August, 2017 - * - * Modifications: - * *------------------------------------------------------------------------- */ const H5std_string filename3("encode_decode.h5"); const int ARRAY1_RANK = 1; const int ARRAY1_DIM = 10; + static void test_encode_decode() { short enum_val; @@ -1045,11 +1025,14 @@ static void test_encode_decode() } -/**************************************************************** -** -** test_types(): Main datatypes testing routine. -** -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_types + * + * Purpose Main datatypes testing routine + * + * Return None + *------------------------------------------------------------------------- + */ extern "C" void test_types() { @@ -1074,13 +1057,7 @@ void test_types() * * Purpose Cleanup temporary test files * - * Return none - * - * Programmer Quincey Koziol - * September 10, 1999 - * - * Modifications: - * + * Return None *------------------------------------------------------------------------- */ extern "C" diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index d5fea07..2421a87 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -40,16 +40,22 @@ const H5std_string FILENAME("tvlstr.h5"); const int SPACE1_RANK = 1; const hsize_t SPACE1_DIM1 = 4; -/**************************************************************** -** -** test_vlstr_alloc_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses malloc to -** allocate the memory and increments the amount of memory -** allocated. It is passed into setVlenMemManager. -** -** Note: exact copy from the C version. -** (Not used now) -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_vlstr_alloc_custom + * + * Purpose Test VL datatype custom memory allocation routines. + * + * Return None + * + * Description + * This routine just uses malloc to allocate the memory and + * increments the amount of memory allocated. It is passed + * into setVlenMemManager. + * + * Note: exact copy from the C version. + * (Not used now) + *------------------------------------------------------------------------- + */ #if 0 // not used now static void *test_vlstr_alloc_custom(size_t size, void *info) { @@ -74,16 +80,22 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) } #endif -/**************************************************************** -** -** test_vlstr_free_custom(): Test VL datatype custom memory -** allocation routines. This routine just uses free to -** release the memory and decrements the amount of memory -** allocated. It is passed into setVlenMemManager. -** -** Note: exact copy from the C version. -** (Not used now) -****************************************************************/ +/*------------------------------------------------------------------------- + * Function: test_vlstr_free_custom + * + * Purpose Test VL datatype custom memory de-allocation routines. + * + * Return None + * + * Description + * This routine just uses free to release the memory and + * decrements the amount of memory allocated. It is passed + * into setVlenMemManager. + * + * Note: exact copy from the C version. + * (Not used now) + *------------------------------------------------------------------------- + */ #if 0 // not used now static void test_vlstr_free_custom(void *_mem, void *info) { @@ -221,6 +233,7 @@ static void test_vlstring_dataset() *------------------------------------------------------------------------- */ const H5std_string DSSTRARR_NAME("StringArray_dset"); + static void test_vlstring_array_dataset() { const char *string_ds_array[SPACE1_DIM1]= { @@ -440,6 +453,7 @@ static void test_vlstrings_special() *------------------------------------------------------------------------- */ const H5std_string VLSTR_TYPE("vl_string_type"); + static void test_vlstring_type() { // Output message about test being performed. @@ -608,10 +622,7 @@ static void test_compact_vlstring() * *------------------------------------------------------------------------- */ -// String for writing to attribute static char *string_att_write=NULL; - -// Info for a string attribute const H5std_string ATTRSTR_NAME("String_attr"); const H5std_string ATTRSTR_DATA("String Attribute"); @@ -877,6 +888,7 @@ static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space, */ const H5std_string FILENAME2("tvlstr2.h5"); const int REWRITE_NDATASETS = 32; + static void test_vl_rewrite() { // Output message about test being performed @@ -987,12 +999,6 @@ void test_vlstrings() * Purpose Cleanup temporary test files * * Return none - * - * Programmer Quincey Koziol - * September 10, 1999 - * - * Modifications: - * *------------------------------------------------------------------------- */ extern "C" -- cgit v0.12 From 9e39def205fe470ef1527d7955ddbde6290be511 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 12:53:20 -0600 Subject: removed fortran comments --- fortran/src/hdf5_fortrandll.def.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 3903c8b..585602f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -182,10 +182,10 @@ H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F ; ; H5O flags declaration ; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F ! TO STAY UNDER THE +H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F +H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F +H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F +H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F H5GLOBAL_mp_H5O_COPY_ALL_F @@ -197,9 +197,9 @@ H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F ! 32 CHARACTER -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F ! VARIABLE -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F ! LENGTH *** +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F +H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F +H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -- cgit v0.12 From 6d658a946cc71994fc239b16ccc645b5e728998f Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines --- hl/fortran/src/H5DSff.F90 | 65 +++-------------------------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From fc089499ad407364bcefaa72ed06f7b4d579a387 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:38:38 -0600 Subject: added missing parameter --- fortran/src/hdf5_fortrandll.def.in | 1 + 1 file changed, 1 insertion(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 585602f..507c991 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -44,6 +44,7 @@ H5GLOBAL_mp_H5T_NATIVE_B32 H5GLOBAL_mp_H5T_NATIVE_B64 H5GLOBAL_mp_H5T_FORTRAN_S1 H5GLOBAL_mp_H5T_C_S1 +H5GLOBAL_mp_H5T_NATIVE_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 ; ; H5generic flags declaration -- cgit v0.12 From 1f3eb82bceacf5d08db02d68977de0d21f54d26f Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:55:51 -0600 Subject: added missing parameter --- fortran/src/hdf5_fortrandll.def.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 507c991..417778d 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,5 +1,7 @@ EXPORTS ; H5GLOBAL +H5GLOBAL_mp_H5_REAL_KIND +H5GLOBAL_mp_H5_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -- cgit v0.12 From 30807e1d80e9edd09cb5f2c75220bd82b761d595 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 16:35:13 -0600 Subject: removed parameters --- fortran/src/hdf5_fortrandll.def.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 417778d..507c991 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,7 +1,5 @@ EXPORTS ; H5GLOBAL -H5GLOBAL_mp_H5_REAL_KIND -H5GLOBAL_mp_H5_INTEGER_KIND H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -- cgit v0.12 From 17d148434fff055a2e22c6ac715c7ecff536a5c3 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 4 Dec 2017 16:57:37 -0600 Subject: Fixed typo. --- c++/test/tcompound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp index 55d4744..ec8adf0 100644 --- a/c++/test/tcompound.cpp +++ b/c++/test/tcompound.cpp @@ -821,7 +821,7 @@ void test_compound() * * Purpose Cleanup temporary test files - nothing at this time. * - * Return none + * Return None *------------------------------------------------------------------------- */ extern "C" -- cgit v0.12 From bd49f6460c3b4b3bafe5607f41af8b605d3044bb Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 5 Dec 2017 10:03:49 -0600 Subject: moved dll export to Module --- fortran/src/H5f90global.F90 | 342 ++++++++++++++++++++++++++++++++++++- fortran/src/hdf5_fortrandll.def.in | 332 ----------------------------------- 2 files changed, 336 insertions(+), 338 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 9054522..3f00d9a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -88,7 +88,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -142,6 +191,19 @@ MODULE H5GLOBAL ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +218,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +262,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +296,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +354,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +375,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +391,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -269,6 +433,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +453,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +471,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +531,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +578,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +638,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +714,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +760,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 507c991..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,336 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT -H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_INTEGER -H5GLOBAL_mp_H5T_NATIVE_REAL -H5GLOBAL_mp_H5T_NATIVE_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_CHARACTER -H5GLOBAL_mp_H5T_STD_REF_OBJ -H5GLOBAL_mp_H5T_STD_REF_DSETREG -H5GLOBAL_mp_H5T_IEEE_F32BE -H5GLOBAL_mp_H5T_IEEE_F32LE -H5GLOBAL_mp_H5T_IEEE_F64BE -H5GLOBAL_mp_H5T_IEEE_F64LE -H5GLOBAL_mp_H5T_STD_I8BE -H5GLOBAL_mp_H5T_STD_I8LE -H5GLOBAL_mp_H5T_STD_I16BE -H5GLOBAL_mp_H5T_STD_I16LE -H5GLOBAL_mp_H5T_STD_I32BE -H5GLOBAL_mp_H5T_STD_I32LE -H5GLOBAL_mp_H5T_STD_I64BE -H5GLOBAL_mp_H5T_STD_I64LE -H5GLOBAL_mp_H5T_STD_U8BE -H5GLOBAL_mp_H5T_STD_U8LE -H5GLOBAL_mp_H5T_STD_U16BE -H5GLOBAL_mp_H5T_STD_U16LE -H5GLOBAL_mp_H5T_STD_U32BE -H5GLOBAL_mp_H5T_STD_U32LE -H5GLOBAL_mp_H5T_STD_U64BE -H5GLOBAL_mp_H5T_STD_U64LE -H5GLOBAL_mp_H5T_STRING -H5GLOBAL_mp_H5T_STD_B8BE -H5GLOBAL_mp_H5T_STD_B8LE -H5GLOBAL_mp_H5T_STD_B16BE -H5GLOBAL_mp_H5T_STD_B16LE -H5GLOBAL_mp_H5T_STD_B32BE -H5GLOBAL_mp_H5T_STD_B32LE -H5GLOBAL_mp_H5T_STD_B64BE -H5GLOBAL_mp_H5T_STD_B64LE -H5GLOBAL_mp_H5T_NATIVE_B8 -H5GLOBAL_mp_H5T_NATIVE_B16 -H5GLOBAL_mp_H5T_NATIVE_B32 -H5GLOBAL_mp_H5T_NATIVE_B64 -H5GLOBAL_mp_H5T_FORTRAN_S1 -H5GLOBAL_mp_H5T_C_S1 -H5GLOBAL_mp_H5T_NATIVE_INTEGER_KIND -H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 -; -; H5generic flags declaration -; -H5GLOBAL_mp_H5_INDEX_UNKNOWN_F -H5GLOBAL_mp_H5_INDEX_NAME_F -H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F -H5GLOBAL_mp_H5_INDEX_N_F -H5GLOBAL_mp_H5_ITER_UNKNOWN_F -H5GLOBAL_mp_H5_ITER_INC_F -H5GLOBAL_mp_H5_ITER_DEC_F -H5GLOBAL_mp_H5_ITER_NATIVE_F -H5GLOBAL_mp_H5_ITER_N_F -H5GLOBAL_mp_HADDR_UNDEF_F -; -; H5F flags declaration -; -H5GLOBAL_mp_H5F_ACC_RDWR_F -H5GLOBAL_mp_H5F_ACC_RDONLY_F -H5GLOBAL_mp_H5F_ACC_TRUNC_F -H5GLOBAL_mp_H5F_ACC_EXCL_F -H5GLOBAL_mp_H5F_ACC_DEBUG_F -H5GLOBAL_mp_H5F_SCOPE_LOCAL_F -H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F -H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F -H5GLOBAL_mp_H5F_CLOSE_WEAK_F -H5GLOBAL_mp_H5F_CLOSE_SEMI_F -H5GLOBAL_mp_H5F_CLOSE_STRONG_F -H5GLOBAL_mp_H5F_OBJ_FILE_F -H5GLOBAL_mp_H5F_OBJ_DATASET_F -H5GLOBAL_mp_H5F_OBJ_GROUP_F -H5GLOBAL_mp_H5F_OBJ_DATATYPE_F -H5GLOBAL_mp_H5F_OBJ_ALL_F -H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F -H5GLOBAL_mp_H5F_LIBVER_LATEST_F -H5GLOBAL_mp_H5F_UNLIMITED_F -; -; H5G flags declaration -; -H5GLOBAL_mp_H5G_UNKNOWN_F -H5GLOBAL_mp_H5G_GROUP_F -H5GLOBAL_mp_H5G_DATASET_F -H5GLOBAL_mp_H5G_TYPE_F -H5GLOBAL_mp_H5G_LINK_F -H5GLOBAL_mp_H5G_UDLINK_F -H5GLOBAL_mp_H5G_SAME_LOC_F -H5GLOBAL_mp_H5G_LINK_ERROR_F -H5GLOBAL_mp_H5G_LINK_HARD_F -H5GLOBAL_mp_H5G_LINK_SOFT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F -; -; H5D flags declaration -; -H5GLOBAL_mp_H5D_COMPACT_F -H5GLOBAL_mp_H5D_CONTIGUOUS_F -H5GLOBAL_mp_H5D_CHUNKED_F -H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F -H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F -H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F -H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F -H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F -H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F -H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F -H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F -H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F -H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F -H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F -H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F -H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F -H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F -H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F -H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F -H5GLOBAL_mp_H5D_VDS_ERROR_F -H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F -H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F -H5GLOBAL_mp_H5D_VIRTUAL_F -; -; H5E flags declaration -; -H5GLOBAL_mp_H5E_DEFAULT_F -H5GLOBAL_mp_H5E_MAJOR_F -H5GLOBAL_mp_H5E_MINOR_F -H5GLOBAL_mp_H5E_WALK_UPWARD_F -H5GLOBAL_mp_H5E_WALK_DOWNWARD_F -; -; H5FD file drivers flags declaration -; -H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F -H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F -H5GLOBAL_mp_H5FD_MEM_NOLIST_F -H5GLOBAL_mp_H5FD_MEM_DEFAULT_F -H5GLOBAL_mp_H5FD_MEM_SUPER_F -H5GLOBAL_mp_H5FD_MEM_BTREE_F -H5GLOBAL_mp_H5FD_MEM_DRAW_F -H5GLOBAL_mp_H5FD_MEM_GHEAP_F -H5GLOBAL_mp_H5FD_MEM_LHEAP_F -H5GLOBAL_mp_H5FD_MEM_OHDR_F -H5GLOBAL_mp_H5FD_MEM_NTYPES_F -H5GLOBAL_mp_H5FD_CORE_F -H5GLOBAL_mp_H5FD_FAMILY_F -H5GLOBAL_mp_H5FD_LOG_F -H5GLOBAL_mp_H5FD_MPIO_F -H5GLOBAL_mp_H5FD_MULTI_F -H5GLOBAL_mp_H5FD_SEC2_F -H5GLOBAL_mp_H5FD_STDIO_F -; -; H5I flags declaration -; -H5GLOBAL_mp_H5I_FILE_F -H5GLOBAL_mp_H5I_GROUP_F -H5GLOBAL_mp_H5I_DATATYPE_F -H5GLOBAL_mp_H5I_DATASPACE_F -H5GLOBAL_mp_H5I_DATASET_F -H5GLOBAL_mp_H5I_ATTR_F -H5GLOBAL_mp_H5I_BADID_F -; -; H5L flags declaration -; -H5GLOBAL_mp_H5L_TYPE_ERROR_F -H5GLOBAL_mp_H5L_TYPE_HARD_F -H5GLOBAL_mp_H5L_TYPE_SOFT_F -H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F -H5GLOBAL_mp_H5L_SAME_LOC_F -H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F -; -; H5O flags declaration -; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F -H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F -H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F -H5GLOBAL_mp_H5O_COPY_ALL_F -H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F -H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F -H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F -H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F -H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F -H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5O_TYPE_GROUP_F -H5GLOBAL_mp_H5O_TYPE_DATASET_F -H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F -H5GLOBAL_mp_H5O_TYPE_NTYPES_F -; -; H5P flags declaration -; -H5GLOBAL_mp_H5P_FILE_CREATE_F -H5GLOBAL_mp_H5P_FILE_ACCESS_F -H5GLOBAL_mp_H5P_DATASET_CREATE_F -H5GLOBAL_mp_H5P_DATASET_XFER_F -H5GLOBAL_mp_H5P_FILE_MOUNT_F -H5GLOBAL_mp_H5P_DEFAULT_F -H5GLOBAL_mp_H5P_ROOT_F -H5GLOBAL_mp_H5P_OBJECT_CREATE_F -H5GLOBAL_mp_H5P_DATASET_ACCESS_F -H5GLOBAL_mp_H5P_GROUP_CREATE_F -H5GLOBAL_mp_H5P_GROUP_ACCESS_F -H5GLOBAL_mp_H5P_DATATYPE_CREATE_F -H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F -H5GLOBAL_mp_H5P_STRING_CREATE_F -H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F -H5GLOBAL_mp_H5P_OBJECT_COPY_F -H5GLOBAL_mp_H5P_LINK_CREATE_F -H5GLOBAL_mp_H5P_LINK_ACCESS_F -H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F -H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F -; -; H5R flags declaration -; -H5GLOBAL_mp_H5R_OBJECT_F -H5GLOBAL_mp_H5R_DATASET_REGION_F -; -; H5S flags declaration -; -H5GLOBAL_mp_H5S_UNLIMITED_F -H5GLOBAL_mp_H5S_ALL_F -H5GLOBAL_mp_H5S_SCALAR_F -H5GLOBAL_mp_H5S_SIMPLE_F -H5GLOBAL_mp_H5S_NULL_F -H5GLOBAL_mp_H5S_SELECT_NOOP_F -H5GLOBAL_mp_H5S_SELECT_SET_F -H5GLOBAL_mp_H5S_SELECT_OR_F -H5GLOBAL_mp_H5S_SELECT_AND_F -H5GLOBAL_mp_H5S_SELECT_XOR_F -H5GLOBAL_mp_H5S_SELECT_NOTB_F -H5GLOBAL_mp_H5S_SELECT_NOTA_F -H5GLOBAL_mp_H5S_SELECT_APPEND_F -H5GLOBAL_mp_H5S_SELECT_PREPEND_F -H5GLOBAL_mp_H5S_SELECT_INVALID_F -H5GLOBAL_mp_H5S_SEL_ERROR_F -H5GLOBAL_mp_H5S_SEL_NONE_F -H5GLOBAL_mp_H5S_SEL_POINTS_F -H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F -H5GLOBAL_mp_H5S_SEL_ALL_F -; -; H5T flags declaration -; -H5GLOBAL_mp_H5T_NO_CLASS_F -H5GLOBAL_mp_H5T_INTEGER_F -H5GLOBAL_mp_H5T_FLOAT_F -H5GLOBAL_mp_H5T_TIME_F -H5GLOBAL_mp_H5T_STRING_F -H5GLOBAL_mp_H5T_BITFIELD_F -H5GLOBAL_mp_H5T_OPAQUE_F -H5GLOBAL_mp_H5T_COMPOUND_F -H5GLOBAL_mp_H5T_REFERENCE_F -H5GLOBAL_mp_H5T_ENUM_F -H5GLOBAL_mp_H5T_VLEN_F -H5GLOBAL_mp_H5T_ARRAY_F -H5GLOBAL_mp_H5T_ORDER_LE_F -H5GLOBAL_mp_H5T_ORDER_BE_F -H5GLOBAL_mp_H5T_ORDER_VAX_F -H5GLOBAL_mp_H5T_ORDER_NONE_F -H5GLOBAL_mp_H5T_ORDER_MIXED_F -H5GLOBAL_mp_H5T_PAD_ZERO_F -H5GLOBAL_mp_H5T_PAD_ONE_F -H5GLOBAL_mp_H5T_PAD_BACKGROUND_F -H5GLOBAL_mp_H5T_PAD_ERROR_F -H5GLOBAL_mp_H5T_SGN_NONE_F -H5GLOBAL_mp_H5T_SGN_2_F -H5GLOBAL_mp_H5T_SGN_ERROR_F -H5GLOBAL_mp_H5T_NORM_IMPLIED_F -H5GLOBAL_mp_H5T_NORM_MSBSET_F -H5GLOBAL_mp_H5T_NORM_NONE_F -H5GLOBAL_mp_H5T_CSET_ASCII_F -H5GLOBAL_mp_H5T_CSET_UTF8_F -H5GLOBAL_mp_H5T_STR_NULLTERM_F -H5GLOBAL_mp_H5T_STR_NULLPAD_F -H5GLOBAL_mp_H5T_STR_SPACEPAD_F -H5GLOBAL_mp_H5T_STR_ERROR_F -H5GLOBAL_mp_H5T_DIR_ASCEND_F -H5GLOBAL_mp_H5T_DIR_DESCEND_F -; -; H5Z flags declaration -; -H5GLOBAL_mp_H5Z_FILTER_ERROR_F -H5GLOBAL_mp_H5Z_FILTER_NONE_F -H5GLOBAL_mp_H5Z_FILTER_ALL_F -H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F -H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F -H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F -H5GLOBAL_mp_H5Z_FILTER_SZIP_F -H5GLOBAL_mp_H5Z_ERROR_EDC_F -H5GLOBAL_mp_H5Z_DISABLE_EDC_F -H5GLOBAL_mp_H5Z_ENABLE_EDC_F -H5GLOBAL_mp_H5Z_NO_EDC_F -H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F -H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_NBIT_F -H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F -H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F -H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F -H5GLOBAL_mp_H5Z_SO_INT_F -H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F -; -; H5 Library flags declaration -; -H5GLOBAL_mp_H5_SZIP_EC_OM_F -H5GLOBAL_mp_H5_SZIP_NN_OM_F -; -; PROCEDURES -; -------------- -; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F -- cgit v0.12 From 23cec838a410deaf8be6a9ce76d2865a078a7d51 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 5 Dec 2017 10:29:53 -0600 Subject: clean-up --- fortran/src/H5f90global.F90 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 3f00d9a..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in -- cgit v0.12 From ec1e00a55f7b005fa9d87f92e58bc312286d0b8a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 5 Dec 2017 10:41:54 -0800 Subject: Normalization with VOL integration branch. --- src/H5.c | 24 ++++++------- src/H5Fint.c | 2 +- src/H5Fmount.c | 7 ++-- src/H5Fpkg.h | 25 ++++++------- src/H5Fprivate.h | 4 +-- src/H5Fquery.c | 8 ++--- src/H5Pprivate.h | 12 ++++--- src/hdf5.h | 52 +++++++++++++-------------- test/h5test.c | 107 ++++++++++++++++++++++--------------------------------- 9 files changed, 109 insertions(+), 132 deletions(-) diff --git a/src/H5.c b/src/H5.c index f0a222d..b8fd885 100644 --- a/src/H5.c +++ b/src/H5.c @@ -19,18 +19,18 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free lists */ -#include "H5FSprivate.h" /* File free space */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SLprivate.h" /* Skip lists */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5FSprivate.h" /* File free space */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free lists */ +#include "H5FSprivate.h" /* File free space */ +#include "H5Lprivate.h" /* Links */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip lists */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5FSprivate.h" /* File free space */ /****************/ /* Local Macros */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 0eb1ea9..8212eb5 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1574,7 +1574,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi * * Purpose: Flushes cached data. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 3cd5c21..17d7850 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -25,9 +25,6 @@ #include "H5MMprivate.h" /* Memory management */ /* PRIVATE PROTOTYPES */ -static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, - hid_t plist_id, hid_t dxpl_id); -static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); @@ -99,7 +96,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) { @@ -265,7 +262,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) { H5G_t *child_group = NULL; /* Child's group in parent mtab */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index d702506..b50b4e5 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -360,16 +360,16 @@ struct H5F_file_t { * to shared H5F_file_t structs. */ struct H5F_t { - char *open_name; /* Name used to open file */ - char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ - char *extpath; /* Path for searching target external link file */ - H5F_file_t *shared; /* The shared file info */ - unsigned nopen_objs; /* Number of open object headers*/ - H5FO_t *obj_count; /* # of time each object is opened through top file structure */ - hid_t file_id; /* ID of this file */ - hbool_t closing; /* File is in the process of being closed */ - struct H5F_t *parent; /* Parent file that this file is mounted to */ - unsigned nmounts; /* Number of children mounted to this file */ + char *open_name; /* Name used to open file */ + char *actual_name; /* Actual name of the file, after resolving symlinks, etc. */ + char *extpath; /* Path for searching target external link file */ + H5F_file_t *shared; /* The shared file info */ + unsigned nopen_objs; /* Number of open object headers */ + H5FO_t *obj_count; /* # of time each object is opened through top file structure */ + hid_t file_id; /* ID of this file */ + hbool_t closing; /* File is in the process of being closed */ + struct H5F_t *parent; /* Parent file that this file is mounted to */ + unsigned nmounts; /* Number of children mounted to this file */ #ifdef H5_HAVE_PARALLEL H5P_coll_md_read_flag_t coll_md_read; /* Do all metadata reads collectively */ hbool_t coll_md_write; /* Do all metadata writes collectively */ @@ -399,11 +399,12 @@ H5_DLL herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); -H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, - hid_t meta_dxpl_id, hid_t raw_dxpl_id); +H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ +H5_DLL herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id, hid_t dxpl_id); +H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id); H5_DLL herr_t H5F_close_mounts(H5F_t *f); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 18d0460..daf0a52 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -586,7 +586,7 @@ typedef struct H5F_t H5F_t; #define H5_SIZEOF_CHKSUM 4 /* v1 B-tree node signature */ -#define H5B_MAGIC "TREE" +#define H5B_MAGIC "TREE" /* v2 B-tree signatures */ #define H5B2_HDR_MAGIC "BTHD" /* Header */ @@ -616,7 +616,7 @@ typedef struct H5F_t H5F_t; #define H5HF_DBLOCK_MAGIC "FHDB" /* Direct block */ /* Global heap signature */ -#define H5HG_MAGIC "GCOL" +#define H5HG_MAGIC "GCOL" /* Local heap signature */ #define H5HL_MAGIC "HEAP" diff --git a/src/H5Fquery.c b/src/H5Fquery.c index cc2399b..61b4183 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -32,10 +32,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5FDprivate.h" /* File drivers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FDprivate.h" /* File drivers */ /****************/ diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index a468464..374c117 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -17,6 +17,9 @@ #ifndef _H5Pprivate_H #define _H5Pprivate_H +/* Early typedefs to avoid circular dependencies */ +typedef struct H5P_genplist_t H5P_genplist_t; + /* Include package's public header */ #include "H5Ppublic.h" @@ -52,12 +55,7 @@ typedef enum H5P_coll_md_read_flag_t { H5P_USER_TRUE = 1 } H5P_coll_md_read_flag_t; -/* Forward declarations (for prototypes & type definitions) */ -struct H5O_fill_t; -struct H5T_t; - /* Forward declarations for anonymous H5P objects */ -typedef struct H5P_genplist_t H5P_genplist_t; typedef struct H5P_genclass_t H5P_genclass_t; typedef enum H5P_plist_type_t { @@ -145,6 +143,10 @@ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_FACC[1]; /* File access */ /* Library Private Prototypes */ /******************************/ +/* Forward declaration of structs used below */ +struct H5O_fill_t; +struct H5T_t; + /* Package initialization routine */ H5_DLL herr_t H5P_init(void); diff --git a/src/hdf5.h b/src/hdf5.h index fc4541a..1709375 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -20,35 +20,35 @@ #define _HDF5_H #include "H5public.h" -#include "H5Apublic.h" /* Attributes */ -#include "H5ACpublic.h" /* Metadata cache */ -#include "H5Dpublic.h" /* Datasets */ -#include "H5Epublic.h" /* Errors */ -#include "H5Fpublic.h" /* Files */ -#include "H5FDpublic.h" /* File drivers */ -#include "H5Gpublic.h" /* Groups */ -#include "H5Ipublic.h" /* ID management */ -#include "H5Lpublic.h" /* Links */ -#include "H5MMpublic.h" /* Memory management */ -#include "H5Opublic.h" /* Object headers */ -#include "H5Ppublic.h" /* Property lists */ -#include "H5PLpublic.h" /* Plugins */ -#include "H5Rpublic.h" /* References */ -#include "H5Spublic.h" /* Dataspaces */ -#include "H5Tpublic.h" /* Datatypes */ -#include "H5Zpublic.h" /* Data filters */ +#include "H5Apublic.h" /* Attributes */ +#include "H5ACpublic.h" /* Metadata cache */ +#include "H5Dpublic.h" /* Datasets */ +#include "H5Epublic.h" /* Errors */ +#include "H5Fpublic.h" /* Files */ +#include "H5FDpublic.h" /* File drivers */ +#include "H5Gpublic.h" /* Groups */ +#include "H5Ipublic.h" /* ID management */ +#include "H5Lpublic.h" /* Links */ +#include "H5MMpublic.h" /* Memory management */ +#include "H5Opublic.h" /* Object headers */ +#include "H5Ppublic.h" /* Property lists */ +#include "H5PLpublic.h" /* Plugins */ +#include "H5Rpublic.h" /* References */ +#include "H5Spublic.h" /* Dataspaces */ +#include "H5Tpublic.h" /* Datatypes */ +#include "H5Zpublic.h" /* Data filters */ /* Predefined file drivers */ -#include "H5FDcore.h" /* Files stored entirely in memory */ -#include "H5FDdirect.h" /* Linux direct I/O */ -#include "H5FDfamily.h" /* File families */ -#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ -#include "H5FDmpi.h" /* MPI-based file drivers */ -#include "H5FDmulti.h" /* Usage-partitioned file family */ -#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ -#include "H5FDstdio.h" /* Standard C buffered I/O */ +#include "H5FDcore.h" /* Files stored entirely in memory */ +#include "H5FDdirect.h" /* Linux direct I/O */ +#include "H5FDfamily.h" /* File families */ +#include "H5FDlog.h" /* sec2 driver with I/O logging (for debugging) */ +#include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5FDmulti.h" /* Usage-partitioned file family */ +#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ +#include "H5FDstdio.h" /* Standard C buffered I/O */ #ifdef H5_HAVE_WINDOWS -#include "H5FDwindows.h" /* Windows buffered I/O */ +#include "H5FDwindows.h" /* Win32 I/O */ #endif #endif diff --git a/test/h5test.c b/test/h5test.c index af45589..bbdd58b 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -104,68 +104,6 @@ static herr_t h5_errors(hid_t estack, void *client_data); static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, char *fullname, size_t size, hbool_t nest_printf); - - -/* A non-usable VFD class and its functions. - * - * Usable for testing things like ID handling where we shouldn't mess with the real VFDs. - */ -static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); -static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; } - -static herr_t dummy_vfd_close(H5FD_t *_file); -static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; } - -static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type); -static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } - -static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; } - -static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type); -static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } - -static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); -static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; } - -static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); -static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } - -static H5FD_class_t dummy_vfd_class_g = { - "fake", /* name */ - 1, /* maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - NULL, /* terminate */ - NULL, /* sb_size */ - NULL, /* sb_encode */ - NULL, /* sb_decode */ - 0, /* fapl_size */ - NULL, /* fapl_get */ - NULL, /* fapl_copy */ - NULL, /* fapl_free */ - 0, /* dxpl_size */ - NULL, /* dxpl_copy */ - NULL, /* dxpl_free */ - dummy_vfd_open, /* open */ - dummy_vfd_close, /* close */ - NULL, /* cmp */ - NULL, /* query */ - NULL, /* get_type_map */ - NULL, /* alloc */ - NULL, /* free */ - dummy_vfd_get_eoa, /* get_eoa */ - dummy_vfd_set_eoa, /* set_eoa */ - dummy_vfd_get_eof, /* get_eof */ - NULL, /* get_handle */ - dummy_vfd_read, /* read */ - dummy_vfd_write, /* write */ - NULL, /* flush */ - NULL, /* truncate */ - NULL, /* lock */ - NULL, /* unlock */ - H5FD_FLMAP_DEFAULT /* fl_map */ -}; - /*------------------------------------------------------------------------- * Function: h5_errors @@ -1890,6 +1828,33 @@ error: return FAIL; } /* h5_wait_message() */ +/* Functions for the dummy VFD class (see below). + * + * Useful for testing things like ID handling where we shouldn't mess with the + * real VFDs. + */ +static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); +static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; } + +static herr_t dummy_vfd_close(H5FD_t *_file); +static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; } + +static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); +static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; } + +static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type); +static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; } + +static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); +static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; } + +static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); +static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } + + /*------------------------------------------------------------------------- * Function: h5_get_dummy_vfd_class() * @@ -1913,12 +1878,24 @@ error: H5FD_class_t * h5_get_dummy_vfd_class(void) { - H5FD_class_t *vfd_class = NULL; + H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */ - if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) + /* Create the class and initialize everything to zero/NULL */ + if(NULL == (vfd_class = (H5FD_class_t *)HDcalloc((size_t)1, sizeof(H5FD_class_t)))) TEST_ERROR; - HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t)); + /* Fill in the minimum parameters to make a VFD that + * can be registered. + */ + vfd_class->name = "dummy"; + vfd_class->maxaddr = 1; + vfd_class->open = dummy_vfd_open; + vfd_class->close = dummy_vfd_close; + vfd_class->get_eoa = dummy_vfd_get_eoa; + vfd_class->set_eoa = dummy_vfd_set_eoa; + vfd_class->get_eof = dummy_vfd_get_eof; + vfd_class->read = dummy_vfd_read; + vfd_class->write = dummy_vfd_write; return vfd_class; -- cgit v0.12 From 19507b91d53dd7ee17fd26d10e672af26178110c Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines added missing parameter added missing parameter removed parameters moved dll export to Module clean-up --- fortran/src/H5f90global.F90 | 350 +++++++++++++++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 331 ----------------------------------- hl/fortran/src/H5DSff.F90 | 65 +------ 3 files changed, 340 insertions(+), 406 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 9054522..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in @@ -88,7 +82,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -142,6 +185,19 @@ MODULE H5GLOBAL ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +212,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +256,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +290,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +348,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +369,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +385,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -269,6 +427,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +447,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +465,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +525,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +572,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +632,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +708,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +754,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 585602f..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,335 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5T_NATIVE_REAL_C_FLOAT -H5GLOBAL_mp_H5T_NATIVE_REAL_C_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_REAL_C_LONG_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_INTEGER -H5GLOBAL_mp_H5T_NATIVE_REAL -H5GLOBAL_mp_H5T_NATIVE_DOUBLE -H5GLOBAL_mp_H5T_NATIVE_CHARACTER -H5GLOBAL_mp_H5T_STD_REF_OBJ -H5GLOBAL_mp_H5T_STD_REF_DSETREG -H5GLOBAL_mp_H5T_IEEE_F32BE -H5GLOBAL_mp_H5T_IEEE_F32LE -H5GLOBAL_mp_H5T_IEEE_F64BE -H5GLOBAL_mp_H5T_IEEE_F64LE -H5GLOBAL_mp_H5T_STD_I8BE -H5GLOBAL_mp_H5T_STD_I8LE -H5GLOBAL_mp_H5T_STD_I16BE -H5GLOBAL_mp_H5T_STD_I16LE -H5GLOBAL_mp_H5T_STD_I32BE -H5GLOBAL_mp_H5T_STD_I32LE -H5GLOBAL_mp_H5T_STD_I64BE -H5GLOBAL_mp_H5T_STD_I64LE -H5GLOBAL_mp_H5T_STD_U8BE -H5GLOBAL_mp_H5T_STD_U8LE -H5GLOBAL_mp_H5T_STD_U16BE -H5GLOBAL_mp_H5T_STD_U16LE -H5GLOBAL_mp_H5T_STD_U32BE -H5GLOBAL_mp_H5T_STD_U32LE -H5GLOBAL_mp_H5T_STD_U64BE -H5GLOBAL_mp_H5T_STD_U64LE -H5GLOBAL_mp_H5T_STRING -H5GLOBAL_mp_H5T_STD_B8BE -H5GLOBAL_mp_H5T_STD_B8LE -H5GLOBAL_mp_H5T_STD_B16BE -H5GLOBAL_mp_H5T_STD_B16LE -H5GLOBAL_mp_H5T_STD_B32BE -H5GLOBAL_mp_H5T_STD_B32LE -H5GLOBAL_mp_H5T_STD_B64BE -H5GLOBAL_mp_H5T_STD_B64LE -H5GLOBAL_mp_H5T_NATIVE_B8 -H5GLOBAL_mp_H5T_NATIVE_B16 -H5GLOBAL_mp_H5T_NATIVE_B32 -H5GLOBAL_mp_H5T_NATIVE_B64 -H5GLOBAL_mp_H5T_FORTRAN_S1 -H5GLOBAL_mp_H5T_C_S1 -H5GLOBAL_mp_H5T_NATIVE_FLOAT_128 -; -; H5generic flags declaration -; -H5GLOBAL_mp_H5_INDEX_UNKNOWN_F -H5GLOBAL_mp_H5_INDEX_NAME_F -H5GLOBAL_mp_H5_INDEX_CRT_ORDER_F -H5GLOBAL_mp_H5_INDEX_N_F -H5GLOBAL_mp_H5_ITER_UNKNOWN_F -H5GLOBAL_mp_H5_ITER_INC_F -H5GLOBAL_mp_H5_ITER_DEC_F -H5GLOBAL_mp_H5_ITER_NATIVE_F -H5GLOBAL_mp_H5_ITER_N_F -H5GLOBAL_mp_HADDR_UNDEF_F -; -; H5F flags declaration -; -H5GLOBAL_mp_H5F_ACC_RDWR_F -H5GLOBAL_mp_H5F_ACC_RDONLY_F -H5GLOBAL_mp_H5F_ACC_TRUNC_F -H5GLOBAL_mp_H5F_ACC_EXCL_F -H5GLOBAL_mp_H5F_ACC_DEBUG_F -H5GLOBAL_mp_H5F_SCOPE_LOCAL_F -H5GLOBAL_mp_H5F_SCOPE_GLOBAL_F -H5GLOBAL_mp_H5F_CLOSE_DEFAULT_F -H5GLOBAL_mp_H5F_CLOSE_WEAK_F -H5GLOBAL_mp_H5F_CLOSE_SEMI_F -H5GLOBAL_mp_H5F_CLOSE_STRONG_F -H5GLOBAL_mp_H5F_OBJ_FILE_F -H5GLOBAL_mp_H5F_OBJ_DATASET_F -H5GLOBAL_mp_H5F_OBJ_GROUP_F -H5GLOBAL_mp_H5F_OBJ_DATATYPE_F -H5GLOBAL_mp_H5F_OBJ_ALL_F -H5GLOBAL_mp_H5F_LIBVER_EARLIEST_F -H5GLOBAL_mp_H5F_LIBVER_LATEST_F -H5GLOBAL_mp_H5F_UNLIMITED_F -; -; H5G flags declaration -; -H5GLOBAL_mp_H5G_UNKNOWN_F -H5GLOBAL_mp_H5G_GROUP_F -H5GLOBAL_mp_H5G_DATASET_F -H5GLOBAL_mp_H5G_TYPE_F -H5GLOBAL_mp_H5G_LINK_F -H5GLOBAL_mp_H5G_UDLINK_F -H5GLOBAL_mp_H5G_SAME_LOC_F -H5GLOBAL_mp_H5G_LINK_ERROR_F -H5GLOBAL_mp_H5G_LINK_HARD_F -H5GLOBAL_mp_H5G_LINK_SOFT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_SYMBOL_TABLE_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_COMPACT_F -H5GLOBAL_mp_H5G_STORAGE_TYPE_DENSE_F -; -; H5D flags declaration -; -H5GLOBAL_mp_H5D_COMPACT_F -H5GLOBAL_mp_H5D_CONTIGUOUS_F -H5GLOBAL_mp_H5D_CHUNKED_F -H5GLOBAL_mp_H5D_ALLOC_TIME_ERROR_F -H5GLOBAL_mp_H5D_ALLOC_TIME_DEFAULT_F -H5GLOBAL_mp_H5D_ALLOC_TIME_EARLY_F -H5GLOBAL_mp_H5D_ALLOC_TIME_LATE_F -H5GLOBAL_mp_H5D_ALLOC_TIME_INCR_F -H5GLOBAL_mp_H5D_SPACE_STS_ERROR_F -H5GLOBAL_mp_H5D_SPACE_STS_NOT_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_PART_ALLOCATED_F -H5GLOBAL_mp_H5D_SPACE_STS_ALLOCATED_F -H5GLOBAL_mp_H5D_FILL_TIME_ERROR_F -H5GLOBAL_mp_H5D_FILL_TIME_ALLOC_F -H5GLOBAL_mp_H5D_FILL_TIME_NEVER_F -H5GLOBAL_mp_H5D_FILL_VALUE_ERROR_F -H5GLOBAL_mp_H5D_FILL_VALUE_UNDEFINED_F -H5GLOBAL_mp_H5D_FILL_VALUE_DEFAULT_F -H5GLOBAL_mp_H5D_FILL_VALUE_USER_DEFINED_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NSLOTS_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_NBYTES_DFLT_F -H5GLOBAL_mp_H5D_CHUNK_CACHE_W0_DFLT_F -H5GLOBAL_mp_H5D_MPIO_NO_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_INDEPENDENT_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_COLLECTIVE_F -H5GLOBAL_mp_H5D_MPIO_CHUNK_MIXED_F -H5GLOBAL_mp_H5D_MPIO_CONTIG_COLLECTIVE_F -H5GLOBAL_mp_H5D_VDS_ERROR_F -H5GLOBAL_mp_H5D_VDS_FIRST_MISSING_F -H5GLOBAL_mp_H5D_VDS_LAST_AVAILABLE_F -H5GLOBAL_mp_H5D_VIRTUAL_F -; -; H5E flags declaration -; -H5GLOBAL_mp_H5E_DEFAULT_F -H5GLOBAL_mp_H5E_MAJOR_F -H5GLOBAL_mp_H5E_MINOR_F -H5GLOBAL_mp_H5E_WALK_UPWARD_F -H5GLOBAL_mp_H5E_WALK_DOWNWARD_F -; -; H5FD file drivers flags declaration -; -H5GLOBAL_mp_H5FD_MPIO_INDEPENDENT_F -H5GLOBAL_mp_H5FD_MPIO_COLLECTIVE_F -H5GLOBAL_mp_H5FD_MEM_NOLIST_F -H5GLOBAL_mp_H5FD_MEM_DEFAULT_F -H5GLOBAL_mp_H5FD_MEM_SUPER_F -H5GLOBAL_mp_H5FD_MEM_BTREE_F -H5GLOBAL_mp_H5FD_MEM_DRAW_F -H5GLOBAL_mp_H5FD_MEM_GHEAP_F -H5GLOBAL_mp_H5FD_MEM_LHEAP_F -H5GLOBAL_mp_H5FD_MEM_OHDR_F -H5GLOBAL_mp_H5FD_MEM_NTYPES_F -H5GLOBAL_mp_H5FD_CORE_F -H5GLOBAL_mp_H5FD_FAMILY_F -H5GLOBAL_mp_H5FD_LOG_F -H5GLOBAL_mp_H5FD_MPIO_F -H5GLOBAL_mp_H5FD_MULTI_F -H5GLOBAL_mp_H5FD_SEC2_F -H5GLOBAL_mp_H5FD_STDIO_F -; -; H5I flags declaration -; -H5GLOBAL_mp_H5I_FILE_F -H5GLOBAL_mp_H5I_GROUP_F -H5GLOBAL_mp_H5I_DATATYPE_F -H5GLOBAL_mp_H5I_DATASPACE_F -H5GLOBAL_mp_H5I_DATASET_F -H5GLOBAL_mp_H5I_ATTR_F -H5GLOBAL_mp_H5I_BADID_F -; -; H5L flags declaration -; -H5GLOBAL_mp_H5L_TYPE_ERROR_F -H5GLOBAL_mp_H5L_TYPE_HARD_F -H5GLOBAL_mp_H5L_TYPE_SOFT_F -H5GLOBAL_mp_H5L_TYPE_EXTERNAL_F -H5GLOBAL_mp_H5L_SAME_LOC_F -H5GLOBAL_mp_H5L_LINK_CLASS_T_VERS_F -; -; H5O flags declaration -; -H5GLOBAL_mp_H5O_COPY_SHALLOW_HIERARCHY_F -H5GLOBAL_mp_H5O_COPY_EXPAND_SOFT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_EXT_LINK_F -H5GLOBAL_mp_H5O_COPY_EXPAND_REFERENCE_F -H5GLOBAL_mp_H5O_COPY_WITHOUT_ATTR_FLAG_F -H5GLOBAL_mp_H5O_COPY_PRESERVE_NULL_FLAG_F -H5GLOBAL_mp_H5O_COPY_ALL_F -H5GLOBAL_mp_H5O_SHMESG_NONE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_SDSPACE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_DTYPE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_FILL_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_PLINE_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ATTR_FLAG_F -H5GLOBAL_mp_H5O_SHMESG_ALL_FLAG_F -H5GLOBAL_mp_H5O_HDR_CHUNK0_SIZE_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_TRACK_F -H5GLOBAL_mp_H5O_HDR_ATTR_CRT_ORDER_INDEX_F -H5GLOBAL_mp_H5O_HDR_ATTR_STORE_PHASE_CHA_F -H5GLOBAL_mp_H5O_HDR_STORE_TIMES_F -H5GLOBAL_mp_H5O_HDR_ALL_FLAGS_F -H5GLOBAL_mp_H5O_SHMESG_MAX_NINDEXES_F -H5GLOBAL_mp_H5O_SHMESG_MAX_LIST_SIZE_F -H5GLOBAL_mp_H5O_TYPE_UNKNOWN_F -H5GLOBAL_mp_H5O_TYPE_GROUP_F -H5GLOBAL_mp_H5O_TYPE_DATASET_F -H5GLOBAL_mp_H5O_TYPE_NAMED_DATATYPE_F -H5GLOBAL_mp_H5O_TYPE_NTYPES_F -; -; H5P flags declaration -; -H5GLOBAL_mp_H5P_FILE_CREATE_F -H5GLOBAL_mp_H5P_FILE_ACCESS_F -H5GLOBAL_mp_H5P_DATASET_CREATE_F -H5GLOBAL_mp_H5P_DATASET_XFER_F -H5GLOBAL_mp_H5P_FILE_MOUNT_F -H5GLOBAL_mp_H5P_DEFAULT_F -H5GLOBAL_mp_H5P_ROOT_F -H5GLOBAL_mp_H5P_OBJECT_CREATE_F -H5GLOBAL_mp_H5P_DATASET_ACCESS_F -H5GLOBAL_mp_H5P_GROUP_CREATE_F -H5GLOBAL_mp_H5P_GROUP_ACCESS_F -H5GLOBAL_mp_H5P_DATATYPE_CREATE_F -H5GLOBAL_mp_H5P_DATATYPE_ACCESS_F -H5GLOBAL_mp_H5P_STRING_CREATE_F -H5GLOBAL_mp_H5P_ATTRIBUTE_CREATE_F -H5GLOBAL_mp_H5P_OBJECT_COPY_F -H5GLOBAL_mp_H5P_LINK_CREATE_F -H5GLOBAL_mp_H5P_LINK_ACCESS_F -H5GLOBAL_mp_H5P_CRT_ORDER_INDEXED_F -H5GLOBAL_mp_H5P_CRT_ORDER_TRACKED_F -; -; H5R flags declaration -; -H5GLOBAL_mp_H5R_OBJECT_F -H5GLOBAL_mp_H5R_DATASET_REGION_F -; -; H5S flags declaration -; -H5GLOBAL_mp_H5S_UNLIMITED_F -H5GLOBAL_mp_H5S_ALL_F -H5GLOBAL_mp_H5S_SCALAR_F -H5GLOBAL_mp_H5S_SIMPLE_F -H5GLOBAL_mp_H5S_NULL_F -H5GLOBAL_mp_H5S_SELECT_NOOP_F -H5GLOBAL_mp_H5S_SELECT_SET_F -H5GLOBAL_mp_H5S_SELECT_OR_F -H5GLOBAL_mp_H5S_SELECT_AND_F -H5GLOBAL_mp_H5S_SELECT_XOR_F -H5GLOBAL_mp_H5S_SELECT_NOTB_F -H5GLOBAL_mp_H5S_SELECT_NOTA_F -H5GLOBAL_mp_H5S_SELECT_APPEND_F -H5GLOBAL_mp_H5S_SELECT_PREPEND_F -H5GLOBAL_mp_H5S_SELECT_INVALID_F -H5GLOBAL_mp_H5S_SEL_ERROR_F -H5GLOBAL_mp_H5S_SEL_NONE_F -H5GLOBAL_mp_H5S_SEL_POINTS_F -H5GLOBAL_mp_H5S_SEL_HYPERSLABS_F -H5GLOBAL_mp_H5S_SEL_ALL_F -; -; H5T flags declaration -; -H5GLOBAL_mp_H5T_NO_CLASS_F -H5GLOBAL_mp_H5T_INTEGER_F -H5GLOBAL_mp_H5T_FLOAT_F -H5GLOBAL_mp_H5T_TIME_F -H5GLOBAL_mp_H5T_STRING_F -H5GLOBAL_mp_H5T_BITFIELD_F -H5GLOBAL_mp_H5T_OPAQUE_F -H5GLOBAL_mp_H5T_COMPOUND_F -H5GLOBAL_mp_H5T_REFERENCE_F -H5GLOBAL_mp_H5T_ENUM_F -H5GLOBAL_mp_H5T_VLEN_F -H5GLOBAL_mp_H5T_ARRAY_F -H5GLOBAL_mp_H5T_ORDER_LE_F -H5GLOBAL_mp_H5T_ORDER_BE_F -H5GLOBAL_mp_H5T_ORDER_VAX_F -H5GLOBAL_mp_H5T_ORDER_NONE_F -H5GLOBAL_mp_H5T_ORDER_MIXED_F -H5GLOBAL_mp_H5T_PAD_ZERO_F -H5GLOBAL_mp_H5T_PAD_ONE_F -H5GLOBAL_mp_H5T_PAD_BACKGROUND_F -H5GLOBAL_mp_H5T_PAD_ERROR_F -H5GLOBAL_mp_H5T_SGN_NONE_F -H5GLOBAL_mp_H5T_SGN_2_F -H5GLOBAL_mp_H5T_SGN_ERROR_F -H5GLOBAL_mp_H5T_NORM_IMPLIED_F -H5GLOBAL_mp_H5T_NORM_MSBSET_F -H5GLOBAL_mp_H5T_NORM_NONE_F -H5GLOBAL_mp_H5T_CSET_ASCII_F -H5GLOBAL_mp_H5T_CSET_UTF8_F -H5GLOBAL_mp_H5T_STR_NULLTERM_F -H5GLOBAL_mp_H5T_STR_NULLPAD_F -H5GLOBAL_mp_H5T_STR_SPACEPAD_F -H5GLOBAL_mp_H5T_STR_ERROR_F -H5GLOBAL_mp_H5T_DIR_ASCEND_F -H5GLOBAL_mp_H5T_DIR_DESCEND_F -; -; H5Z flags declaration -; -H5GLOBAL_mp_H5Z_FILTER_ERROR_F -H5GLOBAL_mp_H5Z_FILTER_NONE_F -H5GLOBAL_mp_H5Z_FILTER_ALL_F -H5GLOBAL_mp_H5Z_FILTER_DEFLATE_F -H5GLOBAL_mp_H5Z_FILTER_SHUFFLE_F -H5GLOBAL_mp_H5Z_FILTER_FLETCHER32_F -H5GLOBAL_mp_H5Z_FILTER_SZIP_F -H5GLOBAL_mp_H5Z_ERROR_EDC_F -H5GLOBAL_mp_H5Z_DISABLE_EDC_F -H5GLOBAL_mp_H5Z_ENABLE_EDC_F -H5GLOBAL_mp_H5Z_NO_EDC_F -H5GLOBAL_mp_H5Z_FLAG_OPTIONAL_F -H5GLOBAL_mp_H5Z_FILTER_ENCODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_DECODE_ENABLED_F -H5GLOBAL_mp_H5Z_FILTER_NBIT_F -H5GLOBAL_mp_H5Z_FILTER_SCALEOFFSET_F -H5GLOBAL_mp_H5Z_SO_FLOAT_DSCALE_F -H5GLOBAL_mp_H5Z_SO_FLOAT_ESCALE_F -H5GLOBAL_mp_H5Z_SO_INT_F -H5GLOBAL_mp_H5Z_SO_INT_MINBITS_DEFAULT_F -; -; H5 Library flags declaration -; -H5GLOBAL_mp_H5_SZIP_EC_OM_F -H5GLOBAL_mp_H5_SZIP_NN_OM_F -; -; PROCEDURES -; -------------- -; ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From 701029876eef6c54df27620411c959969dfab5a4 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Mon, 4 Dec 2017 15:26:19 -0600 Subject: removed duplicate exports of DS subroutines --- fortran/src/H5f90global.F90 | 354 +++++++++++++++++++++++++++++++++++-- fortran/src/hdf5_fortrandll.def.in | 2 - hl/fortran/src/H5DSff.F90 | 65 +------ 3 files changed, 342 insertions(+), 79 deletions(-) diff --git a/fortran/src/H5f90global.F90 b/fortran/src/H5f90global.F90 index 0247ad8..078778a 100644 --- a/fortran/src/H5f90global.F90 +++ b/fortran/src/H5f90global.F90 @@ -70,16 +70,10 @@ MODULE H5GLOBAL INTEGER, DIMENSION(1:REF_REG_BUF_LEN) :: ref END TYPE hdset_reg_ref_t_f - ! Do not forget to change this value when new predefined + ! Do not forget to change these values when new predefined ! datatypes are added INTEGER, PARAMETER :: PREDEF_TYPES_LEN = 19 - - ! Do not forget to change the following line when new predefined - ! floating data types are added INTEGER, PARAMETER :: FLOATING_TYPES_LEN = 4 - - ! Do not forget to change the following line when new predefined - ! integer data types are added INTEGER, PARAMETER :: INTEGER_TYPES_LEN = 27 ! These arrays need to be global because they are used in @@ -88,7 +82,56 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:PREDEF_TYPES_LEN) :: predef_types = -1 INTEGER(HID_T), DIMENSION(1:FLOATING_TYPES_LEN) :: floating_types = -1 INTEGER(HID_T), DIMENSION(1:INTEGER_TYPES_LEN) :: integer_types = -1 - ! + + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_FLOAT + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL_C_LONG_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_REAL + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_DOUBLE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_CHARACTER + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_OBJ + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_REF_DSETREG + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_IEEE_F64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_I64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_U64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B8LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B16LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B32LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64BE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STD_B64LE + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B8 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B16 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B32 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_B64 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FORTRAN_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_C_S1 + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_INTEGER_KIND + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NATIVE_FLOAT_128 + !DEC$endif + INTEGER(HID_T) :: H5T_NATIVE_REAL_C_FLOAT INTEGER(HID_T) :: H5T_NATIVE_REAL_C_DOUBLE INTEGER(HID_T) :: H5T_NATIVE_REAL_C_LONG_DOUBLE @@ -139,9 +182,22 @@ MODULE H5GLOBAL INTEGER(HID_T), DIMENSION(1:NUM_NATIVE_INTEGER_KIND) :: H5T_NATIVE_INTEGER_KIND INTEGER(HID_T) :: H5T_NATIVE_FLOAT_128 ! NEED IFDEF -MSB- - + ! ! H5generic flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_NAME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_CRT_ORDER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_INDEX_N_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_INC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_DEC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_NATIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_ITER_N_F + !DEC$ATTRIBUTES DLLEXPORT :: HADDR_UNDEF_F + !DEC$endif + INTEGER :: H5_INDEX_UNKNOWN_F INTEGER :: H5_INDEX_NAME_F INTEGER :: H5_INDEX_CRT_ORDER_F @@ -156,6 +212,28 @@ MODULE H5GLOBAL ! ! H5F flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDWR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_RDONLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_TRUNC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_EXCL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_ACC_DEBUG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_LOCAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_SCOPE_GLOBAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_WEAK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_SEMI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_CLOSE_STRONG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_OBJ_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_EARLIEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_LIBVER_LATEST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5F_UNLIMITED_F + !DEC$endif + INTEGER :: H5F_ACC_RDWR_F INTEGER :: H5F_ACC_RDONLY_F INTEGER :: H5F_ACC_TRUNC_F @@ -178,6 +256,23 @@ MODULE H5GLOBAL ! ! H5G flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_TYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_UDLINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_LINK_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_SYMBOL_TABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5G_STORAGE_TYPE_DENSE_F + !DEC$endif + INTEGER :: H5G_UNKNOWN_F INTEGER :: H5G_GROUP_F INTEGER :: H5G_DATASET_F @@ -195,6 +290,40 @@ MODULE H5GLOBAL ! ! H5D flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5D_COMPACT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CONTIGUOUS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNKED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_EARLY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_LATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_ALLOC_TIME_INCR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_NOT_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_PART_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_SPACE_STS_ALLOCATED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_ALLOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_TIME_NEVER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_UNDEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_FILL_VALUE_USER_DEFINED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_NBYTES_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_CHUNK_CACHE_W0_DFLT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_NO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CHUNK_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_MPIO_CONTIG_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_FIRST_MISSING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VDS_LAST_AVAILABLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5D_VIRTUAL_F + !DEC$endif + INTEGER :: H5D_COMPACT_F INTEGER :: H5D_CONTIGUOUS_F INTEGER :: H5D_CHUNKED_F @@ -219,11 +348,11 @@ MODULE H5GLOBAL INTEGER :: H5D_FILL_VALUE_DEFAULT_F INTEGER :: H5D_FILL_VALUE_USER_DEFINED_F -! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 -! characters for variable names in Fortran. -! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 -! characters for variable names in Fortran. - + ! shortened "_DEFAULT" to "_DFLT" to satisfy the limit of 31 + ! characters for variable names in Fortran. + ! shortened "_CONTIGUOUS" to "_CONTIG" to satisfy the limit of 31 + ! characters for variable names in Fortran. + INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NSLOTS_DFLT_F INTEGER(SIZE_T) :: H5D_CHUNK_CACHE_NBYTES_DFLT_F @@ -240,6 +369,14 @@ MODULE H5GLOBAL ! ! H5E flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5E_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MAJOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_MINOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_UPWARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5E_WALK_DOWNWARD_F + !DEC$endif + INTEGER(HID_T) :: H5E_DEFAULT_F INTEGER :: H5E_MAJOR_F INTEGER :: H5E_MINOR_F @@ -248,6 +385,27 @@ MODULE H5GLOBAL ! ! H5FD file drivers flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_INDEPENDENT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_COLLECTIVE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NOLIST_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_SUPER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_BTREE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_DRAW_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_GHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_LHEAP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_OHDR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MEM_NTYPES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_CORE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_FAMILY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_LOG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MPIO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_MULTI_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_SEC2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5FD_STDIO_F + !DEC$endif + INTEGER :: H5FD_MPIO_INDEPENDENT_F INTEGER :: H5FD_MPIO_COLLECTIVE_F INTEGER :: H5FD_MEM_NOLIST_F @@ -258,7 +416,7 @@ MODULE H5GLOBAL INTEGER :: H5FD_MEM_GHEAP_F INTEGER :: H5FD_MEM_LHEAP_F INTEGER :: H5FD_MEM_OHDR_F - INTEGER :: H5FD_MEM_NTYPES_F=-1 + INTEGER :: H5FD_MEM_NTYPES_F INTEGER(HID_T) :: H5FD_CORE_F INTEGER(HID_T) :: H5FD_FAMILY_F INTEGER(HID_T) :: H5FD_LOG_F @@ -269,6 +427,16 @@ MODULE H5GLOBAL ! ! H5I flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5I_FILE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASPACE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_ATTR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5I_BADID_F + !DEC$endif + INTEGER :: H5I_FILE_F INTEGER :: H5I_GROUP_F INTEGER :: H5I_DATATYPE_F @@ -279,6 +447,15 @@ MODULE H5GLOBAL ! ! H5L flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_HARD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_SOFT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_TYPE_EXTERNAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_SAME_LOC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5L_LINK_CLASS_T_VERS_F + !DEC$endif + INTEGER :: H5L_TYPE_ERROR_F INTEGER :: H5L_TYPE_HARD_F INTEGER :: H5L_TYPE_SOFT_F @@ -288,6 +465,36 @@ MODULE H5GLOBAL ! ! H5O flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_SHALLOW_HIERARCHY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_SOFT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_EXT_LINK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_EXPAND_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_WITHOUT_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_PRESERVE_NULL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_COPY_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_NONE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_SDSPACE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_DTYPE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_FILL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_PLINE_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ATTR_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_ALL_FLAG_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_CHUNK0_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_TRACK_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_CRT_ORDER_INDEX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ATTR_STORE_PHASE_CHA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_STORE_TIMES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_HDR_ALL_FLAGS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_NINDEXES_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_SHMESG_MAX_LIST_SIZE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_UNKNOWN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_GROUP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_DATASET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NAMED_DATATYPE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5O_TYPE_NTYPES_F + !DEC$endif + INTEGER :: H5O_COPY_SHALLOW_HIERARCHY_F ! *** THESE VARIABLES DO INTEGER :: H5O_COPY_EXPAND_SOFT_LINK_F ! NOT MATCH THE C VARIABLE INTEGER :: H5O_COPY_EXPAND_EXT_LINK_F ! IN ORDER @@ -318,6 +525,29 @@ MODULE H5GLOBAL ! ! H5P flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_XFER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_FILE_MOUNT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DEFAULT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ROOT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATASET_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_GROUP_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_DATATYPE_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_STRING_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_ATTRIBUTE_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_OBJECT_COPY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_CREATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_LINK_ACCESS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_INDEXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5P_CRT_ORDER_TRACKED_F + !DEC$endif + INTEGER(HID_T) :: H5P_FILE_CREATE_F INTEGER(HID_T) :: H5P_FILE_ACCESS_F INTEGER(HID_T) :: H5P_DATASET_CREATE_F @@ -342,11 +572,39 @@ MODULE H5GLOBAL ! ! H5R flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5R_OBJECT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5R_DATASET_REGION_F + !DEC$endif + INTEGER :: H5R_OBJECT_F INTEGER :: H5R_DATASET_REGION_F ! ! H5S flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5S_UNLIMITED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SCALAR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SIMPLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_NULL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOOP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_SET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_OR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_AND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_XOR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTB_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_NOTA_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_APPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_PREPEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SELECT_INVALID_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_POINTS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_HYPERSLABS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5S_SEL_ALL_F + !DEC$endif + INTEGER(HSIZE_T) :: H5S_UNLIMITED_F INTEGER(HID_T) :: H5S_ALL_F @@ -374,6 +632,44 @@ MODULE H5GLOBAL ! ! H5T flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NO_CLASS_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_INTEGER_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_FLOAT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_TIME_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STRING_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_BITFIELD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_OPAQUE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_COMPOUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_REFERENCE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ENUM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_VLEN_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ARRAY_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_LE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_BE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_VAX_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_ORDER_MIXED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ZERO_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_BACKGROUND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_PAD_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_2_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_SGN_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_IMPLIED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_MSBSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_NORM_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_ASCII_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_CSET_UTF8_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLTERM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_NULLPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_SPACEPAD_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_STR_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_ASCEND_F + !DEC$ATTRIBUTES DLLEXPORT :: H5T_DIR_DESCEND_F + !DEC$endif + INTEGER :: H5T_NO_CLASS_F INTEGER :: H5T_INTEGER_F INTEGER :: H5T_FLOAT_F @@ -412,6 +708,29 @@ MODULE H5GLOBAL ! ! H5Z flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ERROR_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NONE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ALL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DEFLATE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SHUFFLE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_FLETCHER32_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SZIP_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ERROR_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_DISABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_ENABLE_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_NO_EDC_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FLAG_OPTIONAL_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_ENCODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_DECODE_ENABLED_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_NBIT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_FILTER_SCALEOFFSET_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_DSCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_FLOAT_ESCALE_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_F + !DEC$ATTRIBUTES DLLEXPORT :: H5Z_SO_INT_MINBITS_DEFAULT_F + !DEC$endif + INTEGER :: H5Z_FILTER_ERROR_F INTEGER :: H5Z_FILTER_NONE_F INTEGER :: H5Z_FILTER_ALL_F @@ -435,6 +754,11 @@ MODULE H5GLOBAL ! ! H5 Library flags declaration ! + !DEC$if defined(BUILD_HDF5_DLL) + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_EC_OM_F + !DEC$ATTRIBUTES DLLEXPORT :: H5_SZIP_NN_OM_F + !DEC$endif + INTEGER :: H5_SZIP_EC_OM_F INTEGER :: H5_SZIP_NN_OM_F diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index 43a802c..3a5a91f 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -1,6 +1,4 @@ EXPORTS -; H5GLOBAL -H5GLOBAL_mp_H5FD_MEM_NTYPES_F ; H5LIB H5LIB_mp_H5OPEN_F H5LIB_mp_H5CLOSE_F diff --git a/hl/fortran/src/H5DSff.F90 b/hl/fortran/src/H5DSff.F90 index 4f0d040..2dca479 100644 --- a/hl/fortran/src/H5DSff.F90 +++ b/hl/fortran/src/H5DSff.F90 @@ -44,13 +44,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_scale_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: dsid ! The dataset to be made a Dimension Scale CHARACTER(LEN=*), INTENT(in), OPTIONAL :: dimname ! The dimension name INTEGER :: errcode ! Error code @@ -99,12 +92,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsattach_scale_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with. @@ -148,13 +135,7 @@ CONTAINS SUBROUTINE H5DSdetach_scale_f( did, dsid, idx, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsdetach_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be detached INTEGER , INTENT(in) :: idx ! the dimension of did to detach @@ -199,13 +180,7 @@ CONTAINS SUBROUTINE H5DSis_attached_f( did, dsid, idx, is_attached, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_attached_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER(hid_t), INTENT(in) :: dsid ! the scale to be attached INTEGER , INTENT(in) :: idx ! the dimension of did that dsid is associated with @@ -264,13 +239,7 @@ CONTAINS SUBROUTINE H5DSis_scale_f( did, is_scale, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsis_scale_f -!DEC$endif -! + INTEGER(hid_t), INTENT(in) :: did ! the data set to query LOGICAL , INTENT(out) :: is_scale ! logical: ! .TRUE. if did is a Dimension Scale @@ -319,13 +288,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsset_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataset INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -375,13 +337,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_label_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget INTEGER , INTENT(in) :: idx ! The dimension CHARACTER(LEN=*), INTENT(in) :: label ! The label @@ -430,13 +385,6 @@ CONTAINS IMPLICIT NONE -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_scale_name_f -!DEC$endif -! - INTEGER(hid_t), INTENT(in) :: did ! The dataget CHARACTER(LEN=*), INTENT(out) :: name ! The name INTEGER(size_t) , INTENT(inout) :: size ! The length of the name buffer @@ -478,13 +426,6 @@ CONTAINS SUBROUTINE H5DSget_num_scales_f( did, idx, num_scales, errcode) IMPLICIT NONE - -! -!This definition is needed for Windows DLLs -!DEC$if defined(BUILD_HDF5_HL_DLL) -!DEC$attributes dllexport :: h5dsget_num_scales_f -!DEC$endif -! INTEGER(hid_t), INTENT(in) :: did ! the dataset INTEGER , INTENT(in) :: idx ! the dimension of did to query INTEGER , INTENT(out) :: num_scales ! the number of Dimension Scales associated with did -- cgit v0.12 From 6eab04894e88f7dcc0e684271328efc409a98662 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Thu, 7 Dec 2017 08:56:04 -0600 Subject: HDFFV-10223 Shared libraries fail test on OSX with fortran enabled with cmake This is now fixed via the HDFFV-10325 fix. --- CMakeLists.txt | 15 +-------------- fortran/examples/CMakeLists.txt | 6 +++--- fortran/examples/CMakeTests.cmake | 8 ++++---- fortran/src/CMakeLists.txt | 14 +++++++------- fortran/test/CMakeLists.txt | 20 ++++++++++---------- fortran/test/CMakeTests.cmake | 2 +- hl/fortran/src/CMakeLists.txt | 14 +++++++------- hl/fortran/test/CMakeLists.txt | 8 ++++---- hl/fortran/test/CMakeTests.cmake | 2 +- release_docs/INSTALL_CMake.txt | 1 - 10 files changed, 38 insertions(+), 52 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2640b1..e22ac2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -849,21 +849,8 @@ set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _") set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _") if (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/fortran") option (HDF5_BUILD_FORTRAN "Build FORTRAN support" OFF) - option (SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF) if (HDF5_BUILD_FORTRAN) - if (BUILD_SHARED_LIBS AND APPLE) - # Tell cmake to do the right thing with COMMON symbols, this fixes - # corrupt values with COMMON and EQUIVALENCE when building shared - # Fortran libraries on OSX with gnu and Intel compilers (HDFFV-2772). - # *** NOTE: Fix does not work with Cmake. *** - # set (HDF5_LINKER_FLAGS "-Wl,-commons,use_dylibs") - if (NOT ALLOW_UNSUPPORTED) - message (STATUS " **** Shared FORTRAN libraries are unsupported **** ") - set (SKIP_HDF5_FORTRAN_SHARED ON) - else () - message (STATUS " **** Allowing unsupported Fortran shared libraries **** ") - endif () - endif () + option (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" ON) include (${HDF_RESOURCES_EXT_DIR}/HDFUseFortran.cmake) diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 426df7e..a05f296 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -52,7 +52,7 @@ foreach (example ${examples}) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f90_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_${example}-shared SHARED " " " ") @@ -83,7 +83,7 @@ foreach (example ${F2003_examples}) FOLDER examples/fortran03 Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f03_ex_${example}-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example}-shared SHARED) TARGET_FORTRAN_PROPERTIES (f03_ex_${example}-shared SHARED " " " ") @@ -114,7 +114,7 @@ if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) FOLDER examples/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static ) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_executable (f90_ex_ph5example-shared ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example-shared SHARED) TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example-shared SHARED " " " ") diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index b130f30..c3d94b4 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -41,7 +41,7 @@ set_tests_properties (f90_ex-clear-objects PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex-clear-objects") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_test ( NAME f90_ex-shared-clear-objects COMMAND ${CMAKE_COMMAND} @@ -87,7 +87,7 @@ foreach (example ${examples}) set_tests_properties (f90_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f90_ex_${example}") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME f90_ex-shared_${example} COMMAND $) else () @@ -129,7 +129,7 @@ if (HDF5_ENABLE_F2003) set_tests_properties (f03_ex_${example} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "f03_ex_${example}") - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME f03_ex-shared_${example} COMMAND $) else () @@ -154,7 +154,7 @@ endif () if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_test (NAME f90_ex_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) add_test (NAME f90_ex-shared_ph5example COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $ ${MPIEXEC_POSTFLAGS}) endif () endif () diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index e34c778..0f576d4 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -64,7 +64,7 @@ set_target_properties (H5_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -136,7 +136,7 @@ set_target_properties (${HDF5_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_LIBSH_TARGET} SHARED ${f90CStub_C_SOURCES} ${f90CStub_C_HDRS}) TARGET_C_PROPERTIES (${HDF5_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_LIBSH_TARGET} PUBLIC ${HDF5_LIBSH_TARGET}) @@ -173,7 +173,7 @@ add_custom_target (H5gen ALL ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/H5_gen.F90 PROPERTIES GENERATED TRUE) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/H5_gen.F90 @@ -220,7 +220,7 @@ set (f90_F_SOURCES # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/HDF5.F90 ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (f90_F_SOURCES_SHARED # generated file ${HDF5_F90_BINARY_DIR}/H5fortran_types.F90 @@ -262,7 +262,7 @@ endif () set (install_targets ${install_targets} ${HDF5_F90_LIB_TARGET}) add_dependencies(${HDF5_F90_LIB_TARGET} H5gen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${f90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -339,7 +339,7 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (modsh_files ${MODSH_BUILD_DIR}/h5fortran_types.mod ${MODSH_BUILD_DIR}/hdf5.mod @@ -375,7 +375,7 @@ endif () # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) #INSTALL_TARGET_PDB (${HDF5_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} fortlibraries) endif () diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 1661a10..3c3eb8f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -32,7 +32,7 @@ set_target_properties (H5_test_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_F90_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -64,7 +64,7 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C INTERFACE_INCLUDE_DIRECTORIES "$/include>" ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) TARGET_C_PROPERTIES (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_F90_C_TEST_LIBSH_TARGET} @@ -94,7 +94,7 @@ add_custom_target (H5testgen ALL ) set_source_files_properties (${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES GENERATED TRUE) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 @@ -117,7 +117,7 @@ set (HDF5_F90_TF_SOURCES tf.F90 ) set_source_files_properties (${HDF5_F90_TF_SOURCES} PROPERTIES LANGUAGE Fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (HDF5_F90_TF_SOURCES_SHARED # generated file ${HDF5_F90_BINARY_DIR}/shared/tf_gen.F90 @@ -150,7 +150,7 @@ if (WIN32) endif () add_dependencies(${HDF5_F90_TEST_LIB_TARGET} H5testgen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_F90_TEST_LIBSH_TARGET} SHARED ${HDF5_F90_TF_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -220,7 +220,7 @@ set_target_properties (testhdf5_fortran PROPERTIES ) add_dependencies (testhdf5_fortran ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (testhdf5_fortran-shared fortranlib_test.F90 tH5A.F90 @@ -284,7 +284,7 @@ set_target_properties (testhdf5_fortran_1_8 PROPERTIES ) add_dependencies (testhdf5_fortran_1_8 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (testhdf5_fortran_1_8-shared fortranlib_test_1_8.F90 tH5O.F90 @@ -341,7 +341,7 @@ set_target_properties (fortranlib_test_F03 PROPERTIES ) add_dependencies (fortranlib_test_F03 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fortranlib_test_F03-shared fortranlib_test_F03.F90 tH5E_F03.F90 @@ -392,7 +392,7 @@ set_target_properties (fflush1 PROPERTIES ) add_dependencies (fflush1 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fflush1-shared fflush1.F90) TARGET_NAMING (fflush1-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush1-shared SHARED " " " ") @@ -433,7 +433,7 @@ set_target_properties (fflush2 PROPERTIES ) add_dependencies (fflush2 ${HDF5_F90_TEST_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (fflush2-shared fflush2.F90) TARGET_NAMING (fflush2-shared SHARED) TARGET_FORTRAN_PROPERTIES (fflush2-shared SHARED " " " ") diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index e171e7c..4d06359 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -132,7 +132,7 @@ set_tests_properties (FORTRAN_fflush1 PROPERTIES DEPENDS FORTRAN_testhdf5-clear- add_test (NAME FORTRAN_fflush2 COMMAND $) set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_test ( NAME FORTRAN_testhdf5-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 345a739..c870aed 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -36,7 +36,7 @@ set_target_properties (H5HL_buildiface PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) file (MAKE_DIRECTORY "${HDF5_HL_F90_SRC_BINARY_DIR}/shared") if (WIN32) set (MODSH_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/shared/${CMAKE_BUILD_TYPE}) @@ -87,7 +87,7 @@ set_target_properties (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES ) set (install_targets ${HDF5_HL_F90_C_LIB_TARGET}) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) TARGET_C_PROPERTIES (${HDF5_HL_F90_C_LIBSH_TARGET} SHARED " " " ") target_link_libraries (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_C_LIBSH_TARGET} ${HDF5_HL_LIBSH_TARGET}) @@ -129,7 +129,7 @@ set_source_files_properties ( ${HDF5_HL_F90_SRC_BINARY_DIR}/H5TBff_gen.F90 PROPERTIES GENERATED TRUE ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (CMDSH $) add_custom_command ( OUTPUT ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_SRC_BINARY_DIR}/shared/H5TBff_gen.F90 @@ -157,7 +157,7 @@ set (HDF5_HL_F90_F_SOURCES ) set_source_files_properties (${HDF5_HL_F90_F_SOURCES} PROPERTIES LANGUAGE Fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (HDF5_HL_F90_F_SOURCES_SHARED ${HDF5_HL_F90_F_BASE_SOURCES} @@ -187,7 +187,7 @@ endif () set (install_targets ${install_targets} ${HDF5_HL_F90_LIB_TARGET}) add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED}) set (SHARED_LINK_FLAGS " ") if (WIN32 AND MSVC) @@ -236,7 +236,7 @@ install ( fortheaders ) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) set (modsh_files ${MODSH_BUILD_DIR}/h5ds.mod ${MODSH_BUILD_DIR}/h5tb.mod @@ -259,7 +259,7 @@ endif () # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) - if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) + if (BUILD_SHARED_LIBS) INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) #INSTALL_TARGET_PDB (${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_INSTALL_BIN_DIR} hlfortlibraries) endif () diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index 3138173..fbd31c5 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -14,7 +14,7 @@ target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TAR target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstds-shared tstds.F90) TARGET_NAMING (hl_f90_tstds-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstds-shared SHARED " " " ") @@ -35,7 +35,7 @@ target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_T target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstlite-shared tstlite.F90) TARGET_NAMING (hl_f90_tstlite-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite-shared SHARED " " " ") @@ -56,7 +56,7 @@ target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tstimage-shared tstimage.F90) TARGET_NAMING (hl_f90_tstimage-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage-shared SHARED " " " ") @@ -77,7 +77,7 @@ target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_ target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran) set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_executable (hl_f90_tsttable-shared tsttable.F90) TARGET_NAMING (hl_f90_tsttable-shared SHARED) TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable-shared SHARED " " " ") diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 90cc3a3..d541377 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -96,7 +96,7 @@ else () endif () set_tests_properties (HL_FORTRAN_f90_tsttable PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) -if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED) +if (BUILD_SHARED_LIBS) add_test ( NAME HL_FORTRAN_test-shared-clear-objects COMMAND ${CMAKE_COMMAND} diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 26750b5..f20ca43 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -594,7 +594,6 @@ HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON HDF5_ENABLE_THREADSAFE "Enable Threadsafety" OFF -SKIP_HDF5_FORTRAN_SHARED "Do not build the fortran shared libraries" OFF if (APPLE) HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF if (CMAKE_BUILD_TYPE MATCHES Debug) -- cgit v0.12