diff --git a/.github/workflows/release-files.yml b/.github/workflows/release-files.yml index 97f19671d2e..58081a59b11 100644 --- a/.github/workflows/release-files.yml +++ b/.github/workflows/release-files.yml @@ -175,11 +175,10 @@ jobs: - name: Create description file run: | cat ${{ github.workspace }}/NEWSLETTER.txt > description.txt - echo "SHA256 sums:" >> description.txt - cat sha256sums.txt >> description.txt - name: PreRelease tag id: create_prerelease + if: ${{ (inputs.use_environ == 'snapshots') }} uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 with: tag_name: "${{ inputs.use_tag }}" @@ -202,6 +201,30 @@ jobs: sha256sums.txt if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + - name: Release tag + id: create_release + if: ${{ (inputs.use_environ == 'release') }} + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 + with: + tag_name: "${{ inputs.use_tag }}" + prerelease: false + body_path: description.txt + files: | + ${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}.tar.gz + ${{ steps.get-file-base.outputs.FILE_BASE }}.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-osx12.tar.gz + ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.tar.gz + ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.deb + ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm + ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc_s3.tar.gz + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}-ubuntu-2204_intel.tar.gz + ${{ steps.get-file-base.outputs.FILE_BASE }}-win-vs2022_intel.zip + ${{ steps.get-file-base.outputs.FILE_BASE }}.html.abi.reports + sha256sums.txt + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + - name: List files for the space (Linux) run: | ls -l ${{ github.workspace }} diff --git a/.github/workflows/vfd-main.yml b/.github/workflows/vfd-main.yml new file mode 100644 index 00000000000..710e925df31 --- /dev/null +++ b/.github/workflows/vfd-main.yml @@ -0,0 +1,66 @@ +name: hdf5 VFD CI main + +on: + workflow_call: + inputs: + build_sys: + description: "build system used" + required: true + type: string + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + # Test HDF5 VFDs that are always built by default + #hdf5_vfd_standard: + # uses: ./.github/workflows/vfd-standard.yml + # with: + # build_sys: "${{ inputs.build_sys }}" + # build_mode: "${{ inputs.build_mode }}" + + # Test HDF5 MPI I/O VFD + #hdf5_vfd_mpiio: + # uses: ./.github/workflows/vfd-mpiio.yml + # with: + # build_sys: "${{ inputs.build_sys }}" + # build_mode: "${{ inputs.build_mode }}" + + # Test HDF5 Direct VFD + #hdf5_vfd_direct: + # uses: ./.github/workflows/vfd-direct.yml + # with: + # build_sys: "${{ inputs.build_sys }}" + # build_mode: "${{ inputs.build_mode }}" + + #Test HDF5 Mirror VFD + #hdf5_vfd_mirror: + # uses: ./.github/workflows/vfd-mirror.yml + # with: + # build_sys: "${{ inputs.build_sys }}" + # build_mode: "${{ inputs.build_mode }}" + + #Test HDF5 ROS3 VFD + #hdf5_vfd_ros3: + # uses: ./.github/workflows/vfd-ros3.yml + # with: + # build_sys: "${{ inputs.build_sys }}" + # build_mode: "${{ inputs.build_mode }}" + + #Test HDF5 HDFS VFD + #hdf5_vfd_hdfs: + # uses: ./.github/workflows/vfd-hdfs.yml + # with: + # build_sys: "${{ inputs.build_sys }}" + # build_mode: "${{ inputs.build_mode }}" + + # Test HDF5 Subfiling VFD + hdf5_vfd_subfiling: + uses: ./.github/workflows/vfd-subfiling.yml + with: + build_sys: "${{ inputs.build_sys }}" + build_mode: "${{ inputs.build_mode }}" diff --git a/.github/workflows/vfd-subfiling.yml b/.github/workflows/vfd-subfiling.yml new file mode 100644 index 00000000000..833f4cd7c85 --- /dev/null +++ b/.github/workflows/vfd-subfiling.yml @@ -0,0 +1,136 @@ +name: Test HDF5 Subfiling VFD + +on: + workflow_call: + inputs: + build_sys: + description: "build system used" + required: true + type: string + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + build_and_test: + strategy: + # Let jobs run to completion even if one fails + fail-fast: false + matrix: + os_name: ["Ubuntu"] +# os_name: ["Ubuntu", "MacOS"] + mpi_lib: ["OpenMPI"] +# mpi_lib: ["OpenMPI", "MPICH"] + include: + - os_name: "Ubuntu" + os: ubuntu-latest + mpi_lib: "OpenMPI" +# - os_name: "Ubuntu" +# os: ubuntu-latest +# mpi_lib: "MPICH" +# - os_name: "MacOS" +# os: macos-latest +# mpi_lib: "OpenMPI" +# - os_name: "MacOS" +# os: macos-latest +# mpi_lib: "MPICH" + + # Sets the job's name from the properties + name: "Test HDF5 Subfiling VFD (${{ inputs.build_sys }} ${{ inputs.build_mode }}) on ${{ matrix.os_name }} with ${{ matrix.mpi_lib }}" + + runs-on: ${{ matrix.os }} + + steps: + - name: Install Linux Dependencies + run: | + sudo apt update + sudo apt-get install automake autoconf libtool libtool-bin + if: ${{ matrix.os == 'ubuntu-latest' }} + + # For now, just install OpenMPI or MPICH with the package + # manager. Eventually, we should pick one or 2 release + # versions of each, then build and cache those installations + - name: Install OpenMPI + run: | + sudo apt update + sudo apt-get install libopenmpi-dev + echo "CC=mpicc" >> $GITHUB_ENV + if: ${{ matrix.os == 'ubuntu-latest' && matrix.mpi_lib == 'OpenMPI' }} + + - name: Install MPICH + run: | + sudo apt update + sudo apt-get install libmpich-dev + echo "CC=mpicc" >> $GITHUB_ENV + if: ${{ matrix.os == 'ubuntu-latest' && matrix.mpi_lib == 'MPICH' }} + + - name: Checkout HDF5 + uses: actions/checkout@v4.1.1 + + - name: Configure HDF5 with Subfiling VFD (Autotools) + shell: bash + run: | + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + $GITHUB_WORKSPACE/configure \ + --enable-build-mode=${{ inputs.build_mode }} \ + --enable-shared \ + --disable-static \ + --enable-parallel \ + --enable-subfiling-vfd \ + if: ${{ inputs.build_sys == 'Autotools' }} + + - name: Configure HDF5 with Subfiling VFD (CMake) + shell: bash + run: | + mkdir ${{ runner.workspace }}/build + cd ${{ runner.workspace }}/build + cmake -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/hdf5_build \ + -DBUILD_STATIC_LIBS=OFF \ + -DHDF5_TEST_VFD:BOOL=ON \ + -DHDF5_ENABLE_PARALLEL:BOOL=ON \ + -DHDF5_ENABLE_SUBFILING_VFD:BOOL=ON \ + -DMPIEXEC_MAX_NUMPROCS=2 \ + $GITHUB_WORKSPACE + cat src/libhdf5.settings + if: ${{ inputs.build_sys == 'CMake' }} + + - name: Build HDF5 (Autotools) + shell: bash + working-directory: ${{ runner.workspace }}/build + run: make -j3 + if: ${{ inputs.build_sys == 'Autotools' }} + + - name: Build HDF5 (CMake) + shell: bash + working-directory: ${{ runner.workspace }}/build + run: | + cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + echo "LD_LIBRARY_PATH=${{ runner.workspace }}/build/bin" >> $GITHUB_ENV + if: ${{ inputs.build_sys == 'CMake' }} + + - name: Test HDF5 Subfiling VFD (Autotools) + working-directory: ${{ runner.workspace }}/build/testpar + # For now, just run the tests directly setup for use with the + # Subfiling VFD. We can expand on this once the library's tests + # are better separated into categories for VFD testing. + run: | + mpirun -np 2 t_subfiling_vfd + mpirun -np 2 t_vfd + if: ${{ inputs.build_sys == 'Autotools' }} + + - name: Test HDF5 Subfiling VFD (CMake) + working-directory: ${{ runner.workspace }}/build + run: | + # For now, just run the tests directly setup for use with the + # Subfiling VFD. We can expand on this once the library's tests + # are better separated into categories for VFD testing. + ctest --build-config ${{ inputs.build_mode }} -VV \ + -R "MPI_TEST_t_subfiling_vfd|MPI_TEST_t_vfd|H5_ph5_subfiling" + if: ${{ inputs.build_sys == 'CMake' }} diff --git a/.github/workflows/vfd.yml b/.github/workflows/vfd.yml new file mode 100644 index 00000000000..0cf7458518c --- /dev/null +++ b/.github/workflows/vfd.yml @@ -0,0 +1,47 @@ +name: hdf5 VFD CI + +# Run VFD CI daily at 07:00 CDT (12:00 UTC) +on: + workflow_dispatch: + schedule: + - cron: "0 12 * * *" + +permissions: + contents: read + +jobs: + build_and_test: + strategy: + matrix: + build_sys: ["CMake", "Autotools"] + build_mode: ["Release", "production", "Debug", "debug"] + include: + - build_sys: "CMake" + build_mode: "Release" + - build_sys: "CMake" + build_mode: "Debug" + - build_sys: "Autotools" + build_mode: "production" + - build_sys: "Autotools" + build_mode: "debug" + # Exclude mismatched configurations + exclude: + - build_sys: "CMake" + build_mode: "production" + - build_sys: "CMake" + build_mode: "debug" + - build_sys: "Autotools" + build_mode: "Release" + - build_sys: "Autotools" + build_mode: "Debug" + + # Sets the job's name from the properties + name: "${{ matrix.build_sys }} ${{ matrix.build_mode }} Workflows" + + # Don't run the action if the commit message says to skip CI + if: "!contains(github.event.head_commit.message, 'skip-ci')" + + uses: ./.github/workflows/vfd-main.yml + with: + build_sys: ${{ matrix.build_sys }} + build_mode: ${{ matrix.build_mode }} diff --git a/CMakeLists.txt b/CMakeLists.txt index cb8b596b7d7..81a6e96b6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -919,8 +919,8 @@ if (HDF5_ENABLE_THREADSAFE) message (VERBOSE " **** Allowing unsupported HL and thread-safety options **** ") endif () endif () - if (H5_HAVE_IOEO) - message (VERBOSE " **** Win32 threads requires WINVER>=0x600 (Windows Vista/7/8) **** ") + if (WIN32) + # When Win32 is available, we use those threads set (H5_HAVE_WIN_THREADS 1) else () if (NOT H5_HAVE_PTHREAD_H) diff --git a/HDF5Examples/C/H5FLT/h5ex_d_blosc.c b/HDF5Examples/C/H5FLT/h5ex_d_blosc.c index 883b459373f..3fc13654c15 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_blosc.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_blosc.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 7; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_bshuf.c b/HDF5Examples/C/H5FLT/h5ex_d_bshuf.c index a5f3ed724be..7b666da094c 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_bshuf.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_bshuf.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 3; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_bzip2.c b/HDF5Examples/C/H5FLT/h5ex_d_bzip2.c index 0c02b1daf99..421a1bf954e 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_bzip2.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_bzip2.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 1; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_jpeg.c b/HDF5Examples/C/H5FLT/h5ex_d_jpeg.c index 78a42528a0a..a3931bb32e0 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_jpeg.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_jpeg.c @@ -45,7 +45,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[3] = {NUM_IMAGES, DIM0, DIM1}, chunk[3] = {CHUNK0, CHUNK1, CHUNK2}; size_t nelmts = 4; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_lz4.c b/HDF5Examples/C/H5FLT/h5ex_d_lz4.c index 9900b512c55..0bcfc876cf3 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_lz4.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_lz4.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 1; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_lzf.c b/HDF5Examples/C/H5FLT/h5ex_d_lzf.c index 0e74e790683..a860d67e16c 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_lzf.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_lzf.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 3; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_mafisc.c b/HDF5Examples/C/H5FLT/h5ex_d_mafisc.c index b04a5b5583d..5cee4a07ce0 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_mafisc.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_mafisc.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 8; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_zfp.c b/HDF5Examples/C/H5FLT/h5ex_d_zfp.c index cb7d24d7f97..dd0a9366da9 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_zfp.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_zfp.c @@ -42,7 +42,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1}; size_t nelmts = 3; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/h5ex_d_zstd.c b/HDF5Examples/C/H5FLT/h5ex_d_zstd.c index 6891a71024e..28f084d90dd 100644 --- a/HDF5Examples/C/H5FLT/h5ex_d_zstd.c +++ b/HDF5Examples/C/H5FLT/h5ex_d_zstd.c @@ -44,7 +44,7 @@ main(void) herr_t status; htri_t avail; H5Z_filter_t filter_id = 0; - char filter_name[80]; + char filter_name[128]; hsize_t dims[3] = {NUM_IMAGES, DIM0, DIM1}, chunk[3] = {CHUNK0, CHUNK1, CHUNK2}; size_t nelmts = 1; /* number of elements in cd_values */ unsigned int flags; diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.ddl b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.ddl index 324fa1df26f..c14881d623c 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.ddl +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.ddl @@ -10,7 +10,7 @@ GROUP "/" { FILTERS { USER_DEFINED_FILTER { FILTER_ID 32001 - COMMENT HDF5 blosc filter; see http://www.hdfgroup.org/services/contributions.html + COMMENT HDF5 blosc filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md PARAMS { 2 2 4 128 4 1 2 } } } diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.tst b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.tst index ace1975ef9e..4a349b3dee0 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.tst +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_blosc.tst @@ -5,7 +5,7 @@ blosc filter is available for encoding and decoding. Filter info is available from the dataset creation property Filter identifier is 32001 Number of parameters is 7 with the value 4 1 2 - To find more about the filter check HDF5 blosc filter; see http://www.hdfgroup.org/services/contributions.html + To find more about the filter check HDF5 blosc filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md ....Reading blosc compressed data ................ Maximum value in DS1 is 1890 blosc filter is available now since H5Dread triggered loading of the filter. diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.ddl b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.ddl index 5cf633893e7..32c55eb8ddb 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.ddl +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.ddl @@ -10,7 +10,7 @@ GROUP "/" { FILTERS { USER_DEFINED_FILTER { FILTER_ID 307 - COMMENT HDF5 bzip2 filter; see http://www.hdfgroup.org/services/contributions.html + COMMENT HDF5 bzip2 filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md PARAMS { 2 } } } diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.tst b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.tst index a628ae1da5f..9f71cce3024 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.tst +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_bzip2.tst @@ -5,7 +5,7 @@ bzip2 filter is available for encoding and decoding. Filter info is available from the dataset creation property Filter identifier is 307 Number of parameters is 1 with the value 2 - To find more about the filter check HDF5 bzip2 filter; see http://www.hdfgroup.org/services/contributions.html + To find more about the filter check HDF5 bzip2 filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md ....Reading bzip2 compressed data ................ Maximum value in DS1 is 1890 bzip2 filter is available now since H5Dread triggered loading of the filter. diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.ddl b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.ddl index 1dc8928dcd8..1cc2ec38ffc 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.ddl +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.ddl @@ -10,7 +10,7 @@ GROUP "/" { FILTERS { USER_DEFINED_FILTER { FILTER_ID 32019 - COMMENT HDF5 jpeg filter; see http://www.hdfgroup.org/services/contributions.html + COMMENT HDF5 jpeg filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md PARAMS { 100 1024 512 0 } } } diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.tst b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.tst index d3f3bf87f4f..188aa5c2f57 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.tst +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_jpeg.tst @@ -5,7 +5,7 @@ jpeg filter is available for encoding and decoding. Filter info is available from the dataset creation property Filter identifier is 32019 Number of parameters is 4 with the value 100 - To find more about the filter check HDF5 jpeg filter; see http://www.hdfgroup.org/services/contributions.html + To find more about the filter check HDF5 jpeg filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md ....Reading jpeg compressed data ................ JPEG quality=100, percent of differing array elements=0.000000 jpeg filter is available now since H5Dread triggered loading of the filter. diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.ddl b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.ddl index f13c950f55b..a1fd1533046 100755 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.ddl +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.ddl @@ -10,7 +10,7 @@ GROUP "/" { FILTERS { USER_DEFINED_FILTER { FILTER_ID 32004 - COMMENT HDF5 lz4 filter; see http://www.hdfgroup.org/services/contributions.html + COMMENT HDF5 lz4 filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md PARAMS { 3 } } } diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.tst b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.tst index 5e5e9d74684..077e9dfc59d 100755 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.tst +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lz4.tst @@ -5,7 +5,7 @@ lz4 filter is available for encoding and decoding. Filter info is available from the dataset creation property Filter identifier is 32004 Number of parameters is 1 with the value 3 - To find more about the filter check HDF5 lz4 filter; see http://www.hdfgroup.org/services/contributions.html + To find more about the filter check HDF5 lz4 filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md ....Reading lz4 compressed data ................ Maximum value in DS1 is 1890 lz4 filter is available now since H5Dread triggered loading of the filter. diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.ddl b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.ddl index 089a82aa8be..c565245e65a 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.ddl +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.ddl @@ -10,7 +10,7 @@ GROUP "/" { FILTERS { USER_DEFINED_FILTER { FILTER_ID 32000 - COMMENT HDF5 lzf filter; see http://www.hdfgroup.org/services/contributions.html + COMMENT HDF5 lzf filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md PARAMS { 4 261 128 } } } diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.tst b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.tst index 96aca413b8d..0eeff2fd930 100755 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.tst +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_lzf.tst @@ -5,7 +5,7 @@ lzf filter is available for encoding and decoding. Filter info is available from the dataset creation property Filter identifier is 32000 Number of parameters is 3 with the value 4 - To find more about the filter check HDF5 lzf filter; see http://www.hdfgroup.org/services/contributions.html + To find more about the filter check HDF5 lzf filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md ....Reading lzf compressed data ................ Maximum value in DS1 is 1890 lzf filter is available now since H5Dread triggered loading of the filter. diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.ddl b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.ddl index c9513569f3f..a53b1bceef6 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.ddl +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.ddl @@ -10,7 +10,7 @@ GROUP "/" { FILTERS { USER_DEFINED_FILTER { FILTER_ID 32015 - COMMENT HDF5 zstd filter; see http://www.hdfgroup.org/services/contributions.html + COMMENT HDF5 zstd filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md PARAMS { 0 } } } diff --git a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.tst b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.tst index 3789a3eb202..c66aef97deb 100644 --- a/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.tst +++ b/HDF5Examples/C/H5FLT/tfiles/h5ex_d_zstd.tst @@ -5,7 +5,7 @@ zstd filter is available for encoding and decoding. Filter info is available from the dataset creation property Filter identifier is 32015 Number of parameters is 1 with the value 0 - To find more about the filter check HDF5 zstd filter; see http://www.hdfgroup.org/services/contributions.html + To find more about the filter check HDF5 zstd filter; see https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md ....Reading zstd compressed data ................ ZSTD number of differing array elements=0 zstd filter is available now since H5Dread triggered loading of the filter. diff --git a/HDF5Examples/C/H5T/h5ex_t_array.c b/HDF5Examples/C/H5T/h5ex_t_array.c index b63e4e0eb7f..a29ac455c98 100644 --- a/HDF5Examples/C/H5T/h5ex_t_array.c +++ b/HDF5Examples/C/H5T/h5ex_t_array.c @@ -144,7 +144,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n", DATASET, i); + printf("%s[%" PRIuHSIZE "]:\n", DATASET, i); for (j = 0; j < adims[0]; j++) { printf(" ["); for (k = 0; k < adims[1]; k++) diff --git a/HDF5Examples/C/H5T/h5ex_t_arrayatt.c b/HDF5Examples/C/H5T/h5ex_t_arrayatt.c index a89f2b2584a..f0711286160 100644 --- a/HDF5Examples/C/H5T/h5ex_t_arrayatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_arrayatt.c @@ -155,7 +155,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]:\n", ATTRIBUTE, i); for (j = 0; j < adims[0]; j++) { printf(" ["); for (k = 0; k < adims[1]; k++) diff --git a/HDF5Examples/C/H5T/h5ex_t_cmpd.c b/HDF5Examples/C/H5T/h5ex_t_cmpd.c index 739d0616096..44f15523fba 100644 --- a/HDF5Examples/C/H5T/h5ex_t_cmpd.c +++ b/HDF5Examples/C/H5T/h5ex_t_cmpd.c @@ -136,7 +136,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n", DATASET, i); + printf("%s[%" PRIuHSIZE "]:\n", DATASET, i); printf("Serial number : %d\n", rdata[i].serial_no); printf("Location : %s\n", rdata[i].location); printf("Temperature (F) : %f\n", rdata[i].temperature); diff --git a/HDF5Examples/C/H5T/h5ex_t_cmpdatt.c b/HDF5Examples/C/H5T/h5ex_t_cmpdatt.c index 246537b1d92..04c72a510e2 100644 --- a/HDF5Examples/C/H5T/h5ex_t_cmpdatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_cmpdatt.c @@ -146,7 +146,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]:\n", ATTRIBUTE, i); printf("Serial number : %d\n", rdata[i].serial_no); printf("Location : %s\n", rdata[i].location); printf("Temperature (F) : %f\n", rdata[i].temperature); diff --git a/HDF5Examples/C/H5T/h5ex_t_cpxcmpd.c b/HDF5Examples/C/H5T/h5ex_t_cpxcmpd.c index 8506c08cbeb..370f7819bb4 100644 --- a/HDF5Examples/C/H5T/h5ex_t_cpxcmpd.c +++ b/HDF5Examples/C/H5T/h5ex_t_cpxcmpd.c @@ -293,7 +293,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n", DATASET, i); + printf("%s[%" PRIuHSIZE "]:\n", DATASET, i); printf(" Vehicle name :\n %s\n", rdata[i].name); printf(" Sensor locations :\n"); for (j = 0; j < rdata[i].sensors.len; j++) diff --git a/HDF5Examples/C/H5T/h5ex_t_cpxcmpdatt.c b/HDF5Examples/C/H5T/h5ex_t_cpxcmpdatt.c index c7efbce72aa..a55fb76f765 100644 --- a/HDF5Examples/C/H5T/h5ex_t_cpxcmpdatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_cpxcmpdatt.c @@ -304,7 +304,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]:\n", ATTRIBUTE, i); printf(" Vehicle name :\n %s\n", rdata[i].name); printf(" Sensor locations :\n"); for (j = 0; j < rdata[i].sensors.len; j++) diff --git a/HDF5Examples/C/H5T/h5ex_t_objref.c b/HDF5Examples/C/H5T/h5ex_t_objref.c index 660cc110a25..e6c2de95d66 100644 --- a/HDF5Examples/C/H5T/h5ex_t_objref.c +++ b/HDF5Examples/C/H5T/h5ex_t_objref.c @@ -135,7 +135,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n ->", DATASET, i); + printf("%s[%" PRIuHSIZE "]:\n ->", DATASET, i); /* * Open the referenced object, get its name and type. @@ -174,6 +174,9 @@ main(void) case H5O_TYPE_NAMED_DATATYPE: printf("Named Datatype"); break; + case H5O_TYPE_MAP: + printf("Map Object"); + break; case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: printf("Unknown"); diff --git a/HDF5Examples/C/H5T/h5ex_t_objrefatt.c b/HDF5Examples/C/H5T/h5ex_t_objrefatt.c index 1d9d1feb91a..562364a203e 100644 --- a/HDF5Examples/C/H5T/h5ex_t_objrefatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_objrefatt.c @@ -147,7 +147,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n ->", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]:\n ->", ATTRIBUTE, i); /* * Open the referenced object, get its name and type. @@ -186,6 +186,9 @@ main(void) case H5O_TYPE_NAMED_DATATYPE: printf("Named Datatype"); break; + case H5O_TYPE_MAP: + printf("Map Object"); + break; case H5O_TYPE_UNKNOWN: case H5O_TYPE_NTYPES: printf("Unknown"); diff --git a/HDF5Examples/C/H5T/h5ex_t_opaqueatt.c b/HDF5Examples/C/H5T/h5ex_t_opaqueatt.c index e88031ac9ab..67294921ae3 100644 --- a/HDF5Examples/C/H5T/h5ex_t_opaqueatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_opaqueatt.c @@ -121,7 +121,7 @@ main(void) */ printf("Datatype tag for %s is: \"%s\"\n", ATTRIBUTE, tag); for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]: ", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]: ", ATTRIBUTE, i); for (j = 0; j < len; j++) printf("%c", rdata[j + i * len]); printf("\n"); diff --git a/HDF5Examples/C/H5T/h5ex_t_regref.c b/HDF5Examples/C/H5T/h5ex_t_regref.c index 39227259507..e6d4cef2c32 100644 --- a/HDF5Examples/C/H5T/h5ex_t_regref.c +++ b/HDF5Examples/C/H5T/h5ex_t_regref.c @@ -168,7 +168,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n ->", DATASET, i); + printf("%s[%" PRIuHSIZE "]:\n ->", DATASET, i); /* * Open the referenced object, retrieve its region as a diff --git a/HDF5Examples/C/H5T/h5ex_t_regrefatt.c b/HDF5Examples/C/H5T/h5ex_t_regrefatt.c index 5ed745d75b0..bb31b707c51 100644 --- a/HDF5Examples/C/H5T/h5ex_t_regrefatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_regrefatt.c @@ -183,7 +183,7 @@ main(void) * Output the data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n ->", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]:\n ->", ATTRIBUTE, i); /* * Open the referenced object, retrieve its region as a diff --git a/HDF5Examples/C/H5T/h5ex_t_vlen.c b/HDF5Examples/C/H5T/h5ex_t_vlen.c index 7111a343e1c..b5649729c9b 100644 --- a/HDF5Examples/C/H5T/h5ex_t_vlen.c +++ b/HDF5Examples/C/H5T/h5ex_t_vlen.c @@ -118,7 +118,7 @@ main(void) * Output the variable-length data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n {", DATASET, i); + printf("%s[%" PRIuHSIZE "]:\n {", DATASET, i); ptr = rdata[i].p; for (j = 0; j < rdata[i].len; j++) { printf(" %d", ptr[j]); diff --git a/HDF5Examples/C/H5T/h5ex_t_vlenatt.c b/HDF5Examples/C/H5T/h5ex_t_vlenatt.c index db69aea4631..e173a20f3bc 100644 --- a/HDF5Examples/C/H5T/h5ex_t_vlenatt.c +++ b/HDF5Examples/C/H5T/h5ex_t_vlenatt.c @@ -128,7 +128,7 @@ main(void) * Output the variable-length data to the screen. */ for (i = 0; i < dims[0]; i++) { - printf("%s[%llu]:\n {", ATTRIBUTE, i); + printf("%s[%" PRIuHSIZE "]:\n {", ATTRIBUTE, i); ptr = rdata[i].p; for (j = 0; j < rdata[i].len; j++) { printf(" %d", ptr[j]); diff --git a/README.md b/README.md index 4749ab7c56d..fa1c70e7977 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ HDF5 version 1.15.0 currently under development [![h5py build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/h5py.yml?branch=develop&label=h5py)](https://github.com/HDFGroup/hdf5/actions/workflows/h5py.yml?query=branch%3Adevelop) [![CVE regression](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/cve.yml?branch=develop&label=CVE)](https://github.com/HDFGroup/hdf5/actions/workflows/cve.yml?query=branch%3Adevelop) [![HDF5 VOL connectors build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/vol.yml?branch=develop&label=HDF5-VOL)](https://github.com/HDFGroup/hdf5/actions/workflows/vol.yml?query=branch%3Adevelop) +[![HDF5 VFD build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/vfd.yml?branch=develop&label=HDF5-VFD)](https://github.com/HDFGroup/hdf5/actions/workflows/vfd.yml?query=branch%3Adevelop) [![1.14 build status](https://img.shields.io/github/actions/workflow/status/HDFGroup/hdf5/main.yml?branch=hdf5_1_14&label=1.14)](https://github.com/HDFGroup/hdf5/actions/workflows/main.yml?query=branch%3Ahdf5_1_14) [![BSD](https://img.shields.io/badge/License-BSD-blue.svg)](https://github.com/HDFGroup/hdf5/blob/develop/COPYING) @@ -88,7 +89,7 @@ are tentative. | Release | New Features | | ------- | ------------ | | 1.14.4 | native float16 support, cloud-optimized HDF5 improvements | -| 1.14.5 | TBD | +| 1.14.5 | Complex number support | | TBD | VFD SWMR | | 2.0.0 | TBD | diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 30ff60f655d..aea37831df4 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -52,6 +52,9 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-error_test #uses runTest.cmake H5TEST-err_compat #uses runTest.cmake H5TEST-testlibinfo #uses grepTest.cmake + H5SHELL-test_flush_refresh #uses shell script + H5SHELL-test_flush_refresh #uses shell script + H5SHELL-test_vds_swmr #uses shell script ######### H5TEST-clear-objects H5TEST-cache-clear-objects diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 668739e7074..ef8500c2559 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -119,10 +119,7 @@ CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H) CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) CHECK_INCLUDE_FILE_CONCAT ("pwd.h" ${HDF_PREFIX}_HAVE_PWD_H) -CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H) -CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H) CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H) -CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H) CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H) CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H) CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H) @@ -143,7 +140,6 @@ else () endif () if (CYGWIN) - set (${HDF_PREFIX}_HAVE_LSEEK64 0) set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") add_definitions ("-D_GNU_SOURCE") endif () @@ -262,6 +258,13 @@ endif () # # https://docs.oracle.com/cd/E23824_01/html/821-1474/lfcompile-5.html +# MinGW and Cygwin +if (MINGW OR CYGWIN) + set (CMAKE_REQUIRED_DEFINITIONS + "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE" + ) +endif () + #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- @@ -327,7 +330,7 @@ if (MINGW OR NOT WINDOWS) endif () HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) -HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T) +HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T) #----------------------------------------------------------------------------- # Extra C99 types @@ -440,62 +443,6 @@ if (MINGW OR NOT WINDOWS) endforeach () endif () -#----------------------------------------------------------------------------- -# Check if InitOnceExecuteOnce is available -#----------------------------------------------------------------------------- -if (WINDOWS) - if (NOT HDF_NO_IOEO_TEST) - message (VERBOSE "Checking for InitOnceExecuteOnce:") - if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO) - if (LARGEFILE) - set (CMAKE_REQUIRED_DEFINITIONS - "${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" - ) - endif () - set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}") - if (CMAKE_REQUIRED_INCLUDES) - set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else () - set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif () - - TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_DIR}/HDFTests.c - COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}" - LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}" - CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}" - COMPILE_OUTPUT_VARIABLE OUTPUT - ) - # if it did not compile make the return value fail code of 1 - if (NOT HAVE_IOEO_COMPILED) - set (HAVE_IOEO_EXITCODE 1) - endif () - # if the return value was 0 then it worked - if ("${HAVE_IOEO_EXITCODE}" EQUAL 0) - set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce") - message (VERBOSE "Performing Test InitOnceExecuteOnce - Success") - file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing C SOURCE FILE Test InitOnceExecuteOnce succeeded with the following output:\n" - "${OUTPUT}\n" - "Return value: ${HAVE_IOEO}\n") - else () - if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN") - set (${HDF_PREFIX}_HAVE_IOEO "${HAVE_IOEO_EXITCODE}") - else () - set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce") - endif () - - message (VERBOSE "Performing Test InitOnceExecuteOnce - Failed") - file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Performing InitOnceExecuteOnce Test failed with the following output:\n" - "${OUTPUT}\n" - "Return value: ${HAVE_IOEO_EXITCODE}\n") - endif () - endif () - endif () -endif () - # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can handle converting # denormalized floating-point values. @@ -653,38 +600,20 @@ unset (CMAKE_EXTRA_INCLUDE_FILES) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- -# Check if Direct I/O driver works +# Check whether we can build the direct VFD #----------------------------------------------------------------------------- -if (NOT WINDOWS) - option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF) - if (HDF5_ENABLE_DIRECT_VFD) - set (msg "Performing TEST_DIRECT_VFD_WORKS") - set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") - TRY_RUN (TEST_DIRECT_VFD_WORKS_RUN TEST_DIRECT_VFD_WORKS_COMPILE - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_DIR}/HDFTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - OUTPUT_VARIABLE OUTPUT - ) - if (TEST_DIRECT_VFD_WORKS_COMPILE) - if (TEST_DIRECT_VFD_WORKS_RUN EQUAL "0") - HDF_FUNCTION_TEST (HAVE_DIRECT) - set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") - add_definitions ("-D_GNU_SOURCE") - else () - set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (VERBOSE "${msg}... no") - file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" - ) - endif () - else () - set (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) - message (VERBOSE "${msg}... no") - file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" - ) - endif () +option (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" OFF) +if (HDF5_ENABLE_DIRECT_VFD) + # The direct VFD is tied to POSIX direct I/O as enabled by the O_DIRECT + # flag. No other form of direct I/O is supported. This feature also + # requires posix_memalign(). + CHECK_SYMBOL_EXISTS (O_DIRECT "fcntl.h" HAVE_O_DIRECT) + CHECK_SYMBOL_EXISTS (posix_memalign "stdlib.h" HAVE_POSIX_MEMALIGN) + + if (HAVE_O_DIRECT AND HAVE_POSIX_MEMALIGN) + set (${HDF_PREFIX}_HAVE_DIRECT 1) + else () + message (FATAL_ERROR "The direct VFD was requested but cannot be built.\nIt requires O_DIRECT flag support and posix_memalign()") endif () endif () @@ -705,7 +634,7 @@ option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF) endif () # ---------------------------------------------------------------------- -# Check whether we can build the Mirror VFD +# Check whether we can build the mirror VFD # ---------------------------------------------------------------------- option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF) if (HDF5_ENABLE_MIRROR_VFD) @@ -858,7 +787,8 @@ macro (H5ConversionTests TEST def msg) ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_DIR}/ConversionTests.c CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-D${TEST}_TEST - OUTPUT_VARIABLE OUTPUT + COMPILE_OUTPUT_VARIABLE ${TEST}_COMPILE_OUTPUT + RUN_OUTPUT_VARIABLE ${TEST}_RUN_OUTPUT ) if (${TEST}_COMPILE) if (${TEST}_RUN EQUAL "0") @@ -868,14 +798,17 @@ macro (H5ConversionTests TEST def msg) set (${TEST} "" CACHE INTERNAL ${msg}) message (VERBOSE "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Test ${TEST} Run failed with the following output and exit code:\n ${OUTPUT}\n" + "Test ${TEST} Compile succeeded with the following output:\n ${${TEST}_COMPILE_OUTPUT}\n" + ) + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test ${TEST} Run failed with exit code ${${TEST}_RUN} and with the following output:\n ${${TEST}_RUN_OUTPUT}\n" ) endif () else () set (${TEST} "" CACHE INTERNAL ${msg}) message (VERBOSE "${msg}... no") file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Test ${TEST} Compile failed with the following output:\n ${OUTPUT}\n" + "Test ${TEST} Compile failed with the following output:\n ${${TEST}_COMPILE_OUTPUT}\n" ) endif () else () @@ -937,3 +870,76 @@ H5ConversionTests (${HDF_PREFIX}_LLONG_TO_LDOUBLE_CORRECT TRUE "Checking IF corr # some long double values #----------------------------------------------------------------------------- H5ConversionTests (${HDF_PREFIX}_DISABLE_SOME_LDOUBLE_CONV FALSE "Checking IF the cpu is power9 and cannot correctly converting long double values") + +#----------------------------------------------------------------------------- +# Check if _Float16 type is available +#----------------------------------------------------------------------------- +message (STATUS "Checking if _Float16 support is available") +set (${HDF_PREFIX}_HAVE__FLOAT16 0) +HDF_CHECK_TYPE_SIZE (_Float16 ${HDF_PREFIX}_SIZEOF__FLOAT16) +if (${HDF_PREFIX}_SIZEOF__FLOAT16) + # Request _Float16 support + set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} "-D__STDC_WANT_IEC_60559_TYPES_EXT__") + + # Some compilers expose the _Float16 datatype, but not the macros and + # functions used with the datatype. We need the macros for proper + # datatype conversion support. Check for these here. + CHECK_SYMBOL_EXISTS (FLT16_EPSILON "float.h" h5_have_flt16_epsilon) + CHECK_SYMBOL_EXISTS (FLT16_MIN "float.h" h5_have_flt16_min) + CHECK_SYMBOL_EXISTS (FLT16_MAX "float.h" h5_have_flt16_max) + CHECK_SYMBOL_EXISTS (FLT16_MIN_10_EXP "float.h" h5_have_flt16_min_10_exp) + CHECK_SYMBOL_EXISTS (FLT16_MAX_10_EXP "float.h" h5_have_flt16_max_10_exp) + CHECK_SYMBOL_EXISTS (FLT16_MANT_DIG "float.h" h5_have_flt16_mant_dig) + + if (h5_have_flt16_epsilon AND h5_have_flt16_min AND + h5_have_flt16_max AND h5_have_flt16_min_10_exp AND + h5_have_flt16_max_10_exp AND h5_have_flt16_mant_dig) + # Some compilers like OneAPI on Windows appear to detect _Float16 support + # properly up to this point, and, in the absence of any architecture-specific + # tuning compiler flags, will generate code for H5Tconv.c that performs + # software conversions on _Float16 variables with compiler-internal functions + # such as __extendhfsf2, __truncsfhf2, or __truncdfhf2. However, these + # compilers will fail to link these functions into the build for currently + # unknown reasons and cause the build to fail. Since these are compiler-internal + # functions that we don't appear to have much control over, let's try to + # compile a program that will generate these functions to check for _Float16 + # support. If we fail to compile this program, we will simply disable + # _Float16 support for the time being. + H5ConversionTests ( + ${HDF_PREFIX}_FLOAT16_CONVERSION_FUNCS_LINK + FALSE + "Checking if compiler can convert _Float16 type with casts" + ) + + if (${${HDF_PREFIX}_FLOAT16_CONVERSION_FUNCS_LINK}) + # Finally, MacOS 13 appears to have a bug specifically when converting + # long double values to _Float16. Release builds of the dt_arith test + # would cause any assignments to a _Float16 variable to be elided, + # whereas Debug builds would perform incorrect hardware conversions by + # simply chopping off all the bytes of the value except for the first 2. + # These tests pass on MacOS 14, so let's perform a quick test to check + # if the hardware conversion is done correctly. + H5ConversionTests ( + ${HDF_PREFIX}_LDOUBLE_TO_FLOAT16_CORRECT + TRUE + "Checking if correctly converting long double to _Float16 values" + ) + + if (NOT ${${HDF_PREFIX}_LDOUBLE_TO_FLOAT16_CORRECT}) + message (VERBOSE "Conversions from long double to _Float16 appear to be incorrect. These will be emulated through a soft conversion function.") + endif () + + set (${HDF_PREFIX}_HAVE__FLOAT16 1) + + # Check if we can use fabsf16 + CHECK_FUNCTION_EXISTS (fabsf16 ${HDF_PREFIX}_HAVE_FABSF16) + else () + message (STATUS "_Float16 support has been disabled because the compiler couldn't compile and run a test program for _Float16 conversions") + message (STATUS "Check ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log for information on why the test program couldn't be compiled/run") + endif () + else () + message (STATUS "_Float16 support has been disabled since the required macros (FLT16_MAX, FLT16_EPSILON, etc. were not found)") + endif () +else () + message (STATUS "_Float16 support has been disabled since the _Float16 type was not found") +endif () diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 725f0496f01..8e103bd3e97 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -285,3 +285,125 @@ int HDF_NO_UBSAN main(void) } #endif + +#ifdef H5_FLOAT16_CONVERSION_FUNCS_LINK_TEST + +#define __STDC_WANT_IEC_60559_TYPES_EXT__ + +#include +#include + +int HDF_NO_UBSAN main(void) +{ + _Float16 fl16_var; + signed char sc; + unsigned char usc; + short s; + unsigned short us; + int i; + unsigned int ui; + long l; + unsigned long ul; + long long ll; + unsigned long long ull; + float f; + double d; + long double ld; + int ret = 0; + + /* + * Cast the _Float16 type between all the different C datatypes + * we support conversions for in H5Tconv.c to check if the compiler + * properly links any software conversion functions it may generate + * for the casts, such as __extendhfsf2 or __truncdfhf2. + */ + + fl16_var = 3.0f16; + + sc = (signed char)fl16_var; + usc = (unsigned char)fl16_var; + s = (short)fl16_var; + us = (unsigned short)fl16_var; + i = (int)fl16_var; + ui = (unsigned int)fl16_var; + l = (long)fl16_var; + ul = (unsigned long)fl16_var; + ll = (long long)fl16_var; + ull = (unsigned long long)fl16_var; + f = (float)fl16_var; + d = (double)fl16_var; + ld = (long double)fl16_var; + + sc = (signed char)3; + fl16_var = (_Float16)sc; + + usc = (unsigned char)3; + fl16_var = (_Float16)usc; + + s = (short)3; + fl16_var = (_Float16)s; + + us = (unsigned short)3; + fl16_var = (_Float16)us; + + i = (int)3; + fl16_var = (_Float16)i; + + ui = (unsigned int)3; + fl16_var = (_Float16)ui; + + l = (long)3; + fl16_var = (_Float16)l; + + ul = (unsigned long)3; + fl16_var = (_Float16)ul; + + ll = (long long)3; + fl16_var = (_Float16)ll; + + ull = (unsigned long long)3; + fl16_var = (_Float16)ull; + + f = (float)3.0f; + fl16_var = (_Float16)f; + + d = (double)3.0; + fl16_var = (_Float16)d; + + ld = (long double)3.0l; + fl16_var = (_Float16)ld; + +done: + exit(ret); +} + +#endif + +#ifdef H5_LDOUBLE_TO_FLOAT16_CORRECT_TEST + +#define __STDC_WANT_IEC_60559_TYPES_EXT__ + +#include +#include +#include +#include + +int HDF_NO_UBSAN main(void) +{ + long double ld; + _Float16 half; + int ret = 1; + + ld = 32.0L; + half = 64.0f16; + + half = (_Float16)ld; + + if (fabsl(ld - (long double)half) < LDBL_EPSILON) + ret = 0; + +done: + exit(ret); +} + +#endif diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index f835da103f8..b3fbede50a3 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -131,6 +131,9 @@ /* Define if library information should be embedded in the executables */ #cmakedefine H5_HAVE_EMBEDDED_LIBINFO @H5_HAVE_EMBEDDED_LIBINFO@ +/* Define to 1 if you have the `fabsf16' function. */ +#cmakedefine H5_HAVE_FABSF16 @H5_HAVE_FABSF16@ + /* Define to 1 if you have the `fcntl' function. */ #cmakedefine H5_HAVE_FCNTL @H5_HAVE_FCNTL@ @@ -143,6 +146,9 @@ /* Define if support for szip filter is enabled */ #cmakedefine H5_HAVE_FILTER_SZIP @H5_HAVE_FILTER_SZIP@ +/* Determine if _Float16 is available */ +#cmakedefine H5_HAVE__FLOAT16 @H5_HAVE__FLOAT16@ + /* Determine if __float128 is available */ #cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@ @@ -216,9 +222,6 @@ /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ -/* Define to 1 if you have the `lseek64' function. */ -#cmakedefine H5_HAVE_LSEEK64 @H5_HAVE_LSEEK64@ - /* Define if the map API (H5M) should be compiled */ #cmakedefine H5_HAVE_MAP_API @H5_HAVE_MAP_API@ @@ -283,9 +286,6 @@ compiled */ #cmakedefine H5_HAVE_ROS3_VFD @H5_HAVE_ROS3_VFD@ -/* Define to 1 if you have the `stat64' function. */ -#cmakedefine H5_HAVE_STAT64 @H5_HAVE_STAT64@ - /* Define if struct stat has the st_blocks field */ #cmakedefine H5_HAVE_STAT_ST_BLOCKS @H5_HAVE_STAT_ST_BLOCKS@ @@ -366,10 +366,10 @@ /* Define to 1 if you have the `waitpid' function. */ #cmakedefine H5_HAVE_WAITPID @H5_HAVE_WAITPID@ -/* Define to 1 if you have the 'InitOnceExecuteOnce' function. */ +/* Define to 1 if you have Win32 threads */ #cmakedefine H5_HAVE_WIN_THREADS @H5_HAVE_WIN_THREADS@ -/* Define if your system has window style path name. */ +/* Define if your system has Windows-style path name. */ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ /* Define to 1 if you have the header file. */ @@ -390,6 +390,9 @@ /* Define if new-style references should be used with dimension scales */ #cmakedefine H5_DIMENSION_SCALES_WITH_NEW_REF @H5_DIMENSION_SCALES_WITH_NEW_REF@ +/* Define if your system can convert long double to _Float16 values correctly. */ +#cmakedefine H5_LDOUBLE_TO_FLOAT16_CORRECT @H5_LDOUBLE_TO_FLOAT16_CORRECT@ + /* Define if your system can convert long double to (unsigned) long long values correctly. */ #cmakedefine H5_LDOUBLE_TO_LLONG_ACCURATE @H5_LDOUBLE_TO_LLONG_ACCURATE@ @@ -592,6 +595,9 @@ /* The size of `_Quad', as computed by sizeof. */ #define H5_SIZEOF__QUAD @H5_SIZEOF__QUAD@ +/* The size of `_Float16', as computed by sizeof. */ +#define H5_SIZEOF__FLOAT16 @H5_SIZEOF__FLOAT16@ + /* The size of `__float128', as computed by sizeof. */ #define H5_SIZEOF___FLOAT128 @H5_SIZEOF___FLOAT128@ diff --git a/config/cmake/HDFTests.c b/config/cmake/HDFTests.c index 3d16721346c..0f0600abd81 100644 --- a/config/cmake/HDFTests.c +++ b/config/cmake/HDFTests.c @@ -89,29 +89,6 @@ int main () #endif /* DEV_T_IS_SCALAR */ -#ifdef TEST_DIRECT_VFD_WORKS - -#include -#include -#include - -int main(void) -{ - int fid; - - if ((fid = open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755)) < 0) - return 1; - close(fid); - remove("tst_file"); - - return 0; -} -#endif - -#ifdef HAVE_DIRECT - SIMPLE_TEST(posix_memalign()); -#endif - #ifdef HAVE_DEFAULT_SOURCE /* Check default source */ #include @@ -126,21 +103,3 @@ main(void) #endif } #endif - -#ifdef HAVE_IOEO - -#include -typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); -int main () -{ - PGNSI pGNSI; - - pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "InitOnceExecuteOnce"); - - if (NULL == pGNSI) - return 1; - else - return 0; -} - -#endif /* HAVE_IOEO */ diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index f60f0def177..abf33c734f2 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -79,7 +79,7 @@ Dimension scales w/ new references: @DIMENSION_SCALES_WITH_NEW_REF@ With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@ I/O filters (external): @EXTERNAL_FILTERS@ Map (H5M) API: @H5_HAVE_MAP_API@ - Direct VFD: @H5_HAVE_DIRECT@ + Direct VFD: @HDF5_ENABLE_DIRECT_VFD@ Mirror VFD: @H5_HAVE_MIRROR_VFD@ Subfiling VFD: @H5_HAVE_SUBFILING_VFD@ (Read-Only) S3 VFD: @H5_HAVE_ROS3_VFD@ diff --git a/config/sanitizer/README.md b/config/sanitizer/README.md index eee157b53e9..62202ffa7ec 100644 --- a/config/sanitizer/README.md +++ b/config/sanitizer/README.md @@ -182,7 +182,7 @@ As an example, a CMake configuration such as this: would result in build commands such as this: ```AFL_LLVM_THREADSAFE_INST=1 AFL_LLVM_LAF_ALL=1 afl-clang-lto --afl-lto <...>``` -## Compiler Options [`compiler-options.cmake`](compiler-options.cmake) +## Compiler Options Allows for easy use of some pre-made compiler options for the major compilers. @@ -200,8 +200,7 @@ Using `-DGENERATE_DEPENDENCY_DATA=ON` generates `.d` files along with regular ob ## Dependency Graph [`dependency-graph.cmake`](dependency-graph.cmake) -CMake, with the dot application available, will build a visual representation of the library/executable dependencies, like so: -![Dependency Graph](img/dp-graph.png) +CMake, with the dot application available, will build a visual representation of the library/executable dependencies. ### Required Arguments diff --git a/configure.ac b/configure.ac index b76f18ff29f..6f9cba4f57e 100644 --- a/configure.ac +++ b/configure.ac @@ -559,6 +559,109 @@ AC_CHECK_SIZEOF([float]) AC_CHECK_SIZEOF([double]) AC_CHECK_SIZEOF([long double]) +## ---------------------------------------------------------------------- +## Check if _Float16 support is available +## +AC_MSG_NOTICE([checking if _Float16 support is available]) +HAVE__FLOAT16="no" +AC_CHECK_SIZEOF([_Float16]) +if test "$ac_cv_sizeof__Float16" != 0; then + # Some compilers expose the _Float16 datatype, but not the macros and + # functions used with the datatype. We need the macros for proper + # datatype conversion support. Check for these here. + AC_CHECK_DECL([FLT16_EPSILON], [], [], [[ + #define __STDC_WANT_IEC_60559_TYPES_EXT__ + #include ]]) + AC_CHECK_DECL([FLT16_MIN], [], [], [[ + #define __STDC_WANT_IEC_60559_TYPES_EXT__ + #include ]]) + AC_CHECK_DECL([FLT16_MAX], [], [], [[ + #define __STDC_WANT_IEC_60559_TYPES_EXT__ + #include ]]) + AC_CHECK_DECL([FLT16_MIN_10_EXP], [], [], [[ + #define __STDC_WANT_IEC_60559_TYPES_EXT__ + #include ]]) + AC_CHECK_DECL([FLT16_MAX_10_EXP], [], [], [[ + #define __STDC_WANT_IEC_60559_TYPES_EXT__ + #include ]]) + AC_CHECK_DECL([FLT16_MANT_DIG], [], [], [[ + #define __STDC_WANT_IEC_60559_TYPES_EXT__ + #include ]]) + + if test "X$ac_cv_have_decl_FLT16_EPSILON" = "Xyes" && + test "X$ac_cv_have_decl_FLT16_MIN" = "Xyes" && + test "X$ac_cv_have_decl_FLT16_MAX" = "Xyes" && + test "X$ac_cv_have_decl_FLT16_MIN_10_EXP" = "Xyes" && + test "X$ac_cv_have_decl_FLT16_MAX_10_EXP" = "Xyes" && + test "X$ac_cv_have_decl_FLT16_MANT_DIG" = "Xyes" ; then + # Some compilers like OneAPI on Windows appear to detect _Float16 support + # properly up to this point, and, in the absence of any architecture-specific + # tuning compiler flags, will generate code for H5Tconv.c that performs + # software conversions on _Float16 variables with compiler-internal functions + # such as __extendhfsf2, __truncsfhf2, or __truncdfhf2. However, these + # compilers will fail to link these functions into the build for currently + # unknown reasons and cause the build to fail. Since these are compiler-internal + # functions that we don't appear to have much control over, let's try to + # compile a program that will generate these functions to check for _Float16 + # support. If we fail to compile this program, we will simply disable + # _Float16 support for the time being. + AC_MSG_CHECKING([if compiler can correctly compile and run a test program which converts _Float16 to other types with casts]) + TEST_SRC="`(echo \"#define H5_FLOAT16_CONVERSION_FUNCS_LINK_TEST 1\"; cat $srcdir/config/cmake/ConversionTests.c)`" + AC_CACHE_VAL([hdf5_cv_float16_conversion_funcs_link], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([$TEST_SRC])], + [hdf5_cv_float16_conversion_funcs_link=yes], [hdf5_cv_float16_conversion_funcs_link=no], [hdf5_cv_float16_conversion_funcs_link=no])]) + + if test ${hdf5_cv_float16_conversion_funcs_link} = "yes"; then + AC_MSG_RESULT([yes]) + + # Finally, MacOS 13 appears to have a bug specifically when converting + # long double values to _Float16. Release builds of the dt_arith test + # would cause any assignments to a _Float16 variable to be elided, + # whereas Debug builds would perform incorrect hardware conversions by + # simply chopping off all the bytes of the value except for the first 2. + # These tests pass on MacOS 14, so let's perform a quick test to check + # if the hardware conversion is done correctly. + AC_MSG_CHECKING([if compiler can correctly convert long double values to _Float16]) + TEST_SRC="`(echo \"#define H5_LDOUBLE_TO_FLOAT16_CORRECT_TEST 1\"; cat $srcdir/config/cmake/ConversionTests.c)`" + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_ldouble_to_float16_correct=${hdf5_cv_ldouble_to_float16_correct=no} + else + AC_CACHE_VAL([hdf5_cv_ldouble_to_float16_correct], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([$TEST_SRC])], + [hdf5_cv_ldouble_to_float16_correct=yes], [hdf5_cv_ldouble_to_float16_correct=no], [hdf5_cv_ldouble_to_float16_correct=yes])]) + fi + + if test ${hdf5_cv_ldouble_to_float16_correct} = "yes"; then + AC_DEFINE([LDOUBLE_TO_FLOAT16_CORRECT], [1], + [Define if your system can convert long double to _Float16 values correctly.]) + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Conversions from long double to _Float16 appear to be incorrect. These will be emulated through a soft conversion function.]) + fi + + HAVE__FLOAT16="yes" + + # Check if we can use fabsf16 + AC_CHECK_FUNC([fabsf16], [AC_DEFINE([HAVE_FABSF16], [1], + [Define if has fabsf16 function])], []) + + # Define HAVE__FLOAT16 macro for H5pubconf.h if _Float16 is available. + AC_DEFINE([HAVE__FLOAT16], [1], [Determine if _Float16 is available]) + else + AC_MSG_RESULT([no]) + fi + fi + + AC_MSG_CHECKING([if _Float16 support is enabled]) + AC_MSG_RESULT([$HAVE__FLOAT16]) +fi + +# Define HAVE__FLOAT16 value to substitute into other files for conditional testing +AC_SUBST([HAVE__FLOAT16]) + ## ---------------------------------------------------------------------- ## Check if the Fortran interface should be enabled ## @@ -1441,10 +1544,10 @@ case $host_os in esac ## Windows -case "`uname`" in - MINGW*) +case "$host_os" in + *mingw*) # The Winsock library - AC_CHECK_LIB([ws2_32], [GetUserName]) + AC_CHECK_LIB([ws2_32], [htons]) ;; esac @@ -1459,9 +1562,9 @@ AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h sys/socket.h]) ## if test "X${enable_shared}" = "Xyes"; then AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared libraries]) - case "`uname`" in - CYGWIN*|MINGW*|AIX*) - ## Add in the -no-undefined flag to LDFLAGS for libtool. + case "$host_os" in + *cygwin*|*mingw*|*aix*) + ## Add in the -no-undefined flag to LDFLAGS for libtool AC_MSG_RESULT([yes]) H5_LDFLAGS="$H5_LDFLAGS -no-undefined" ;; @@ -1480,7 +1583,7 @@ AC_SYS_LARGEFILE ## ---------------------------------------------------------------------- ## Add necessary defines for Linux Systems. ## -case "$host_cpu-$host_vendor-$host_os" in +case "$host_os" in *linux*) ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen @@ -1510,6 +1613,7 @@ case "$host_cpu-$host_vendor-$host_os" in H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ;; *mingw*) + HDF_MINGW="yes" AC_DEFINE([HAVE_WINDOWS], [1], [Define if this is a Windows machine]) AC_DEFINE([HAVE_WIN32_API], [1], [Define if on the Windows platform using the Win32 API]) AC_DEFINE([HAVE_MINGW], [1], [Define if using MinGW]) @@ -1923,101 +2027,118 @@ if test "X$THREADSAFE" = "Xyes"; then ## and/or a library path. If the library path is specified then it must ## be preceded by a comma. ## - ## Thread-safety in HDF5 only uses Pthreads via configure, so the - ## default is "check", though this only has an effect when - ## --enable-threadsafe is specified. + ## The default is to use Pthreads when building with the Autotools, unless + ## we're building w/ MinGW. AC_SUBST([HAVE_PTHREAD]) HAVE_PTHREAD=yes AC_ARG_WITH([pthread], [AS_HELP_STRING([--with-pthread=DIR], [Specify alternative path to Pthreads library when - thread-safe capability is built.])],, - [withval=check]) - - case "$withval" in - check | yes) - AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) - if test "x$HAVE_PTHREAD" = "xyes"; then - AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + thread-safe capability is built. Set this to + 'yes' or the location of Pthreads when building + with MinGW and you would rather use Pthreads + than Win32 threads.])],, + [withval=default]) + + ## If we're on MinGW, we want to use Win32 threads unless the builder + ## explicitly specifies --with-pthreads=(yes | path(s)) + mingw_use_win32_threads="no" + if test -n "$HDF_MINGW" -a "$HDF_MINGW" = "yes" ; then + # Default or no --> Win32 threads + if test "$withval" = "default" -o "$withval" = "no" ; then + mingw_use_win32_threads="yes" + unset HAVE_PTHREAD + AC_DEFINE([HAVE_WIN_THREADS], [1], [Define to 1 if you have win32 threads]) fi - ;; - no) - AC_MSG_ERROR([Must use Pthreads with thread safety]) - ;; - *) + fi + + if test "$mingw_use_win32_threads" = "no" ; then case "$withval" in - *,*) - pthread_inc="`echo $withval | cut -f1 -d,`" - pthread_lib="`echo $withval | cut -f2 -d, -s`" - ;; - *) - if test -n "$withval"; then - pthread_inc="$withval/include" - pthread_lib="$withval/lib" - fi - ;; + default | yes) + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + if test "x$HAVE_PTHREAD" = "xyes"; then + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi + ;; + no) + AC_MSG_ERROR([Must use Pthreads with thread safety on non-Windows systems]) + ;; + *) + case "$withval" in + *,*) + pthread_inc="`echo $withval | cut -f1 -d,`" + pthread_lib="`echo $withval | cut -f2 -d, -s`" + ;; + *) + if test -n "$withval"; then + pthread_inc="$withval/include" + pthread_lib="$withval/lib" + fi + ;; + esac + + if test -n "$pthread_inc"; then + saved_CPPFLAGS="$CPPFLAGS" + saved_AM_CPPFLAGS="$AM_CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$pthread_inc" + AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc" + AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD]) + else + AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + fi + + if test "x$HAVE_PTHREAD" = "xyes"; then + if test -n "$pthread_lib"; then + saved_LDFLAGS="$LDFLAGS" + saved_AM_LDFLAGS="$AM_LDFLAGS" + LDFLAGS="$LDFLAGS -L$pthread_lib" + AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" + AC_CHECK_LIB([pthread], [pthread_self],, + [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD]) + else + AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) + fi + fi + ;; esac - if test -n "$pthread_inc"; then - saved_CPPFLAGS="$CPPFLAGS" - saved_AM_CPPFLAGS="$AM_CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$pthread_inc" - AM_CPPFLAGS="$AM_CPPFLAGS -I$pthread_inc" - AC_CHECK_HEADERS([pthread.h],, [CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"; unset HAVE_PTHREAD]) + ## ---------------------------------------------------------------------- + ## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) + ## is supported on this system + ## + ## Unfortunately, this probably needs to be an AC_RUN_IFELSE since + ## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is + ## supported a priori. POSIX.1-2001 requires that a conformant + ## system need only support one of SYSTEM or PROCESS scopes. + ## + ## CROSS-COMPILING: Use a pessimistic 'no'. You can hand-hack the config + ## file if you know otherwise. + AC_MSG_CHECKING([Pthreads supports system scope]) + AC_CACHE_VAL([hdf5_cv_system_scope_threads], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([ + #include + #include + ],[ + pthread_attr_t attribute; + int ret; + + pthread_attr_init(&attribute); + ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); + exit(ret==0 ? 0 : 1); + ])] + , [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])]) + + if test ${hdf5_cv_system_scope_threads} = "yes"; then + AC_DEFINE([SYSTEM_SCOPE_THREADS], [1], + [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.]) + AC_MSG_RESULT([yes]) else - AC_CHECK_HEADERS([pthread.h],, [unset HAVE_PTHREAD]) + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Always 'no' if cross-compiling. Edit the config file if your platform supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM).]) fi - if test "x$HAVE_PTHREAD" = "xyes"; then - if test -n "$pthread_lib"; then - saved_LDFLAGS="$LDFLAGS" - saved_AM_LDFLAGS="$AM_LDFLAGS" - LDFLAGS="$LDFLAGS -L$pthread_lib" - AM_LDFLAGS="$AM_LDFLAGS -L$pthread_lib" - AC_CHECK_LIB([pthread], [pthread_self],, - [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_PTHREAD]) - else - AC_CHECK_LIB([pthread], [pthread_self],, [unset HAVE_PTHREAD]) - fi - fi - ;; - esac - - ## ---------------------------------------------------------------------- - ## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) - ## is supported on this system - ## - ## Unfortunately, this probably needs to be an AC_RUN_IFELSE since - ## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is - ## supported a priori. POSIX.1-2001 requires that a conformant - ## system need only support one of SYSTEM or PROCESS scopes. - ## - ## CROSS-COMPILING: Use a pessimistic 'no'. You can hand-hack the config - ## file if you know otherwise. - AC_MSG_CHECKING([Pthreads supports system scope]) - AC_CACHE_VAL([hdf5_cv_system_scope_threads], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([ - #include - #include - ],[ - pthread_attr_t attribute; - int ret; - - pthread_attr_init(&attribute); - ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - exit(ret==0 ? 0 : 1); - ])] - , [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])]) - - if test ${hdf5_cv_system_scope_threads} = "yes"; then - AC_DEFINE([SYSTEM_SCOPE_THREADS], [1], - [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.]) - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_NOTICE([Always 'no' if cross-compiling. Edit the config file if your platform supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM).]) - fi -fi + fi # end of Pthreads checks +fi # end of threadsafe processing ## ---------------------------------------------------------------------- ## Check for MONOTONIC_TIMER support (used in clock_gettime). This has @@ -2044,8 +2165,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ## Check whether the global variable `timezone' is defined. AC_MSG_CHECKING([for global timezone variable]) -case "`uname`" in - CYGWIN*) +case "$host_os" in + *cygwin*) AC_MSG_RESULT([disabled in CYGWIN]) ;; *) @@ -2075,8 +2196,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ## How do we figure out the width of a tty in characters? ## AC_CHECK_FUNCS([_getvideoconfig gettextinfo]) -case "`uname`" in - CYGWIN*) +case "$host_os" in + *cygwin*) ;; *) AC_CHECK_FUNCS([GetConsoleScreenBufferInfo]) @@ -2123,12 +2244,23 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ## NOTE: clock_gettime may require linking to the rt or posix4 library ## so we'll search for it before calling AC_CHECK_FUNCS. AC_SEARCH_LIBS([clock_gettime], [rt posix4]) -AC_CHECK_FUNCS([alarm asprintf clock_gettime fcntl flock fork]) +AC_CHECK_FUNCS([asprintf clock_gettime fcntl flock fork]) AC_CHECK_FUNCS([gethostname getrusage gettimeofday]) AC_CHECK_FUNCS([rand_r random]) AC_CHECK_FUNCS([strcasestr strdup symlink]) AC_CHECK_FUNCS([tmpfile vasprintf waitpid]) +case "$host_os" in + *mingw*) + # alarm(2) support is spotty in MinGW, so assume it doesn't exist + # + # https://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00040.html + ;; + *) + AC_CHECK_FUNCS([alarm]) + ;; +esac + ## ---------------------------------------------------------------------- ## Check compiler characteristics ## @@ -3547,10 +3679,10 @@ fi ## AC_MSG_CHECKING([if the machine has window style path name]) -case "`uname`" in - MINGW*) +case "$host_os" in + *mingw*) AC_DEFINE([HAVE_WINDOW_PATH], [1], - [Define if your system has window style path name.]) + [Define if your system has Windows-style path name.]) AC_MSG_RESULT([yes]) ;; *) diff --git a/doc/parallel-compression.md b/doc/parallel-compression.md index f55e6b36a82..040c8aa702c 100644 --- a/doc/parallel-compression.md +++ b/doc/parallel-compression.md @@ -166,7 +166,7 @@ chosen chunk size becomes a very important factor when compression is involved, as data chunks have to be completely read and re-written to perform partial writes to the chunk. -[Improving I/O performance with HDF5 compressed datasets](http://portal.hdfgroup.org/display/HDF5/Improving+IO+Performance+When+Working+with+HDF5+Compressed+Datasets) +[Improving I/O performance with HDF5 compressed datasets](https://portal.hdfgroup.org/display/HDF5/Improving+IO+Performance+When+Working+with+HDF5+Compressed+Datasets) is a useful reference for more information on getting good performance when using a chunked dataset layout. diff --git a/doxygen/aliases b/doxygen/aliases index 4eb19621e74..ad868432bee 100644 --- a/doxygen/aliases +++ b/doxygen/aliases @@ -235,7 +235,6 @@ ALIASES += sa_metadata_ops="\sa \li H5Pget_all_coll_metadata_ops() \li H5Pget_co ################################################################################ ALIASES += ref_cons_semantics="Enabling a Strict Consistency Semantics Model in Parallel HDF5" -ALIASES += ref_dld_filters="HDF5 Dynamically Loaded Filters" ALIASES += ref_file_image_ops="HDF5 File Image Operations" ALIASES += ref_filter_pipe="Data Flow Pipeline for H5Dread()" ALIASES += ref_group_impls="Group implementations in HDF5" diff --git a/doxygen/dox/DDLBNF112.dox b/doxygen/dox/DDLBNF112.dox index 6809a0632ff..cfe34c321f9 100644 --- a/doxygen/dox/DDLBNF112.dox +++ b/doxygen/dox/DDLBNF112.dox @@ -1,4 +1,4 @@ -/** \page DDLBNF112 DDL in BNF for HDF5 1.12 and above +/** \page DDLBNF112 DDL in BNF for HDF5 1.12 through HDF5 1.14.3 \todo Revise this & break it up! diff --git a/doxygen/dox/DDLBNF114.dox b/doxygen/dox/DDLBNF114.dox new file mode 100644 index 00000000000..61e9157e560 --- /dev/null +++ b/doxygen/dox/DDLBNF114.dox @@ -0,0 +1,654 @@ +/** \page DDLBNF114 DDL in BNF for HDF5 1.14.4 and above + +\todo Revise this & break it up! + +\section intro114 Introduction + +This document contains the data description language (DDL) for an HDF5 file. The +description is in Backus-Naur Form (BNF). + +\section expo114 Explanation of Symbols + +This section contains a brief explanation of the symbols used in the DDL. + +\code{.unparsed} +::= defined as + a token with the name tname + | one of or + opt zero or one occurrence of + * zero or more occurrence of + + one or more occurrence of + [0-9] an element in the range between 0 and 9 + '[' the token within the quotes (used for special characters) + TBD To Be Decided +\endcode + +\section ddl114 The DDL + +\code{.unparsed} + ::= HDF5 { opt } + + ::= + + ::= SUPER_BLOCK { + SUPERBLOCK_VERSION + FREELIST_VERSION + SYMBOLTABLE_VERSION + OBJECTHEADER_VERSION + OFFSET_SIZE + LENGTH_SIZE + BTREE_RANK + BTREE_LEAF + ISTORE_K + + USER_BLOCK { + USERBLOCK_SIZE + } + } + + ::= FILE_SPACE_STRATEGY + FREE_SPACE_PERSIST + FREE_SPACE_SECTION_THRESHOLD + FILE_SPACE_PAGE_SIZE + + ::= H5F_FSPACE_STRATEGY_FSM_AGGR | H5F_FSPACE_STRATEGY_PAGE | + H5F_FSPACE_STRATEGY_AGGR | H5F_FSPACE_STRATEGY_NONE | + Unknown strategy + + ::= GROUP "/" { + * + opt + opt + * + * + } + + ::= | | | + + ::= DATATYPE { + + } + + ::= the assigned name for anonymous named type is + in the form of #oid, where oid is the object id + of the type + + ::= | | download it as a tgz archive for offline reading. + You can download it as an archive for offline reading. \par ToDo List There is plenty of unfinished business. diff --git a/doxygen/dox/Specifications.dox b/doxygen/dox/Specifications.dox index e352f40cb74..42f06d23099 100644 --- a/doxygen/dox/Specifications.dox +++ b/doxygen/dox/Specifications.dox @@ -4,6 +4,7 @@ \li \ref DDLBNF110 \li \ref DDLBNF112 +\li \ref DDLBNF114 \section File Format diff --git a/doxygen/dox/UsersGuide.dox b/doxygen/dox/UsersGuide.dox index 4f955e6074d..b6113ad15bd 100644 --- a/doxygen/dox/UsersGuide.dox +++ b/doxygen/dox/UsersGuide.dox @@ -134,6 +134,7 @@ HDF5 Release 1.14
  • \ref subsubsec_dataset_transfer_props
  • \ref subsubsec_dataset_transfer_store
  • \ref subsubsec_dataset_transfer_partial +
  • \ref subsubsec_dataset_transfer_dyn_filter \li \ref subsec_dataset_allocation
      @@ -147,6 +148,7 @@ HDF5 Release 1.14
    • \ref subsubsec_dataset_filters_nbit
    • \ref subsubsec_dataset_filters_scale
    • \ref subsubsec_dataset_filters_szip +
    • \ref subsubsec_dataset_filters_dyn
    \ref sec_datatype diff --git a/doxygen/examples/H5.format.1.1.html b/doxygen/examples/H5.format.1.1.html index f5e4c4e0fe5..88f92481f1a 100644 --- a/doxygen/examples/H5.format.1.1.html +++ b/doxygen/examples/H5.format.1.1.html @@ -5436,8 +5436,8 @@

    Name: Data Storage - Filter Pipeline

    filters requested and supported by third parties. Filters supported by The HDF Group are documented immediately below. Information on 3rd-party filters can be found at - - https://support.hdfgroup.org/services/contributions.html#filters. + + https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md. 1

    To request a filter identifier, please contact diff --git a/doxygen/examples/H5.format.2.0.html b/doxygen/examples/H5.format.2.0.html index bde030f3853..2ad32c85f56 100644 --- a/doxygen/examples/H5.format.2.0.html +++ b/doxygen/examples/H5.format.2.0.html @@ -12598,9 +12598,8 @@

    HDF5 Library and for filters requested and supported by third parties. Filters supported by The HDF Group are documented immediately below. Information on 3rd-party filters can be found at - The HDF Group’s - Contributions page. + The HDF Group’s + Registered Filters page.

    @@ -12854,9 +12853,8 @@

    HDF5 Library and for filters requested and supported by third parties. Filters supported by The HDF Group are documented immediately below. Information on 3rd-party filters can be found at - The HDF Group’s - Contributions page. + The HDF Group’s + Registered Filters page.

    diff --git a/doxygen/examples/H5.format.html b/doxygen/examples/H5.format.html index 7aba5fed440..ac1dbab683b 100644 --- a/doxygen/examples/H5.format.html +++ b/doxygen/examples/H5.format.html @@ -14226,8 +14226,8 @@

    IV.A.2.l. The Data Storage - Filter Filters supported by The HDF Group are documented immediately below. Information on 3rd-party filters can be found at The HDF Group’s - - Contributions page.

    + + Registered Filters page.

    To request a filter identifier, please contact @@ -14488,8 +14488,8 @@

    IV.A.2.l. The Data Storage - Filter Filters supported by The HDF Group are documented immediately below. Information on 3rd-party filters can be found at The HDF Group’s - - Contributions page.

    + + Registered Filters page.

    To request a filter identifier, please contact diff --git a/doxygen/examples/tables/predefinedDatatypes.dox b/doxygen/examples/tables/predefinedDatatypes.dox index 2427d0c1782..6cf044af5d4 100644 --- a/doxygen/examples/tables/predefinedDatatypes.dox +++ b/doxygen/examples/tables/predefinedDatatypes.dox @@ -8,6 +8,14 @@ Description +#H5T_IEEE_F16BE +16-bit big-endian IEEE floating point + + +#H5T_IEEE_F16LE +16-bit little-endian IEEE floating point + + #H5T_IEEE_F32BE 32-bit big-endian IEEE floating point @@ -465,6 +473,10 @@ C-style unsigned long long +#H5T_NATIVE_FLOAT16 +C-style _Float16 (May be H5I_INVALID_HID if platform doesn't support _Float16 type) + + #H5T_NATIVE_FLOAT C-style float diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 99644b83fbb..b2ac81ea0c6 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -31,6 +31,12 @@ else () set (CMAKE_H5_HAVE_MPI_F08 0) endif () +if (H5_HAVE_DARWIN) # Used in testing + set (CMAKE_H5_HAVE_DARWIN 1) +else () + set (CMAKE_H5_HAVE_DARWIN 0) +endif () + # configure for Fortran preprocessor # Define Parallel variable for passing to H5config_f.inc.cmake diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 449c8fa1b27..316c9ad9a5d 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -99,26 +99,31 @@ h5eset_auto2_c(int_f *printflag, hid_t_f *estack_id, H5E_auto2_t func, void *cli } int_f -h5epush_c(hid_t_f *err_stack, hid_t_f *cls_id, hid_t_f *maj_id, hid_t_f *min_id, _fcd msg, size_t_f *msg_len, - char *file, char *func, int *line, const char *arg1, const char *arg2, const char *arg3, - const char *arg4, const char *arg5, const char *arg6, const char *arg7, const char *arg8, - const char *arg9, const char *arg10, const char *arg11, const char *arg12, const char *arg13, - const char *arg14, const char *arg15, const char *arg16, const char *arg17, const char *arg18, - const char *arg19, const char *arg20) +h5epush_c(hid_t_f *err_stack, _fcd file, int_f *file_len, _fcd func, int_f *func_len, int line, + hid_t_f *cls_id, hid_t_f *maj_id, hid_t_f *min_id, _fcd msg, int_f *msg_len, const char *arg1, + const char *arg2, const char *arg3, const char *arg4, const char *arg5, const char *arg6, + const char *arg7, const char *arg8, const char *arg9, const char *arg10, const char *arg11, + const char *arg12, const char *arg13, const char *arg14, const char *arg15, const char *arg16, + const char *arg17, const char *arg18, const char *arg19, const char *arg20) /******/ { + char *c_file = NULL; /* Buffer to hold C string */ + char *c_func = NULL; /* Buffer to hold C string */ char *c_msg = NULL; /* Buffer to hold C string */ int_f ret_value = 0; /* Return value */ /* - * Convert FORTRAN name to C name + * Convert FORTRAN string to C string */ - + if (NULL == (c_file = HD5f2cstring(file, (size_t)*file_len))) + HGOTO_DONE(FAIL); + if (NULL == (c_func = HD5f2cstring(func, (size_t)*func_len))) + HGOTO_DONE(FAIL); if (NULL == (c_msg = HD5f2cstring(msg, (size_t)*msg_len))) HGOTO_DONE(FAIL); - if (H5Epush2((hid_t)*err_stack, file, func, (unsigned int)*line, (hid_t)*cls_id, (hid_t)*maj_id, + if (H5Epush2((hid_t)*err_stack, c_file, c_func, (unsigned int)line, (hid_t)*cls_id, (hid_t)*maj_id, (hid_t)*min_id, c_msg, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20) < 0) HGOTO_DONE(FAIL); diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 index 9ea28079451..162a7508085 100644 --- a/fortran/src/H5Eff.F90 +++ b/fortran/src/H5Eff.F90 @@ -277,34 +277,34 @@ END SUBROUTINE h5eset_auto_f !! !! \param err_stack Error stack identifier. If the identifier is H5E_DEFAULT_F, the error !! record will be pushed to the current stack. +!! \param file Name of the file in which the error was detected +!! \param func Name of the function in which the error was detected +!! \param line Line number in the file where the error was detected !! \param cls_id Error class identifier !! \param maj_id Major error identifier !! \param min_id Minor error identifier -!! \param msg Error description string +!! \param msg Error description string !! \param hdferr \fortran_error -!! \param file Name of the file in which the error was detected -!! \param func Name of the function in which the error was detected -!! \param line Line number in the file where the error was detected -!! \param arg1 C style format control strings -!! \param arg2 C style format control strings -!! \param arg3 C style format control strings -!! \param arg4 C style format control strings -!! \param arg5 C style format control strings -!! \param arg6 C style format control strings -!! \param arg7 C style format control strings -!! \param arg8 C style format control strings -!! \param arg9 C style format control strings -!! \param arg10 C style format control strings -!! \param arg11 C style format control strings -!! \param arg12 C style format control strings -!! \param arg13 C style format control strings -!! \param arg14 C style format control strings -!! \param arg15 C style format control strings -!! \param arg16 C style format control strings -!! \param arg17 C style format control strings -!! \param arg18 C style format control strings -!! \param arg19 C style format control strings -!! \param arg20 C style format control strings +!! \param arg1 C style format control strings +!! \param arg2 C style format control strings +!! \param arg3 C style format control strings +!! \param arg4 C style format control strings +!! \param arg5 C style format control strings +!! \param arg6 C style format control strings +!! \param arg7 C style format control strings +!! \param arg8 C style format control strings +!! \param arg9 C style format control strings +!! \param arg10 C style format control strings +!! \param arg11 C style format control strings +!! \param arg12 C style format control strings +!! \param arg13 C style format control strings +!! \param arg14 C style format control strings +!! \param arg15 C style format control strings +!! \param arg16 C style format control strings +!! \param arg17 C style format control strings +!! \param arg18 C style format control strings +!! \param arg19 C style format control strings +!! \param arg20 C style format control strings !! !! \note \p arg[1-20] expects C-style format strings, similar to the !! system and C functions printf() and fprintf(). @@ -322,28 +322,24 @@ END SUBROUTINE h5eset_auto_f !! !! See C API: @ref H5Epush2() !! - SUBROUTINE h5epush_f(err_stack, cls_id, maj_id, min_id, msg, hdferr, & - file, func, line, & + SUBROUTINE h5epush_f(err_stack, file, func, line, cls_id, maj_id, min_id, msg, hdferr, & arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, & arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, arg20) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: err_stack - INTEGER(HID_T), INTENT(IN) :: cls_id - INTEGER(HID_T), INTENT(IN) :: maj_id - INTEGER(HID_T), INTENT(IN) :: min_id - CHARACTER(LEN=*), INTENT(IN) :: msg - INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) :: err_stack + CHARACTER(LEN=*), INTENT(IN) :: file + CHARACTER(LEN=*), INTENT(IN) :: func + INTEGER , INTENT(IN) :: line + INTEGER(HID_T) , INTENT(IN) :: cls_id + INTEGER(HID_T) , INTENT(IN) :: maj_id + INTEGER(HID_T) , INTENT(IN) :: min_id + CHARACTER(LEN=*), INTENT(IN) :: msg + INTEGER , INTENT(OUT) :: hdferr - TYPE(C_PTR), OPTIONAL :: file - TYPE(C_PTR), OPTIONAL :: func - TYPE(C_PTR), OPTIONAL :: line CHARACTER(LEN=*), OPTIONAL, TARGET :: arg1, arg2, arg3, arg4, arg5, & arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, & arg16, arg17, arg18, arg19, arg20 - TYPE(C_PTR) :: file_def = C_NULL_PTR - TYPE(C_PTR) :: func_def = C_NULL_PTR - TYPE(C_PTR) :: line_def = C_NULL_PTR TYPE(C_PTR) :: arg1_def = C_NULL_PTR, arg2_def = C_NULL_PTR, & arg3_def = C_NULL_PTR, arg4_def = C_NULL_PTR, & arg5_def = C_NULL_PTR, arg6_def = C_NULL_PTR, & @@ -356,7 +352,9 @@ SUBROUTINE h5epush_f(err_stack, cls_id, maj_id, min_id, msg, hdferr, & arg19_def = C_NULL_PTR, arg20_def = C_NULL_PTR INTERFACE - INTEGER FUNCTION h5epush_c(err_stack, cls_id, maj_id, min_id, msg, msg_len, file, func, line, & + INTEGER FUNCTION h5epush_c(err_stack, & + file, file_len, func, func_len, line, & + cls_id, maj_id, min_id, msg, msg_len, & arg1, arg2, arg3, arg4, arg5, & arg6, arg7, arg8, arg9, arg10, & arg11, arg12, arg13, arg14, arg15, & @@ -366,28 +364,25 @@ INTEGER FUNCTION h5epush_c(err_stack, cls_id, maj_id, min_id, msg, msg_len, file IMPORT :: HID_T IMPLICIT NONE INTEGER(HID_T) :: err_stack + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: file + INTEGER :: file_len + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: func + INTEGER :: func_len + INTEGER(C_INT), VALUE :: line INTEGER(HID_T) :: cls_id INTEGER(HID_T) :: maj_id INTEGER(HID_T) :: min_id CHARACTER(KIND=C_CHAR), DIMENSION(*) :: msg INTEGER :: msg_len - TYPE(C_PTR), VALUE :: file - TYPE(C_PTR), VALUE :: func - TYPE(C_PTR), VALUE :: line - TYPE(C_PTR), VALUE :: arg1, arg2, arg3, arg4, & - arg5, arg6, arg7, arg8, & - arg9, arg10, arg11, arg12, & - arg13, arg14, arg15, arg16, & - arg17, arg18, arg19, arg20 + TYPE(C_PTR), VALUE :: arg1, arg2, arg3, arg4, arg5, & + arg6, arg7, arg8, arg9, arg10, & + arg11, arg12, arg13, arg14, arg15, & + arg16, arg17, arg18, arg19, arg20 END FUNCTION h5epush_c END INTERFACE - IF (PRESENT(file)) file_def = file - IF (PRESENT(func)) func_def = func - IF (PRESENT(line)) line_def = line - IF (PRESENT(arg1)) arg1_def = C_LOC(arg1(1:1)) IF (PRESENT(arg2)) arg2_def = C_LOC(arg2(1:1)) IF (PRESENT(arg3)) arg3_def = C_LOC(arg3(1:1)) @@ -409,14 +404,15 @@ END FUNCTION h5epush_c IF (PRESENT(arg19)) arg19_def = C_LOC(arg19(1:1)) IF (PRESENT(arg20)) arg20_def = C_LOC(arg20(1:1)) - hdferr = h5epush_c(err_stack, cls_id, maj_id, min_id, msg, LEN(msg), & - file_def, func_def, line_def, & + hdferr = h5epush_c(err_stack, file, LEN(file), func, LEN(func), INT(line,C_INT), & + cls_id, maj_id, min_id, msg, LEN(msg), & arg1_def, arg2_def, arg3_def, arg4_def, arg5_def, & arg6_def, arg7_def, arg8_def, arg9_def, arg10_def, & arg11_def, arg12_def, arg13_def, arg14_def, arg15_def, & arg16_def, arg17_def, arg18_def, arg19_def, arg20_def) END SUBROUTINE h5epush_f + !> !! \ingroup FH5E !! @@ -631,7 +627,7 @@ END FUNCTION H5Eget_msg RETURN ENDIF f_ptr = C_LOC(c_msg(1)(1:1)) - c_msg_size = H5Eget_msg(msg_id, c_msg_type, f_ptr, msg_cp_sz+1) + c_msg_size = H5Eget_msg(msg_id, c_msg_type, f_ptr, msg_cp_sz+1_SIZE_T) CALL HD5c2fstring(msg, c_msg, msg_cp_sz, msg_cp_sz+1_SIZE_T) diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 4bc8c2fa21d..0da371f5e17 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -555,13 +555,13 @@ H5_FCDLL int_f h5iis_valid_c(hid_t_f *obj_id, int_f *c_valid); H5_FCDLL int_f h5eprint_c(hid_t_f *err_stack, _fcd name, size_t_f *namelen); H5_FCDLL int_f h5eset_auto2_c(int_f *printflag, hid_t_f *estack_id, H5E_auto2_t func, void *client_data); -H5_FCDLL int_f h5epush_c(hid_t_f *err_stack, hid_t_f *cls_id, hid_t_f *maj_id, hid_t_f *min_id, _fcd msg, - size_t_f *msg_len, char *file, char *func, int *line, const char *arg1, - const char *arg2, const char *arg3, const char *arg4, const char *arg5, - const char *arg6, const char *arg7, const char *arg8, const char *arg9, - const char *arg10, const char *arg11, const char *arg12, const char *arg13, - const char *arg14, const char *arg15, const char *arg16, const char *arg17, - const char *arg18, const char *arg19, const char *arg20); +H5_FCDLL int_f h5epush_c(hid_t_f *err_stack, _fcd file, int_f *file_len, _fcd func, int_f *func_len, int line, + hid_t_f *cls_id, hid_t_f *maj_id, hid_t_f *min_id, _fcd msg, int_f *msg_len, + const char *arg1, const char *arg2, const char *arg3, const char *arg4, + const char *arg5, const char *arg6, const char *arg7, const char *arg8, + const char *arg9, const char *arg10, const char *arg11, const char *arg12, + const char *arg13, const char *arg14, const char *arg15, const char *arg16, + const char *arg17, const char *arg18, const char *arg19, const char *arg20); /* * Functions from H5f.c diff --git a/fortran/test/tH5E_F03.F90 b/fortran/test/tH5E_F03.F90 index 33d666c1b47..b538e20c530 100644 --- a/fortran/test/tH5E_F03.F90 +++ b/fortran/test/tH5E_F03.F90 @@ -47,14 +47,14 @@ MODULE test_my_hdf5_error_handler !** !*************************************************************** - INTEGER FUNCTION my_hdf5_error_handler(estack_id, data_inout) bind(C) + INTEGER(C_INT) FUNCTION my_hdf5_error_handler(estack_id, data_inout) bind(C) ! This error function handle works with only version 2 error stack IMPLICIT NONE ! estack_id is always passed from C as: H5E_DEFAULT - INTEGER(HID_T) :: estack_id + INTEGER(HID_T), VALUE :: estack_id ! data that was registered with H5Eset_auto_f ! INTEGER :: data_inout ! another option @@ -89,7 +89,7 @@ INTEGER(C_INT) FUNCTION custom_print_cb(n, err_desc, op_data) BIND(C) INTEGER(SIZE_T), PARAMETER :: MSG_SIZE = 64 - INTEGER(C_INT) :: n + INTEGER(C_INT), VALUE :: n TYPE(h5e_error_t) :: err_desc TYPE(C_PTR) :: op_data @@ -101,6 +101,11 @@ INTEGER(C_INT) FUNCTION custom_print_cb(n, err_desc, op_data) BIND(C) INTEGER :: error + IF(n.NE.0_C_INT)THEN + custom_print_cb = -1 + RETURN + ENDIF + CALL H5Eget_class_name_f(err_desc%cls_id, cls, error) IF(error .LT.0)THEN custom_print_cb = -1 @@ -252,10 +257,10 @@ SUBROUTINE test_error_stack(total_error) INTEGER :: total_error INTEGER :: error INTEGER(HID_T) :: cls_id, major, minor, estack_id, estack_id1, estack_id2 - CHARACTER(LEN=18), TARGET :: file - CHARACTER(LEN=18), TARGET :: func - INTEGER(C_INT) , TARGET :: line - TYPE(C_PTR) :: ptr1, ptr2, ptr3, ptr4 + CHARACTER(LEN=18) :: file + CHARACTER(LEN=18) :: func + INTEGER :: line + TYPE(C_PTR) :: ptr1 INTEGER :: msg_type CHARACTER(LEN=9) :: maj_mesg = "MAJOR MSG" @@ -283,21 +288,17 @@ SUBROUTINE test_error_stack(total_error) CALL H5Ecreate_msg_f(cls_id, H5E_MINOR_F, min_mesg, minor, error) CALL check("H5Ecreate_msg_f", error, total_error) - file = "FILE"//C_NULL_CHAR - func = "FUNC"//C_NULL_CHAR + file = "FILE" + func = "FUNC" line = 99 - ptr1 = C_LOC(file(1:1)) - ptr2 = C_LOC(func(1:1)) - ptr3 = C_LOC(line) - CALL h5ecreate_stack_f(estack_id, error) CALL check("h5ecreate_stack_f", error, total_error) ! push a custom error message onto the stack - CALL H5Epush_f(estack_id, cls_id, major, minor, "%s ERROR TEXT %s %s", error, & - ptr1, ptr2, ptr3, & - arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m", arg3=ACHAR(10) ) + CALL H5Epush_f(estack_id, file, func, line, & + cls_id, major, minor, "%s ERROR TEXT %s %s %s", error, & + arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m", arg3=ACHAR(0), arg4=ACHAR(10) ) CALL check("H5Epush_f", error, total_error) CALL h5eget_num_f(estack_id, count, error) @@ -421,10 +422,10 @@ SUBROUTINE test_error_stack(total_error) ENDIF stderr = "** Print error stack in customized way **"//C_NULL_CHAR - ptr4 = C_LOC(stderr(1:1)) + ptr1 = C_LOC(stderr(1:1)) func_ptr = C_FUNLOC(custom_print_cb) - CALL h5ewalk_f(estack_id, H5E_WALK_UPWARD_F, func_ptr, ptr4, error) + CALL h5ewalk_f(estack_id, H5E_WALK_UPWARD_F, func_ptr, ptr1, error) CALL check("h5ewalk_f", error, total_error) CALL h5eget_num_f(estack_id, count, error) @@ -462,9 +463,9 @@ SUBROUTINE test_error_stack(total_error) CALL check("h5ecreate_stack_f", error, total_error) ! push a custom error message onto the stack - CALL H5Epush_f(estack_id1, cls_id, major, minor, "%s ERROR TEXT %s"//C_NEW_LINE, error, & - ptr1, ptr2, ptr3, & - arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m" ) + CALL H5Epush_f(estack_id1, file, func, line, & + cls_id, major, minor, "%s ERROR TEXT %s %s", error, & + arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m", arg3=ACHAR(10) ) CALL check("H5Epush_f", error, total_error) CALL H5Eset_current_stack_f(estack_id1, error) ! API will also close estack_id1 diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 099356f7af1..7d44792fbc0 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -2287,7 +2287,13 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, bo break; case H5T_FLOAT: - if (H5Tequal(dtype, H5T_IEEE_F32BE)) { + if (H5Tequal(dtype, H5T_IEEE_F16BE)) { + snprintf(dt_str, *slen, "H5T_IEEE_F16BE"); + } + else if (H5Tequal(dtype, H5T_IEEE_F16LE)) { + snprintf(dt_str, *slen, "H5T_IEEE_F16LE"); + } + else if (H5Tequal(dtype, H5T_IEEE_F32BE)) { snprintf(dt_str, *slen, "H5T_IEEE_F32BE"); } else if (H5Tequal(dtype, H5T_IEEE_F32LE)) { @@ -2299,6 +2305,11 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, bo else if (H5Tequal(dtype, H5T_IEEE_F64LE)) { snprintf(dt_str, *slen, "H5T_IEEE_F64LE"); } +#ifdef H5_HAVE__FLOAT16 + else if (H5Tequal(dtype, H5T_NATIVE_FLOAT16)) { + snprintf(dt_str, *slen, "H5T_NATIVE_FLOAT16"); + } +#endif else if (H5Tequal(dtype, H5T_NATIVE_FLOAT)) { snprintf(dt_str, *slen, "H5T_NATIVE_FLOAT"); } diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 8890b8e48c4..3e6b20d322e 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -29,14 +29,14 @@ #elif defined _MSC_VER #pragma warning(push, 1) #endif -#line 2 "hl/src//H5LTanalyze.c" +#line 1 "hl/src//H5LTanalyze.c" /* Quiet warnings about integer type macro redefinitions on Visual Studio * (MSVC doesn't define STDC_VERSION, but has inttypes.h). This is an * issue that is apparently fixed in flex 2.6.5. */ #include -#line 9 "hl/src//H5LTanalyze.c" +#line 8 "hl/src//H5LTanalyze.c" #define YY_INT_ALIGNED short int @@ -647,8 +647,8 @@ static void yynoreturn yy_fatal_error ( const char* msg ); (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 64 -#define YY_END_OF_BUFFER 65 +#define YY_NUM_RULES 67 +#define YY_END_OF_BUFFER 68 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -656,38 +656,39 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static const flex_int16_t yy_accept[275] = +static const flex_int16_t yy_accept[283] = { 0, - 63, 63, 65, 64, 63, 64, 55, 61, 62, 64, - 64, 64, 64, 59, 60, 57, 58, 63, 0, 55, - 0, 0, 0, 0, 0, 56, 0, 0, 0, 0, - 0, 38, 0, 0, 0, 0, 0, 39, 0, 0, + 66, 66, 68, 67, 66, 67, 58, 64, 65, 67, + 67, 67, 67, 62, 63, 60, 61, 66, 0, 58, + 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, + 0, 41, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 54, 36, 0, 0, 0, 45, 49, 0, 0, - 0, 0, 0, 0, 0, 0, 51, 53, 50, 0, + 0, 57, 39, 0, 0, 0, 48, 52, 0, 0, + 0, 0, 0, 0, 0, 0, 54, 56, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 52, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, + 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 2, 0, 0, 0, 0, 0, 0, 9, 10, 0, - 0, 47, 0, 44, 0, 0, 0, 0, 0, 0, + 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 3, 4, 5, 6, 7, 8, 11, 12, - 13, 14, 15, 16, 0, 0, 0, 43, 46, 28, - 29, 30, 31, 0, 0, 0, 22, 0, 0, 0, + 0, 1, 2, 0, 0, 0, 0, 0, 0, 9, + 10, 0, 0, 50, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 24, 0, 0, 0, 23, - 0, 0, 0, 41, 0, 0, 0, 32, 0, 26, - 18, 20, 19, 0, 25, 0, 40, 42, 33, 0, - 27, 21, 34, 0 + + 0, 0, 0, 0, 0, 0, 3, 4, 5, 6, + 7, 8, 11, 12, 13, 14, 15, 16, 0, 0, + 0, 46, 49, 28, 29, 30, 31, 32, 33, 0, + 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, + 0, 24, 0, 0, 0, 23, 0, 0, 0, 44, + 0, 0, 0, 35, 0, 26, 18, 20, 19, 0, + 25, 0, 43, 45, 36, 0, 0, 27, 21, 34, + 37, 0 } ; static const YY_CHAR yy_ec[256] = @@ -730,75 +731,77 @@ static const YY_CHAR yy_meta[41] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static const flex_int16_t yy_base[277] = +static const flex_int16_t yy_base[285] = { 0, - 0, 0, 299, 300, 296, 0, 0, 300, 300, 11, - 288, 269, 264, 300, 300, 300, 300, 292, 290, 0, - 274, 257, 259, 261, 259, 300, 256, 259, 247, 246, - 16, 300, 265, 33, 14, 268, 259, 300, 251, 24, - 254, 252, 259, 262, 248, 243, 34, 251, 258, 254, - 235, 240, 244, 249, 236, 233, 235, 245, 231, 247, - 36, 231, 241, 223, 237, 300, 238, 241, 227, 222, - 247, 227, 219, 231, 226, 219, 208, 34, 223, 219, - 225, 300, 300, 208, 215, 202, 300, 300, 210, 200, - 204, 204, 38, 210, 39, 220, 300, 300, 300, 201, - - 47, 218, 212, 212, 211, 66, 73, 208, 195, 199, - 210, 199, 193, 191, 196, 75, 182, 300, 209, 212, - 209, 52, 206, 209, 206, 66, 300, 190, 198, 188, - 193, 193, 189, 169, 200, 197, 74, 71, 72, 77, - 186, 185, 84, 86, 87, 184, 183, 177, 183, 180, - 300, 175, 185, 165, 88, 90, 173, 167, 169, 166, - 91, 99, 96, 172, 171, 170, 169, 168, 167, 300, - 300, 166, 165, 164, 163, 162, 161, 300, 300, 94, - 160, 300, 155, 300, 171, 157, 156, 155, 154, 157, - 138, 143, 137, 141, 140, 140, 143, 137, 141, 136, - - 101, 139, 300, 300, 300, 300, 300, 300, 300, 300, - 300, 300, 300, 300, 145, 140, 130, 300, 300, 300, - 300, 300, 300, 127, 140, 140, 300, 121, 127, 131, - 136, 120, 134, 116, 120, 120, 118, 126, 113, 127, - 300, 117, 108, 123, 117, 300, 107, 104, 105, 300, - 108, 112, 102, 300, 105, 106, 104, 300, 93, 300, - 300, 300, 300, 78, 300, 57, 300, 300, 300, 56, - 300, 300, 300, 300, 127, 65 + 0, 0, 307, 308, 304, 0, 0, 308, 308, 11, + 296, 277, 272, 308, 308, 308, 308, 300, 298, 0, + 282, 265, 267, 269, 267, 308, 264, 267, 255, 254, + 16, 308, 273, 33, 14, 276, 267, 308, 259, 24, + 262, 260, 267, 270, 256, 251, 34, 259, 266, 262, + 243, 248, 252, 257, 244, 241, 243, 253, 239, 255, + 36, 239, 249, 231, 245, 308, 246, 249, 235, 230, + 255, 235, 227, 239, 234, 227, 216, 34, 231, 227, + 233, 308, 308, 216, 223, 210, 308, 308, 218, 208, + 212, 212, 38, 218, 39, 228, 308, 308, 308, 209, + + 47, 226, 220, 220, 219, 66, 73, 216, 203, 207, + 218, 207, 201, 199, 204, 80, 190, 308, 217, 220, + 217, 52, 214, 217, 214, 59, 308, 198, 206, 196, + 201, 201, 197, 177, 204, 207, 204, 75, 66, 73, + 78, 193, 192, 80, 85, 87, 191, 190, 184, 190, + 187, 308, 182, 192, 172, 89, 91, 94, 180, 174, + 176, 173, 96, 95, 102, 179, 178, 177, 176, 175, + 174, 308, 308, 173, 172, 171, 170, 169, 168, 308, + 308, 96, 167, 308, 162, 308, 178, 164, 163, 162, + 161, 160, 159, 162, 143, 148, 142, 146, 145, 145, + + 148, 142, 146, 141, 103, 144, 308, 308, 308, 308, + 308, 308, 308, 308, 308, 308, 308, 308, 150, 145, + 135, 308, 308, 308, 308, 308, 308, 308, 308, 132, + 145, 145, 308, 126, 132, 136, 141, 125, 139, 121, + 125, 125, 123, 131, 118, 132, 308, 122, 113, 128, + 122, 308, 112, 109, 110, 308, 113, 117, 107, 308, + 110, 114, 112, 123, 98, 308, 308, 308, 308, 100, + 308, 84, 308, 308, 308, 89, 68, 308, 308, 308, + 308, 308, 132, 65 } ; -static const flex_int16_t yy_def[277] = +static const flex_int16_t yy_def[285] = { 0, - 274, 1, 274, 274, 274, 275, 276, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 275, 276, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 0, 274, 274 + 282, 1, 282, 282, 282, 283, 284, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 283, 284, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 0, 282, 282 } ; -static const flex_int16_t yy_nxt[341] = +static const flex_int16_t yy_nxt[349] = { 0, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 4, 4, 10, 4, 4, 4, 4, @@ -806,40 +809,41 @@ static const flex_int16_t yy_nxt[341] = 4, 4, 4, 4, 4, 14, 15, 4, 16, 17, 21, 22, 36, 48, 49, 37, 39, 62, 40, 53, 41, 42, 77, 54, 43, 94, 63, 44, 45, 106, - 113, 55, 46, 109, 78, 47, 141, 20, 110, 107, - 119, 95, 120, 273, 142, 121, 122, 123, 114, 124, - 146, 135, 125, 126, 136, 164, 166, 272, 147, 157, - 158, 168, 159, 165, 167, 160, 161, 271, 172, 169, - - 174, 176, 186, 162, 188, 163, 173, 194, 175, 177, - 187, 199, 189, 195, 197, 270, 196, 200, 201, 198, - 215, 269, 268, 235, 216, 202, 236, 19, 267, 19, - 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, - 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, - 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, - 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, - 224, 223, 222, 221, 220, 219, 218, 217, 214, 213, - 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, - 193, 192, 191, 190, 185, 184, 183, 182, 181, 180, - - 179, 178, 171, 170, 156, 155, 154, 153, 152, 151, - 150, 149, 148, 145, 144, 143, 140, 139, 138, 137, - 134, 133, 132, 131, 130, 129, 128, 127, 118, 117, - 116, 115, 112, 111, 108, 105, 104, 103, 102, 101, - 100, 99, 98, 97, 96, 93, 92, 91, 90, 89, - 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, - 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, - 66, 65, 64, 61, 60, 59, 58, 57, 56, 52, - 51, 50, 38, 35, 34, 33, 32, 31, 30, 29, - 28, 27, 26, 18, 25, 24, 23, 18, 274, 3, - - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274 + 113, 55, 46, 109, 78, 47, 142, 20, 110, 107, + 119, 95, 120, 147, 143, 121, 122, 123, 114, 124, + 166, 148, 125, 126, 135, 281, 136, 168, 167, 137, + 159, 160, 170, 161, 174, 169, 162, 163, 280, 176, + + 171, 178, 175, 188, 164, 190, 165, 177, 192, 179, + 201, 189, 198, 191, 279, 202, 193, 203, 199, 278, + 277, 200, 219, 204, 205, 241, 220, 276, 242, 275, + 274, 206, 19, 273, 19, 272, 271, 270, 269, 268, + 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, + 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, + 247, 246, 245, 244, 243, 240, 239, 238, 237, 236, + 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, + 225, 224, 223, 222, 221, 218, 217, 216, 215, 214, + 213, 212, 211, 210, 209, 208, 207, 197, 196, 195, + + 194, 187, 186, 185, 184, 183, 182, 181, 180, 173, + 172, 158, 157, 156, 155, 154, 153, 152, 151, 150, + 149, 146, 145, 144, 141, 140, 139, 138, 134, 133, + 132, 131, 130, 129, 128, 127, 118, 117, 116, 115, + 112, 111, 108, 105, 104, 103, 102, 101, 100, 99, + 98, 97, 96, 93, 92, 91, 90, 89, 88, 87, + 86, 85, 84, 83, 82, 81, 80, 79, 76, 75, + 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, + 64, 61, 60, 59, 58, 57, 56, 52, 51, 50, + 38, 35, 34, 33, 32, 31, 30, 29, 28, 27, + + 26, 18, 25, 24, 23, 18, 282, 3, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282 } ; -static const flex_int16_t yy_chk[341] = +static const flex_int16_t yy_chk[349] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -847,37 +851,38 @@ static const flex_int16_t yy_chk[341] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 31, 35, 35, 31, 34, 47, 34, 40, 34, 34, 61, 40, 34, 78, 47, 34, 34, 93, - 101, 40, 34, 95, 61, 34, 122, 276, 95, 93, - 106, 78, 106, 270, 122, 106, 106, 107, 101, 107, - 126, 116, 107, 107, 116, 138, 139, 266, 126, 137, - 137, 140, 137, 138, 139, 137, 137, 264, 143, 140, - - 144, 145, 155, 137, 156, 137, 143, 161, 144, 145, - 155, 163, 156, 161, 162, 259, 161, 163, 163, 162, - 180, 257, 256, 201, 180, 163, 201, 275, 255, 275, - 253, 252, 251, 249, 248, 247, 245, 244, 243, 242, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, - 230, 229, 228, 226, 225, 224, 217, 216, 215, 202, - 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, - 190, 189, 188, 187, 186, 185, 183, 181, 177, 176, - 175, 174, 173, 172, 169, 168, 167, 166, 165, 164, - 160, 159, 158, 157, 154, 153, 152, 150, 149, 148, - - 147, 146, 142, 141, 136, 135, 134, 133, 132, 131, - 130, 129, 128, 125, 124, 123, 121, 120, 119, 117, - 115, 114, 113, 112, 111, 110, 109, 108, 105, 104, - 103, 102, 100, 96, 94, 92, 91, 90, 89, 86, - 85, 84, 81, 80, 79, 77, 76, 75, 74, 73, - 72, 71, 70, 69, 68, 67, 65, 64, 63, 62, - 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, - 50, 49, 48, 46, 45, 44, 43, 42, 41, 39, - 37, 36, 33, 30, 29, 28, 27, 25, 24, 23, - 22, 21, 19, 18, 13, 12, 11, 5, 3, 274, - - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 274 + 101, 40, 34, 95, 61, 34, 122, 284, 95, 93, + 106, 78, 106, 126, 122, 106, 106, 107, 101, 107, + 139, 126, 107, 107, 116, 277, 116, 140, 139, 116, + 138, 138, 141, 138, 144, 140, 138, 138, 276, 145, + + 141, 146, 144, 156, 138, 157, 138, 145, 158, 146, + 164, 156, 163, 157, 272, 164, 158, 165, 163, 270, + 265, 163, 182, 165, 165, 205, 182, 264, 205, 263, + 262, 165, 283, 261, 283, 259, 258, 257, 255, 254, + 253, 251, 250, 249, 248, 246, 245, 244, 243, 242, + 241, 240, 239, 238, 237, 236, 235, 234, 232, 231, + 230, 221, 220, 219, 206, 204, 203, 202, 201, 200, + 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, + 189, 188, 187, 185, 183, 179, 178, 177, 176, 175, + 174, 171, 170, 169, 168, 167, 166, 162, 161, 160, + + 159, 155, 154, 153, 151, 150, 149, 148, 147, 143, + 142, 137, 136, 135, 134, 133, 132, 131, 130, 129, + 128, 125, 124, 123, 121, 120, 119, 117, 115, 114, + 113, 112, 111, 110, 109, 108, 105, 104, 103, 102, + 100, 96, 94, 92, 91, 90, 89, 86, 85, 84, + 81, 80, 79, 77, 76, 75, 74, 73, 72, 71, + 70, 69, 68, 67, 65, 64, 63, 62, 60, 59, + 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, + 48, 46, 45, 44, 43, 42, 41, 39, 37, 36, + 33, 30, 29, 28, 27, 25, 24, 23, 22, 21, + + 19, 18, 13, 12, 11, 5, 3, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 282, 282, 282, 282, 282, 282, 282, 282 } ; static yy_state_type yy_last_accepting_state; @@ -936,8 +941,8 @@ static int my_yyinput(char *, int); extern char *myinput; extern size_t input_len; -#line 909 "hl/src//H5LTanalyze.c" -#line 910 "hl/src//H5LTanalyze.c" +#line 913 "hl/src//H5LTanalyze.c" +#line 914 "hl/src//H5LTanalyze.c" #define INITIAL 0 @@ -1149,7 +1154,7 @@ YY_DECL #line 53 "hl/src//H5LTanalyze.l" -#line 1122 "hl/src//H5LTanalyze.c" +#line 1126 "hl/src//H5LTanalyze.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1176,13 +1181,13 @@ YY_DECL while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 275 ) + if ( yy_current_state >= 283 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 300 ); + while ( yy_base[yy_current_state] != 308 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1344,197 +1349,212 @@ YY_RULE_SETUP case 28: YY_RULE_SETUP #line 85 "hl/src//H5LTanalyze.l" -{return hid(H5T_IEEE_F32BE_TOKEN);} +{return hid(H5T_IEEE_F16BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP #line 86 "hl/src//H5LTanalyze.l" -{return hid(H5T_IEEE_F32LE_TOKEN);} +{return hid(H5T_IEEE_F16LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP #line 87 "hl/src//H5LTanalyze.l" -{return hid(H5T_IEEE_F64BE_TOKEN);} +{return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP #line 88 "hl/src//H5LTanalyze.l" -{return hid(H5T_IEEE_F64LE_TOKEN);} +{return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP #line 89 "hl/src//H5LTanalyze.l" -{return hid(H5T_NATIVE_FLOAT_TOKEN);} +{return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP #line 90 "hl/src//H5LTanalyze.l" -{return hid(H5T_NATIVE_DOUBLE_TOKEN);} +{return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP #line 91 "hl/src//H5LTanalyze.l" -{return hid(H5T_NATIVE_LDOUBLE_TOKEN);} +{return hid(H5T_NATIVE_FLOAT16_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 93 "hl/src//H5LTanalyze.l" -{return token(H5T_STRING_TOKEN);} +#line 92 "hl/src//H5LTanalyze.l" +{return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 94 "hl/src//H5LTanalyze.l" -{return token(STRSIZE_TOKEN);} +#line 93 "hl/src//H5LTanalyze.l" +{return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 95 "hl/src//H5LTanalyze.l" -{return token(STRPAD_TOKEN);} +#line 94 "hl/src//H5LTanalyze.l" +{return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP #line 96 "hl/src//H5LTanalyze.l" -{return token(CSET_TOKEN);} +{return token(H5T_STRING_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP #line 97 "hl/src//H5LTanalyze.l" -{return token(CTYPE_TOKEN);} +{return token(STRSIZE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP #line 98 "hl/src//H5LTanalyze.l" -{return token(H5T_STR_NULLTERM_TOKEN);} +{return token(STRPAD_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP #line 99 "hl/src//H5LTanalyze.l" -{return token(H5T_STR_NULLPAD_TOKEN);} +{return token(CSET_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP #line 100 "hl/src//H5LTanalyze.l" -{return token(H5T_STR_SPACEPAD_TOKEN);} +{return token(CTYPE_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP #line 101 "hl/src//H5LTanalyze.l" -{return token(H5T_CSET_ASCII_TOKEN);} +{return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP #line 102 "hl/src//H5LTanalyze.l" -{return token(H5T_CSET_UTF8_TOKEN);} +{return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP #line 103 "hl/src//H5LTanalyze.l" -{return token(H5T_C_S1_TOKEN);} +{return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP #line 104 "hl/src//H5LTanalyze.l" -{return token(H5T_FORTRAN_S1_TOKEN);} +{return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP #line 105 "hl/src//H5LTanalyze.l" -{return token(H5T_VARIABLE_TOKEN);} +{return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 107 "hl/src//H5LTanalyze.l" -{return token(H5T_COMPOUND_TOKEN);} +#line 106 "hl/src//H5LTanalyze.l" +{return token(H5T_C_S1_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 108 "hl/src//H5LTanalyze.l" -{return token(H5T_ENUM_TOKEN);} +#line 107 "hl/src//H5LTanalyze.l" +{return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 109 "hl/src//H5LTanalyze.l" -{return token(H5T_ARRAY_TOKEN);} +#line 108 "hl/src//H5LTanalyze.l" +{return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP #line 110 "hl/src//H5LTanalyze.l" -{return token(H5T_VLEN_TOKEN);} +{return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 112 "hl/src//H5LTanalyze.l" -{return token(H5T_OPAQUE_TOKEN);} +#line 111 "hl/src//H5LTanalyze.l" +{return token(H5T_ENUM_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 113 "hl/src//H5LTanalyze.l" -{return token(OPQ_SIZE_TOKEN);} +#line 112 "hl/src//H5LTanalyze.l" +{return token(H5T_ARRAY_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 114 "hl/src//H5LTanalyze.l" -{return token(OPQ_TAG_TOKEN);} +#line 113 "hl/src//H5LTanalyze.l" +{return token(H5T_VLEN_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP +#line 115 "hl/src//H5LTanalyze.l" +{return token(H5T_OPAQUE_TOKEN);} + YY_BREAK +case 56: +YY_RULE_SETUP #line 116 "hl/src//H5LTanalyze.l" +{return token(OPQ_SIZE_TOKEN);} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 117 "hl/src//H5LTanalyze.l" +{return token(OPQ_TAG_TOKEN);} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 119 "hl/src//H5LTanalyze.l" { H5LTyylval.ival = atoi(yytext); return NUMBER; } YY_BREAK -case 56: -/* rule 56 can match eol */ +case 59: +/* rule 59 can match eol */ YY_RULE_SETUP -#line 121 "hl/src//H5LTanalyze.l" +#line 124 "hl/src//H5LTanalyze.l" { H5LTyylval.sval = trim_quotes(yytext); return STRING; } YY_BREAK -case 57: +case 60: YY_RULE_SETUP -#line 126 "hl/src//H5LTanalyze.l" +#line 129 "hl/src//H5LTanalyze.l" {return token('{');} YY_BREAK -case 58: +case 61: YY_RULE_SETUP -#line 127 "hl/src//H5LTanalyze.l" +#line 130 "hl/src//H5LTanalyze.l" {return token('}');} YY_BREAK -case 59: +case 62: YY_RULE_SETUP -#line 128 "hl/src//H5LTanalyze.l" +#line 131 "hl/src//H5LTanalyze.l" {return token('[');} YY_BREAK -case 60: +case 63: YY_RULE_SETUP -#line 129 "hl/src//H5LTanalyze.l" +#line 132 "hl/src//H5LTanalyze.l" {return token(']');} YY_BREAK -case 61: +case 64: YY_RULE_SETUP -#line 130 "hl/src//H5LTanalyze.l" +#line 133 "hl/src//H5LTanalyze.l" {return token(':');} YY_BREAK -case 62: +case 65: YY_RULE_SETUP -#line 131 "hl/src//H5LTanalyze.l" +#line 134 "hl/src//H5LTanalyze.l" {return token(';');} YY_BREAK -case 63: -/* rule 63 can match eol */ +case 66: +/* rule 66 can match eol */ YY_RULE_SETUP -#line 132 "hl/src//H5LTanalyze.l" +#line 135 "hl/src//H5LTanalyze.l" ; YY_BREAK -case 64: +case 67: YY_RULE_SETUP -#line 134 "hl/src//H5LTanalyze.l" +#line 137 "hl/src//H5LTanalyze.l" ECHO; YY_BREAK -#line 1507 "hl/src//H5LTanalyze.c" +#line 1526 "hl/src//H5LTanalyze.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1831,7 +1851,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 275 ) + if ( yy_current_state >= 283 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; @@ -1859,11 +1879,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 275 ) + if ( yy_current_state >= 283 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 274); + yy_is_jam = (yy_current_state == 282); return yy_is_jam ? 0 : yy_current_state; } @@ -2539,7 +2559,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 134 "hl/src//H5LTanalyze.l" +#line 137 "hl/src//H5LTanalyze.l" /* Allocate a copy of `quoted` with the double quote character at diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 58a66366ebd..a573f8137f3 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -82,10 +82,13 @@ H5T_NATIVE_ULONG {return hid(H5T_NATIVE_ULONG_TOKEN);} H5T_NATIVE_LLONG {return hid(H5T_NATIVE_LLONG_TOKEN);} H5T_NATIVE_ULLONG {return hid(H5T_NATIVE_ULLONG_TOKEN);} +H5T_IEEE_F16BE {return hid(H5T_IEEE_F16BE_TOKEN);} +H5T_IEEE_F16LE {return hid(H5T_IEEE_F16LE_TOKEN);} H5T_IEEE_F32BE {return hid(H5T_IEEE_F32BE_TOKEN);} H5T_IEEE_F32LE {return hid(H5T_IEEE_F32LE_TOKEN);} H5T_IEEE_F64BE {return hid(H5T_IEEE_F64BE_TOKEN);} H5T_IEEE_F64LE {return hid(H5T_IEEE_F64LE_TOKEN);} +H5T_NATIVE_FLOAT16 {return hid(H5T_NATIVE_FLOAT16_TOKEN);} H5T_NATIVE_FLOAT {return hid(H5T_NATIVE_FLOAT_TOKEN);} H5T_NATIVE_DOUBLE {return hid(H5T_NATIVE_DOUBLE_TOKEN);} H5T_NATIVE_LDOUBLE {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 592b863207d..bb7137630a5 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -213,84 +213,87 @@ enum yysymbol_kind_t YYSYMBOL_H5T_NATIVE_ULONG_TOKEN = 27, /* H5T_NATIVE_ULONG_TOKEN */ YYSYMBOL_H5T_NATIVE_LLONG_TOKEN = 28, /* H5T_NATIVE_LLONG_TOKEN */ YYSYMBOL_H5T_NATIVE_ULLONG_TOKEN = 29, /* H5T_NATIVE_ULLONG_TOKEN */ - YYSYMBOL_H5T_IEEE_F32BE_TOKEN = 30, /* H5T_IEEE_F32BE_TOKEN */ - YYSYMBOL_H5T_IEEE_F32LE_TOKEN = 31, /* H5T_IEEE_F32LE_TOKEN */ - YYSYMBOL_H5T_IEEE_F64BE_TOKEN = 32, /* H5T_IEEE_F64BE_TOKEN */ - YYSYMBOL_H5T_IEEE_F64LE_TOKEN = 33, /* H5T_IEEE_F64LE_TOKEN */ - YYSYMBOL_H5T_NATIVE_FLOAT_TOKEN = 34, /* H5T_NATIVE_FLOAT_TOKEN */ - YYSYMBOL_H5T_NATIVE_DOUBLE_TOKEN = 35, /* H5T_NATIVE_DOUBLE_TOKEN */ - YYSYMBOL_H5T_NATIVE_LDOUBLE_TOKEN = 36, /* H5T_NATIVE_LDOUBLE_TOKEN */ - YYSYMBOL_H5T_STRING_TOKEN = 37, /* H5T_STRING_TOKEN */ - YYSYMBOL_STRSIZE_TOKEN = 38, /* STRSIZE_TOKEN */ - YYSYMBOL_STRPAD_TOKEN = 39, /* STRPAD_TOKEN */ - YYSYMBOL_CSET_TOKEN = 40, /* CSET_TOKEN */ - YYSYMBOL_CTYPE_TOKEN = 41, /* CTYPE_TOKEN */ - YYSYMBOL_H5T_VARIABLE_TOKEN = 42, /* H5T_VARIABLE_TOKEN */ - YYSYMBOL_H5T_STR_NULLTERM_TOKEN = 43, /* H5T_STR_NULLTERM_TOKEN */ - YYSYMBOL_H5T_STR_NULLPAD_TOKEN = 44, /* H5T_STR_NULLPAD_TOKEN */ - YYSYMBOL_H5T_STR_SPACEPAD_TOKEN = 45, /* H5T_STR_SPACEPAD_TOKEN */ - YYSYMBOL_H5T_CSET_ASCII_TOKEN = 46, /* H5T_CSET_ASCII_TOKEN */ - YYSYMBOL_H5T_CSET_UTF8_TOKEN = 47, /* H5T_CSET_UTF8_TOKEN */ - YYSYMBOL_H5T_C_S1_TOKEN = 48, /* H5T_C_S1_TOKEN */ - YYSYMBOL_H5T_FORTRAN_S1_TOKEN = 49, /* H5T_FORTRAN_S1_TOKEN */ - YYSYMBOL_H5T_OPAQUE_TOKEN = 50, /* H5T_OPAQUE_TOKEN */ - YYSYMBOL_OPQ_SIZE_TOKEN = 51, /* OPQ_SIZE_TOKEN */ - YYSYMBOL_OPQ_TAG_TOKEN = 52, /* OPQ_TAG_TOKEN */ - YYSYMBOL_H5T_COMPOUND_TOKEN = 53, /* H5T_COMPOUND_TOKEN */ - YYSYMBOL_H5T_ENUM_TOKEN = 54, /* H5T_ENUM_TOKEN */ - YYSYMBOL_H5T_ARRAY_TOKEN = 55, /* H5T_ARRAY_TOKEN */ - YYSYMBOL_H5T_VLEN_TOKEN = 56, /* H5T_VLEN_TOKEN */ - YYSYMBOL_STRING = 57, /* STRING */ - YYSYMBOL_NUMBER = 58, /* NUMBER */ - YYSYMBOL_59_ = 59, /* '{' */ - YYSYMBOL_60_ = 60, /* '}' */ - YYSYMBOL_61_ = 61, /* '[' */ - YYSYMBOL_62_ = 62, /* ']' */ - YYSYMBOL_63_ = 63, /* ':' */ - YYSYMBOL_64_ = 64, /* ';' */ - YYSYMBOL_YYACCEPT = 65, /* $accept */ - YYSYMBOL_start = 66, /* start */ - YYSYMBOL_ddl_type = 67, /* ddl_type */ - YYSYMBOL_atomic_type = 68, /* atomic_type */ - YYSYMBOL_integer_type = 69, /* integer_type */ - YYSYMBOL_fp_type = 70, /* fp_type */ - YYSYMBOL_compound_type = 71, /* compound_type */ - YYSYMBOL_72_1 = 72, /* $@1 */ - YYSYMBOL_memb_list = 73, /* memb_list */ - YYSYMBOL_memb_def = 74, /* memb_def */ - YYSYMBOL_75_2 = 75, /* $@2 */ - YYSYMBOL_field_name = 76, /* field_name */ - YYSYMBOL_field_offset = 77, /* field_offset */ - YYSYMBOL_offset = 78, /* offset */ - YYSYMBOL_array_type = 79, /* array_type */ - YYSYMBOL_80_3 = 80, /* $@3 */ - YYSYMBOL_dim_list = 81, /* dim_list */ - YYSYMBOL_dim = 82, /* dim */ - YYSYMBOL_83_4 = 83, /* $@4 */ - YYSYMBOL_84_5 = 84, /* $@5 */ - YYSYMBOL_dimsize = 85, /* dimsize */ - YYSYMBOL_vlen_type = 86, /* vlen_type */ - YYSYMBOL_opaque_type = 87, /* opaque_type */ - YYSYMBOL_88_6 = 88, /* @6 */ - YYSYMBOL_89_7 = 89, /* $@7 */ - YYSYMBOL_opaque_size = 90, /* opaque_size */ - YYSYMBOL_opaque_tag = 91, /* opaque_tag */ - YYSYMBOL_string_type = 92, /* string_type */ - YYSYMBOL_93_8 = 93, /* $@8 */ - YYSYMBOL_94_9 = 94, /* $@9 */ - YYSYMBOL_95_10 = 95, /* $@10 */ - YYSYMBOL_96_11 = 96, /* @11 */ - YYSYMBOL_strsize = 97, /* strsize */ - YYSYMBOL_strpad = 98, /* strpad */ - YYSYMBOL_cset = 99, /* cset */ - YYSYMBOL_ctype = 100, /* ctype */ - YYSYMBOL_enum_type = 101, /* enum_type */ - YYSYMBOL_102_12 = 102, /* $@12 */ - YYSYMBOL_enum_list = 103, /* enum_list */ - YYSYMBOL_enum_def = 104, /* enum_def */ - YYSYMBOL_105_13 = 105, /* $@13 */ - YYSYMBOL_enum_symbol = 106, /* enum_symbol */ - YYSYMBOL_enum_val = 107 /* enum_val */ + YYSYMBOL_H5T_IEEE_F16BE_TOKEN = 30, /* H5T_IEEE_F16BE_TOKEN */ + YYSYMBOL_H5T_IEEE_F16LE_TOKEN = 31, /* H5T_IEEE_F16LE_TOKEN */ + YYSYMBOL_H5T_IEEE_F32BE_TOKEN = 32, /* H5T_IEEE_F32BE_TOKEN */ + YYSYMBOL_H5T_IEEE_F32LE_TOKEN = 33, /* H5T_IEEE_F32LE_TOKEN */ + YYSYMBOL_H5T_IEEE_F64BE_TOKEN = 34, /* H5T_IEEE_F64BE_TOKEN */ + YYSYMBOL_H5T_IEEE_F64LE_TOKEN = 35, /* H5T_IEEE_F64LE_TOKEN */ + YYSYMBOL_H5T_NATIVE_FLOAT16_TOKEN = 36, /* H5T_NATIVE_FLOAT16_TOKEN */ + YYSYMBOL_H5T_NATIVE_FLOAT_TOKEN = 37, /* H5T_NATIVE_FLOAT_TOKEN */ + YYSYMBOL_H5T_NATIVE_DOUBLE_TOKEN = 38, /* H5T_NATIVE_DOUBLE_TOKEN */ + YYSYMBOL_H5T_NATIVE_LDOUBLE_TOKEN = 39, /* H5T_NATIVE_LDOUBLE_TOKEN */ + YYSYMBOL_H5T_STRING_TOKEN = 40, /* H5T_STRING_TOKEN */ + YYSYMBOL_STRSIZE_TOKEN = 41, /* STRSIZE_TOKEN */ + YYSYMBOL_STRPAD_TOKEN = 42, /* STRPAD_TOKEN */ + YYSYMBOL_CSET_TOKEN = 43, /* CSET_TOKEN */ + YYSYMBOL_CTYPE_TOKEN = 44, /* CTYPE_TOKEN */ + YYSYMBOL_H5T_VARIABLE_TOKEN = 45, /* H5T_VARIABLE_TOKEN */ + YYSYMBOL_H5T_STR_NULLTERM_TOKEN = 46, /* H5T_STR_NULLTERM_TOKEN */ + YYSYMBOL_H5T_STR_NULLPAD_TOKEN = 47, /* H5T_STR_NULLPAD_TOKEN */ + YYSYMBOL_H5T_STR_SPACEPAD_TOKEN = 48, /* H5T_STR_SPACEPAD_TOKEN */ + YYSYMBOL_H5T_CSET_ASCII_TOKEN = 49, /* H5T_CSET_ASCII_TOKEN */ + YYSYMBOL_H5T_CSET_UTF8_TOKEN = 50, /* H5T_CSET_UTF8_TOKEN */ + YYSYMBOL_H5T_C_S1_TOKEN = 51, /* H5T_C_S1_TOKEN */ + YYSYMBOL_H5T_FORTRAN_S1_TOKEN = 52, /* H5T_FORTRAN_S1_TOKEN */ + YYSYMBOL_H5T_OPAQUE_TOKEN = 53, /* H5T_OPAQUE_TOKEN */ + YYSYMBOL_OPQ_SIZE_TOKEN = 54, /* OPQ_SIZE_TOKEN */ + YYSYMBOL_OPQ_TAG_TOKEN = 55, /* OPQ_TAG_TOKEN */ + YYSYMBOL_H5T_COMPOUND_TOKEN = 56, /* H5T_COMPOUND_TOKEN */ + YYSYMBOL_H5T_ENUM_TOKEN = 57, /* H5T_ENUM_TOKEN */ + YYSYMBOL_H5T_ARRAY_TOKEN = 58, /* H5T_ARRAY_TOKEN */ + YYSYMBOL_H5T_VLEN_TOKEN = 59, /* H5T_VLEN_TOKEN */ + YYSYMBOL_STRING = 60, /* STRING */ + YYSYMBOL_NUMBER = 61, /* NUMBER */ + YYSYMBOL_62_ = 62, /* '{' */ + YYSYMBOL_63_ = 63, /* '}' */ + YYSYMBOL_64_ = 64, /* '[' */ + YYSYMBOL_65_ = 65, /* ']' */ + YYSYMBOL_66_ = 66, /* ':' */ + YYSYMBOL_67_ = 67, /* ';' */ + YYSYMBOL_YYACCEPT = 68, /* $accept */ + YYSYMBOL_start = 69, /* start */ + YYSYMBOL_ddl_type = 70, /* ddl_type */ + YYSYMBOL_atomic_type = 71, /* atomic_type */ + YYSYMBOL_integer_type = 72, /* integer_type */ + YYSYMBOL_fp_type = 73, /* fp_type */ + YYSYMBOL_compound_type = 74, /* compound_type */ + YYSYMBOL_75_1 = 75, /* $@1 */ + YYSYMBOL_memb_list = 76, /* memb_list */ + YYSYMBOL_memb_def = 77, /* memb_def */ + YYSYMBOL_78_2 = 78, /* $@2 */ + YYSYMBOL_field_name = 79, /* field_name */ + YYSYMBOL_field_offset = 80, /* field_offset */ + YYSYMBOL_offset = 81, /* offset */ + YYSYMBOL_array_type = 82, /* array_type */ + YYSYMBOL_83_3 = 83, /* $@3 */ + YYSYMBOL_dim_list = 84, /* dim_list */ + YYSYMBOL_dim = 85, /* dim */ + YYSYMBOL_86_4 = 86, /* $@4 */ + YYSYMBOL_87_5 = 87, /* $@5 */ + YYSYMBOL_dimsize = 88, /* dimsize */ + YYSYMBOL_vlen_type = 89, /* vlen_type */ + YYSYMBOL_opaque_type = 90, /* opaque_type */ + YYSYMBOL_91_6 = 91, /* @6 */ + YYSYMBOL_92_7 = 92, /* $@7 */ + YYSYMBOL_opaque_size = 93, /* opaque_size */ + YYSYMBOL_opaque_tag = 94, /* opaque_tag */ + YYSYMBOL_string_type = 95, /* string_type */ + YYSYMBOL_96_8 = 96, /* $@8 */ + YYSYMBOL_97_9 = 97, /* $@9 */ + YYSYMBOL_98_10 = 98, /* $@10 */ + YYSYMBOL_99_11 = 99, /* @11 */ + YYSYMBOL_strsize = 100, /* strsize */ + YYSYMBOL_strpad = 101, /* strpad */ + YYSYMBOL_cset = 102, /* cset */ + YYSYMBOL_ctype = 103, /* ctype */ + YYSYMBOL_enum_type = 104, /* enum_type */ + YYSYMBOL_105_12 = 105, /* $@12 */ + YYSYMBOL_enum_list = 106, /* enum_list */ + YYSYMBOL_enum_def = 107, /* enum_def */ + YYSYMBOL_108_13 = 108, /* $@13 */ + YYSYMBOL_enum_symbol = 109, /* enum_symbol */ + YYSYMBOL_enum_val = 110 /* enum_val */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -616,21 +619,21 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 58 +#define YYFINAL 61 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 197 +#define YYLAST 206 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 65 +#define YYNTOKENS 68 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 43 /* YYNRULES -- Number of rules. */ -#define YYNRULES 92 +#define YYNRULES 95 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 134 +#define YYNSTATES 137 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 313 +#define YYMAXUTOK 316 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM @@ -649,14 +652,14 @@ static const yytype_int8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 63, 64, + 2, 2, 2, 2, 2, 2, 2, 2, 66, 67, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 61, 2, 62, 2, 2, 2, 2, 2, 2, + 2, 64, 2, 65, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 59, 2, 60, 2, 2, 2, 2, + 2, 2, 2, 62, 2, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -675,23 +678,23 @@ static const yytype_int8 yytranslate[] = 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58 + 55, 56, 57, 58, 59, 60, 61 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 101, 101, 102, 104, 105, 106, 107, 109, 110, - 111, 112, 113, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 145, 146, 147, 148, 149, 150, 151, 155, 154, 163, - 164, 166, 166, 203, 211, 212, 215, 217, 217, 226, - 227, 229, 230, 229, 237, 240, 247, 252, 244, 259, - 261, 266, 273, 282, 289, 263, 313, 314, 316, 317, - 318, 320, 321, 323, 324, 328, 327, 332, 333, 335, - 335, 385, 387 + 0, 102, 102, 103, 105, 106, 107, 108, 110, 111, + 112, 113, 114, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 159, 158, 167, 168, 170, 170, 207, 215, 216, 219, + 221, 221, 230, 231, 233, 234, 233, 241, 244, 251, + 256, 248, 263, 265, 270, 277, 286, 293, 267, 317, + 318, 320, 321, 322, 324, 325, 327, 328, 332, 331, + 336, 337, 339, 339, 389, 391 }; #endif @@ -718,24 +721,26 @@ static const char *const yytname[] = "H5T_NATIVE_USHORT_TOKEN", "H5T_NATIVE_INT_TOKEN", "H5T_NATIVE_UINT_TOKEN", "H5T_NATIVE_LONG_TOKEN", "H5T_NATIVE_ULONG_TOKEN", "H5T_NATIVE_LLONG_TOKEN", - "H5T_NATIVE_ULLONG_TOKEN", "H5T_IEEE_F32BE_TOKEN", - "H5T_IEEE_F32LE_TOKEN", "H5T_IEEE_F64BE_TOKEN", "H5T_IEEE_F64LE_TOKEN", - "H5T_NATIVE_FLOAT_TOKEN", "H5T_NATIVE_DOUBLE_TOKEN", - "H5T_NATIVE_LDOUBLE_TOKEN", "H5T_STRING_TOKEN", "STRSIZE_TOKEN", - "STRPAD_TOKEN", "CSET_TOKEN", "CTYPE_TOKEN", "H5T_VARIABLE_TOKEN", - "H5T_STR_NULLTERM_TOKEN", "H5T_STR_NULLPAD_TOKEN", - "H5T_STR_SPACEPAD_TOKEN", "H5T_CSET_ASCII_TOKEN", "H5T_CSET_UTF8_TOKEN", - "H5T_C_S1_TOKEN", "H5T_FORTRAN_S1_TOKEN", "H5T_OPAQUE_TOKEN", - "OPQ_SIZE_TOKEN", "OPQ_TAG_TOKEN", "H5T_COMPOUND_TOKEN", - "H5T_ENUM_TOKEN", "H5T_ARRAY_TOKEN", "H5T_VLEN_TOKEN", "STRING", - "NUMBER", "'{'", "'}'", "'['", "']'", "':'", "';'", "$accept", "start", - "ddl_type", "atomic_type", "integer_type", "fp_type", "compound_type", - "$@1", "memb_list", "memb_def", "$@2", "field_name", "field_offset", - "offset", "array_type", "$@3", "dim_list", "dim", "$@4", "$@5", - "dimsize", "vlen_type", "opaque_type", "@6", "$@7", "opaque_size", - "opaque_tag", "string_type", "$@8", "$@9", "$@10", "@11", "strsize", - "strpad", "cset", "ctype", "enum_type", "$@12", "enum_list", "enum_def", - "$@13", "enum_symbol", "enum_val", YY_NULLPTR + "H5T_NATIVE_ULLONG_TOKEN", "H5T_IEEE_F16BE_TOKEN", + "H5T_IEEE_F16LE_TOKEN", "H5T_IEEE_F32BE_TOKEN", "H5T_IEEE_F32LE_TOKEN", + "H5T_IEEE_F64BE_TOKEN", "H5T_IEEE_F64LE_TOKEN", + "H5T_NATIVE_FLOAT16_TOKEN", "H5T_NATIVE_FLOAT_TOKEN", + "H5T_NATIVE_DOUBLE_TOKEN", "H5T_NATIVE_LDOUBLE_TOKEN", + "H5T_STRING_TOKEN", "STRSIZE_TOKEN", "STRPAD_TOKEN", "CSET_TOKEN", + "CTYPE_TOKEN", "H5T_VARIABLE_TOKEN", "H5T_STR_NULLTERM_TOKEN", + "H5T_STR_NULLPAD_TOKEN", "H5T_STR_SPACEPAD_TOKEN", + "H5T_CSET_ASCII_TOKEN", "H5T_CSET_UTF8_TOKEN", "H5T_C_S1_TOKEN", + "H5T_FORTRAN_S1_TOKEN", "H5T_OPAQUE_TOKEN", "OPQ_SIZE_TOKEN", + "OPQ_TAG_TOKEN", "H5T_COMPOUND_TOKEN", "H5T_ENUM_TOKEN", + "H5T_ARRAY_TOKEN", "H5T_VLEN_TOKEN", "STRING", "NUMBER", "'{'", "'}'", + "'['", "']'", "':'", "';'", "$accept", "start", "ddl_type", + "atomic_type", "integer_type", "fp_type", "compound_type", "$@1", + "memb_list", "memb_def", "$@2", "field_name", "field_offset", "offset", + "array_type", "$@3", "dim_list", "dim", "$@4", "$@5", "dimsize", + "vlen_type", "opaque_type", "@6", "$@7", "opaque_size", "opaque_tag", + "string_type", "$@8", "$@9", "$@10", "@11", "strsize", "strpad", "cset", + "ctype", "enum_type", "$@12", "enum_list", "enum_def", "$@13", + "enum_symbol", "enum_val", YY_NULLPTR }; static const char * @@ -759,20 +764,20 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 114, -25, -25, -25, -25, -25, -25, -25, -25, -25, + 120, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -24, -22, -25, -13, -25, - -11, 49, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, 18, 45, 38, 168, 39, 114, -25, -4, - 41, -25, 36, -25, 42, -25, -25, 37, -25, 40, - 56, -25, -3, -25, -25, -25, -25, -25, -25, -25, - -25, 43, -25, 66, 55, 51, -21, 57, -25, 0, - 95, -25, 50, -25, -25, -25, -25, -25, -25, -25, - -25, -25, 89, -25, 90, 97, 92, 99, 52, -25, - -25, -25, -25, -25, -25, 94, -25, 119, 100, -25, - -6, -25, -25, -25, 98, -25, 120, 46, -25, -25, - 101, -25, 103, -25 + -25, -25, -25, -25, -25, -25, -25, -25, -24, -22, + -25, -13, -25, -11, 52, -25, -25, -25, -25, -25, + -25, -25, -25, -25, -25, 18, 48, 41, 177, 42, + 120, -25, -4, 44, -25, 39, -25, 45, -25, -25, + 40, -25, 43, 59, -25, -3, -25, -25, -25, -25, + -25, -25, -25, -25, 46, -25, 69, 58, 54, -21, + 60, -25, 0, 101, -25, 53, -25, -25, -25, -25, + -25, -25, -25, -25, -25, 95, -25, 96, 103, 98, + 105, 55, -25, -25, -25, -25, -25, -25, 100, -25, + 125, 106, -25, -6, -25, -25, -25, 104, -25, 126, + 49, -25, -25, 107, -25, 109, -25 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -783,23 +788,23 @@ static const yytype_int8 yydefact[] = 2, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 0, 0, 47, 0, 57, - 0, 0, 3, 4, 8, 9, 5, 6, 7, 12, - 10, 11, 0, 0, 0, 0, 0, 0, 1, 0, - 0, 49, 0, 59, 0, 76, 77, 0, 69, 0, - 0, 85, 0, 65, 71, 66, 48, 51, 50, 87, - 61, 0, 60, 0, 0, 0, 0, 0, 58, 0, - 0, 53, 54, 91, 86, 88, 89, 64, 62, 78, - 79, 80, 0, 70, 0, 0, 0, 0, 0, 72, - 67, 56, 55, 52, 92, 0, 63, 0, 0, 90, - 0, 68, 81, 82, 0, 73, 0, 0, 83, 84, - 0, 74, 0, 75 + 42, 43, 44, 45, 46, 47, 48, 49, 0, 0, + 50, 0, 60, 0, 0, 3, 4, 8, 9, 5, + 6, 7, 12, 10, 11, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 52, 0, 62, 0, 79, 80, + 0, 72, 0, 0, 88, 0, 68, 74, 69, 51, + 54, 53, 90, 64, 0, 63, 0, 0, 0, 0, + 0, 61, 0, 0, 56, 57, 94, 89, 91, 92, + 67, 65, 81, 82, 83, 0, 73, 0, 0, 0, + 0, 0, 75, 70, 59, 58, 55, 95, 0, 66, + 0, 0, 93, 0, 71, 84, 85, 0, 76, 0, + 0, 86, 87, 0, 77, 0, 78 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -25, -25, -15, -25, 111, -25, -25, -25, -25, -25, + -25, -25, -15, -25, 117, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, @@ -809,11 +814,11 @@ static const yytype_int8 yypgoto[] = /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_uint8 yydefgoto[] = { - 0, 41, 42, 43, 44, 45, 46, 54, 70, 78, - 85, 92, 106, 112, 47, 56, 72, 82, 87, 108, - 98, 48, 49, 84, 118, 69, 104, 50, 83, 117, - 126, 132, 67, 102, 124, 130, 51, 79, 86, 95, - 107, 96, 115 + 0, 44, 45, 46, 47, 48, 49, 57, 73, 81, + 88, 95, 109, 115, 50, 59, 75, 85, 90, 111, + 101, 51, 52, 87, 121, 72, 107, 53, 86, 120, + 129, 135, 70, 105, 127, 133, 54, 82, 89, 98, + 110, 99, 118 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -824,23 +829,24 @@ static const yytype_uint8 yytable[] = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 52, 93, 53, 65, 94, - 122, 123, 64, 99, 100, 101, 55, 36, 57, 58, - 37, 38, 39, 40, 66, 77, 59, 81, 80, 1, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 128, 129, 60, 61, 63, 68, - 71, 74, 73, 88, 75, 89, 36, 90, 91, 37, - 38, 39, 40, 105, 116, 97, 76, 1, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 103, 109, 110, 111, 113, 114, 119, 120, - 121, 127, 125, 133, 36, 131, 62, 37, 38, 39, - 40, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27 + 31, 32, 33, 34, 35, 36, 37, 38, 55, 96, + 56, 68, 97, 125, 126, 67, 102, 103, 104, 58, + 39, 60, 61, 40, 41, 42, 43, 69, 80, 62, + 84, 83, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 131, 132, 63, 64, 66, 71, 74, 77, 76, 91, + 78, 92, 39, 93, 94, 40, 41, 42, 43, 108, + 119, 100, 79, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 106, 112, 113, 114, 116, 117, 122, 123, 124, + 130, 128, 136, 39, 134, 65, 40, 41, 42, 43, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27 }; static const yytype_int8 yycheck[] = @@ -848,23 +854,24 @@ static const yytype_int8 yycheck[] = 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 59, 57, 59, 42, 60, - 46, 47, 57, 43, 44, 45, 59, 50, 59, 0, - 53, 54, 55, 56, 58, 70, 38, 72, 61, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 48, 49, 51, 59, 59, 58, - 64, 64, 60, 60, 64, 39, 50, 52, 57, 53, - 54, 55, 56, 63, 62, 58, 60, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 57, 64, 64, 58, 64, 58, 64, 40, - 60, 41, 64, 60, 50, 64, 55, 53, 54, 55, - 56, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29 + 33, 34, 35, 36, 37, 38, 39, 40, 62, 60, + 62, 45, 63, 49, 50, 60, 46, 47, 48, 62, + 53, 62, 0, 56, 57, 58, 59, 61, 73, 41, + 75, 64, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 51, 52, 54, 62, 62, 61, 67, 67, 63, 63, + 67, 42, 53, 55, 60, 56, 57, 58, 59, 66, + 65, 61, 63, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 60, 67, 67, 61, 67, 61, 67, 43, 63, + 44, 67, 63, 53, 67, 58, 56, 57, 58, 59, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -874,32 +881,32 @@ static const yytype_int8 yystos[] = 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 50, 53, 54, 55, - 56, 66, 67, 68, 69, 70, 71, 79, 86, 87, - 92, 101, 59, 59, 72, 59, 80, 59, 0, 38, - 51, 59, 69, 59, 67, 42, 58, 97, 58, 90, - 73, 64, 81, 60, 64, 64, 60, 67, 74, 102, - 61, 67, 82, 93, 88, 75, 103, 83, 60, 39, - 52, 57, 76, 57, 60, 104, 106, 58, 85, 43, - 44, 45, 98, 57, 91, 63, 77, 105, 84, 64, - 64, 58, 78, 64, 58, 107, 62, 94, 89, 64, - 40, 60, 46, 47, 99, 64, 95, 41, 48, 49, - 100, 64, 96, 60 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 53, + 56, 57, 58, 59, 69, 70, 71, 72, 73, 74, + 82, 89, 90, 95, 104, 62, 62, 75, 62, 83, + 62, 0, 41, 54, 62, 72, 62, 70, 45, 61, + 100, 61, 93, 76, 67, 84, 63, 67, 67, 63, + 70, 77, 105, 64, 70, 85, 96, 91, 78, 106, + 86, 63, 42, 55, 60, 79, 60, 63, 107, 109, + 61, 88, 46, 47, 48, 101, 60, 94, 66, 80, + 108, 87, 67, 67, 61, 81, 67, 61, 110, 65, + 97, 92, 67, 43, 63, 49, 50, 102, 67, 98, + 44, 51, 52, 103, 67, 99, 63 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { - 0, 65, 66, 66, 67, 67, 67, 67, 68, 68, - 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, - 70, 70, 70, 70, 70, 70, 70, 72, 71, 73, - 73, 75, 74, 76, 77, 77, 78, 80, 79, 81, - 81, 83, 84, 82, 85, 86, 88, 89, 87, 90, - 91, 93, 94, 95, 96, 92, 97, 97, 98, 98, - 98, 99, 99, 100, 100, 102, 101, 103, 103, 105, - 104, 106, 107 + 0, 68, 69, 69, 70, 70, 70, 70, 71, 71, + 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 75, 74, 76, 76, 78, 77, 79, 80, 80, 81, + 83, 82, 84, 84, 86, 87, 85, 88, 89, 91, + 92, 90, 93, 94, 96, 97, 98, 99, 95, 100, + 100, 101, 101, 101, 102, 102, 103, 103, 105, 104, + 106, 106, 108, 107, 109, 110 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -909,12 +916,12 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 5, 0, - 2, 0, 5, 1, 0, 2, 1, 0, 6, 0, - 2, 0, 0, 5, 1, 4, 0, 0, 11, 1, - 1, 0, 0, 0, 0, 19, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 0, 7, 0, 2, 0, - 4, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 5, 0, 2, 0, 5, 1, 0, 2, 1, + 0, 6, 0, 2, 0, 0, 5, 1, 4, 0, + 0, 11, 1, 1, 0, 0, 0, 0, 19, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 7, + 0, 2, 0, 4, 1, 1 }; @@ -1378,245 +1385,263 @@ yyparse (void) switch (yyn) { case 2: /* start: %empty */ -#line 101 "hl/src//H5LTparse.y" +#line 102 "hl/src//H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } -#line 1353 "hl/src//H5LTparse.c" +#line 1360 "hl/src//H5LTparse.c" break; case 3: /* start: ddl_type */ -#line 102 "hl/src//H5LTparse.y" +#line 103 "hl/src//H5LTparse.y" { return (yyval.hid);} -#line 1359 "hl/src//H5LTparse.c" +#line 1366 "hl/src//H5LTparse.c" break; case 13: /* integer_type: H5T_STD_I8BE_TOKEN */ -#line 116 "hl/src//H5LTparse.y" +#line 117 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } -#line 1365 "hl/src//H5LTparse.c" +#line 1372 "hl/src//H5LTparse.c" break; case 14: /* integer_type: H5T_STD_I8LE_TOKEN */ -#line 117 "hl/src//H5LTparse.y" +#line 118 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } -#line 1371 "hl/src//H5LTparse.c" +#line 1378 "hl/src//H5LTparse.c" break; case 15: /* integer_type: H5T_STD_I16BE_TOKEN */ -#line 118 "hl/src//H5LTparse.y" +#line 119 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } -#line 1377 "hl/src//H5LTparse.c" +#line 1384 "hl/src//H5LTparse.c" break; case 16: /* integer_type: H5T_STD_I16LE_TOKEN */ -#line 119 "hl/src//H5LTparse.y" +#line 120 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } -#line 1383 "hl/src//H5LTparse.c" +#line 1390 "hl/src//H5LTparse.c" break; case 17: /* integer_type: H5T_STD_I32BE_TOKEN */ -#line 120 "hl/src//H5LTparse.y" +#line 121 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } -#line 1389 "hl/src//H5LTparse.c" +#line 1396 "hl/src//H5LTparse.c" break; case 18: /* integer_type: H5T_STD_I32LE_TOKEN */ -#line 121 "hl/src//H5LTparse.y" +#line 122 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } -#line 1395 "hl/src//H5LTparse.c" +#line 1402 "hl/src//H5LTparse.c" break; case 19: /* integer_type: H5T_STD_I64BE_TOKEN */ -#line 122 "hl/src//H5LTparse.y" +#line 123 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } -#line 1401 "hl/src//H5LTparse.c" +#line 1408 "hl/src//H5LTparse.c" break; case 20: /* integer_type: H5T_STD_I64LE_TOKEN */ -#line 123 "hl/src//H5LTparse.y" +#line 124 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } -#line 1407 "hl/src//H5LTparse.c" +#line 1414 "hl/src//H5LTparse.c" break; case 21: /* integer_type: H5T_STD_U8BE_TOKEN */ -#line 124 "hl/src//H5LTparse.y" +#line 125 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } -#line 1413 "hl/src//H5LTparse.c" +#line 1420 "hl/src//H5LTparse.c" break; case 22: /* integer_type: H5T_STD_U8LE_TOKEN */ -#line 125 "hl/src//H5LTparse.y" +#line 126 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } -#line 1419 "hl/src//H5LTparse.c" +#line 1426 "hl/src//H5LTparse.c" break; case 23: /* integer_type: H5T_STD_U16BE_TOKEN */ -#line 126 "hl/src//H5LTparse.y" +#line 127 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } -#line 1425 "hl/src//H5LTparse.c" +#line 1432 "hl/src//H5LTparse.c" break; case 24: /* integer_type: H5T_STD_U16LE_TOKEN */ -#line 127 "hl/src//H5LTparse.y" +#line 128 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } -#line 1431 "hl/src//H5LTparse.c" +#line 1438 "hl/src//H5LTparse.c" break; case 25: /* integer_type: H5T_STD_U32BE_TOKEN */ -#line 128 "hl/src//H5LTparse.y" +#line 129 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } -#line 1437 "hl/src//H5LTparse.c" +#line 1444 "hl/src//H5LTparse.c" break; case 26: /* integer_type: H5T_STD_U32LE_TOKEN */ -#line 129 "hl/src//H5LTparse.y" +#line 130 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } -#line 1443 "hl/src//H5LTparse.c" +#line 1450 "hl/src//H5LTparse.c" break; case 27: /* integer_type: H5T_STD_U64BE_TOKEN */ -#line 130 "hl/src//H5LTparse.y" +#line 131 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } -#line 1449 "hl/src//H5LTparse.c" +#line 1456 "hl/src//H5LTparse.c" break; case 28: /* integer_type: H5T_STD_U64LE_TOKEN */ -#line 131 "hl/src//H5LTparse.y" +#line 132 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } -#line 1455 "hl/src//H5LTparse.c" +#line 1462 "hl/src//H5LTparse.c" break; case 29: /* integer_type: H5T_NATIVE_CHAR_TOKEN */ -#line 132 "hl/src//H5LTparse.y" +#line 133 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } -#line 1461 "hl/src//H5LTparse.c" +#line 1468 "hl/src//H5LTparse.c" break; case 30: /* integer_type: H5T_NATIVE_SCHAR_TOKEN */ -#line 133 "hl/src//H5LTparse.y" +#line 134 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } -#line 1467 "hl/src//H5LTparse.c" +#line 1474 "hl/src//H5LTparse.c" break; case 31: /* integer_type: H5T_NATIVE_UCHAR_TOKEN */ -#line 134 "hl/src//H5LTparse.y" +#line 135 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } -#line 1473 "hl/src//H5LTparse.c" +#line 1480 "hl/src//H5LTparse.c" break; case 32: /* integer_type: H5T_NATIVE_SHORT_TOKEN */ -#line 135 "hl/src//H5LTparse.y" +#line 136 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } -#line 1479 "hl/src//H5LTparse.c" +#line 1486 "hl/src//H5LTparse.c" break; case 33: /* integer_type: H5T_NATIVE_USHORT_TOKEN */ -#line 136 "hl/src//H5LTparse.y" +#line 137 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } -#line 1485 "hl/src//H5LTparse.c" +#line 1492 "hl/src//H5LTparse.c" break; case 34: /* integer_type: H5T_NATIVE_INT_TOKEN */ -#line 137 "hl/src//H5LTparse.y" +#line 138 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } -#line 1491 "hl/src//H5LTparse.c" +#line 1498 "hl/src//H5LTparse.c" break; case 35: /* integer_type: H5T_NATIVE_UINT_TOKEN */ -#line 138 "hl/src//H5LTparse.y" +#line 139 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } -#line 1497 "hl/src//H5LTparse.c" +#line 1504 "hl/src//H5LTparse.c" break; case 36: /* integer_type: H5T_NATIVE_LONG_TOKEN */ -#line 139 "hl/src//H5LTparse.y" +#line 140 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } -#line 1503 "hl/src//H5LTparse.c" +#line 1510 "hl/src//H5LTparse.c" break; case 37: /* integer_type: H5T_NATIVE_ULONG_TOKEN */ -#line 140 "hl/src//H5LTparse.y" +#line 141 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } -#line 1509 "hl/src//H5LTparse.c" +#line 1516 "hl/src//H5LTparse.c" break; case 38: /* integer_type: H5T_NATIVE_LLONG_TOKEN */ -#line 141 "hl/src//H5LTparse.y" +#line 142 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } -#line 1515 "hl/src//H5LTparse.c" +#line 1522 "hl/src//H5LTparse.c" break; case 39: /* integer_type: H5T_NATIVE_ULLONG_TOKEN */ -#line 142 "hl/src//H5LTparse.y" +#line 143 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } -#line 1521 "hl/src//H5LTparse.c" +#line 1528 "hl/src//H5LTparse.c" + break; + + case 40: /* fp_type: H5T_IEEE_F16BE_TOKEN */ +#line 146 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F16BE); } +#line 1534 "hl/src//H5LTparse.c" + break; + + case 41: /* fp_type: H5T_IEEE_F16LE_TOKEN */ +#line 147 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F16LE); } +#line 1540 "hl/src//H5LTparse.c" break; - case 40: /* fp_type: H5T_IEEE_F32BE_TOKEN */ -#line 145 "hl/src//H5LTparse.y" + case 42: /* fp_type: H5T_IEEE_F32BE_TOKEN */ +#line 148 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } -#line 1527 "hl/src//H5LTparse.c" +#line 1546 "hl/src//H5LTparse.c" break; - case 41: /* fp_type: H5T_IEEE_F32LE_TOKEN */ -#line 146 "hl/src//H5LTparse.y" + case 43: /* fp_type: H5T_IEEE_F32LE_TOKEN */ +#line 149 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } -#line 1533 "hl/src//H5LTparse.c" +#line 1552 "hl/src//H5LTparse.c" break; - case 42: /* fp_type: H5T_IEEE_F64BE_TOKEN */ -#line 147 "hl/src//H5LTparse.y" + case 44: /* fp_type: H5T_IEEE_F64BE_TOKEN */ +#line 150 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } -#line 1539 "hl/src//H5LTparse.c" +#line 1558 "hl/src//H5LTparse.c" break; - case 43: /* fp_type: H5T_IEEE_F64LE_TOKEN */ -#line 148 "hl/src//H5LTparse.y" + case 45: /* fp_type: H5T_IEEE_F64LE_TOKEN */ +#line 151 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } -#line 1545 "hl/src//H5LTparse.c" +#line 1564 "hl/src//H5LTparse.c" break; - case 44: /* fp_type: H5T_NATIVE_FLOAT_TOKEN */ -#line 149 "hl/src//H5LTparse.y" + case 46: /* fp_type: H5T_NATIVE_FLOAT16_TOKEN */ +#line 152 "hl/src//H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT16); } +#line 1570 "hl/src//H5LTparse.c" + break; + + case 47: /* fp_type: H5T_NATIVE_FLOAT_TOKEN */ +#line 153 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } -#line 1551 "hl/src//H5LTparse.c" +#line 1576 "hl/src//H5LTparse.c" break; - case 45: /* fp_type: H5T_NATIVE_DOUBLE_TOKEN */ -#line 150 "hl/src//H5LTparse.y" + case 48: /* fp_type: H5T_NATIVE_DOUBLE_TOKEN */ +#line 154 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } -#line 1557 "hl/src//H5LTparse.c" +#line 1582 "hl/src//H5LTparse.c" break; - case 46: /* fp_type: H5T_NATIVE_LDOUBLE_TOKEN */ -#line 151 "hl/src//H5LTparse.y" + case 49: /* fp_type: H5T_NATIVE_LDOUBLE_TOKEN */ +#line 155 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } -#line 1563 "hl/src//H5LTparse.c" +#line 1588 "hl/src//H5LTparse.c" break; - case 47: /* $@1: %empty */ -#line 155 "hl/src//H5LTparse.y" + case 50: /* $@1: %empty */ +#line 159 "hl/src//H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } -#line 1569 "hl/src//H5LTparse.c" +#line 1594 "hl/src//H5LTparse.c" break; - case 48: /* compound_type: H5T_COMPOUND_TOKEN $@1 '{' memb_list '}' */ -#line 157 "hl/src//H5LTparse.y" + case 51: /* compound_type: H5T_COMPOUND_TOKEN $@1 '{' memb_list '}' */ +#line 161 "hl/src//H5LTparse.y" { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; csindex--; } -#line 1579 "hl/src//H5LTparse.c" +#line 1604 "hl/src//H5LTparse.c" break; - case 51: /* $@2: %empty */ -#line 166 "hl/src//H5LTparse.y" + case 54: /* $@2: %empty */ +#line 170 "hl/src//H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } -#line 1585 "hl/src//H5LTparse.c" +#line 1610 "hl/src//H5LTparse.c" break; - case 52: /* memb_def: ddl_type $@2 field_name field_offset ';' */ -#line 168 "hl/src//H5LTparse.y" + case 55: /* memb_def: ddl_type $@2 field_name field_offset ';' */ +#line 172 "hl/src//H5LTparse.y" { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; @@ -1651,108 +1676,108 @@ yyparse (void) new_size = H5Tget_size(dtype_id); } -#line 1624 "hl/src//H5LTparse.c" +#line 1649 "hl/src//H5LTparse.c" break; - case 53: /* field_name: STRING */ -#line 204 "hl/src//H5LTparse.y" + case 56: /* field_name: STRING */ +#line 208 "hl/src//H5LTparse.y" { (yyval.sval) = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } -#line 1634 "hl/src//H5LTparse.c" +#line 1659 "hl/src//H5LTparse.c" break; - case 54: /* field_offset: %empty */ -#line 211 "hl/src//H5LTparse.y" + case 57: /* field_offset: %empty */ +#line 215 "hl/src//H5LTparse.y" { (yyval.ival) = 0; } -#line 1640 "hl/src//H5LTparse.c" +#line 1665 "hl/src//H5LTparse.c" break; - case 55: /* field_offset: ':' offset */ -#line 213 "hl/src//H5LTparse.y" + case 58: /* field_offset: ':' offset */ +#line 217 "hl/src//H5LTparse.y" { (yyval.ival) = yylval.ival; } -#line 1646 "hl/src//H5LTparse.c" +#line 1671 "hl/src//H5LTparse.c" break; - case 57: /* $@3: %empty */ -#line 217 "hl/src//H5LTparse.y" + case 60: /* $@3: %empty */ +#line 221 "hl/src//H5LTparse.y" { asindex++; /*pushd onto the stack*/ } -#line 1652 "hl/src//H5LTparse.c" +#line 1677 "hl/src//H5LTparse.c" break; - case 58: /* array_type: H5T_ARRAY_TOKEN $@3 '{' dim_list ddl_type '}' */ -#line 219 "hl/src//H5LTparse.y" + case 61: /* array_type: H5T_ARRAY_TOKEN $@3 '{' dim_list ddl_type '}' */ +#line 223 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tarray_create2((yyvsp[-1].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; H5Tclose((yyvsp[-1].hid)); } -#line 1663 "hl/src//H5LTparse.c" +#line 1688 "hl/src//H5LTparse.c" break; - case 61: /* $@4: %empty */ -#line 229 "hl/src//H5LTparse.y" + case 64: /* $@4: %empty */ +#line 233 "hl/src//H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } -#line 1669 "hl/src//H5LTparse.c" +#line 1694 "hl/src//H5LTparse.c" break; - case 62: /* $@5: %empty */ -#line 230 "hl/src//H5LTparse.y" + case 65: /* $@5: %empty */ +#line 234 "hl/src//H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; arr_stack[asindex].is_dim = 0; } -#line 1679 "hl/src//H5LTparse.c" +#line 1704 "hl/src//H5LTparse.c" break; - case 65: /* vlen_type: H5T_VLEN_TOKEN '{' ddl_type '}' */ -#line 241 "hl/src//H5LTparse.y" + case 68: /* vlen_type: H5T_VLEN_TOKEN '{' ddl_type '}' */ +#line 245 "hl/src//H5LTparse.y" { (yyval.hid) = H5Tvlen_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } -#line 1685 "hl/src//H5LTparse.c" +#line 1710 "hl/src//H5LTparse.c" break; - case 66: /* @6: %empty */ -#line 247 "hl/src//H5LTparse.y" + case 69: /* @6: %empty */ +#line 251 "hl/src//H5LTparse.y" { size_t size = (size_t)yylval.ival; (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); } -#line 1694 "hl/src//H5LTparse.c" +#line 1719 "hl/src//H5LTparse.c" break; - case 67: /* $@7: %empty */ -#line 252 "hl/src//H5LTparse.y" + case 70: /* $@7: %empty */ +#line 256 "hl/src//H5LTparse.y" { H5Tset_tag((yyvsp[-3].hid), yylval.sval); free(yylval.sval); yylval.sval = NULL; } -#line 1704 "hl/src//H5LTparse.c" +#line 1729 "hl/src//H5LTparse.c" break; - case 68: /* opaque_type: H5T_OPAQUE_TOKEN '{' OPQ_SIZE_TOKEN opaque_size ';' @6 OPQ_TAG_TOKEN opaque_tag ';' $@7 '}' */ -#line 257 "hl/src//H5LTparse.y" + case 71: /* opaque_type: H5T_OPAQUE_TOKEN '{' OPQ_SIZE_TOKEN opaque_size ';' @6 OPQ_TAG_TOKEN opaque_tag ';' $@7 '}' */ +#line 261 "hl/src//H5LTparse.y" { (yyval.hid) = (yyvsp[-5].hid); } -#line 1710 "hl/src//H5LTparse.c" +#line 1735 "hl/src//H5LTparse.c" break; - case 71: /* $@8: %empty */ -#line 266 "hl/src//H5LTparse.y" + case 74: /* $@8: %empty */ +#line 270 "hl/src//H5LTparse.y" { if((yyvsp[-1].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; else str_size = yylval.ival; } -#line 1721 "hl/src//H5LTparse.c" +#line 1746 "hl/src//H5LTparse.c" break; - case 72: /* $@9: %empty */ -#line 273 "hl/src//H5LTparse.y" + case 75: /* $@9: %empty */ +#line 277 "hl/src//H5LTparse.y" { if((yyvsp[-1].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -1761,33 +1786,33 @@ yyparse (void) else if((yyvsp[-1].ival) == H5T_STR_SPACEPAD_TOKEN) str_pad = H5T_STR_SPACEPAD; } -#line 1734 "hl/src//H5LTparse.c" +#line 1759 "hl/src//H5LTparse.c" break; - case 73: /* $@10: %empty */ -#line 282 "hl/src//H5LTparse.y" + case 76: /* $@10: %empty */ +#line 286 "hl/src//H5LTparse.y" { if((yyvsp[-1].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; else if((yyvsp[-1].ival) == H5T_CSET_UTF8_TOKEN) str_cset = H5T_CSET_UTF8; } -#line 1745 "hl/src//H5LTparse.c" +#line 1770 "hl/src//H5LTparse.c" break; - case 74: /* @11: %empty */ -#line 289 "hl/src//H5LTparse.y" + case 77: /* @11: %empty */ +#line 293 "hl/src//H5LTparse.y" { if((yyvsp[-1].hid) == H5T_C_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_C_S1); else if((yyvsp[-1].hid) == H5T_FORTRAN_S1_TOKEN) (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } -#line 1756 "hl/src//H5LTparse.c" +#line 1781 "hl/src//H5LTparse.c" break; - case 75: /* string_type: H5T_STRING_TOKEN '{' STRSIZE_TOKEN strsize ';' $@8 STRPAD_TOKEN strpad ';' $@9 CSET_TOKEN cset ';' $@10 CTYPE_TOKEN ctype ';' @11 '}' */ -#line 296 "hl/src//H5LTparse.y" + case 78: /* string_type: H5T_STRING_TOKEN '{' STRSIZE_TOKEN strsize ';' $@8 STRPAD_TOKEN strpad ';' $@9 CSET_TOKEN cset ';' $@10 CTYPE_TOKEN ctype ';' @11 '}' */ +#line 300 "hl/src//H5LTparse.y" { hid_t str_id = (yyvsp[-1].hid); @@ -1804,82 +1829,82 @@ yyparse (void) (yyval.hid) = str_id; } -#line 1777 "hl/src//H5LTparse.c" +#line 1802 "hl/src//H5LTparse.c" break; - case 76: /* strsize: H5T_VARIABLE_TOKEN */ -#line 313 "hl/src//H5LTparse.y" + case 79: /* strsize: H5T_VARIABLE_TOKEN */ +#line 317 "hl/src//H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} -#line 1783 "hl/src//H5LTparse.c" +#line 1808 "hl/src//H5LTparse.c" break; - case 78: /* strpad: H5T_STR_NULLTERM_TOKEN */ -#line 316 "hl/src//H5LTparse.y" + case 81: /* strpad: H5T_STR_NULLTERM_TOKEN */ +#line 320 "hl/src//H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} -#line 1789 "hl/src//H5LTparse.c" +#line 1814 "hl/src//H5LTparse.c" break; - case 79: /* strpad: H5T_STR_NULLPAD_TOKEN */ -#line 317 "hl/src//H5LTparse.y" + case 82: /* strpad: H5T_STR_NULLPAD_TOKEN */ +#line 321 "hl/src//H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} -#line 1795 "hl/src//H5LTparse.c" +#line 1820 "hl/src//H5LTparse.c" break; - case 80: /* strpad: H5T_STR_SPACEPAD_TOKEN */ -#line 318 "hl/src//H5LTparse.y" + case 83: /* strpad: H5T_STR_SPACEPAD_TOKEN */ +#line 322 "hl/src//H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} -#line 1801 "hl/src//H5LTparse.c" +#line 1826 "hl/src//H5LTparse.c" break; - case 81: /* cset: H5T_CSET_ASCII_TOKEN */ -#line 320 "hl/src//H5LTparse.y" + case 84: /* cset: H5T_CSET_ASCII_TOKEN */ +#line 324 "hl/src//H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} -#line 1807 "hl/src//H5LTparse.c" +#line 1832 "hl/src//H5LTparse.c" break; - case 82: /* cset: H5T_CSET_UTF8_TOKEN */ -#line 321 "hl/src//H5LTparse.y" + case 85: /* cset: H5T_CSET_UTF8_TOKEN */ +#line 325 "hl/src//H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} -#line 1813 "hl/src//H5LTparse.c" +#line 1838 "hl/src//H5LTparse.c" break; - case 83: /* ctype: H5T_C_S1_TOKEN */ -#line 323 "hl/src//H5LTparse.y" + case 86: /* ctype: H5T_C_S1_TOKEN */ +#line 327 "hl/src//H5LTparse.y" {(yyval.hid) = H5T_C_S1_TOKEN;} -#line 1819 "hl/src//H5LTparse.c" +#line 1844 "hl/src//H5LTparse.c" break; - case 84: /* ctype: H5T_FORTRAN_S1_TOKEN */ -#line 324 "hl/src//H5LTparse.y" + case 87: /* ctype: H5T_FORTRAN_S1_TOKEN */ +#line 328 "hl/src//H5LTparse.y" {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} -#line 1825 "hl/src//H5LTparse.c" +#line 1850 "hl/src//H5LTparse.c" break; - case 85: /* $@12: %empty */ -#line 328 "hl/src//H5LTparse.y" + case 88: /* $@12: %empty */ +#line 332 "hl/src//H5LTparse.y" { is_enum = 1; enum_id = H5Tenum_create((yyvsp[-1].hid)); H5Tclose((yyvsp[-1].hid)); } -#line 1831 "hl/src//H5LTparse.c" +#line 1856 "hl/src//H5LTparse.c" break; - case 86: /* enum_type: H5T_ENUM_TOKEN '{' integer_type ';' $@12 enum_list '}' */ -#line 330 "hl/src//H5LTparse.y" + case 89: /* enum_type: H5T_ENUM_TOKEN '{' integer_type ';' $@12 enum_list '}' */ +#line 334 "hl/src//H5LTparse.y" { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } -#line 1837 "hl/src//H5LTparse.c" +#line 1862 "hl/src//H5LTparse.c" break; - case 89: /* $@13: %empty */ -#line 335 "hl/src//H5LTparse.y" + case 92: /* $@13: %empty */ +#line 339 "hl/src//H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ enum_memb_symbol = strdup(yylval.sval); free(yylval.sval); yylval.sval = NULL; } -#line 1848 "hl/src//H5LTparse.c" +#line 1873 "hl/src//H5LTparse.c" break; - case 90: /* enum_def: enum_symbol $@13 enum_val ';' */ -#line 342 "hl/src//H5LTparse.y" + case 93: /* enum_def: enum_symbol $@13 enum_val ';' */ +#line 346 "hl/src//H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -1922,11 +1947,11 @@ yyparse (void) H5Tclose(super); H5Tclose(native); } -#line 1895 "hl/src//H5LTparse.c" +#line 1920 "hl/src//H5LTparse.c" break; -#line 1899 "hl/src//H5LTparse.c" +#line 1924 "hl/src//H5LTparse.c" default: break; } diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index 84c5fd09322..be3c91f7fdb 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -81,35 +81,38 @@ extern int H5LTyydebug; H5T_NATIVE_ULONG_TOKEN = 282, /* H5T_NATIVE_ULONG_TOKEN */ H5T_NATIVE_LLONG_TOKEN = 283, /* H5T_NATIVE_LLONG_TOKEN */ H5T_NATIVE_ULLONG_TOKEN = 284, /* H5T_NATIVE_ULLONG_TOKEN */ - H5T_IEEE_F32BE_TOKEN = 285, /* H5T_IEEE_F32BE_TOKEN */ - H5T_IEEE_F32LE_TOKEN = 286, /* H5T_IEEE_F32LE_TOKEN */ - H5T_IEEE_F64BE_TOKEN = 287, /* H5T_IEEE_F64BE_TOKEN */ - H5T_IEEE_F64LE_TOKEN = 288, /* H5T_IEEE_F64LE_TOKEN */ - H5T_NATIVE_FLOAT_TOKEN = 289, /* H5T_NATIVE_FLOAT_TOKEN */ - H5T_NATIVE_DOUBLE_TOKEN = 290, /* H5T_NATIVE_DOUBLE_TOKEN */ - H5T_NATIVE_LDOUBLE_TOKEN = 291, /* H5T_NATIVE_LDOUBLE_TOKEN */ - H5T_STRING_TOKEN = 292, /* H5T_STRING_TOKEN */ - STRSIZE_TOKEN = 293, /* STRSIZE_TOKEN */ - STRPAD_TOKEN = 294, /* STRPAD_TOKEN */ - CSET_TOKEN = 295, /* CSET_TOKEN */ - CTYPE_TOKEN = 296, /* CTYPE_TOKEN */ - H5T_VARIABLE_TOKEN = 297, /* H5T_VARIABLE_TOKEN */ - H5T_STR_NULLTERM_TOKEN = 298, /* H5T_STR_NULLTERM_TOKEN */ - H5T_STR_NULLPAD_TOKEN = 299, /* H5T_STR_NULLPAD_TOKEN */ - H5T_STR_SPACEPAD_TOKEN = 300, /* H5T_STR_SPACEPAD_TOKEN */ - H5T_CSET_ASCII_TOKEN = 301, /* H5T_CSET_ASCII_TOKEN */ - H5T_CSET_UTF8_TOKEN = 302, /* H5T_CSET_UTF8_TOKEN */ - H5T_C_S1_TOKEN = 303, /* H5T_C_S1_TOKEN */ - H5T_FORTRAN_S1_TOKEN = 304, /* H5T_FORTRAN_S1_TOKEN */ - H5T_OPAQUE_TOKEN = 305, /* H5T_OPAQUE_TOKEN */ - OPQ_SIZE_TOKEN = 306, /* OPQ_SIZE_TOKEN */ - OPQ_TAG_TOKEN = 307, /* OPQ_TAG_TOKEN */ - H5T_COMPOUND_TOKEN = 308, /* H5T_COMPOUND_TOKEN */ - H5T_ENUM_TOKEN = 309, /* H5T_ENUM_TOKEN */ - H5T_ARRAY_TOKEN = 310, /* H5T_ARRAY_TOKEN */ - H5T_VLEN_TOKEN = 311, /* H5T_VLEN_TOKEN */ - STRING = 312, /* STRING */ - NUMBER = 313 /* NUMBER */ + H5T_IEEE_F16BE_TOKEN = 285, /* H5T_IEEE_F16BE_TOKEN */ + H5T_IEEE_F16LE_TOKEN = 286, /* H5T_IEEE_F16LE_TOKEN */ + H5T_IEEE_F32BE_TOKEN = 287, /* H5T_IEEE_F32BE_TOKEN */ + H5T_IEEE_F32LE_TOKEN = 288, /* H5T_IEEE_F32LE_TOKEN */ + H5T_IEEE_F64BE_TOKEN = 289, /* H5T_IEEE_F64BE_TOKEN */ + H5T_IEEE_F64LE_TOKEN = 290, /* H5T_IEEE_F64LE_TOKEN */ + H5T_NATIVE_FLOAT16_TOKEN = 291, /* H5T_NATIVE_FLOAT16_TOKEN */ + H5T_NATIVE_FLOAT_TOKEN = 292, /* H5T_NATIVE_FLOAT_TOKEN */ + H5T_NATIVE_DOUBLE_TOKEN = 293, /* H5T_NATIVE_DOUBLE_TOKEN */ + H5T_NATIVE_LDOUBLE_TOKEN = 294, /* H5T_NATIVE_LDOUBLE_TOKEN */ + H5T_STRING_TOKEN = 295, /* H5T_STRING_TOKEN */ + STRSIZE_TOKEN = 296, /* STRSIZE_TOKEN */ + STRPAD_TOKEN = 297, /* STRPAD_TOKEN */ + CSET_TOKEN = 298, /* CSET_TOKEN */ + CTYPE_TOKEN = 299, /* CTYPE_TOKEN */ + H5T_VARIABLE_TOKEN = 300, /* H5T_VARIABLE_TOKEN */ + H5T_STR_NULLTERM_TOKEN = 301, /* H5T_STR_NULLTERM_TOKEN */ + H5T_STR_NULLPAD_TOKEN = 302, /* H5T_STR_NULLPAD_TOKEN */ + H5T_STR_SPACEPAD_TOKEN = 303, /* H5T_STR_SPACEPAD_TOKEN */ + H5T_CSET_ASCII_TOKEN = 304, /* H5T_CSET_ASCII_TOKEN */ + H5T_CSET_UTF8_TOKEN = 305, /* H5T_CSET_UTF8_TOKEN */ + H5T_C_S1_TOKEN = 306, /* H5T_C_S1_TOKEN */ + H5T_FORTRAN_S1_TOKEN = 307, /* H5T_FORTRAN_S1_TOKEN */ + H5T_OPAQUE_TOKEN = 308, /* H5T_OPAQUE_TOKEN */ + OPQ_SIZE_TOKEN = 309, /* OPQ_SIZE_TOKEN */ + OPQ_TAG_TOKEN = 310, /* OPQ_TAG_TOKEN */ + H5T_COMPOUND_TOKEN = 311, /* H5T_COMPOUND_TOKEN */ + H5T_ENUM_TOKEN = 312, /* H5T_ENUM_TOKEN */ + H5T_ARRAY_TOKEN = 313, /* H5T_ARRAY_TOKEN */ + H5T_VLEN_TOKEN = 314, /* H5T_VLEN_TOKEN */ + STRING = 315, /* STRING */ + NUMBER = 316 /* NUMBER */ }; typedef enum yytokentype yytoken_kind_t; #endif @@ -124,7 +127,7 @@ union YYSTYPE char *sval; /*for name string*/ hid_t hid; /*for hid_t token*/ -#line 128 "hl/src//H5LTparse.h" +#line 131 "hl/src//H5LTparse.h" }; typedef union YYSTYPE YYSTYPE; diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 86218368171..3a14e769419 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -79,8 +79,9 @@ static char* enum_memb_symbol; /*enum member symbol string*/ %token H5T_NATIVE_SHORT_TOKEN H5T_NATIVE_USHORT_TOKEN H5T_NATIVE_INT_TOKEN H5T_NATIVE_UINT_TOKEN %token H5T_NATIVE_LONG_TOKEN H5T_NATIVE_ULONG_TOKEN H5T_NATIVE_LLONG_TOKEN H5T_NATIVE_ULLONG_TOKEN +%token H5T_IEEE_F16BE_TOKEN H5T_IEEE_F16LE_TOKEN %token H5T_IEEE_F32BE_TOKEN H5T_IEEE_F32LE_TOKEN H5T_IEEE_F64BE_TOKEN H5T_IEEE_F64LE_TOKEN -%token H5T_NATIVE_FLOAT_TOKEN H5T_NATIVE_DOUBLE_TOKEN H5T_NATIVE_LDOUBLE_TOKEN +%token H5T_NATIVE_FLOAT16_TOKEN H5T_NATIVE_FLOAT_TOKEN H5T_NATIVE_DOUBLE_TOKEN H5T_NATIVE_LDOUBLE_TOKEN %token H5T_STRING_TOKEN STRSIZE_TOKEN STRPAD_TOKEN CSET_TOKEN CTYPE_TOKEN H5T_VARIABLE_TOKEN %token H5T_STR_NULLTERM_TOKEN H5T_STR_NULLPAD_TOKEN H5T_STR_SPACEPAD_TOKEN @@ -142,10 +143,13 @@ integer_type : H5T_STD_I8BE_TOKEN { $$ = H5Tcopy(H5T_STD_I8BE); } | H5T_NATIVE_ULLONG_TOKEN { $$ = H5Tcopy(H5T_NATIVE_ULLONG); } ; -fp_type : H5T_IEEE_F32BE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F32BE); } +fp_type : H5T_IEEE_F16BE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F16BE); } + | H5T_IEEE_F16LE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F16LE); } + | H5T_IEEE_F32BE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F32BE); } | H5T_IEEE_F32LE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F32LE); } | H5T_IEEE_F64BE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F64BE); } | H5T_IEEE_F64LE_TOKEN { $$ = H5Tcopy(H5T_IEEE_F64LE); } + | H5T_NATIVE_FLOAT16_TOKEN { $$ = H5Tcopy(H5T_NATIVE_FLOAT16); } | H5T_NATIVE_FLOAT_TOKEN { $$ = H5Tcopy(H5T_NATIVE_FLOAT); } | H5T_NATIVE_DOUBLE_TOKEN { $$ = H5Tcopy(H5T_NATIVE_DOUBLE); } | H5T_NATIVE_LDOUBLE_TOKEN { $$ = H5Tcopy(H5T_NATIVE_LDOUBLE); } diff --git a/hl/test/test_dset_append.c b/hl/test/test_dset_append.c index 0971cf31de1..d3e385532b7 100644 --- a/hl/test/test_dset_append.c +++ b/hl/test/test_dset_append.c @@ -78,6 +78,7 @@ test_dataset_append_notset(hid_t fid) } /* end for */ /* File size when not flushed */ + memset(&sb1, 0, sizeof(h5_stat_t)); if (HDstat(FILENAME, &sb1) < 0) TEST_ERROR; @@ -86,6 +87,7 @@ test_dataset_append_notset(hid_t fid) FAIL_STACK_ERROR; /* File size after flushing */ + memset(&sb2, 0, sizeof(h5_stat_t)); if (HDstat(FILENAME, &sb2) < 0) TEST_ERROR; diff --git a/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 25b65fa016a..55b6f4be913 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -1095,6 +1095,10 @@ public class HDF5Constants { /** */ public static final long H5T_FORTRAN_S1 = H5T_FORTRAN_S1(); /** */ + public static final long H5T_IEEE_F16BE = H5T_IEEE_F16BE(); + /** */ + public static final long H5T_IEEE_F16LE = H5T_IEEE_F16LE(); + /** */ public static final long H5T_IEEE_F32BE = H5T_IEEE_F32BE(); /** */ public static final long H5T_IEEE_F32LE = H5T_IEEE_F32LE(); @@ -1175,6 +1179,8 @@ public class HDF5Constants { /** */ public static final long H5T_NATIVE_FLOAT = H5T_NATIVE_FLOAT(); /** */ + public static final long H5T_NATIVE_FLOAT16 = H5T_NATIVE_FLOAT16(); + /** */ public static final long H5T_NATIVE_HADDR = H5T_NATIVE_HADDR(); /** */ public static final long H5T_NATIVE_HBOOL = H5T_NATIVE_HBOOL(); @@ -2580,6 +2586,10 @@ public class HDF5Constants { private static native final long H5T_FORTRAN_S1(); + private static native final long H5T_IEEE_F16BE(); + + private static native final long H5T_IEEE_F16LE(); + private static native final long H5T_IEEE_F32BE(); private static native final long H5T_IEEE_F32LE(); @@ -2660,6 +2670,8 @@ public class HDF5Constants { private static native final long H5T_NATIVE_FLOAT(); + private static native final long H5T_NATIVE_FLOAT16(); + private static native final long H5T_NATIVE_HADDR(); private static native final long H5T_NATIVE_HBOOL(); diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index d83b4628ffa..ee1bd5af1c0 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -2678,6 +2678,16 @@ Java_hdf_hdf5lib_HDF5Constants_H5T_1FORTRAN_1S1(JNIEnv *env, jclass cls) return H5T_FORTRAN_S1; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F16BE(JNIEnv *env, jclass cls) +{ + return H5T_IEEE_F16BE; +} +JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F16LE(JNIEnv *env, jclass cls) +{ + return H5T_IEEE_F16LE; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1IEEE_1F32BE(JNIEnv *env, jclass cls) { return H5T_IEEE_F32BE; @@ -2878,6 +2888,11 @@ Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1FLOAT(JNIEnv *env, jclass cls) return H5T_NATIVE_FLOAT; } JNIEXPORT jlong JNICALL +Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1FLOAT16(JNIEnv *env, jclass cls) +{ + return H5T_NATIVE_FLOAT16; +} +JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5T_1NATIVE_1HADDR(JNIEnv *env, jclass cls) { return H5T_NATIVE_HADDR; diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index ce9989d5043..e38701ff3ba 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -563,8 +563,8 @@ Java_hdf_hdf5lib_H5_H5Pisa_1class(JNIEnv *env, jclass clss, jlong plid, jlong pc JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5Pget(JNIEnv *env, jclass clss, jlong plid, jstring name) { - const char *cstr = NULL; - jint val; + const char *cstr = NULL; + jint val = -1; herr_t status = FAIL; UNUSED(clss); diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index bf798b88ee1..d10ab839a44 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -2082,7 +2082,9 @@ h5str_get_little_endian_type(hid_t tid) } case H5T_FLOAT: { - if (size == 4) + if (size == 2) + p_type = H5Tcopy(H5T_IEEE_F16LE); + else if (size == 4) p_type = H5Tcopy(H5T_IEEE_F32LE); else if (size == 8) p_type = H5Tcopy(H5T_IEEE_F64LE); @@ -2176,7 +2178,9 @@ h5str_get_big_endian_type(hid_t tid) } case H5T_FLOAT: { - if (size == 4) + if (size == 2) + p_type = H5Tcopy(H5T_IEEE_F16BE); + else if (size == 4) p_type = H5Tcopy(H5T_IEEE_F32BE); else if (size == 8) p_type = H5Tcopy(H5T_IEEE_F64BE); diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 49e5732e61d..f7427924ee2 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -159,7 +159,7 @@ dnl disable Fortran 2003 if it does not. AC_DEFUN([PAC_PROG_FC_HAVE_F2003_REQUIREMENTS],[ HAVE_F2003_REQUIREMENTS="no" - AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003 HDF]) + AC_MSG_CHECKING([if Fortran compiler version compatible with Fortran 2003]) TEST_SRC="`sed -n '/PROG_FC_HAVE_F2003_REQUIREMENTS/,/END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS/p' $srcdir/m4/aclocal_fc.f90`" AC_COMPILE_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) HAVE_F2003_REQUIREMENTS="yes"], diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 4d4af2423c9..94f525be451 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -1104,7 +1104,7 @@ Using individual command presets (where is GNUC or MSVC or Clan cpack --preset ci-StdShar- -Using the workflow preset to configure, build, test and package the standard configuration is: +Using the workflow preset to configure, build, test and package the standard configuration: change directory to the hdf5 source folder execute "cmake --workflow --preset ci-StdShar- --fresh" where is GNUC or MSVC or Clang diff --git a/release_docs/NEWSLETTER.txt b/release_docs/NEWSLETTER.txt index f03f710d717..51d8757861c 100644 --- a/release_docs/NEWSLETTER.txt +++ b/release_docs/NEWSLETTER.txt @@ -1,25 +1,10 @@ -INTRODUCTION -============ - -This purpose of this document is to contain entries that can be used to quickly -produce a release newsletter. When something is added to the library that is -"newsletter worthy" (i.e., new feature, CVE fix, etc.) a summary note should -be added here. - -The format should look like this: - -* SUMMARY OF NEWSLETTER-WORTHY THING - - Here is where you describe the summary. Summarize the feature, fix, or - change in general language. Remember, RELEASE.txt is for communicating - technical specifics. Text entered here is more like advertising. - - (GitHub #123, #125) - -The GitHub #s could be relevant issues or PRs. They will probably not appear -in the final newsletter, but are so that the person writing the newsletter -has easy access to context if they have questions. - -Every entry in RELEASE.txt does NOT require an entry here. The newsletter is -for communicating major changes that are of interest to anyone. Minor bugfixes, -memory leak fixes, etc. do not require entries. +* Added support for _Float16 16-bit floating-point datatype + + Support for the 16-bit floating-point _Float16 C type has been added to + HDF5. On platforms where this type is available, this can enable more + efficient storage of floating-point data when an application doesn't + need the precision of larger floating-point datatypes. It can also allow + for improved performance when converting between 16-bit floating-point + data and data of another HDF5 datatype. + + (GitHub #4065, #2154) diff --git a/release_docs/NEWSLETTER_README.txt b/release_docs/NEWSLETTER_README.txt new file mode 100644 index 00000000000..f03f710d717 --- /dev/null +++ b/release_docs/NEWSLETTER_README.txt @@ -0,0 +1,25 @@ +INTRODUCTION +============ + +This purpose of this document is to contain entries that can be used to quickly +produce a release newsletter. When something is added to the library that is +"newsletter worthy" (i.e., new feature, CVE fix, etc.) a summary note should +be added here. + +The format should look like this: + +* SUMMARY OF NEWSLETTER-WORTHY THING + + Here is where you describe the summary. Summarize the feature, fix, or + change in general language. Remember, RELEASE.txt is for communicating + technical specifics. Text entered here is more like advertising. + + (GitHub #123, #125) + +The GitHub #s could be relevant issues or PRs. They will probably not appear +in the final newsletter, but are so that the person writing the newsletter +has easy access to context if they have questions. + +Every entry in RELEASE.txt does NOT require an entry here. The newsletter is +for communicating major changes that are of interest to anyone. Minor bugfixes, +memory leak fixes, etc. do not require entries. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 729fc42e1e6..a46ba8066be 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -24,7 +24,7 @@ The official HDF5 releases can be obtained from: Changes from Release to Release and New Features in the HDF5-1.16.x release series can be found at: - https://portal.hdfgroup.org/display/HDF5/Release+Specific+Information + https://portal.hdfgroup.org/documentation/hdf5-docs/release_specific_info.html If you have any questions or comments, please send them to the HDF Help Desk: @@ -368,6 +368,108 @@ New Features Library: -------- + - Added support for _Float16 16-bit half-precision floating-point datatype + + Support for the _Float16 C datatype has been added on platforms where: + + - The _Float16 datatype and its associated macros (FLT16_MIN, FLT16_MAX, + FLT16_EPSILON, etc.) are available + - A simple test program that converts between the _Float16 datatype and + other datatypes with casts can be successfully compiled and run at + configure time. Some compilers appear to be buggy or feature-incomplete + in this regard and will generate calls to compiler-internal functions + for converting between the _Float16 datatype and other datatypes, but + will not link these functions into the build, resulting in build + failures. + + The following new macros have been added: + + H5_HAVE__FLOAT16 - This macro is defined in H5pubconf.h and will have + the value 1 if support for the _Float16 datatype is + available. It will not be defined otherwise. + + H5_SIZEOF__FLOAT16 - This macro is defined in H5pubconf.h and will have + a value corresponding to the size of the _Float16 + datatype, as computed by sizeof(). It will have the + value 0 if support for the _Float16 datatype is not + available. + + H5_HAVE_FABSF16 - This macro is defined in H5pubconf.h and will have the + value 1 if the fabsf16 function is available for use. + + H5_LDOUBLE_TO_FLOAT16_CORRECT - This macro is defined in H5pubconf.h and + will have the value 1 if the platform can + correctly convert long double values to + _Float16. Some compilers have issues with + this. + + H5T_NATIVE_FLOAT16 - This macro maps to the ID of an HDF5 datatype representing + the native C _Float16 datatype for the platform. If + support for the _Float16 datatype is not available, the + macro will map to H5I_INVALID_HID and should not be used. + + H5T_IEEE_F16BE - This macro maps to the ID of an HDF5 datatype representing + a big-endian IEEE 754 16-bit floating-point datatype. This + datatype is available regardless of whether _Float16 support + is available or not. + + H5T_IEEE_F16LE - This macro maps to the ID of an HDF5 datatype representing + a little-endian IEEE 754 16-bit floating-point datatype. + This datatype is available regardless of whether _Float16 + support is available or not. + + The following new hard datatype conversion paths have been added, but + will only be used when _Float16 support is available: + + H5T_NATIVE_SCHAR <-> H5T_NATIVE_FLOAT16 | H5T_NATIVE_UCHAR <-> H5T_NATIVE_FLOAT16 + H5T_NATIVE_SHORT <-> H5T_NATIVE_FLOAT16 | H5T_NATIVE_USHORT <-> H5T_NATIVE_FLOAT16 + H5T_NATIVE_INT <-> H5T_NATIVE_FLOAT16 | H5T_NATIVE_UINT <-> H5T_NATIVE_FLOAT16 + H5T_NATIVE_LONG <-> H5T_NATIVE_FLOAT16 | H5T_NATIVE_ULONG <-> H5T_NATIVE_FLOAT16 + H5T_NATIVE_LLONG <-> H5T_NATIVE_FLOAT16 | H5T_NATIVE_ULLONG <-> H5T_NATIVE_FLOAT16 + H5T_NATIVE_FLOAT <-> H5T_NATIVE_FLOAT16 | H5T_NATIVE_DOUBLE <-> H5T_NATIVE_FLOAT16 + H5T_NATIVE_LDOUBLE <-> H5T_NATIVE_FLOAT16 + + The H5T_NATIVE_LDOUBLE -> H5T_NATIVE_FLOAT16 hard conversion path will only + be available and used if H5_LDOUBLE_TO_FLOAT16_CORRECT has a value of 1. Otherwise, + the conversion will be emulated in software by the library. + + Note that in the absence of any compiler flags for architecture-specific + tuning, the generated code for datatype conversions with the _Float16 type + may perform conversions by first promoting the type to float. Use of + architecture-specific tuning compiler flags may instead allow for the + generation of specialized instructions, such as AVX512-FP16 instructions, + if available. + + - Made several improvements to the datatype conversion code + + * The datatype conversion code was refactored to use pointers to + H5T_t datatype structures internally rather than IDs wrapping + the pointers to those structures. These IDs are needed if an + application-registered conversion function or conversion exception + function are involved during the conversion process. For simplicity, + the conversion code simply passed these IDs down and let the internal + code unwrap the IDs as necessary when needing to access the wrapped + H5T_t structures. However, this could cause a significant amount of + repeated ID lookups for compound datatypes and other container-like + datatypes. The code now passes down pointers to the datatype + structures and only creates IDs to wrap those pointers as necessary. + Quick testing showed an average ~3x to ~10x improvement in performance + of conversions on container-like datatypes, depending on the + complexity of the datatype. + + * A conversion "context" structure was added to hold information about + the current conversion being performed. This allows conversions on + container-like datatypes to be optimized better by skipping certain + portions of the conversion process that remain relatively constant + when multiple elements of the container-like datatype are being + converted. + + * After refactoring the datatype conversion code to use pointers + internally rather than IDs, several copies of datatypes that were + made by higher levels of the library were able to be removed. The + internal IDs that were previously registered to wrap those copied + datatypes were also able to be removed. + - Implemented optimized support for vector I/O in the Subfiling VFD Previously, the Subfiling VFD would handle vector I/O requests by @@ -612,6 +714,68 @@ Bug Fixes since HDF5-1.14.0 release Fixes #3003 + - Fixed a bug that causes the library to incorrectly identify + the endian-ness of 16-bit and smaller C floating-point datatypes + + When detecting the endian-ness of an in-memory C floating-point + datatype, the library previously always assumed that the type + was at least 32 bits in size. This resulted in invalid memory + accesses and would usually cause the library to identify the + datatype as having an endian-ness of H5T_ORDER_VAX. This has + now been fixed. + + - Fixed a bug that causes an invalid memory access issue when + converting 16-bit floating-point values to integers with the + library's software conversion function + + The H5T__conv_f_i function previously always assumed that + floating-point values were at least 32 bits in size and would + access invalid memory when attempting to convert 16-bit + floating-point values to integers. To fix this, parts of the + H5T__conv_f_i function had to be rewritten, which also resulted + in a significant speedup when converting floating-point values + to integers where the library does not have a hard conversion + path. This is the case for any floating-point values with a + datatype not represented by H5T_NATIVE_FLOAT16 (if _Float16 is + supported), H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE or + H5T_NATIVE_LDOUBLE. + + - Fixed a bug that can cause incorrect data when overflows occur + while converting integer values to floating-point values with + the library's software conversion function + + The H5T__conv_i_f function had a bug which previously caused it + to return incorrect data when an overflow occurs and an application's + conversion exception callback function decides not to handle the + overflow. Rather than return positive infinity, the library would + return truncated data. This has now been fixed. + + - Corrected H5Soffset_simple() when offset is NULL + + The reference manual states that the offset parameter of H5Soffset_simple() + can be set to NULL to reset the offset of a simple dataspace to 0. This + has never been true, and passing NULL was regarded as an error. + + The library will now accept NULL for the offset parameter and will + correctly set the offset to zero. + + Fixes HDFFV-9299 + + - Fixed an issue where the Subfiling VFD's context object cache could + grow too large + + The Subfiling VFD keeps a cache of its internal context objects to + speed up access to a context object for a particular file, as well + as access to that object across multiple opens of the same file. + However, opening a large amount of files with the Subfiling VFD over + the course of an application's lifetime could cause this cache to grow + too large and result in the application running out of available MPI + communicator objects. On file close, the Subfiling VFD now simply + evicts context objects out of its cache and frees them. It is assumed + that multiple opens of a file will be a less common use case for the + Subfiling VFD, but this can be revisited if it proves to be an issue + for performance. + - Fixed error when overwriting certain nested variable length types Previously, when using a datatype that included a variable length type @@ -1116,6 +1280,15 @@ Bug Fixes since HDF5-1.14.0 release The overflow was found by OSS-Fuzz https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58658 + - Fixed a segfault when using a user-defined conversion function between compound datatypes + + During type info initialization for compound datatype conversion, the library checked if the + datatypes are subsets of one another in order to perform special conversion handling. + This check uses information that is only defined if a library conversion function is in use. + The library now skips this check for user-defined conversion functions. + + Fixes Github issue #3840 + Java Library ------------ - Fixed switch case 'L' block missing a break statement. @@ -1351,6 +1524,17 @@ Bug Fixes since HDF5-1.14.0 release Testing ------- + - Fixed a bug in the dt_arith test when H5_WANT_DCONV_EXCEPTION is not + defined + + The dt_arith test program's test_particular_fp_integer sub-test tries + to ensure that the library correctly raises a datatype conversion + exception when converting a floating-point value to an integer overflows. + However, this test would run even when H5_WANT_DCONV_EXCEPTION isn't + defined, causing the test to fail due to the library not raising + datatype conversion exceptions. This has now been fixed by not running + the test when H5_WANT_DCONV_EXCEPTION is not defined. + - Disabled running of MPI Atomicity tests for OpenMPI major versions < 5 Support for MPI atomicity operations is not implemented for major @@ -1578,7 +1762,7 @@ Known Problems CMake vs. Autotools installations ================================= While both build systems produce similar results, there are differences. -Each system produces the same set of folders on linux (only CMake works +Each system produces the same set of folders on Linux (only CMake works on standard Windows); bin, include, lib and share. Autotools places the COPYING and RELEASE.txt file in the root folder, CMake places them in the share folder. diff --git a/src/H5A.c b/src/H5A.c index 1db7fd3eb48..6728596ab52 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -15,7 +15,6 @@ /****************/ #include "H5Amodule.h" /* This source code file is part of the H5A module */ -#define H5O_FRIEND /* Suppress error about including H5Opkg */ /***********/ /* Headers */ @@ -26,7 +25,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5ESprivate.h" /* Event Sets */ #include "H5Iprivate.h" /* IDs */ -#include "H5Opkg.h" /* Object headers */ #include "H5Sprivate.h" /* Dataspace functions */ #include "H5VLprivate.h" /* Virtual Object Layer */ diff --git a/src/H5AC.c b/src/H5AC.c index 6610af88d09..5f9df26aba1 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -40,6 +40,7 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Pprivate.h" /* Property lists */ #include "H5SLprivate.h" /* Skip Lists */ diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index cdebe80a3b6..70d7344bb06 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -35,8 +35,10 @@ #include "H5Cprivate.h" /* Cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Fpkg.h" /* Files */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ #ifdef H5_HAVE_PARALLEL diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index 1a968d69e87..5ad1673dd5c 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -32,7 +32,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACpkg.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Adense.c b/src/H5Adense.c index 27ccf918634..80c3c94f733 100644 --- a/src/H5Adense.c +++ b/src/H5Adense.c @@ -33,6 +33,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5SMprivate.h" /* Shared object header messages */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 15f025c6050..5ba02163f87 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -32,6 +32,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ @@ -679,9 +680,7 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) uint8_t *bkg_buf = NULL; /* background buffer */ hssize_t snelmts; /* elements in attribute */ size_t nelmts; /* elements in attribute*/ - H5T_path_t *tpath = NULL; /* type conversion info */ - H5T_t *src_type = NULL; /* temporary datatype */ - H5T_t *dst_type = NULL; /* temporary datatype */ + H5T_path_t *tpath = NULL; /* type conversion info */ size_t src_type_size; /* size of source type */ size_t dst_type_size; /* size of destination type */ size_t buf_size; /* desired buffer size */ @@ -721,11 +720,6 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) if (!H5T_path_noop(tpath)) { H5T_bkg_t need_bkg; /* Background buffer type */ - if (NULL == (src_type = H5T_copy(attr->shared->dt, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy attribute datatype"); - if (NULL == (dst_type = H5T_copy(mem_type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy memory datatype"); - /* Get the maximum buffer size needed and allocate it */ buf_size = nelmts * MAX(src_type_size, dst_type_size); if (NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) @@ -750,8 +744,8 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) } /* Perform datatype conversion. */ - if (H5T_convert(tpath, src_type, dst_type, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < - 0) + if (H5T_convert(tpath, attr->shared->dt, mem_type, nelmts, (size_t)0, (size_t)0, tconv_buf, + bkg_buf) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Copy the converted data into the user's buffer */ @@ -769,10 +763,6 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) done: /* Release resources */ - if (src_type && H5T_close(src_type) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (dst_type && H5T_close(dst_type) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); if (tconv_buf) tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); if (bkg_buf) @@ -803,9 +793,7 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) uint8_t *bkg_buf = NULL; /* temp conversion buffer */ hssize_t snelmts; /* elements in attribute */ size_t nelmts; /* elements in attribute */ - H5T_path_t *tpath = NULL; /* conversion information*/ - H5T_t *src_type = NULL; /* temporary datatype */ - H5T_t *dst_type = NULL; /* temporary datatype */ + H5T_path_t *tpath = NULL; /* conversion information*/ size_t src_type_size; /* size of source type */ size_t dst_type_size; /* size of destination type*/ size_t buf_size; /* desired buffer size */ @@ -841,11 +829,6 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) if (!H5T_path_noop(tpath)) { H5T_bkg_t need_bkg; /* Background buffer type */ - if (NULL == (src_type = H5T_copy(mem_type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy memory datatype"); - if (NULL == (dst_type = H5T_copy(attr->shared->dt, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy attribute datatype"); - /* Get the maximum buffer size needed and allocate it */ buf_size = nelmts * MAX(src_type_size, dst_type_size); if (NULL == (tconv_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) @@ -878,7 +861,8 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) } /* Perform datatype conversion */ - if (H5T_convert(tpath, src_type, dst_type, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) + if (H5T_convert(tpath, mem_type, attr->shared->dt, nelmts, (size_t)0, (size_t)0, tconv_buf, + bkg_buf) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Free the previous attribute data buffer, if there is one */ @@ -909,10 +893,6 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) done: /* Release resources */ - if (src_type && H5T_close(src_type) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (dst_type && H5T_close(dst_type) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); if (tconv_buf) tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); if (bkg_buf) @@ -2082,10 +2062,10 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size { H5A_t *attr_dst = NULL; /* Destination attribute */ H5T_t *dt_mem = NULL; /* Memory datatype */ + H5S_t *buf_space = NULL; /* Dataspace describing buffer */ void *buf = NULL; /* Buffer for copying data */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ void *bkg_buf = NULL; /* Background buffer */ - hid_t buf_sid = -1; /* ID for buffer dataspace */ hssize_t sdst_nelmts; /* # of elements in destination attribute (signed) */ size_t dst_nelmts; /* # of elements in destination attribute */ size_t dst_dt_size; /* Size of destination attribute datatype */ @@ -2198,7 +2178,6 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size size_t src_dt_size; /* Source datatype size */ size_t tmp_dt_size; /* Temp. datatype size */ size_t max_dt_size; /* Max atatype size */ - H5S_t *buf_space; /* Dataspace describing buffer */ hsize_t buf_dim; /* Dimension for buffer */ size_t nelmts; /* Number of elements in buffer */ size_t buf_size; /* Size of copy buffer */ @@ -2239,12 +2218,6 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace"); - /* Register */ - if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { - H5S_close(buf_space); - HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, NULL, "unable to register dataspace ID"); - } /* end if */ - /* Allocate memory for recclaim buf */ if (NULL == (reclaim_buf = H5FL_BLK_MALLOC(attr_buf, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation NULLed for raw data chunk"); @@ -2302,10 +2275,10 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size ret_value = attr_dst; done: - if (buf_sid > 0 && H5I_dec_ref(buf_sid) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "can't decrement temporary dataspace ID"); if (dt_mem && (H5T_close(dt_mem) < 0)) HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); + if (buf_space && H5S_close(buf_space) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTCLOSEOBJ, NULL, "can't close temporary dataspace"); if (buf) buf = H5FL_BLK_FREE(attr_buf, buf); if (reclaim_buf) diff --git a/src/H5B.c b/src/H5B.c index 7b71b5f9719..5a7a23853c5 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -101,6 +101,7 @@ #include "H5Bpkg.h" /* B-link trees */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5B2.c b/src/H5B2.c index 7f59ac8fae7..f49689911dc 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -36,6 +36,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 8196ee22a30..f46b1d0820a 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5B2int.c b/src/H5B2int.c index 1b3ecae7232..0174b527879 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5B2internal.c b/src/H5B2internal.c index e97e921487d..82e686a9569 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ /****************/ diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index 48e5f62fe29..3351909484c 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5Bcache.c b/src/H5Bcache.c index d9c94f498ce..007912053e9 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Bpkg.h" /* B-link trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ /****************/ diff --git a/src/H5C.c b/src/H5C.c index 1713e83ef90..44d499df964 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -66,6 +66,7 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5CS.c b/src/H5CS.c index 3728273ea2a..0dca211604f 100644 --- a/src/H5CS.c +++ b/src/H5CS.c @@ -27,6 +27,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5CSprivate.h" /* Function stack */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_CODESTACK diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 457b29cbc78..978b1709945 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -32,6 +32,7 @@ #include "H5ACprivate.h" /* Metadata Cache */ #include "H5Cpkg.h" /* Cache */ #include "H5Eprivate.h" /* Error Handling */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Centry.c b/src/H5Centry.c index fec1f4ae755..c6892e90e3c 100644 --- a/src/H5Centry.c +++ b/src/H5Centry.c @@ -34,8 +34,10 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Cint.c b/src/H5Cint.c index 2e79a0da057..905cbf951ec 100644 --- a/src/H5Cint.c +++ b/src/H5Cint.c @@ -34,6 +34,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5MFprivate.h" /* File memory management */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index c8db5352ff6..233e4f92d2d 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -38,6 +38,7 @@ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ #ifdef H5_HAVE_PARALLEL /****************/ diff --git a/src/H5D.c b/src/H5D.c index 79b945a8e3f..10f647c9cb9 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -1853,7 +1853,7 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ herr_t H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *operator_data) { - H5T_t *type; /* Datatype */ + const H5T_t *type; /* Datatype */ H5S_t *space; /* Dataspace for iteration */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ herr_t ret_value; /* Return value */ @@ -1868,7 +1868,7 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, void *op HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid buffer"); if (H5I_DATATYPE != H5I_get_type(type_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid datatype"); - if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + if (NULL == (type = (const H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype"); if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace"); diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 9bb2e73974e..310f774e8da 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -56,6 +56,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5MFprivate.h" /* File memory management */ #include "H5PBprivate.h" /* Page Buffer */ +#include "H5SLprivate.h" /* Skip Lists */ #include "H5VMprivate.h" /* Vector and array functions */ /****************/ @@ -179,15 +180,15 @@ typedef struct H5D_chunk_it_ud3_t { bool do_convert; /* Whether to perform type conversions */ /* needed for converting variable-length data */ - H5T_t *dt_src; /* Source datatype */ - H5T_t *dt_dst; /* Destination datatype */ - H5T_t *dt_mem; /* Memory datatype */ - H5T_path_t *tpath_src_mem; /* Datatype conversion path from source file to memory */ - H5T_path_t *tpath_mem_dst; /* Datatype conversion path from memory to dest. file */ - void *reclaim_buf; /* Buffer for reclaiming data */ - size_t reclaim_buf_size; /* Reclaim buffer size */ - uint32_t nelmts; /* Number of elements in buffer */ - H5S_t *buf_space; /* Dataspace describing buffer */ + const H5T_t *dt_src; /* Source datatype */ + const H5T_t *dt_dst; /* Destination datatype */ + const H5T_t *dt_mem; /* Memory datatype */ + H5T_path_t *tpath_src_mem; /* Datatype conversion path from source file to memory */ + H5T_path_t *tpath_mem_dst; /* Datatype conversion path from memory to dest. file */ + void *reclaim_buf; /* Buffer for reclaiming data */ + size_t reclaim_buf_size; /* Reclaim buffer size */ + uint32_t nelmts; /* Number of elements in buffer */ + H5S_t *buf_space; /* Dataspace describing buffer */ /* needed for compressed variable-length data */ const H5O_pline_t *pline; /* Filter pipeline */ @@ -297,9 +298,9 @@ static herr_t H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, H5D_io_in static herr_t H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *di, H5D_io_info_t *io_info); static herr_t H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *di); static herr_t H5D__create_piece_mem_map_hyper(const H5D_dset_io_info_t *di); -static herr_t H5D__piece_file_cb(void *elem, H5T_t *type, unsigned ndims, const hsize_t *coords, +static herr_t H5D__piece_file_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *_opdata); -static herr_t H5D__piece_mem_cb(void *elem, H5T_t *type, unsigned ndims, const hsize_t *coords, +static herr_t H5D__piece_mem_cb(void *elem, const H5T_t *type, unsigned ndims, const hsize_t *coords, void *_opdata); static herr_t H5D__chunk_may_use_select_io(H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info); static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); @@ -1182,7 +1183,6 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) const H5D_t *dataset; /* Local pointer to dataset info */ const H5T_t *mem_type; /* Local pointer to memory datatype */ H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ - H5T_t *file_type = NULL; /* Temporary copy of file datatype for iteration */ bool iter_init = false; /* Selection iteration info has been initialized */ char bogus; /* "bogus" buffer to pass to selection iterator */ H5D_io_info_wrap_t io_info_wrap; @@ -1285,10 +1285,6 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) else { H5S_sel_iter_op_t iter_op; /* Operator for iteration */ - /* Create temporary datatypes for selection iteration */ - if (NULL == (file_type = H5T_copy(dataset->shared->type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy file datatype"); - /* set opdata for H5D__piece_mem_cb */ io_info_wrap.io_info = io_info; io_info_wrap.dinfo = dinfo; @@ -1296,7 +1292,8 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) iter_op.u.lib_op = H5D__piece_file_cb; /* Spaces might not be the same shape, iterate over the file selection directly */ - if (H5S_select_iterate(&bogus, file_type, dinfo->file_space, &iter_op, &io_info_wrap) < 0) + if (H5S_select_iterate(&bogus, dataset->shared->type, dinfo->file_space, &iter_op, + &io_info_wrap) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections"); /* Reset "last piece" info */ @@ -1335,11 +1332,6 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) /* Save chunk template information */ fm->mchunk_tmpl = tmp_mspace; - /* Create temporary datatypes for selection iteration */ - if (!file_type) - if (NULL == (file_type = H5T_copy(dataset->shared->type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy file datatype"); - /* Create selection iterator for memory selection */ if (0 == (elmt_size = H5T_get_size(mem_type))) HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid"); @@ -1354,7 +1346,8 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) iter_op.u.lib_op = H5D__piece_mem_cb; /* Spaces aren't the same shape, iterate over the memory selection directly */ - if (H5S_select_iterate(&bogus, file_type, dinfo->file_space, &iter_op, &io_info_wrap) < 0) + if (H5S_select_iterate(&bogus, dataset->shared->type, dinfo->file_space, &iter_op, + &io_info_wrap) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections"); } /* end else */ } /* end else */ @@ -1372,8 +1365,6 @@ H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) if (iter_init && H5S_SELECT_ITER_RELEASE(&(fm->mem_iter)) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator"); - if (file_type && (H5T_close_real(file_type) < 0)) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "Can't free temporary datatype"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__chunk_io_init_selections() */ @@ -2237,7 +2228,7 @@ H5D__create_piece_mem_map_1d(const H5D_dset_io_info_t *dinfo) *------------------------------------------------------------------------- */ static herr_t -H5D__piece_file_cb(void H5_ATTR_UNUSED *elem, H5T_t H5_ATTR_UNUSED *type, unsigned ndims, +H5D__piece_file_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, unsigned ndims, const hsize_t *coords, void *_opdata) { H5D_io_info_wrap_t *opdata = (H5D_io_info_wrap_t *)_opdata; @@ -2363,7 +2354,7 @@ H5D__piece_file_cb(void H5_ATTR_UNUSED *elem, H5T_t H5_ATTR_UNUSED *type, unsign *------------------------------------------------------------------------- */ static herr_t -H5D__piece_mem_cb(void H5_ATTR_UNUSED *elem, H5T_t H5_ATTR_UNUSED *type, unsigned ndims, +H5D__piece_mem_cb(void H5_ATTR_UNUSED *elem, const H5T_t H5_ATTR_UNUSED *type, unsigned ndims, const hsize_t *coords, void *_opdata) { H5D_io_info_wrap_t *opdata = (H5D_io_info_wrap_t *)_opdata; @@ -6578,7 +6569,7 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) bool need_insert = false; /* Whether the chunk needs to be inserted into the index */ /* General information about chunk copy */ - H5T_t *dt_src = udata->dt_src; + const H5T_t *dt_src = udata->dt_src; void *bkg = udata->bkg; /* Background buffer for datatype conversion */ void *buf = udata->buf; /* Chunk buffer for I/O & datatype conversions */ size_t buf_size = udata->buf_size; /* Size of chunk buffer */ @@ -6705,13 +6696,13 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Perform datatype conversion, if necessary */ if (is_vlen) { - H5T_path_t *tpath_src_mem = udata->tpath_src_mem; - H5T_path_t *tpath_mem_dst = udata->tpath_mem_dst; - H5T_t *dt_dst = udata->dt_dst; - H5T_t *dt_mem = udata->dt_mem; - H5S_t *buf_space = udata->buf_space; - void *reclaim_buf = udata->reclaim_buf; - size_t reclaim_buf_size = udata->reclaim_buf_size; + H5T_path_t *tpath_src_mem = udata->tpath_src_mem; + H5T_path_t *tpath_mem_dst = udata->tpath_mem_dst; + const H5T_t *dt_dst = udata->dt_dst; + const H5T_t *dt_mem = udata->dt_mem; + H5S_t *buf_space = udata->buf_space; + void *reclaim_buf = udata->reclaim_buf; + size_t reclaim_buf_size = udata->reclaim_buf_size; /* Convert from source file to memory */ H5_CHECK_OVERFLOW(udata->nelmts, uint32_t, size_t); @@ -6836,7 +6827,6 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk void *bkg = NULL; /* Buffer for background during type conversion */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ H5S_t *buf_space = NULL; /* Dataspace describing buffer */ - hid_t sid_buf = -1; /* ID for buffer dataspace */ uint32_t nelmts = 0; /* Number of elements in buffer */ bool do_convert = false; /* Indicate that type conversions should be performed */ bool copy_setup_done = false; /* Indicate that 'copy setup' is done */ @@ -6944,12 +6934,6 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); - /* Register */ - if ((sid_buf = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { - (void)H5S_close(buf_space); - HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - } /* end if */ - /* Set initial buffer sizes */ buf_size = nelmts * max_dt_size; reclaim_buf_size = nelmts * mem_dt_size; @@ -7044,8 +7028,6 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk bkg = udata.bkg; done: - if (sid_buf > 0 && H5I_dec_ref(sid_buf) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't decrement temporary dataspace ID"); /* Caller expects that source datatype will be freed */ if (dt_src && (H5T_close(dt_src) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); @@ -7053,6 +7035,8 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); if (dt_mem && (H5T_close(dt_mem) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + if (buf_space && H5S_close(buf_space) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary dataspace"); if (buf) H5MM_xfree(buf); if (bkg) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 66acfd5efa6..864d4963a6e 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -472,10 +472,10 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds { H5T_t *dt_mem = NULL; /* Memory datatype */ H5T_t *dt_dst = NULL; /* Destination datatype */ + H5S_t *buf_space = NULL; /* Dataspace describing buffer */ void *buf = NULL; /* Buffer for copying data */ void *bkg = NULL; /* Temporary buffer for copying data */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ - hid_t buf_sid = -1; /* ID for buffer dataspace */ H5D_shared_t *shared_fo = (H5D_shared_t *)cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */ H5O_storage_compact_t *storage_src = _storage_src; /* Pointer to storage_src */ @@ -498,7 +498,6 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds /* If there's a VLEN source datatype, do type conversion information */ if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) { H5T_path_t *tpath_src_mem, *tpath_mem_dst; /* Datatype conversion paths */ - H5S_t *buf_space; /* Dataspace describing buffer */ size_t buf_size; /* Size of copy buffer */ size_t nelmts; /* Number of elements in buffer */ size_t src_dt_size; /* Source datatype size */ @@ -548,12 +547,6 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if (NULL == (buf_space = H5S_create_simple((unsigned)1, &buf_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); - /* Register */ - if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { - H5S_close(buf_space); - HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - } /* end if */ - /* Allocate memory for recclaim buf */ if (NULL == (reclaim_buf = H5FL_BLK_MALLOC(type_conv, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); @@ -613,8 +606,6 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds storage_dst->dirty = true; done: - if (buf_sid > 0 && H5I_dec_ref(buf_sid) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't decrement temporary dataspace ID"); /* Caller expects that source datatype will be freed */ if (dt_src && (H5T_close(dt_src) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); @@ -622,6 +613,8 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); if (dt_mem && (H5T_close(dt_mem) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + if (buf_space && H5S_close(buf_space) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary dataspace"); if (buf) buf = H5FL_BLK_FREE(type_conv, buf); if (reclaim_buf) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 087488184cc..d9137b9479a 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -1608,7 +1608,6 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f void *bkg = NULL; /* Temporary buffer for copying data */ void *reclaim_buf = NULL; /* Buffer for reclaiming data */ H5S_t *buf_space = NULL; /* Dataspace describing buffer */ - hid_t buf_sid = -1; /* ID for buffer dataspace */ hsize_t buf_dim[1] = {0}; /* Dimension for buffer */ bool is_vlen = false; /* Flag to indicate that VL type conversion should occur */ bool fix_ref = false; /* Flag to indicate that ref values should be fixed */ @@ -1687,12 +1686,6 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f if (NULL == (buf_space = H5S_create_simple((unsigned)1, buf_dim, NULL))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); - /* Register */ - if ((buf_sid = H5I_register(H5I_DATASPACE, buf_space, false)) < 0) { - H5S_close(buf_space); - HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - } /* end if */ - /* Set flag to do type conversion */ is_vlen = true; } /* end if */ @@ -1817,8 +1810,6 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f } /* end while */ done: - if (buf_sid > 0 && H5I_dec_ref(buf_sid) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't decrement temporary dataspace ID"); /* Caller expects that source datatype will be freed */ if (dt_src && (H5T_close(dt_src) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); @@ -1826,6 +1817,8 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); if (dt_mem && (H5T_close(dt_mem) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + if (buf_space && H5S_close(buf_space) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary dataspace"); if (buf) buf = H5FL_BLK_FREE(type_conv, buf); if (reclaim_buf) diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 0a71b5c5ec8..e763a9b7b2e 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -306,9 +306,9 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) { - H5T_t *type; - H5S_t *space; /* Dataspace for iteration */ - herr_t ret_value; /* Return value */ + const H5T_t *type; + H5S_t *space; /* Dataspace for iteration */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "iii*x", type_id, space_id, dxpl_id, buf); @@ -316,7 +316,7 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) /* Check args */ if (buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "'buf' pointer is NULL"); - if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + if (NULL == (type = (const H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid datatype"); if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace"); diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 447a22dfa9b..56609844021 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -114,10 +114,8 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ uint8_t elem_buf[H5T_ELEM_BUF_SIZE]; /* Buffer for element data */ H5WB_t *bkg_elem_wb = NULL; /* Wrapped buffer for background data */ uint8_t bkg_elem_buf[H5T_ELEM_BUF_SIZE]; /* Buffer for background data */ - uint8_t *bkg_buf = NULL; /* Background conversion buffer */ - uint8_t *tmp_buf = NULL; /* Temp conversion buffer */ - H5T_t *src_type = NULL; /* Source datatype */ - H5T_t *dst_type = NULL; /* Destination datatype */ + uint8_t *bkg_buf = NULL; /* Background conversion buffer */ + uint8_t *tmp_buf = NULL; /* Temp conversion buffer */ size_t dst_type_size; /* Size of destination type*/ herr_t ret_value = SUCCEED; /* Return value */ @@ -168,15 +166,6 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype"); - /* Construct source & destination datatype IDs, if we will need them */ - if (!H5T_path_noop(tpath)) { - if (NULL == (src_type = H5T_copy(fill_type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy fill value datatype"); - - if (NULL == (dst_type = H5T_copy(buf_type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy memory datatype"); - } /* end if */ - /* If there's VL type of data, make multiple copies of fill value first, * then do conversion on each element so that each of them has a copy * of the VL data. @@ -201,7 +190,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ H5VM_array_fill(tmp_buf, fill, src_type_size, (size_t)nelmts); /* Convert from file's fill value into memory form */ - if (H5T_convert(tpath, src_type, dst_type, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, + if (H5T_convert(tpath, fill_type, buf_type, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed"); @@ -251,7 +240,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ } /* end if */ /* Perform datatype conversion */ - if (H5T_convert(tpath, src_type, dst_type, (size_t)1, (size_t)0, (size_t)0, elem_ptr, + if (H5T_convert(tpath, fill_type, buf_type, (size_t)1, (size_t)0, (size_t)0, elem_ptr, bkg_ptr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed"); @@ -272,10 +261,6 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator"); if (mem_iter) mem_iter = H5FL_FREE(H5S_sel_iter_t, mem_iter); - if (src_type && H5T_close(src_type) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (dst_type && H5T_close(dst_type) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); if (tmp_buf) tmp_buf = H5FL_BLK_FREE(type_conv, tmp_buf); if (elem_wb && H5WB_unwrap(elem_wb) < 0) @@ -300,7 +285,7 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ herr_t H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, - H5T_t *dset_type, size_t total_nelmts, size_t max_buf_size) + const H5T_t *dset_type, size_t total_nelmts, size_t max_buf_size) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 2e835a5df5d..d408ef30c81 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -29,6 +29,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5VMprivate.h" /* Vector Functions */ @@ -88,7 +89,7 @@ static herr_t H5D__use_minimized_dset_headers(H5F_t *file, bool *minimize); static herr_t H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc); static size_t H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr); static void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); -static herr_t H5D__vlen_get_buf_size_cb(void *elem, H5T_t *type, unsigned ndim, const hsize_t *point, +static herr_t H5D__vlen_get_buf_size_cb(void *elem, const H5T_t *type, unsigned ndim, const hsize_t *point, void *op_data); static herr_t H5D__vlen_get_buf_size_gen_cb(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data); @@ -2624,7 +2625,7 @@ H5D__vlen_get_buf_size_alloc(size_t size, void *info) *------------------------------------------------------------------------- */ static herr_t -H5D__vlen_get_buf_size_cb(void H5_ATTR_UNUSED *elem, H5T_t *type, unsigned H5_ATTR_UNUSED ndim, +H5D__vlen_get_buf_size_cb(void H5_ATTR_UNUSED *elem, const H5T_t *type, unsigned H5_ATTR_UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_native_t *vlen_bufsize = (H5D_vlen_bufsize_native_t *)op_data; @@ -2687,14 +2688,14 @@ H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ - H5T_t *type; /* Datatype */ + const H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ herr_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE /* Check args */ - if (NULL == (type = (H5T_t *)H5I_object(type_id))) + if (NULL == (type = (const H5T_t *)H5I_object(type_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype"); if (NULL == (space = (H5S_t *)H5I_object(space_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace"); @@ -2828,7 +2829,7 @@ H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id H5S_t *mspace = NULL; /* Memory dataspace */ char bogus; /* Bogus value to pass to H5Diterate() */ H5S_t *space; /* Dataspace for iteration */ - H5T_t *type; /* Datatype */ + const H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ H5VL_dataset_get_args_t vol_cb_args; /* Arguments to VOL callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2836,7 +2837,7 @@ H5D__vlen_get_buf_size_gen(H5VL_object_t *vol_obj, hid_t type_id, hid_t space_id FUNC_ENTER_PACKAGE /* Check args */ - if (NULL == (type = (H5T_t *)H5I_object(type_id))) + if (NULL == (type = (const H5T_t *)H5I_object(type_id))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not an valid datatype"); if (NULL == (space = (H5S_t *)H5I_object(space_id))) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "invalid dataspace"); @@ -3560,8 +3561,8 @@ H5D_get_create_plist(const H5D_t *dset) H5O_layout_t copied_layout; /* Layout to tweak */ H5O_fill_t copied_fill = {0}; /* Fill value to tweak */ H5O_efl_t copied_efl; /* External file list to tweak */ - H5T_t *src_type = NULL; H5T_t *dst_type = NULL; + H5T_t *tmp_type = NULL; hid_t new_dcpl_id = FAIL; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -3650,10 +3651,13 @@ H5D_get_create_plist(const H5D_t *dset) uint8_t *bkg_buf = NULL; /* Background conversion buffer */ size_t bkg_size; /* Size of background buffer */ - if (NULL == (src_type = H5T_copy(dset->shared->type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy dataset's datatype"); - if (NULL == (dst_type = H5T_copy(copied_fill.type, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy fill value datatype"); + dst_type = copied_fill.type; + if (H5T_detect_class(dst_type, H5T_VLEN, false) > 0 || + H5T_detect_class(dst_type, H5T_REFERENCE, false) > 0) { + if (NULL == (tmp_type = H5T_copy(dst_type, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy fill value datatype"); + dst_type = tmp_type; + } /* Allocate a background buffer */ bkg_size = MAX(H5T_GET_SIZE(copied_fill.type), H5T_GET_SIZE(dset->shared->type)); @@ -3661,8 +3665,8 @@ H5D_get_create_plist(const H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed"); /* Convert fill value */ - if (H5T_convert(tpath, src_type, dst_type, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, - bkg_buf) < 0) { + if (H5T_convert(tpath, dset->shared->type, dst_type, (size_t)1, (size_t)0, (size_t)0, + copied_fill.buf, bkg_buf) < 0) { if (bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); @@ -3699,9 +3703,7 @@ H5D_get_create_plist(const H5D_t *dset) ret_value = new_dcpl_id; done: - if (src_type && (H5T_close(src_type) < 0)) - HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (dst_type && (H5T_close(dst_type) < 0)) + if (tmp_type && (H5T_close(tmp_type) < 0)) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); if (ret_value < 0) { diff --git a/src/H5Dio.c b/src/H5Dio.c index 14f8b7f85b9..62bb48c2a26 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -43,7 +43,8 @@ static herr_t H5D__ioinfo_init(size_t count, H5D_io_op_type_t op_type, H5D_dset_io_info_t *dset_info, H5D_io_info_t *io_info); static herr_t H5D__dset_ioinfo_init(H5D_t *dset, H5D_dset_io_info_t *dset_info, H5D_storage_t *store); -static herr_t H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, H5T_t *mem_type); +static herr_t H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, + const H5T_t *mem_type); static herr_t H5D__typeinfo_init_phase2(H5D_io_info_t *io_info); static herr_t H5D__typeinfo_init_phase3(H5D_io_info_t *io_info); #ifdef H5_HAVE_PARALLEL @@ -1037,7 +1038,7 @@ H5D__dset_ioinfo_init(H5D_t *dset, H5D_dset_io_info_t *dset_info, H5D_storage_t *------------------------------------------------------------------------- */ static herr_t -H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, H5T_t *mem_type) +H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, const H5T_t *mem_type) { H5D_type_info_t *type_info; const H5D_t *dset; diff --git a/src/H5Dmodule.h b/src/H5Dmodule.h index 81f197d7147..27e5799968e 100644 --- a/src/H5Dmodule.h +++ b/src/H5Dmodule.h @@ -815,19 +815,10 @@ * * * - * + * * * * - * - * - * - * - * - * - * - * * * * @@ -844,6 +835,19 @@ * * * + * + * + * + * + * + * + * + * + * + * + * + * * *
    Data pipeline filters
    FilterBuilt-in FilterDescription
    gzip compressionData compression using zlib.
    Szip compressionData compression using the Szip library. See The HDF Group website for more information - * regarding the Szip filter.
    N-bit compressionData compression using an algorithm specialized for n-bit datatypes.
    Fletcher32Fletcher32 checksum for error-detection.
    Optional Built-in FilterDescription
    gzip compressionData compression using zlib.
    szip compressionData compression using the szip library. The HDF Group now uses the libaec library for the szip +filter.
    * @@ -861,6 +865,44 @@ * \li @see @ref subsubsec_dataset_filters_nbit * \li @see @ref subsubsec_dataset_filters_scale * + * \subsubsection subsubsec_dataset_transfer_dyn_filter Data Pipeline Dynamically Loaded Filters + * While the HDF5 “internal” compression methods work reasonably well on users’ + * datasets, there are certain drawbacks to this implementation. First, the “internal” compression + * methods may not provide the optimal compression ratio, as do some newly developed or specialized + * compression methods. Secondly, if a data provider wants to use a “non-internal” compression for + * storing the data in HDF5, they have to write a filter function that uses the new compression method + * and then register it with the library. Data consumers of such HDF5 files will need to have the new filter + * function and use it with their applications to read the data, or they will need a modified version of the + * HDF5 Library that has the new filter as a part of the library. + * + * If a user of such data does not have a modified HDF5 Library installed on his system, command-line tools + * such as h5dump or h5ls will not be able to display the compressed data. Furthermore, it would be + * practically impossible to determine the compression method used, making the data stored in HDF5 + * useless. + * + * It is clear that the internal HDF5 filter mechanism, while extensible, does not work well with third-party + * filters. It would be a maintenance nightmare to keep adding and supporting new compression methods + * in HDF5. For any set of HDF5 “internal” filters, there always will be data with which the “internal” +filters + * will not achieve the optimal performance needed to address data I/O and storage problems. Thus the + * internal HDF5 filter mechanism is enhanced to address the issues discussed above. + * + * We have a feature of HDF5 called “dynamically loaded filters in HDF5.” This feature + * makes the HDF5 third-party filters available to an application at runtime. The third-party HDF5 filter + * function has to be a part of the HDF5 filter plugin installed on the system as a shared library or DLL. + * + * To use a third-party filter an HDF5 application should call the #H5Pset_filter function when setting the + * filter pipeline for a dataset creation property. The HDF5 Library will register the filter with the library + * and the filter will be applied when data is written to the file. + * + * When an application reads data compressed with a third-party HDF5 filter, the HDF5 Library will search + * for the required filter plugin, register the filter with the library (if the filter function is not +registered) and + * apply it to the data on the read operation. + * + * For more information, + * \li @see @ref sec_filter_plugins + * * \subsubsection subsubsec_dataset_transfer_drive File Drivers * I/O is performed by the HDF5 virtual file layer. The file driver interface writes and reads blocks * of data; each driver module implements the interface using different I/O mechanisms. The table @@ -2685,8 +2727,25 @@ allocated if necessary. * and minimum values, and they will get a much larger minimum-bits (poor compression) *

  • * - * \subsubsection subsubsec_dataset_filters_szip Using the Szip Filter - * See The HDF Group website for further information regarding the Szip filter. + * \subsubsection subsubsec_dataset_filters_szip Using the SZip Filter + * See The HDF Group website for further information regarding the SZip filter. + * + * \subsubsection subsubsec_dataset_filters_dyn Using Dynamically-Loadable Filters + * \see \ref sec_filter_plugins for further information regarding the dynamically-loadable filters. + * + * HDF has a filter plugin repository of useful third-party plugins that can used + * + * + * + * + * + * + * + * + * + * + * + *
    FilterSetFilter Params
    BLOSCUD=32001,0,0
    BSHUFUD=32004,0,0
    BZIP2UD=307,0,1,9
    JPEGUD=32019,0,4,q,c,r,t
    LZ4 UD=32004,0,1,3
    LZFUD=32000,1,3,0,0,0
    SZUD=32017,1,5,2,7,20,40,0
    ZFPUD=32013,1,0,0
    ZSTDUD=32015,0,0
    * * Previous Chapter \ref sec_group - Next Chapter \ref sec_datatype * diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 7d8ba21f403..307629f7718 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -34,6 +34,7 @@ #include "H5Oprivate.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ #include "H5Sprivate.h" /* Dataspaces */ +#include "H5SLprivate.h" /* Skip Lists */ #include "H5VMprivate.h" /* Vector */ #ifdef H5_HAVE_PARALLEL @@ -613,7 +614,8 @@ H5D__mpio_debug_init(void) if (debug_str) H5D__mpio_parse_debug_str(debug_str); - debug_stream = stdout; + if (H5DEBUG(D)) + debug_stream = stdout; H5D_mpio_debug_inited = true; @@ -1410,7 +1412,7 @@ H5D__piece_io(H5D_io_info_t *io_info) fprintf(debug_log_file, "##############\n\n"); if (EOF == fclose(debug_log_file)) HDONE_ERROR(H5E_IO, H5E_CLOSEERROR, FAIL, "couldn't close debugging log file"); - debug_stream = stdout; + debug_stream = H5DEBUG(D) ? stdout : NULL; } #endif diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index a24249f05ca..684780e8e85 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -120,8 +120,8 @@ typedef struct H5D_type_info_t { /* Initial values */ const H5T_t *mem_type; /* Pointer to memory datatype */ const H5T_t *dset_type; /* Pointer to dataset datatype */ - H5T_t *src_type; /* Pointer to source datatype */ - H5T_t *dst_type; /* Pointer to destination datatype */ + const H5T_t *src_type; /* Pointer to source datatype */ + const H5T_t *dst_type; /* Pointer to destination datatype */ H5T_path_t *tpath; /* Datatype conversion path */ /* Computed/derived values */ @@ -278,7 +278,7 @@ typedef struct H5D_dset_io_info_t { H5D_piece_info_t *contig_piece_info; /* Piece info for contiguous dataset */ } layout_io_info; - H5T_t *mem_type; /* memory datatype */ + const H5T_t *mem_type; /* memory datatype */ H5D_type_info_t type_info; bool skip_io; /* Whether to skip I/O for this dataset */ } H5D_dset_io_info_t; @@ -602,7 +602,7 @@ typedef struct H5D_fill_buf_info_t { void *bkg_buf; /* Background conversion buffer */ size_t bkg_buf_size; /* Size of background buffer */ H5T_t *mem_type; /* Pointer to memory datatype */ - H5T_t *file_type; /* Pointer to file datatype */ + const H5T_t *file_type; /* Pointer to file datatype */ size_t mem_elmt_size, file_elmt_size; /* Size of element in memory and on disk */ size_t max_elmt_size; /* Max. size of memory or file datatype */ size_t elmts_per_buf; /* # of elements that fit into a buffer */ @@ -784,7 +784,7 @@ H5_DLL herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, con H5S_t *space); H5_DLL herr_t H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, - H5T_t *dset_type, size_t nelmts, size_t min_buf_size); + const H5T_t *dset_type, size_t nelmts, size_t min_buf_size); H5_DLL herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts); H5_DLL herr_t H5D__fill_term(H5D_fill_buf_info_t *fb_info); diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c index 348e5083b60..96c027ec581 100644 --- a/src/H5EAhdr.c +++ b/src/H5EAhdr.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5FAhdr.c b/src/H5FAhdr.c index ef3d689fce2..3a3ee2db8a9 100644 --- a/src/H5FAhdr.c +++ b/src/H5FAhdr.c @@ -35,6 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 7c4846975f7..c74ef5ed28a 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -766,8 +766,9 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if (fa->backing_store) { if ((fd = HDopen(name, o_flags | O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file"); + memset(&sb, 0, sizeof(h5_stat_t)); if (HDfstat(fd, &sb) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file"); } /* end if */ } /* end if */ /* Open backing store, and get stat() from file. The only case that backing @@ -776,8 +777,9 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr else if (fa->backing_store || !(H5F_ACC_CREAT & flags)) { if ((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file"); + memset(&sb, 0, sizeof(h5_stat_t)); if (HDfstat(fd, &sb) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file"); } /* end if */ /* Create the new file struct */ @@ -1567,7 +1569,7 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool closing) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #else /* H5_HAVE_WIN32_API */ if (-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ } /* end if */ @@ -1620,7 +1622,7 @@ H5FD__core_lock(H5FD_t *_file, bool rw) errno = 0; } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file"); } /* end if */ } /* end if */ @@ -1656,7 +1658,7 @@ H5FD__core_unlock(H5FD_t *_file) errno = 0; } else - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to unlock file"); } done: @@ -1690,7 +1692,7 @@ H5FD__core_delete(const char *filename, hid_t fapl_id) if (fa->backing_store) if (HDremove(filename) < 0) - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 49f80d4f8bc..dc80a614e6a 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -476,10 +476,11 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad /* Open the file */ if ((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file"); + memset(&sb, 0, sizeof(h5_stat_t)); if (HDfstat(fd, &sb) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file"); /* Create the new file struct */ if (NULL == (file = H5FL_CALLOC(H5FD_direct_t))) @@ -542,7 +543,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad else { file->fa.must_align = false; if (-1 == HDftruncate(file->fd, 0)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file"); } } else { @@ -555,7 +556,7 @@ H5FD__direct_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxad else { if (o_flags & O_RDWR) { if (HDlseek(file->fd, 0, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position"); if (HDwrite(file->fd, buf1, sizeof(int)) < 0) file->fa.must_align = true; else @@ -603,7 +604,7 @@ H5FD__direct_close(H5FD_t *_file) FUNC_ENTER_PACKAGE if (HDclose(file->fd) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") + HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file"); H5FL_FREE(H5FD_direct_t, file); @@ -862,7 +863,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U if (!_must_align || ((addr % _fbsize == 0) && (size % _fbsize == 0) && ((size_t)buf % _boundary == 0))) { /* Seek to the correct location */ if ((addr != file->pos || OP_READ != file->op) && HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* Read the aligned data in file first, being careful of interrupted * system calls and partial results. */ while (size > 0) { @@ -870,7 +871,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U nbytes = HDread(file->fd, buf, size); } while (-1 == nbytes && EINTR == errno); if (-1 == nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") + HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed"); if (0 == nbytes) { /* end of file but not end of format address space */ memset(buf, 0, size); @@ -902,7 +903,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U /* look for the aligned position for reading the data */ assert(!(((addr / _fbsize) * _fbsize) % _fbsize)); if (HDlseek(file->fd, (HDoff_t)((addr / _fbsize) * _fbsize), SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* * Read the aligned data in file into aligned buffer first, then copy the data @@ -930,7 +931,7 @@ H5FD__direct_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_U } while (-1 == nbytes && EINTR == errno); if (-1 == nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") + HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed"); /* Copy the needed data from the copy buffer to the output * buffer, and update copy_size. If the copy buffer does not @@ -1042,14 +1043,14 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ if (!_must_align || ((addr % _fbsize == 0) && (size % _fbsize == 0) && ((size_t)buf % _boundary == 0))) { /* Seek to the correct location */ if ((addr != file->pos || OP_WRITE != file->op) && HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); while (size > 0) { do { nbytes = HDwrite(file->fd, buf, size); } while (-1 == nbytes && EINTR == errno); if (-1 == nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") + HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed"); assert(nbytes > 0); assert((size_t)nbytes <= size); H5_CHECK_OVERFLOW(nbytes, ssize_t, size_t); @@ -1079,7 +1080,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ /* look for the right position for reading or writing the data */ if (HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); p3 = buf; do { @@ -1120,7 +1121,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ /* Seek to the last block, for reading */ assert(!((write_addr + write_size - _fbsize) % _fbsize)); if (HDlseek(file->fd, (HDoff_t)(write_addr + write_size - _fbsize), SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); } /* end if */ else p1 = NULL; @@ -1132,7 +1133,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ } while (-1 == nbytes && EINTR == errno); if (-1 == nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed") + HSYS_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed"); } /* end if */ /* look for the right position and append or copy the data to be written to @@ -1156,7 +1157,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ /*look for the aligned position for writing the data*/ assert(!(write_addr % _fbsize)); if (HDlseek(file->fd, (HDoff_t)write_addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* * Write the data. It doesn't truncate the extra data introduced by @@ -1168,7 +1169,7 @@ H5FD__direct_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_ } while (-1 == nbytes && EINTR == errno); if (-1 == nbytes) /* error */ - HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") + HSYS_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed"); /* update the write address */ write_addr += write_size; @@ -1244,7 +1245,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_ HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #else /* H5_HAVE_WIN32_API */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ /* Update the eof value */ @@ -1259,7 +1260,7 @@ H5FD__direct_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_ *write introduces some extra data for alignment. */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eof)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); } done: @@ -1301,7 +1302,7 @@ H5FD__direct_lock(H5FD_t *_file, bool rw) errno = 0; } else - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file"); } done: @@ -1335,7 +1336,7 @@ H5FD__direct_unlock(H5FD_t *_file) errno = 0; } else - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file"); } done: @@ -1361,7 +1362,7 @@ H5FD__direct_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) assert(filename); if (HDremove(filename) < 0) - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 64d3662bd36..677382552e8 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -513,8 +513,9 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5_timer_start(&stat_timer); /* Get the file stats */ + memset(&sb, 0, sizeof(h5_stat_t)); if (HDfstat(fd, &sb) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file"); /* Stop timer for stat() call */ if (fa->flags & H5FD_LOG_TIME_STAT) @@ -661,7 +662,7 @@ H5FD__log_close(H5FD_t *_file) /* Close the underlying file */ if (HDclose(file->fd) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") + HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file"); /* Stop timer for close() call */ if (file->fa.flags & H5FD_LOG_TIME_CLOSE) @@ -1163,7 +1164,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had H5_timer_start(&seek_timer); if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* Stop timer for seek() call */ if (file->fa.flags & H5FD_LOG_TIME_SEEK) @@ -1382,7 +1383,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha H5_timer_start(&seek_timer); if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); /* Stop timer for seek() call */ if (file->fa.flags & H5FD_LOG_TIME_SEEK) @@ -1587,7 +1588,7 @@ H5FD__log_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNU #else /* H5_HAVE_WIN32_API */ /* Truncate/extend the file */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ /* Stop timer for truncate operation */ @@ -1664,7 +1665,7 @@ H5FD__log_lock(H5FD_t *_file, bool rw) errno = 0; } else - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file"); } done: @@ -1698,7 +1699,7 @@ H5FD__log_unlock(H5FD_t *_file) errno = 0; } else - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file"); } done: @@ -1724,7 +1725,7 @@ H5FD__log_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) assert(filename); if (HDremove(filename) < 0) - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDmirror.h b/src/H5FDmirror.h index 6c98e1a8a6f..95ce936594d 100644 --- a/src/H5FDmirror.h +++ b/src/H5FDmirror.h @@ -25,39 +25,43 @@ /** Identifier for the mirror VFD */ #define H5FD_MIRROR_VALUE H5_VFD_MIRROR -#ifdef __cplusplus -extern "C" { -#endif +/** Magic number to identify the H5FD_mirror_fapl_t struct */ +#define H5FD_MIRROR_FAPL_MAGIC 0xF8DD514C -/* ============================================================================ - * Mirror VFD use and operation. - * ============================================================================ +/** + * The version number of the H5FD_mirror_fapl_t configuration + * structure for the #H5FD_MIRROR driver */ +#define H5FD_MIRROR_CURR_FAPL_T_VERSION 1 -/* --------------------------------------------------------------------------- - * Structure: H5FD_mirror_fapl_t +/** Max size of the remote_ip array in H5FD_mirror_fapl_t */ +#define H5FD_MIRROR_MAX_IP_LEN 45 /* Max size of an IPv4-mapped IPv6 address */ + +/** + *\struct H5FD_mirror_fapl_t + * \brief Configuration structure for H5Pset_fapl_mirror() / H5Pget_fapl_mirror() * - * Used to pass configuration information to the Mirror VFD. - * Populate components as appropriate and pass structure pointer to - * `H5Pset_fapl_mirror()`. + * \details H5FD_mirror_fapl_t is a public structure that is used to pass + * configuration data to the #H5FD_MIRROR driver via a File Access + * Property List. A pointer to an instance of this structure is + * a parameter to H5Pset_fapl_mirror() and H5Pget_fapl_mirror(). * - * `magic` (uint32_t) + * \var uint32_t H5FD_mirror_fapl_t::magic * Semi-unique number to sanity-check pointers to this structure type. - * MUST equal H5FD_MIRROR_FAPL_MAGIC to be considered valid. + * Must equal H5FD_MIRROR_FAPL_MAGIC to be considered valid. * - * `version` (uint32_t) - * Indicates expected components of the structure. + * \var uint32_t H5FD_mirror_fapl_t::version + * Version number of the H5FD_mirror_fapl_t structure. Any instance passed + * to H5Pset_fapl_mirror() / H5Pget_fapl_mirror() must have a recognized version + * number or an error will be raised. Currently, this field should be set + * to #H5FD_MIRROR_CURR_FAPL_T_VERSION. * - * `handshake_port (int) - * Port number to expect to reach the "Mirror Server" on the remote host. + * \var int H5FD_mirror_fapl_t::handshake_port + * Port number on the remote host. * - * `remote_ip` (char[]) - * IP address string of "Mirror Server" remote host. - * --------------------------------------------------------------------------- + * \var char H5FD_mirror_fapl_t::remote_ip[H5FD_MIRROR_MAX_IP_LEN + 1] + * IP address string of the remote host. */ -#define H5FD_MIRROR_FAPL_MAGIC 0xF8DD514C -#define H5FD_MIRROR_CURR_FAPL_T_VERSION 1 -#define H5FD_MIRROR_MAX_IP_LEN 32 typedef struct H5FD_mirror_fapl_t { uint32_t magic; uint32_t version; @@ -65,6 +69,10 @@ typedef struct H5FD_mirror_fapl_t { char remote_ip[H5FD_MIRROR_MAX_IP_LEN + 1]; } H5FD_mirror_fapl_t; +#ifdef __cplusplus +extern "C" { +#endif + /** @private * * \brief Private initializer for the mirror VFD @@ -74,14 +82,33 @@ H5_DLL hid_t H5FD_mirror_init(void); /** * \ingroup FAPL * - * \todo Add missing documentation + * \brief Queries a File Access Property List for #H5FD_MIRROR file driver properties + * + * \fapl_id + * \param[out] fa_out Pointer to #H5FD_MIRROR driver configuration structure + * \returns \herr_t + * + * \details H5Pget_fapl_mirror() queries the #H5FD_MIRROR driver properties as set + * by H5Pset_fapl_mirror(). + * + * \since 1.10.7 */ H5_DLL herr_t H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_out); /** * \ingroup FAPL * - * \todo Add missing documentation + * \brief Modifies the file access property list to use the #H5FD_MIRROR driver + * + * \fapl_id + * \param[in] fa Pointer to #H5FD_MIRROR driver configuration structure + * + * \returns \herr_t + * + * \details H5Pset_fapl_mirror() modifies the file access property list to use the + * #H5FD_MIRROR driver. + * + * \since 1.10.7 */ H5_DLL herr_t H5Pset_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 59f833e31b5..274a8ad3462 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -325,8 +325,9 @@ H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr name, myerrno, strerror(myerrno), flags, (unsigned)o_flags); } /* end if */ + memset(&sb, 0, sizeof(h5_stat_t)); if (HDfstat(fd, &sb) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file"); /* Create the new file struct */ if (NULL == (file = H5FL_CALLOC(H5FD_sec2_t))) @@ -420,7 +421,7 @@ H5FD__sec2_close(H5FD_t *_file) /* Close the underlying file */ if (HDclose(file->fd) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") + HSYS_GOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file"); /* Release the file info */ file = H5FL_FREE(H5FD_sec2_t, file); @@ -664,7 +665,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU /* Seek to the correct location (if we don't have pread) */ if (addr != file->pos || OP_READ != file->op) if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); #endif /* H5_HAVE_PREADWRITE */ /* Read data, being careful of interrupted system calls, partial results, @@ -770,7 +771,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN /* Seek to the correct location (if we don't have pwrite) */ if (addr != file->pos || OP_WRITE != file->op) if (HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position"); #endif /* H5_HAVE_PREADWRITE */ /* Write the data, being careful of interrupted system calls and partial @@ -887,7 +888,7 @@ H5FD__sec2_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UN HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #else /* H5_HAVE_WIN32_API */ if (-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly"); #endif /* H5_HAVE_WIN32_API */ /* Update the eof value */ @@ -937,7 +938,7 @@ H5FD__sec2_lock(H5FD_t *_file, bool rw) errno = 0; } else - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTLOCKFILE, FAIL, "unable to lock file"); } done: @@ -971,7 +972,7 @@ H5FD__sec2_unlock(H5FD_t *_file) errno = 0; } else - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTUNLOCKFILE, FAIL, "unable to unlock file"); } done: @@ -997,7 +998,7 @@ H5FD__sec2_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) assert(filename); if (HDremove(filename) < 0) - HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file"); done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index b019add4009..f465d6f5a38 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -224,7 +224,7 @@ H5FD_ioc_init(void) /* Check if IOC VFD has been loaded dynamically */ env_var = getenv(HDF5_DRIVER); - if (env_var && !strcmp(env_var, H5FD_IOC_NAME)) { + if (env_var && strlen(env_var) > 0 && !strcmp(env_var, H5FD_IOC_NAME)) { int mpi_initialized = 0; int provided = 0; @@ -1479,6 +1479,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) char *prefix_env = NULL; int num_digits = 0; + memset(&st, 0, sizeof(h5_stat_t)); if (HDstat(name, &st) < 0) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_SYSERRSTR, FAIL, "HDstat failed"); @@ -1498,7 +1499,8 @@ H5FD__ioc_del(const char *name, hid_t fapl) /* TODO: No support for subfile directory prefix currently */ /* TODO: Possibly try loading config file prefix from file before deleting */ snprintf(tmp_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, - prefix_env ? prefix_env : file_dirname, base_filename, (uint64_t)st.st_ino); + prefix_env && (strlen(prefix_env) > 0) ? prefix_env : file_dirname, base_filename, + (uint64_t)st.st_ino); if (NULL == (config_file = fopen(tmp_filename, "r"))) { if (ENOENT == errno) { diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index 85c2561549d..4358d624ed7 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -1213,6 +1213,7 @@ ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm) fd = sf_context->sf_fids[subfile_idx]; + memset(&sb, 0, sizeof(h5_stat_t)); if (HDfstat(fd, &sb) < 0) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_SYSERRSTR, -1, "HDfstat failed"); diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 71dd4bacd12..9594f676a88 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -1358,6 +1358,9 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) H5MM_free(file_ptr->file_dir); file_ptr->file_dir = NULL; + if (file_ptr->context_id >= 0 && H5_free_subfiling_object(file_ptr->context_id) < 0) + H5_SUBFILING_DONE_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "can't free subfiling context object"); + /* Release the file info */ file_ptr = H5FL_FREE(H5FD_subfiling_t, file_ptr); @@ -2940,7 +2943,6 @@ translate_io_req_to_iovec(subfiling_context_t *sf_context, size_t iovec_idx, siz int64_t row_offset = 0; int64_t row_stripe_idx_start = 0; int64_t row_stripe_idx_final = 0; - int64_t cur_stripe_idx = 0; int64_t max_iovec_depth = 0; int64_t mem_offset = 0; size_t total_bytes = 0; @@ -3100,7 +3102,6 @@ translate_io_req_to_iovec(subfiling_context_t *sf_context, size_t iovec_idx, siz * vector components for each. Subfiles whose data size is * zero will not have I/O requests passed to them. */ - cur_stripe_idx = stripe_idx; for (int i = 0, subfile_idx = (int)first_subfile_idx; i < num_subfiles; i++) { H5_flexible_const_ptr_t *_io_bufs_ptr; H5FD_mem_t *_io_types_ptr; @@ -3295,7 +3296,6 @@ translate_io_req_to_iovec(subfiling_context_t *sf_context, size_t iovec_idx, siz offset_in_block += (int64_t)*_io_sizes_ptr; subfile_idx++; - cur_stripe_idx++; if (subfile_idx == num_subfiles) { subfile_idx = 0; diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 1127ae0a386..aecc86894bc 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -48,7 +48,6 @@ static int sf_file_map_size = 0; #define DEFAULT_TOPOLOGY_CACHE_SIZE 4 #define DEFAULT_FILE_MAP_ENTRIES 8 -static herr_t H5_free_subfiling_object(int64_t object_id); static herr_t H5_free_subfiling_object_int(subfiling_context_t *sf_context); static herr_t H5_free_subfiling_topology(sf_topology_t *topology); @@ -280,18 +279,25 @@ H5_get_subfiling_object(int64_t object_id) * Purpose: Frees the underlying subfiling object for a given subfiling * object ID. * - * NOTE: Currently we assume that all created subfiling - * objects are cached in the (very simple) context/topology - * cache until application exit, so the only time a subfiling - * object should be freed by this routine is if something - * fails right after creating one. Otherwise, the internal - * indexing for the relevant cache will be invalid. + * NOTE: Because we want to avoid the potentially large + * overhead of determining the application topology on every + * file open, we currently assume that all created subfiling + * topology objects are cached in the (very simple) topology + * cache until application exit. This allows us to quickly + * find and assign a cached topology object to a subfiling + * context object for a file when opened. Therefore, a + * subfiling topology object should (currently) only ever be + * freed by this routine if a function fails right after + * creating a topology object. Otherwise, the internal + * indexing for the topology cache will be invalid and we will + * either leak memory or assign invalid topology pointers to + * subfiling context objects after that point. * * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5_free_subfiling_object(int64_t object_id) { int64_t obj_type = (object_id >> 32) & 0x0FFFF; @@ -305,30 +311,31 @@ H5_free_subfiling_object(int64_t object_id) "couldn't get subfiling context for subfiling object ID"); if (H5_free_subfiling_object_int(sf_context) < 0) - H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling object"); + H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling context object"); assert(sf_context_cache_num_entries > 0); assert(sf_context == sf_context_cache[sf_context_cache_num_entries - 1]); sf_context_cache[sf_context_cache_num_entries - 1] = NULL; sf_context_cache_num_entries--; } - else { + else if (obj_type == SF_TOPOLOGY) { sf_topology_t *sf_topology; - assert(obj_type == SF_TOPOLOGY); - if (NULL == (sf_topology = H5_get_subfiling_object(object_id))) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "couldn't get subfiling context for subfiling object ID"); if (H5_free_subfiling_topology(sf_topology) < 0) - H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling topology"); + H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling topology object"); assert(sf_topology_cache_num_entries > 0); assert(sf_topology == sf_topology_cache[sf_topology_cache_num_entries - 1]); sf_topology_cache[sf_topology_cache_num_entries - 1] = NULL; sf_topology_cache_num_entries--; } + else + H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, + "couldn't free subfiling object - invalid object type"); done: H5_SUBFILING_FUNC_LEAVE; @@ -558,6 +565,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm HDcompile_assert(sizeof(uint64_t) >= sizeof(ino_t)); /* Retrieve Inode value for stub file */ + memset(&st, 0, sizeof(h5_stat_t)); if (HDstat(name, &st) < 0) { stub_file_id = UINT64_MAX; H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, @@ -777,7 +785,7 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param /* Check if a prefix has been set for the configuration file name */ prefix_env = getenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX); - if (prefix_env) { + if (prefix_env && (strlen(prefix_env) > 0)) { if (NULL == (new_context->config_file_prefix = strdup(prefix_env))) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTCOPY, FAIL, "couldn't copy config file prefix string"); } @@ -851,7 +859,8 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param char *env_value = NULL; /* Check for a subfiling stripe size setting from the environment */ - if ((env_value = getenv(H5FD_SUBFILING_STRIPE_SIZE))) { + env_value = getenv(H5FD_SUBFILING_STRIPE_SIZE); + if (env_value && (strlen(env_value) > 0)) { long long stripe_size = -1; errno = 0; @@ -981,7 +990,8 @@ init_app_topology(int64_t sf_context_id, H5FD_subfiling_params_t *subfiling_conf case SELECT_IOC_ONE_PER_NODE: { if (comm_size > 1) { /* Check for an IOC-per-node value set in the environment */ - if ((env_value = getenv(H5FD_SUBFILING_IOC_PER_NODE))) { + env_value = getenv(H5FD_SUBFILING_IOC_PER_NODE); + if (env_value && (strlen(env_value) > 0)) { errno = 0; ioc_select_val = strtol(env_value, NULL, 0); if ((ERANGE == errno)) { @@ -1186,7 +1196,7 @@ get_ioc_selection_criteria_from_env(H5FD_subfiling_ioc_select_t *ioc_selection_t *ioc_sel_info_str = NULL; - if (env_value) { + if (env_value && (strlen(env_value) > 0)) { /* * Parse I/O Concentrator selection strategy criteria as * either a single value or two colon-separated values of @@ -1821,7 +1831,8 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam "couldn't allocate space for subfiling filename"); /* Check for a subfile name prefix setting in the environment */ - if ((env_value = getenv(H5FD_SUBFILING_SUBFILE_PREFIX))) { + env_value = getenv(H5FD_SUBFILING_SUBFILE_PREFIX); + if (env_value && (strlen(env_value) > 0)) { if (NULL == (sf_context->subfile_prefix = strdup(env_value))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't copy subfile prefix value"); } diff --git a/src/H5FDsubfiling/H5subfiling_common.h b/src/H5FDsubfiling/H5subfiling_common.h index 156902a5c5c..6b5cfa45c27 100644 --- a/src/H5FDsubfiling/H5subfiling_common.h +++ b/src/H5FDsubfiling/H5subfiling_common.h @@ -269,6 +269,7 @@ H5_DLL herr_t H5_close_subfiles(int64_t subfiling_context_id, MPI_Comm file_comm H5_DLL int64_t H5_new_subfiling_object_id(sf_obj_type_t obj_type); H5_DLL void *H5_get_subfiling_object(int64_t object_id); +H5_DLL herr_t H5_free_subfiling_object(int64_t object_id); H5_DLL herr_t H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64_t *num_subfiles); H5_DLL herr_t H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepath); diff --git a/src/H5FO.c b/src/H5FO.c index 66e5ba46fbd..534acbe6905 100644 --- a/src/H5FO.c +++ b/src/H5FO.c @@ -25,6 +25,7 @@ #include "H5FLprivate.h" /* Free lists */ #include "H5FOprivate.h" /* File objects */ #include "H5Oprivate.h" /* Object headers */ +#include "H5SLprivate.h" /* Skip Lists */ /* Private typedefs */ diff --git a/src/H5FS.c b/src/H5FS.c index c21ecf298ef..64bf51f5d46 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -28,9 +28,11 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5FScache.c b/src/H5FScache.c index 94c414f1eac..3fa31f00042 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -35,6 +35,7 @@ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ +#include "H5SLprivate.h" /* Skip Lists */ #include "H5VMprivate.h" /* Vectors and arrays */ /****************/ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 9bf2af0cff5..57022a2c02c 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -29,8 +29,10 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5FSpkg.h" /* File free space */ #include "H5MFprivate.h" /* File memory management */ +#include "H5SLprivate.h" /* Skip Lists */ #include "H5VMprivate.h" /* Vectors and arrays */ /****************/ diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 758b0150801..9c4c8cdbbda 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -33,6 +33,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5FDprivate.h" /* File drivers */ #include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 82de9e6dae0..fa7dd1e6d0b 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -28,9 +28,11 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip Lists */ /* Special values for the "tag" field below */ #define H5F_EFC_TAG_DEFAULT (-1) diff --git a/src/H5Ffake.c b/src/H5Ffake.c index 81aa7627637..ad9fc8fb2ff 100644 --- a/src/H5Ffake.c +++ b/src/H5Ffake.c @@ -13,9 +13,10 @@ #include "H5Fmodule.h" /* This source code file is part of the H5F module */ /* Packages needed by this file... */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ /* PRIVATE PROTOTYPES */ diff --git a/src/H5Fint.c b/src/H5Fint.c index 76515bcd8a1..325947656bf 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -27,6 +27,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gprivate.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ @@ -1299,7 +1300,8 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F if (NULL == (f->shared->mdc_log_location = (char *)H5MM_calloc((len + 1) * sizeof(char)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate memory for mdc log file name"); - strncpy(f->shared->mdc_log_location, mdc_log_location, len); + strncpy(f->shared->mdc_log_location, mdc_log_location, len + 1); + f->shared->mdc_log_location[len] = '\0'; } else f->shared->mdc_log_location = NULL; @@ -2781,6 +2783,7 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n h5_stat_t lst; /* Stat info from lstat() call */ /* Call lstat() on the file's name */ + memset(&lst, 0, sizeof(h5_stat_t)); if (HDlstat(name, &lst) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve stat info for file"); @@ -2823,12 +2826,14 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve POSIX file descriptor"); /* Stat the filename we're resolving */ + memset(&st, 0, sizeof(h5_stat_t)); if (HDstat(name, &st) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to stat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to stat file"); /* Stat the file we opened */ + memset(&fst, 0, sizeof(h5_stat_t)); if (HDfstat(*fd, &fst) < 0) - HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to fstat file") + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to fstat file"); /* Verify that the files are really the same */ if (st.st_mode != fst.st_mode || st.st_ino != fst.st_ino || st.st_dev != fst.st_dev) diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index bf54976ab14..098e703eac9 100644 --- a/src/H5Fmodule.h +++ b/src/H5Fmodule.h @@ -239,7 +239,7 @@ * page under * * Libraries and Tools Reference. - * The HDF5 DDL grammar is described in the document \ref DDLBNF110. + * The HDF5 DDL grammar is described in the document \ref DDLBNF114. * * \subsection subsec_file_summary File Function Summaries * General library (\ref H5 functions and macros), (\ref H5F functions), file related diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 2d27579b67e..18492486700 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -24,6 +24,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5Gcache.c b/src/H5Gcache.c index 8a908131482..9e34e77c253 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5Gint.c b/src/H5Gint.c index 1be54ed3ac8..46559d82291 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5FOprivate.h" /* File objects */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Gmodule.h b/src/H5Gmodule.h index c330fcdb400..7ae700a1a36 100644 --- a/src/H5Gmodule.h +++ b/src/H5Gmodule.h @@ -199,11 +199,11 @@ * slash is a always a member of the component indicated by the link name preceding that slash. * * The first component in the path name may be any of the following: - * \li The special character dot (., a period), indicating the current group + * \li The special character dot (., a single period), indicating the current group * \li The special character slash (/), indicating the root group * \li Any member of the current group * - * Component link names may be any string of ASCII characters not containing a slash or a dot + * Component link names may be any string of ASCII characters not containing a slash or a single dot * (/ and ., which are reserved as noted above). However, users are advised to avoid the use of * punctuation and non-printing characters, as they may create problems for other software. The * figure below provides a BNF grammar for HDF5 path names. @@ -343,7 +343,7 @@ * * h5dump is described on the “HDF5 Tools” page of the \ref RM. * - * The HDF5 DDL grammar is described in the @ref DDLBNF110. + * The HDF5 DDL grammar is described in the @ref DDLBNF114. * * \subsection subsec_group_function Group Function Summaries * Functions that can be used with groups (\ref H5G functions) and property list functions that can used diff --git a/src/H5Goh.c b/src/H5Goh.c index b72406f61b2..ce98960e8aa 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -22,6 +22,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ diff --git a/src/H5Groot.c b/src/H5Groot.c index 7d4a2521319..0b524b7b4de 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -32,6 +32,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5HF.c b/src/H5HF.c index 856d792c95a..bbc5ce7e455 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -35,6 +35,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5HFcache.c b/src/H5HFcache.c index b214a1ca1b4..823e2dea28e 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index 62f6d8a07ac..8a6df298482 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5HFhdr.c b/src/H5HFhdr.c index da9d014b4bc..9f457385c31 100644 --- a/src/H5HFhdr.c +++ b/src/H5HFhdr.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 6c273a838e0..6ec2d763711 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5HFiter.c b/src/H5HFiter.c index 8a347e71787..9fc564d09cd 100644 --- a/src/H5HFiter.c +++ b/src/H5HFiter.c @@ -30,6 +30,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5VMprivate.h" /* Vectors and arrays */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index df30f8cdec9..2a61ad43a2a 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -25,6 +25,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HFpkg.h" /* Fractal heaps */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5HG.c b/src/H5HG.c index 26bc59757bb..7037376118d 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -43,6 +43,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HGpkg.h" /* Global heaps */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 6e42a7c624d..f885ecf973a 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -31,6 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5HGpkg.h" /* Global heaps */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5MFsection.c b/src/H5MFsection.c index 3b81960c975..03d1112624e 100644 --- a/src/H5MFsection.c +++ b/src/H5MFsection.c @@ -25,10 +25,11 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* File access */ -#include "H5MFpkg.h" /* File memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* File access */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5MFpkg.h" /* File memory management */ /****************/ /* Local Macros */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 6852ebc9796..6d1d23740f7 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -17,6 +17,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Spkg.h" /* Dataspaces */ diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index e131d679421..37ce88b5759 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -28,9 +28,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Opkg.h" /* Object headers */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Opkg.h" /* Object headers */ /****************/ /* Local Macros */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index e87a7701458..f2f307e82db 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -39,6 +39,7 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index 62dc221dcdd..c509732dfb8 100644 --- a/src/H5Ocopy_ref.c +++ b/src/H5Ocopy_ref.c @@ -32,6 +32,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ @@ -64,7 +65,7 @@ static herr_t H5O__copy_expand_ref_object1(H5O_loc_t *src_oloc, const void *buf_ static herr_t H5O__copy_expand_ref_region1(H5O_loc_t *src_oloc, const void *buf_src, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, void *buf_dst, size_t ref_count, H5O_copy_t *cpy_info); -static herr_t H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, H5T_t *dt_src, const void *buf_src, +static herr_t H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, const H5T_t *dt_src, const void *buf_src, size_t nbytes_src, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, void *buf_dst, size_t ref_count, H5O_copy_t *cpy_info); @@ -284,7 +285,7 @@ H5O__copy_expand_ref_region1(H5O_loc_t *src_oloc, const void *buf_src, H5O_loc_t *------------------------------------------------------------------------- */ static herr_t -H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, H5T_t *dt_src, const void *buf_src, size_t nbytes_src, +H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, const H5T_t *dt_src, const void *buf_src, size_t nbytes_src, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, void *buf_dst, size_t ref_count, H5O_copy_t *cpy_info) { @@ -411,7 +412,7 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, H5T_t *dt_src, const void *buf *------------------------------------------------------------------------- */ herr_t -H5O_copy_expand_ref(H5F_t *file_src, H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, +H5O_copy_expand_ref(H5F_t *file_src, const H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info) { H5O_loc_t dst_oloc; /* Copied object object location */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index c1bb70ff146..a481275d5b8 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -533,8 +533,8 @@ H5O__fill_copy(const void *_src, void *_dst) { const H5O_fill_t *src = (const H5O_fill_t *)_src; H5O_fill_t *dst = (H5O_fill_t *)_dst; - H5T_t *src_type = NULL; H5T_t *dst_type = NULL; + H5T_t *tmp_type = NULL; void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -576,10 +576,13 @@ H5O__fill_copy(const void *_src, void *_dst) uint8_t *bkg_buf = NULL; /* Background conversion buffer */ size_t bkg_size; /* Size of background buffer */ - if (NULL == (src_type = H5T_copy(src->type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy source datatype"); - if (NULL == (dst_type = H5T_copy(dst->type, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy destination datatype"); + dst_type = dst->type; + if (H5T_detect_class(dst_type, H5T_VLEN, false) > 0 || + H5T_detect_class(dst_type, H5T_REFERENCE, false) > 0) { + if (NULL == (tmp_type = H5T_copy(dst_type, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy destination datatype"); + dst_type = tmp_type; + } /* Allocate a background buffer */ bkg_size = MAX(H5T_get_size(dst->type), H5T_get_size(src->type)); @@ -587,7 +590,7 @@ H5O__fill_copy(const void *_src, void *_dst) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); /* Convert fill value */ - if (H5T_convert(tpath, src_type, dst_type, (size_t)1, (size_t)0, (size_t)0, dst->buf, + if (H5T_convert(tpath, src->type, dst_type, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf) < 0) { if (bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); @@ -607,9 +610,7 @@ H5O__fill_copy(const void *_src, void *_dst) ret_value = dst; done: - if (src_type && (H5T_close(src_type) < 0)) - HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, NULL, "unable to close temporary datatype"); - if (dst_type && (H5T_close(dst_type) < 0)) + if (tmp_type && (H5T_close(tmp_type) < 0)) HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, NULL, "unable to close temporary datatype"); if (!ret_value && dst) { @@ -939,9 +940,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, bool *fill_changed) { H5T_path_t *tpath; /* Type conversion info */ void *buf = NULL, *bkg = NULL; /* Conversion buffers */ - H5T_t *src_type = NULL; - H5T_t *dst_type = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -972,11 +971,6 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, bool *fill_changed) if (!H5T_path_noop(tpath)) { size_t fill_type_size; - if (NULL == (src_type = H5T_copy(fill->type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy fill value datatype"); - if (NULL == (dst_type = H5T_copy(dset_type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy dataset's datatype"); - /* * Datatype conversions are always done in place, so we need a buffer * that is large enough for both source and destination. @@ -993,7 +987,7 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, bool *fill_changed) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); /* Do the conversion */ - if (H5T_convert(tpath, src_type, dst_type, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) + if (H5T_convert(tpath, fill->type, dset_type, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "datatype conversion failed"); /* Update the fill message */ @@ -1010,10 +1004,6 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, bool *fill_changed) } /* end if */ done: - if (src_type && (H5T_close(src_type) < 0)) - HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (dst_type && (H5T_close(dst_type) < 0)) - HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); if (bkg) H5MM_xfree(bkg); diff --git a/src/H5Oint.c b/src/H5Oint.c index 39d8c2d976e..537563dbbad 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -39,6 +39,7 @@ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ +#include "H5SLprivate.h" /* Skip Lists */ #include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5VLnative_private.h" /* Native VOL connector */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index f312a3c94b0..6f3d39d1e83 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -985,7 +985,7 @@ H5_DLL herr_t H5O_refresh_metadata_reopen(hid_t oid, hid_t apl_id, H5G_loc_t *ob /* Object copying routines */ H5_DLL herr_t H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, H5O_copy_t *cpy_info, bool inc_depth, H5O_type_t *obj_type, void **udata); -H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, H5T_t *dt_src, void *buf_src, size_t nbytes_src, +H5_DLL herr_t H5O_copy_expand_ref(H5F_t *file_src, const H5T_t *dt_src, void *buf_src, size_t nbytes_src, H5F_t *file_dst, void *buf_dst, H5O_copy_t *cpy_info); /* Debugging routines */ diff --git a/src/H5PB.c b/src/H5PB.c index b941225c7db..fc09cd56e96 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -33,6 +33,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ #include "H5PBpkg.h" /* File access */ #include "H5SLprivate.h" /* Skip List */ diff --git a/src/H5PLmodule.h b/src/H5PLmodule.h index 37654869746..4d0396a5bf5 100644 --- a/src/H5PLmodule.h +++ b/src/H5PLmodule.h @@ -27,7 +27,259 @@ #define H5_MY_PKG_ERR H5E_PLUGIN /** \page H5PL_UG The HDF5 Plugins - * @todo Under Construction + * + * \section sec_filter_plugins HDF5 Filter Plugins + * + * \subsection subsec_filter_plugins_intro Introduction + * HDF5 supports compression of data using a stackable pipeline of filters which can be + * implemented for reading and writing datasets, both at runtime and post‐process. + * These filters are supported as dynamically loadable plugins, and users can even + * implement custom filters of their own design. + * + * \subsection subsec_filter_plugins_model Programming Model for Applications + * This section describes the programming model for an application that uses a third-party HDF5 filter + * plugin to write or read data. For simplicity of presentation, it is assumed that the HDF5 filter plugin is + * available on the system in a default location. The HDF5 filter plugin is discussed in detail in the + * \ref subsec_filter_plugins_prog section. + * + * \subsubsection subsubsec_filter_plugins_model_apply Applying a Third-party Filter When Creating and Writing + * a Dataset A third-party filter can be added to the HDF5 filter pipeline by using the H5Pset_filter + * function, as a user would do in the past. The identification number and the filter parameters should be + * available to the application. For example, if the application intends to apply the HDF5 bzip2 compression + * filter that was registered with The HDF Group and has an identification number 307 + * (Registered + * Filters) then the application would follow the steps as outlined below: \code dcpl = H5Pcreate + * (H5P_DATASET_CREATE); status = H5Pset_filter (dcpl, (H5Z_filter_t)307, H5Z_FLAG_MANDATORY, (size_t)6, + * cd_values); dset = H5Dcreate (file, DATASET, H5T_STD_I32LE, space, H5P_DEFAULT, dcpl, status = H5Dwrite + * (dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata[0]); \endcode + * + * \subsubsection subsubsec_filter_plugins_model_read Reading Data with an Applied Third-party Filter + * An application does not need to do anything special to read the data with a third-party filter applied. For + * example, if one wants to read data written in the previous example, the following regular steps should be + * taken: \code file = H5Fopen (FILE, H5F_ACC_RDONLY, H5P_DEFAULT); dset = H5Dopen (file, DATASET, + * H5P_DEFAULT); H5Dread (dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata[0]); \endcode + * + * The command-line utility h5dump, for example, will read and display the data as shown: + * \code + * HDF5 "h5ex_d_bzip2.h5" { + * GROUP "/" { + * DATASET "DS1" { + * DATATYPE H5T_STD_I32LE + * DATASPACE SIMPLE { ( 32, 64 ) / ( 32, 64 ) } + * STORAGE_LAYOUT { + * CHUNKED ( 4, 8 ) + * SIZE 6410 (1.278:1 COMPRESSION) + * } + * FILTERS { + * USER_DEFINED_FILTER { + * FILTER_ID 307 + * COMMENT HDF5 bzip2 filter; see + * https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md + * PARAMS { 2 } + * } + * } + * FILLVALUE { + * FILL_TIME H5D_FILL_TIME_IFSET + * VALUE H5D_FILL_VALUE_DEFAULT + * } + * ALLOCATION_TIME { + * H5D_ALLOC_TIME_INCR + * } + * DATA { + * ... + * } + * } + * } + * } + * \endcode + * + * If the filter can not be loaded then h5dump will show the following: + * \code + * ... + * } + * DATA {h5dump error: unable to print data + * } + * ... + * \endcode + * + * \subsubsection subsubsec_filter_plugins_model_custom A Word of Caution When Using Custom Filters + * Data goes through the HDF5 filter pipeline only when it is written to the file or read into application + * memory space from the file. For example, the I/O operation is triggered with a call to #H5Fflush, or when + * a data item (HDF5 metadata or a raw data chunk) is evicted from the cache or brought into the cache. + * Please notice that #H5Dread/#H5Dwrite calls on the chunked datasets do not necessarily trigger I/O since + * the HDF5 Library uses a separate chunk cache. + * + * A data item may remain in the cache until the HDF5 Library is closed. If the HDF5 plugin that has to be + * applied to the data item becomes unavailable before the file and all objects in the file are closed, an + * error will occur. The following example demonstrates the issue. Please notice the position of the + * #H5Zunregister call: + * + * \code + * // Create a new group using compression. + * gcpl = H5Pcreate (H5P_GROUP_CREATE); + * status = H5Pset_filter(gcpl,H5Z_FILTER_BZIP2,H5Z_FLAG_MANDATORY,(size_t)1, cd_values); + * group = H5Gcreate (file, GNAME, H5P_DEFAULT, gcpl, H5P_DEFAULT); + * for (i=0; i < NGROUPS; i++) { + * sprintf(name, "group_%d", i); + * tmp_id = H5Gcreate (group, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + * status = H5Gclose(tmp_id); + * } + * + * status = H5Pclose (gcpl); + * status = H5Gclose (group); + * + * // Unregister the filter. Call to H5Fclose will fail because the library tries + * // to apply the filter that is not available anymore. This has a cascade effect + * // on H5Fclose. + * H5Zunregister(H5Z_FILTER_BZIP2); + * status = H5Fclose (file); + * \endcode + * + * Here is an error stack produced by the program: + * \code + * HDF5-DIAG: Error detected in HDF5 (xx.yy.zz) thread 0: + * #000: H5F.c line **** in H5Fclose(): decrementing file ID failed + * major: Object atom + * minor: Unable to close file + * #001: H5I.c line **** in H5I_dec_app_ref(): can't decrement ID ref count + * major: Object atom + * minor: Unable to decrement reference count + * #002: H5F.c line **** in H5F_close(): can't close file + * major: File accessibility + * minor: Unable to close file + * ... + * #026: H5Z.c line **** in H5Z_find(): required filter is not registered + * major: Data filters + * minor: Object not found + * \endcode + * + * To avoid the problem make sure to close all objects to which the filter is applied and flush them using + * the H5Fflush call before unregistering the filter. + * + * \subsection subsec_filter_plugins_prog Programming Model for HDF5 Filter Plugins + * This section describes how to create an HDF5 filter, an HDF5 filter plugin, and how to install the HDF5 + * plugin on the system. + * + * \subsubsection subsubsec_filter_plugins_prog_write Writing a Filter Function + * The HDF5 filter function for the dynamically loaded filter feature should be written as any custom filter + * described in Custom Filters. See the + * “Example” section, section 5, of that document to get an idea of the simple filter function, and see the + * example of the more sophisticated HDF5 bzip2 filter function in the “Building an HDF5 bzip2 Plugin Example” + * section. The HDF5 bzip2 filter function is also available for download from Filter Plugin Repository. + * + * The user has to remember a few things when writing an HDF5 filter function. + *
    • 1. An HDF5 filter is bidirectional. + * The filter handles both input and output to the file; a flag is passed to the filter to indicate the + * direction.
    • + *
    • 2. An HDF5 filter operates on a buffer. + * The filter reads data from a buffer, performs some sort of transformation on the data, places + * the result in the same or new buffer, and returns the buffer pointer and size to the caller.
    • + *
    • 3. An HDF5 filter should return zero in the case of failure.
    + * + * The signature of the HDF5 filter function and the accompanying filter structure (see the section below) + * are described in the HDF5 Reference Manual #H5Z_filter_t. + * + * \subsubsection subsubsec_filter_plugins_prog_reg Registering a Filter with The HDF Group + * If you are writing a filter that will be used by others, it would be a good idea to request a filter + * identification number and register it with The HDF Group. Please follow the procedure described at + * Registered + * Filters. + * + * The HDF Group anticipates that developers of HDF5 filter plugins will not only register new filters, but + * will also provide links to the source code and/or binaries for the corresponding HDF5 filter plugins. + * + * It is very important for the users of the filter that developers provide filter information in the “name” + * field of the filter structure, for example: + * \code + * const H5Z_class2_t H5Z_BZIP2[1] = {{ + * H5Z_CLASS_T_VERS, // H5Z_class_t version + * (H5Z_filter_t)H5Z_FILTER_BZIP2, // Filter id number + * 1, // encoder_present flag (set to true) + * 1, // decoder_present flag (set to true) + * "HDF5 bzip2 filter; see + * https://github.com/HDFGroup/hdf5_plugins/blob/master/docs/RegisteredFilterPlugins.md", + * // Filter name for debugging + * NULL, // The "can apply" callback + * NULL, // The "set local" callback + * (H5Z_func_t)H5Z_filter_bzip2, // The actual filter function + * }}; + * \endcode + * + * The HDF5 Library and command-line tools have access to the “name” field. An application can + * use the H5Pget_filter<*> functions to retrieve information about the filters. + * + * Using the example of the structure above, the h5dump tool will print the string “HDF5 bzip2 + * filter found at …” pointing users to the applied filter (see the example in the \ref + * subsubsec_filter_plugins_model_read section) thus solving the problem of the filter’s origin. + * + * \subsubsection subsubsec_filter_plugins_prog_create Creating an HDF5 Filter Plugin + * The HDF5 filter plugin source should include: + *
    • 1. The H5PLextern.h header file from the HDF5 distribution.
    • + *
    • 2. The definition of the filter structure (see the example shown in the section above).
    • + *
    • 3. The filter function (for example, H5Z_filter_bzip2).
    • + *
    • 4. The two functions necessary for the HDF5 Library to find the correct type of the plugin library + * while loading it at runtime and to get information about the filter function: + * + *
      H5PL_type_t H5PLget_plugin_type(void);
      const void* H5PLget_plugin_info(void);
      + * Here is an example of the functions above for the HDF5 bzip2 filter: + * + *
      H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
      const void* H5PLget_plugin_info(void) {return H5Z_BZIP2;}
      + *
    • + *
    • 5. Other functions such as the source of the compression library may also be included.
    • + *
    + * Build the HDF5 filter plugin as a shared library. The following steps should be taken: + *
    • 1. When compiling, point to the HDF5 header files.
    • + *
    • 2. Use the appropriate linking flags.
    • + *
    • 3. Link with any required external libraries.
    • + *
    • 4. For example, if libbz2.so is installed on a Linux system, the HDF5 bzip2 plugin library + * libH5Zbzip2.so may be linked with libbz2.so instead of including bzip2 source into the + * plugin library. + * The complete example of the HDF5 bzip2 plugin library is provided at + * BZIP2 Filter Plugin + * and can be adopted for other plugins.
    + * + * \subsubsection subsubsec_filter_plugins_prog_install Installing an HDF5 Filter Plugin + * The default directory for an HDF5 filter plugin library is defined on UNIX-like systems as + * \code + * “/usr/local/hdf5/lib/plugin” + * \endcode + * and on Windows systems as + * \code + * "%ALLUSERSPROFILE%/hdf5/lib/plugin". + * \endcode + * + * The default path can be overwritten by a user with the #HDF5_PLUGIN_PATH environment variable. + * Several directories can be specified for the search path using “:” as a path separator for UNIX-like + * systems and “;” for Windows. + * + * Readers are encouraged to try the example in the “Building an HDF5 bzip2 Plugin Example” section. + * + * \subsection subsec_filter_plugins_design Design + * Dynamic loading of the HDF5 filter plugin (or filter library) is triggered only by two events: when an + * application calls the #H5Pset_filter function to set the filter for the first time, or when the data to + * which the filter is applied is read for the first time. + * + * \subsection subsec_filter_plugins_build Building an HDF5 bzip2 Plugin Example + * The HDF Group provides an repository of the HDF5 filter plugin that can be checked out from + * BZIP2 Filter Plugin. + * + * It contains the source code for the bzip2 + * plugin library and an example that uses the plugin. It requires the HDF5 Library with the dynamically + * loaded feature and the bzip2 library being available on the system. + * The plugin and the example can be built using configure or CMake commands. For instructions on how + * to build with CMake, see the README.txt file in the source code distribution. The bzip2 library that can + * be built with CMake is available from: + * \code + * GIT_URL: "https://github.com/libarchive/bzip2.git" + * GIT_BRANCH: "master" + * \endcode + * + * See the documentation at + * hdf5_plugins/docs folder. In + * particular: + * INSTALL_With_CMake + * USING_HDF5_AND_CMake */ /** @@ -36,26 +288,6 @@ * Use the functions in this module to manage the loading behavior of HDF5 * plugins. * - * - * - * - * - * - * - * - * - * - * - *
    CreateRead
    - * \snippet H5PL_examples.c create - * - * \snippet H5PL_examples.c read - *
    UpdateDelete
    - * \snippet H5PL_examples.c update - * - * \snippet H5PL_examples.c delete - *
    - * * \attention The loading behavior of HDF5 plugins can be controlled via the * functions described below and certain environment variables, such * as \c HDF5_PLUGIN_PRELOAD and \c HDF5_PLUGIN_PATH. diff --git a/src/H5PLpath.c b/src/H5PLpath.c index 4dd4b17afe7..02e7d25d4d5 100644 --- a/src/H5PLpath.c +++ b/src/H5PLpath.c @@ -645,6 +645,7 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type snprintf(path, len, "%s/%s", plugin_path, dp->d_name); /* Get info for directory entry */ + memset(&my_stat, 0, sizeof(h5_stat_t)); if (HDstat(path, &my_stat) == -1) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5_ITER_ERROR, "can't stat file %s -- error was: %s", path, strerror(errno)); @@ -882,6 +883,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found snprintf(path, len, "%s/%s", dir, dp->d_name); /* Get info for directory entry */ + memset(&my_stat, 0, sizeof(h5_stat_t)); if (HDstat(path, &my_stat) == -1) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file %s -- error was: %s", path, strerror(errno)); diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 96cb52aa9e2..8f0ba04745d 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -3084,7 +3084,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ void *buf = NULL; /*conversion buffer */ void *bkg = NULL; /*conversion buffer */ H5T_t *src_type = NULL; /*source datatype */ - H5T_t *dst_type = NULL; /*destination datatype */ + H5T_t *tmp_type = NULL; /*temporary datatype */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3111,10 +3111,14 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ */ if (NULL == (tpath = H5T_path_find(fill.type, type))) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to convert between src and dst datatypes"); - if (NULL == (src_type = H5T_copy(fill.type, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy fill value datatype"); - if (NULL == (dst_type = H5T_copy(type, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy memory datatype"); + + src_type = fill.type; + if (H5T_detect_class(src_type, H5T_VLEN, false) > 0 || + H5T_detect_class(src_type, H5T_REFERENCE, false) > 0) { + if (NULL == (tmp_type = H5T_copy(src_type, H5T_COPY_TRANSIENT))) + HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy fill value datatype"); + src_type = tmp_type; + } /* * Data type conversions are always done in place, so we need a buffer @@ -3135,7 +3139,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ H5MM_memcpy(buf, fill.buf, H5T_get_size(fill.type)); /* Do the conversion */ - if (H5T_convert(tpath, src_type, dst_type, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) + if (H5T_convert(tpath, src_type, type, (size_t)1, (size_t)0, (size_t)0, buf, bkg) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "datatype conversion failed"); if (buf != value) H5MM_memcpy(value, buf, H5T_get_size(type)); @@ -3145,9 +3149,7 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ H5MM_xfree(buf); if (bkg != value) H5MM_xfree(bkg); - if (src_type && H5T_close(src_type) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (dst_type && H5T_close(dst_type) < 0) + if (tmp_type && H5T_close(tmp_type) < 0) HDONE_ERROR(H5E_PLIST, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Pint.c b/src/H5Pint.c index 544ad370249..8f9f5125847 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -29,6 +29,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5RS.c b/src/H5RS.c index b0322be46bc..ad1f1d0c69e 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -30,6 +30,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ +#include "H5MMprivate.h" /* Memory management */ #include "H5RSprivate.h" /* Reference-counted strings */ /****************/ diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index ef0da51544c..6165d664f38 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -20,10 +20,11 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Opkg.h" /* Object Headers */ -#include "H5SMpkg.h" /* Shared object header messages */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Opkg.h" /* Object Headers */ +#include "H5SMpkg.h" /* Shared object header messages */ /****************/ /* Local Macros */ diff --git a/src/H5Spkg.h b/src/H5Spkg.h index 3ae63a50964..fddd5e3c5fa 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -413,6 +413,7 @@ H5_DLL herr_t H5S__get_rebuild_status_test(hid_t space_id, H5S_diminfo_valid_t * H5S_diminfo_valid_t *status2); H5_DLL herr_t H5S__get_diminfo_status_test(hid_t space_id, H5S_diminfo_valid_t *status); H5_DLL htri_t H5S__internal_consistency_test(hid_t space_id); +H5_DLL herr_t H5S__verify_offsets(hid_t space_id, const hssize_t *offset); #endif /* H5S_TESTING */ #endif /*H5Spkg_H*/ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index b8cd20c7f9e..8fd73f54740 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -106,7 +106,7 @@ typedef struct H5S_sel_iter_t { } H5S_sel_iter_t; /* Selection iteration operator for internal library callbacks */ -typedef herr_t (*H5S_sel_iter_lib_op_t)(void *elem, H5T_t *type, unsigned ndim, const hsize_t *point, +typedef herr_t (*H5S_sel_iter_lib_op_t)(void *elem, const H5T_t *type, unsigned ndim, const hsize_t *point, void *op_data); /* Describe kind of callback to make */ @@ -231,32 +231,32 @@ H5_DLL herr_t H5S_extent_copy(H5S_t *dst, const H5S_t *src); /* Operations on selections */ H5_DLL herr_t H5S_select_deserialize(H5S_t **space, const uint8_t **p, const size_t p_size); H5_DLL H5S_sel_type H5S_get_select_type(const H5S_t *space); -H5_DLL herr_t H5S_select_iterate(void *buf, H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op, - void *op_data); -H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *buf); -H5_DLL htri_t H5S_select_valid(const H5S_t *space); -H5_DLL hsize_t H5S_get_select_npoints(const H5S_t *space); -H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); -H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset); -H5_DLL int H5S_get_select_unlim_dim(const H5S_t *space); -H5_DLL herr_t H5S_get_select_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim); -H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset); -H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, bool share_selection); -H5_DLL htri_t H5S_select_shape_same(H5S_t *space1, H5S_t *space2); -H5_DLL htri_t H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end); -H5_DLL herr_t H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, - unsigned new_space_rank, hsize_t element_size, - ptrdiff_t *buf_adj); -H5_DLL herr_t H5S_select_release(H5S_t *ds); -H5_DLL hssize_t H5S_select_serial_size(H5S_t *space); -H5_DLL herr_t H5S_select_serialize(H5S_t *space, uint8_t **p); -H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space); -H5_DLL htri_t H5S_select_is_single(const H5S_t *space); -H5_DLL htri_t H5S_select_is_regular(H5S_t *space); -H5_DLL herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset); -H5_DLL herr_t H5S_select_adjust_s(H5S_t *space, const hssize_t *offset); -H5_DLL herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset); -H5_DLL herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); +H5_DLL herr_t H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op, + void *op_data); +H5_DLL herr_t H5S_select_fill(const void *fill, size_t fill_size, H5S_t *space, void *buf); +H5_DLL htri_t H5S_select_valid(const H5S_t *space); +H5_DLL hsize_t H5S_get_select_npoints(const H5S_t *space); +H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); +H5_DLL herr_t H5S_get_select_offset(const H5S_t *space, hsize_t *offset); +H5_DLL int H5S_get_select_unlim_dim(const H5S_t *space); +H5_DLL herr_t H5S_get_select_num_elem_non_unlim(const H5S_t *space, hsize_t *num_elem_non_unlim); +H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset); +H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, bool share_selection); +H5_DLL htri_t H5S_select_shape_same(H5S_t *space1, H5S_t *space2); +H5_DLL htri_t H5S_select_intersect_block(H5S_t *space, const hsize_t *start, const hsize_t *end); +H5_DLL herr_t H5S_select_construct_projection(H5S_t *base_space, H5S_t **new_space_ptr, + unsigned new_space_rank, hsize_t element_size, + ptrdiff_t *buf_adj); +H5_DLL herr_t H5S_select_release(H5S_t *ds); +H5_DLL hssize_t H5S_select_serial_size(H5S_t *space); +H5_DLL herr_t H5S_select_serialize(H5S_t *space, uint8_t **p); +H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space); +H5_DLL htri_t H5S_select_is_single(const H5S_t *space); +H5_DLL htri_t H5S_select_is_regular(H5S_t *space); +H5_DLL herr_t H5S_select_adjust_u(H5S_t *space, const hsize_t *offset); +H5_DLL herr_t H5S_select_adjust_s(H5S_t *space, const hssize_t *offset); +H5_DLL herr_t H5S_select_project_scalar(const H5S_t *space, hsize_t *offset); +H5_DLL herr_t H5S_select_project_simple(const H5S_t *space, H5S_t *new_space, hsize_t *offset); H5_DLL herr_t H5S_select_project_intersection(H5S_t *src_space, H5S_t *dst_space, H5S_t *src_intersect_space, H5S_t **new_space_ptr, bool share_space); H5_DLL herr_t H5S_select_subtract(H5S_t *space, H5S_t *subtract_space); diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 5422d96bcbf..bf9e9118f64 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -832,12 +832,16 @@ H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_i * \p space_id. The offset array must be the same number of * elements as the number of dimensions for the dataspace. If the * \p offset array is set to NULL, the offset for the dataspace is - * reset to 0. + * reset to 0 in all dimensions. * * This function allows the same shaped selection to be moved to * different locations within a dataspace without requiring it to * be redefined. * + * \note Until 1.14.4, setting the offset parameter to NULL was considered + * an error, despite the reference manual stating that it had the + * behavior described above. + * * \version 1.4.0 Fortran subroutine was introduced. * \since 1.0.0 * diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 477e0f840c1..d67b8e6f7e0 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -81,11 +81,6 @@ H5FL_SEQ_EXTERN(hsize_t); Non-negative on success/Negative on failure DESCRIPTION Sets the selection offset for the dataspace - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - Only works for simple dataspaces currently - EXAMPLES - REVISION LOG --------------------------------------------------------------------------*/ herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset) @@ -95,10 +90,14 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset) /* Check args */ assert(space); assert(0 < space->extent.rank && space->extent.rank <= H5S_MAX_RANK); - assert(offset); - /* Copy the offset over */ - H5MM_memcpy(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank); + /* Copy the offset over. As a special case, when offset is NULL, we + * reset all dimensions to zero. + */ + if (offset) + H5MM_memcpy(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank); + else + memset(space->select.offset, 0, sizeof(hssize_t) * space->extent.rank); /* Indicate that the offset was changed */ space->select.offset_changed = true; @@ -133,12 +132,12 @@ H5Soffset_simple(hid_t space_id, const hssize_t *offset) /* Check args */ if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ID, H5E_BADID, FAIL, "not a dataspace"); + HGOTO_ERROR(H5E_DATASPACE, H5E_BADID, FAIL, "not a dataspace"); if (space->extent.rank == 0 || (H5S_GET_EXTENT_TYPE(space) == H5S_SCALAR || H5S_GET_EXTENT_TYPE(space) == H5S_NULL)) - HGOTO_ERROR(H5E_ID, H5E_UNSUPPORTED, FAIL, "can't set offset on scalar or null dataspace"); - if (offset == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no offset specified"); + HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "can't set offset on scalar or null dataspace"); + + /* offset can be NULL (resets all dims to zero) */ /* Set the selection offset */ if (H5S_select_offset(space, offset) < 0) @@ -1357,7 +1356,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter) the selection is not modified. --------------------------------------------------------------------------*/ herr_t -H5S_select_iterate(void *buf, H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op, void *op_data) +H5S_select_iterate(void *buf, const H5T_t *type, H5S_t *space, const H5S_sel_iter_op_t *op, void *op_data) { H5S_sel_iter_t *iter = NULL; /* Selection iteration info */ bool iter_init = false; /* Selection iteration info has been initialized */ diff --git a/src/H5Stest.c b/src/H5Stest.c index 4978de0558e..422f7c1d20f 100644 --- a/src/H5Stest.c +++ b/src/H5Stest.c @@ -341,11 +341,6 @@ H5S__check_internal_consistency(const H5S_t *space) DESCRIPTION Check the states of internal data structures of the hyperslab, and see whether they are consistent or not - GLOBAL VARIABLES - COMMENTS, BUGS, ASSUMPTIONS - DO NOT USE THIS FUNCTION FOR ANYTHING EXCEPT TESTING - EXAMPLES - REVISION LOG --------------------------------------------------------------------------*/ htri_t H5S__internal_consistency_test(hid_t space_id) @@ -367,3 +362,40 @@ H5S__internal_consistency_test(hid_t space_id) done: FUNC_LEAVE_NOAPI(ret_value) } /* H5S__internal_consistency_test() */ + +/*-------------------------------------------------------------------------- + NAME + H5S__verify_offsets + PURPOSE + Verify that internal offsets match an array of offsets + USAGE + herr_t H5S__verify_offsets(hid_t space_id) + hid_t space_id; IN: dataspace id + const hssize_t *offset; IN: Offset to position the selection at + RETURNS + Non-negative true/false on success, negative on failure + DESCRIPTION + This function is necessary because there is no public API call + that lets you get the offsets +--------------------------------------------------------------------------*/ +herr_t +H5S__verify_offsets(hid_t space_id, const hssize_t *offset) +{ + H5S_t *space; /* Dataspace to modify */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADID, FAIL, "not a dataspace"); + if (space->extent.rank == 0 || + (H5S_GET_EXTENT_TYPE(space) == H5S_SCALAR || H5S_GET_EXTENT_TYPE(space) == H5S_NULL)) + HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "can't set offset on scalar or null dataspace"); + + /* Check that the internal and passed-in offset data are the same */ + if (0 != memcmp(space->select.offset, offset, sizeof(hssize_t) * space->extent.rank)) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "internal offsets don't match parameters"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S__verify_offsets() */ diff --git a/src/H5T.c b/src/H5T.c index 7d3db702a84..b9a387eed9e 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -100,6 +100,30 @@ dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; \ } +/* Define the code templates for standard 16-bit floats for the "GUTS" in the H5T_INIT_TYPE macro */ +#define H5T_INIT_TYPE_FLOAT16_COMMON(ENDIANNESS) \ + { \ + H5T_INIT_TYPE_NUM_COMMON(ENDIANNESS) \ + dt->shared->u.atomic.u.f.sign = 15; \ + dt->shared->u.atomic.u.f.epos = 10; \ + dt->shared->u.atomic.u.f.esize = 5; \ + dt->shared->u.atomic.u.f.ebias = 0xf; \ + dt->shared->u.atomic.u.f.mpos = 0; \ + dt->shared->u.atomic.u.f.msize = 10; \ + dt->shared->u.atomic.u.f.norm = H5T_NORM_IMPLIED; \ + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; \ + } + +#define H5T_INIT_TYPE_FLOAT16LE_CORE \ + { \ + H5T_INIT_TYPE_FLOAT16_COMMON(H5T_ORDER_LE) \ + } + +#define H5T_INIT_TYPE_FLOAT16BE_CORE \ + { \ + H5T_INIT_TYPE_FLOAT16_COMMON(H5T_ORDER_BE) \ + } + /* Define the code templates for standard floats for the "GUTS" in the H5T_INIT_TYPE macro */ #define H5T_INIT_TYPE_FLOAT_COMMON(ENDIANNESS) \ { \ @@ -375,102 +399,105 @@ H5T_order_t H5T_native_order_g = H5T_ORDER_ERROR; * If more of these are added, the new ones must be added to the list of * types to reset in H5T_term_package(). */ -hid_t H5T_IEEE_F32BE_g = FAIL; -hid_t H5T_IEEE_F32LE_g = FAIL; -hid_t H5T_IEEE_F64BE_g = FAIL; -hid_t H5T_IEEE_F64LE_g = FAIL; - -hid_t H5T_VAX_F32_g = FAIL; -hid_t H5T_VAX_F64_g = FAIL; - -hid_t H5T_STD_I8BE_g = FAIL; -hid_t H5T_STD_I8LE_g = FAIL; -hid_t H5T_STD_I16BE_g = FAIL; -hid_t H5T_STD_I16LE_g = FAIL; -hid_t H5T_STD_I32BE_g = FAIL; -hid_t H5T_STD_I32LE_g = FAIL; -hid_t H5T_STD_I64BE_g = FAIL; -hid_t H5T_STD_I64LE_g = FAIL; -hid_t H5T_STD_U8BE_g = FAIL; -hid_t H5T_STD_U8LE_g = FAIL; -hid_t H5T_STD_U16BE_g = FAIL; -hid_t H5T_STD_U16LE_g = FAIL; -hid_t H5T_STD_U32BE_g = FAIL; -hid_t H5T_STD_U32LE_g = FAIL; -hid_t H5T_STD_U64BE_g = FAIL; -hid_t H5T_STD_U64LE_g = FAIL; -hid_t H5T_STD_B8BE_g = FAIL; -hid_t H5T_STD_B8LE_g = FAIL; -hid_t H5T_STD_B16BE_g = FAIL; -hid_t H5T_STD_B16LE_g = FAIL; -hid_t H5T_STD_B32BE_g = FAIL; -hid_t H5T_STD_B32LE_g = FAIL; -hid_t H5T_STD_B64BE_g = FAIL; -hid_t H5T_STD_B64LE_g = FAIL; -hid_t H5T_STD_REF_OBJ_g = FAIL; -hid_t H5T_STD_REF_DSETREG_g = FAIL; -hid_t H5T_STD_REF_g = FAIL; - -hid_t H5T_UNIX_D32BE_g = FAIL; -hid_t H5T_UNIX_D32LE_g = FAIL; -hid_t H5T_UNIX_D64BE_g = FAIL; -hid_t H5T_UNIX_D64LE_g = FAIL; - -hid_t H5T_C_S1_g = FAIL; - -hid_t H5T_FORTRAN_S1_g = FAIL; - -hid_t H5T_NATIVE_SCHAR_g = FAIL; -hid_t H5T_NATIVE_UCHAR_g = FAIL; -hid_t H5T_NATIVE_SHORT_g = FAIL; -hid_t H5T_NATIVE_USHORT_g = FAIL; -hid_t H5T_NATIVE_INT_g = FAIL; -hid_t H5T_NATIVE_UINT_g = FAIL; -hid_t H5T_NATIVE_LONG_g = FAIL; -hid_t H5T_NATIVE_ULONG_g = FAIL; -hid_t H5T_NATIVE_LLONG_g = FAIL; -hid_t H5T_NATIVE_ULLONG_g = FAIL; -hid_t H5T_NATIVE_FLOAT_g = FAIL; -hid_t H5T_NATIVE_DOUBLE_g = FAIL; -hid_t H5T_NATIVE_LDOUBLE_g = FAIL; -hid_t H5T_NATIVE_B8_g = FAIL; -hid_t H5T_NATIVE_B16_g = FAIL; -hid_t H5T_NATIVE_B32_g = FAIL; -hid_t H5T_NATIVE_B64_g = FAIL; -hid_t H5T_NATIVE_OPAQUE_g = FAIL; -hid_t H5T_NATIVE_HADDR_g = FAIL; -hid_t H5T_NATIVE_HSIZE_g = FAIL; -hid_t H5T_NATIVE_HSSIZE_g = FAIL; -hid_t H5T_NATIVE_HERR_g = FAIL; -hid_t H5T_NATIVE_HBOOL_g = FAIL; - -hid_t H5T_NATIVE_INT8_g = FAIL; -hid_t H5T_NATIVE_UINT8_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST8_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST8_g = FAIL; -hid_t H5T_NATIVE_INT_FAST8_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST8_g = FAIL; - -hid_t H5T_NATIVE_INT16_g = FAIL; -hid_t H5T_NATIVE_UINT16_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST16_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST16_g = FAIL; -hid_t H5T_NATIVE_INT_FAST16_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST16_g = FAIL; - -hid_t H5T_NATIVE_INT32_g = FAIL; -hid_t H5T_NATIVE_UINT32_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST32_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST32_g = FAIL; -hid_t H5T_NATIVE_INT_FAST32_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST32_g = FAIL; - -hid_t H5T_NATIVE_INT64_g = FAIL; -hid_t H5T_NATIVE_UINT64_g = FAIL; -hid_t H5T_NATIVE_INT_LEAST64_g = FAIL; -hid_t H5T_NATIVE_UINT_LEAST64_g = FAIL; -hid_t H5T_NATIVE_INT_FAST64_g = FAIL; -hid_t H5T_NATIVE_UINT_FAST64_g = FAIL; +hid_t H5T_IEEE_F16BE_g = H5I_INVALID_HID; +hid_t H5T_IEEE_F16LE_g = H5I_INVALID_HID; +hid_t H5T_IEEE_F32BE_g = H5I_INVALID_HID; +hid_t H5T_IEEE_F32LE_g = H5I_INVALID_HID; +hid_t H5T_IEEE_F64BE_g = H5I_INVALID_HID; +hid_t H5T_IEEE_F64LE_g = H5I_INVALID_HID; + +hid_t H5T_VAX_F32_g = H5I_INVALID_HID; +hid_t H5T_VAX_F64_g = H5I_INVALID_HID; + +hid_t H5T_STD_I8BE_g = H5I_INVALID_HID; +hid_t H5T_STD_I8LE_g = H5I_INVALID_HID; +hid_t H5T_STD_I16BE_g = H5I_INVALID_HID; +hid_t H5T_STD_I16LE_g = H5I_INVALID_HID; +hid_t H5T_STD_I32BE_g = H5I_INVALID_HID; +hid_t H5T_STD_I32LE_g = H5I_INVALID_HID; +hid_t H5T_STD_I64BE_g = H5I_INVALID_HID; +hid_t H5T_STD_I64LE_g = H5I_INVALID_HID; +hid_t H5T_STD_U8BE_g = H5I_INVALID_HID; +hid_t H5T_STD_U8LE_g = H5I_INVALID_HID; +hid_t H5T_STD_U16BE_g = H5I_INVALID_HID; +hid_t H5T_STD_U16LE_g = H5I_INVALID_HID; +hid_t H5T_STD_U32BE_g = H5I_INVALID_HID; +hid_t H5T_STD_U32LE_g = H5I_INVALID_HID; +hid_t H5T_STD_U64BE_g = H5I_INVALID_HID; +hid_t H5T_STD_U64LE_g = H5I_INVALID_HID; +hid_t H5T_STD_B8BE_g = H5I_INVALID_HID; +hid_t H5T_STD_B8LE_g = H5I_INVALID_HID; +hid_t H5T_STD_B16BE_g = H5I_INVALID_HID; +hid_t H5T_STD_B16LE_g = H5I_INVALID_HID; +hid_t H5T_STD_B32BE_g = H5I_INVALID_HID; +hid_t H5T_STD_B32LE_g = H5I_INVALID_HID; +hid_t H5T_STD_B64BE_g = H5I_INVALID_HID; +hid_t H5T_STD_B64LE_g = H5I_INVALID_HID; +hid_t H5T_STD_REF_OBJ_g = H5I_INVALID_HID; +hid_t H5T_STD_REF_DSETREG_g = H5I_INVALID_HID; +hid_t H5T_STD_REF_g = H5I_INVALID_HID; + +hid_t H5T_UNIX_D32BE_g = H5I_INVALID_HID; +hid_t H5T_UNIX_D32LE_g = H5I_INVALID_HID; +hid_t H5T_UNIX_D64BE_g = H5I_INVALID_HID; +hid_t H5T_UNIX_D64LE_g = H5I_INVALID_HID; + +hid_t H5T_C_S1_g = H5I_INVALID_HID; + +hid_t H5T_FORTRAN_S1_g = H5I_INVALID_HID; + +hid_t H5T_NATIVE_SCHAR_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UCHAR_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_SHORT_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_USHORT_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_LONG_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_ULONG_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_LLONG_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_ULLONG_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_FLOAT16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_FLOAT_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_DOUBLE_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_LDOUBLE_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_B8_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_B16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_B32_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_B64_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_OPAQUE_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_HADDR_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_HSIZE_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_HSSIZE_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_HERR_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_HBOOL_g = H5I_INVALID_HID; + +hid_t H5T_NATIVE_INT8_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT8_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_LEAST8_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_LEAST8_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_FAST8_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_FAST8_g = H5I_INVALID_HID; + +hid_t H5T_NATIVE_INT16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_LEAST16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_LEAST16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_FAST16_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_FAST16_g = H5I_INVALID_HID; + +hid_t H5T_NATIVE_INT32_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT32_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_LEAST32_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_LEAST32_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_FAST32_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_FAST32_g = H5I_INVALID_HID; + +hid_t H5T_NATIVE_INT64_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT64_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_LEAST64_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_LEAST64_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_INT_FAST64_g = H5I_INVALID_HID; +hid_t H5T_NATIVE_UINT_FAST64_g = H5I_INVALID_HID; /* * Alignment constraints for HDF5 types. Accessing objects of these @@ -498,6 +525,7 @@ size_t H5T_NATIVE_LONG_ALIGN_g = 0; size_t H5T_NATIVE_ULONG_ALIGN_g = 0; size_t H5T_NATIVE_LLONG_ALIGN_g = 0; size_t H5T_NATIVE_ULLONG_ALIGN_g = 0; +size_t H5T_NATIVE_FLOAT16_ALIGN_g = 0; size_t H5T_NATIVE_FLOAT_ALIGN_g = 0; size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0; size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0; @@ -533,6 +561,15 @@ size_t H5T_NATIVE_UINT_FAST64_ALIGN_g = 0; /* Useful floating-point values for conversion routines */ /* (+/- Inf for all floating-point types) */ +#ifdef H5_HAVE__FLOAT16 +/* Initialize these with a float literal since the f16 suffix + * is non-standard C and gives warnings when compiling the + * library with the -pedantic flag. These values will be + * overwritten anyway. + */ +H5__Float16 H5T_NATIVE_FLOAT16_POS_INF_g = 0.0f; +H5__Float16 H5T_NATIVE_FLOAT16_NEG_INF_g = 0.0f; +#endif float H5T_NATIVE_FLOAT_POS_INF_g = 0.0F; float H5T_NATIVE_FLOAT_NEG_INF_g = 0.0F; double H5T_NATIVE_DOUBLE_POS_INF_g = 0.0; @@ -685,6 +722,49 @@ H5T__init_inf(void) } /* end for */ } /* end if */ +#ifdef H5_HAVE__FLOAT16 + /* Get the _Float16 datatype */ + if (NULL == (dst_p = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT16_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + dst = &dst_p->shared->u.atomic; + + /* Check that we can re-order the bytes correctly */ + if (H5T_ORDER_LE != H5T_native_order_g && H5T_ORDER_BE != H5T_native_order_g) + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order"); + + /* +Inf */ + d = (uint8_t *)&H5T_NATIVE_FLOAT16_POS_INF_g; + H5T__bit_set(d, dst->u.f.sign, (size_t)1, false); + 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, false); + + /* Swap the bytes if the machine architecture is big-endian */ + if (H5T_ORDER_BE == H5T_native_order_g) { + half_size = dst_p->shared->size / 2; + for (u = 0; u < half_size; u++) { + uint8_t tmp = d[dst_p->shared->size - (u + 1)]; + d[dst_p->shared->size - (u + 1)] = d[u]; + d[u] = tmp; + } /* end for */ + } /* end if */ + + /* -Inf */ + d = (uint8_t *)&H5T_NATIVE_FLOAT16_NEG_INF_g; + H5T__bit_set(d, dst->u.f.sign, (size_t)1, true); + 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, false); + + /* Swap the bytes if the machine architecture is big-endian */ + if (H5T_ORDER_BE == H5T_native_order_g) { + half_size = dst_p->shared->size / 2; + for (u = 0; u < half_size; u++) { + uint8_t tmp = d[dst_p->shared->size - (u + 1)]; + d[dst_p->shared->size - (u + 1)] = d[u]; + d[u] = tmp; + } /* end for */ + } /* end if */ +#endif + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__init_inf() */ @@ -738,6 +818,9 @@ H5T_init(void) herr_t status; bool copied_dtype = true; /* Flag to indicate whether datatype was copied or allocated (for error cleanup) */ +#ifdef H5_HAVE__FLOAT16 + H5T_t *native_float16 = NULL; /* Datatype structure for native _Float16 type */ +#endif herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -779,6 +862,10 @@ H5T_init(void) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); if (NULL == (native_ullong = (H5T_t *)H5I_object(H5T_NATIVE_ULLONG_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); +#ifdef H5_HAVE__FLOAT16 + if (NULL == (native_float16 = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT16_g))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); +#endif if (NULL == (native_float = (H5T_t *)H5I_object(H5T_NATIVE_FLOAT_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object"); if (NULL == (native_double = (H5T_t *)H5I_object(H5T_NATIVE_DOUBLE_g))) @@ -823,6 +910,12 @@ H5T_init(void) *------------------------------------------------------------ */ + /* IEEE 2-byte little-endian float */ + H5T_INIT_TYPE(FLOAT16LE, H5T_IEEE_F16LE_g, COPY, native_double, SET, 2) + + /* IEEE 2-byte big-endian float */ + H5T_INIT_TYPE(FLOAT16BE, H5T_IEEE_F16BE_g, COPY, native_double, SET, 2) + /* IEEE 4-byte little-endian float */ H5T_INIT_TYPE(FLOATLE, H5T_IEEE_F32LE_g, COPY, native_double, SET, 4) @@ -1062,6 +1155,22 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "flt16_flt", native_float16, native_float, H5T__conv__Float16_float); + status |= H5T__register_int(H5T_PERS_HARD, "flt16_dbl", native_float16, native_double, + H5T__conv__Float16_double); + status |= H5T__register_int(H5T_PERS_HARD, "flt16_ldbl", native_float16, native_ldouble, + H5T__conv__Float16_ldouble); + status |= + H5T__register_int(H5T_PERS_HARD, "flt_flt16", native_float, native_float16, H5T__conv_float__Float16); + status |= H5T__register_int(H5T_PERS_HARD, "dbl_flt16", native_double, native_float16, + H5T__conv_double__Float16); +#ifdef H5T_CONV_INTERNAL_LDOUBLE_FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "ldbl_flt16", native_ldouble, native_float16, + H5T__conv_ldouble__Float16); +#endif +#endif /* from long long */ status |= @@ -1220,6 +1329,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double); status |= H5T__register_int(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "schar_flt16", native_schar, native_float16, + H5T__conv_schar__Float16); +#endif /* From unsigned char to floats */ status |= @@ -1228,6 +1341,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double); status |= H5T__register_int(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "uchar_flt16", native_uchar, native_float16, + H5T__conv_uchar__Float16); +#endif /* From short to floats */ status |= @@ -1236,6 +1353,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double); status |= H5T__register_int(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "short_flt16", native_short, native_float16, + H5T__conv_short__Float16); +#endif /* From unsigned short to floats */ status |= @@ -1244,23 +1365,39 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double); status |= H5T__register_int(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "ushort_flt16", native_ushort, native_float16, + H5T__conv_ushort__Float16); +#endif /* From int to floats */ status |= H5T__register_int(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float); status |= H5T__register_int(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double); status |= H5T__register_int(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "int_flt16", native_int, native_float16, H5T__conv_int__Float16); +#endif /* From unsigned int to floats */ status |= H5T__register_int(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float); status |= H5T__register_int(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double); status |= H5T__register_int(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "uint_flt16", native_uint, native_float16, H5T__conv_uint__Float16); +#endif /* From long to floats */ status |= H5T__register_int(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float); status |= H5T__register_int(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double); status |= H5T__register_int(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "long_flt16", native_long, native_float16, H5T__conv_long__Float16); +#endif /* From unsigned long to floats */ status |= @@ -1269,6 +1406,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double); status |= H5T__register_int(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "ulong_flt16", native_ulong, native_float16, + H5T__conv_ulong__Float16); +#endif /* From long long to floats */ status |= @@ -1279,6 +1420,10 @@ H5T_init(void) status |= H5T__register_int(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble); #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "llong_flt16", native_llong, native_float16, + H5T__conv_llong__Float16); +#endif /* From unsigned long long to floats */ status |= @@ -1289,6 +1434,10 @@ H5T_init(void) status |= H5T__register_int(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble); #endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "ullong_flt16", native_ullong, native_float16, + H5T__conv_ullong__Float16); +#endif /* From floats to char */ status |= @@ -1297,6 +1446,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_schar", native_float16, native_schar, + H5T__conv__Float16_schar); +#endif /* From floats to unsigned char */ status |= @@ -1305,6 +1458,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_uchar", native_float16, native_uchar, + H5T__conv__Float16_uchar); +#endif /* From floats to short */ status |= @@ -1313,6 +1470,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_short", native_float16, native_short, + H5T__conv__Float16_short); +#endif /* From floats to unsigned short */ status |= @@ -1321,23 +1482,39 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_ushort", native_float16, native_ushort, + H5T__conv__Float16_ushort); +#endif /* From floats to int */ status |= H5T__register_int(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int); status |= H5T__register_int(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "flt16_int", native_float16, native_int, H5T__conv__Float16_int); +#endif /* From floats to unsigned int */ status |= H5T__register_int(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint); status |= H5T__register_int(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "flt16_uint", native_float16, native_uint, H5T__conv__Float16_uint); +#endif /* From floats to long */ status |= H5T__register_int(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long); status |= H5T__register_int(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long); +#ifdef H5_HAVE__FLOAT16 + status |= + H5T__register_int(H5T_PERS_HARD, "flt16_long", native_float16, native_long, H5T__conv__Float16_long); +#endif /* From floats to unsigned long */ status |= @@ -1346,6 +1523,10 @@ H5T_init(void) H5T__register_int(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong); status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong); +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_ulong", native_float16, native_ulong, + H5T__conv__Float16_ulong); +#endif /* From floats to long long */ status |= @@ -1356,6 +1537,10 @@ H5T_init(void) status |= H5T__register_int(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong); #endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_llong", native_float16, native_llong, + H5T__conv__Float16_llong); +#endif /* From floats to unsigned long long */ status |= @@ -1366,6 +1551,10 @@ H5T_init(void) status |= H5T__register_int(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong); #endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ +#ifdef H5_HAVE__FLOAT16 + status |= H5T__register_int(H5T_PERS_HARD, "flt16_ullong", native_float16, native_ullong, + H5T__conv__Float16_ullong); +#endif /* * The special no-op conversion is the fastest, so we list it last. The @@ -1546,99 +1735,102 @@ H5T_top_term_package(void) /* Reset all the datatype IDs */ if (H5T_IEEE_F32BE_g > 0) { - H5T_IEEE_F32BE_g = FAIL; - H5T_IEEE_F32LE_g = FAIL; - H5T_IEEE_F64BE_g = FAIL; - H5T_IEEE_F64LE_g = FAIL; - - H5T_STD_I8BE_g = FAIL; - H5T_STD_I8LE_g = FAIL; - H5T_STD_I16BE_g = FAIL; - H5T_STD_I16LE_g = FAIL; - H5T_STD_I32BE_g = FAIL; - H5T_STD_I32LE_g = FAIL; - H5T_STD_I64BE_g = FAIL; - H5T_STD_I64LE_g = FAIL; - H5T_STD_U8BE_g = FAIL; - H5T_STD_U8LE_g = FAIL; - H5T_STD_U16BE_g = FAIL; - H5T_STD_U16LE_g = FAIL; - H5T_STD_U32BE_g = FAIL; - H5T_STD_U32LE_g = FAIL; - H5T_STD_U64BE_g = FAIL; - H5T_STD_U64LE_g = FAIL; - H5T_STD_B8BE_g = FAIL; - H5T_STD_B8LE_g = FAIL; - H5T_STD_B16BE_g = FAIL; - H5T_STD_B16LE_g = FAIL; - H5T_STD_B32BE_g = FAIL; - H5T_STD_B32LE_g = FAIL; - H5T_STD_B64BE_g = FAIL; - H5T_STD_B64LE_g = FAIL; - H5T_STD_REF_OBJ_g = FAIL; - H5T_STD_REF_DSETREG_g = FAIL; - H5T_STD_REF_g = FAIL; - - H5T_UNIX_D32BE_g = FAIL; - H5T_UNIX_D32LE_g = FAIL; - H5T_UNIX_D64BE_g = FAIL; - H5T_UNIX_D64LE_g = FAIL; - - H5T_C_S1_g = FAIL; - - H5T_FORTRAN_S1_g = FAIL; - - H5T_NATIVE_SCHAR_g = FAIL; - H5T_NATIVE_UCHAR_g = FAIL; - H5T_NATIVE_SHORT_g = FAIL; - H5T_NATIVE_USHORT_g = FAIL; - H5T_NATIVE_INT_g = FAIL; - H5T_NATIVE_UINT_g = FAIL; - H5T_NATIVE_LONG_g = FAIL; - H5T_NATIVE_ULONG_g = FAIL; - H5T_NATIVE_LLONG_g = FAIL; - H5T_NATIVE_ULLONG_g = FAIL; - H5T_NATIVE_FLOAT_g = FAIL; - H5T_NATIVE_DOUBLE_g = FAIL; - H5T_NATIVE_LDOUBLE_g = FAIL; - H5T_NATIVE_B8_g = FAIL; - H5T_NATIVE_B16_g = FAIL; - H5T_NATIVE_B32_g = FAIL; - H5T_NATIVE_B64_g = FAIL; - H5T_NATIVE_OPAQUE_g = FAIL; - H5T_NATIVE_HADDR_g = FAIL; - H5T_NATIVE_HSIZE_g = FAIL; - H5T_NATIVE_HSSIZE_g = FAIL; - H5T_NATIVE_HERR_g = FAIL; - H5T_NATIVE_HBOOL_g = FAIL; - - H5T_NATIVE_INT8_g = FAIL; - H5T_NATIVE_UINT8_g = FAIL; - H5T_NATIVE_INT_LEAST8_g = FAIL; - H5T_NATIVE_UINT_LEAST8_g = FAIL; - H5T_NATIVE_INT_FAST8_g = FAIL; - H5T_NATIVE_UINT_FAST8_g = FAIL; - - H5T_NATIVE_INT16_g = FAIL; - H5T_NATIVE_UINT16_g = FAIL; - H5T_NATIVE_INT_LEAST16_g = FAIL; - H5T_NATIVE_UINT_LEAST16_g = FAIL; - H5T_NATIVE_INT_FAST16_g = FAIL; - H5T_NATIVE_UINT_FAST16_g = FAIL; - - H5T_NATIVE_INT32_g = FAIL; - H5T_NATIVE_UINT32_g = FAIL; - H5T_NATIVE_INT_LEAST32_g = FAIL; - H5T_NATIVE_UINT_LEAST32_g = FAIL; - H5T_NATIVE_INT_FAST32_g = FAIL; - H5T_NATIVE_UINT_FAST32_g = FAIL; - - H5T_NATIVE_INT64_g = FAIL; - H5T_NATIVE_UINT64_g = FAIL; - H5T_NATIVE_INT_LEAST64_g = FAIL; - H5T_NATIVE_UINT_LEAST64_g = FAIL; - H5T_NATIVE_INT_FAST64_g = FAIL; - H5T_NATIVE_UINT_FAST64_g = FAIL; + H5T_IEEE_F16BE_g = H5I_INVALID_HID; + H5T_IEEE_F16LE_g = H5I_INVALID_HID; + H5T_IEEE_F32BE_g = H5I_INVALID_HID; + H5T_IEEE_F32LE_g = H5I_INVALID_HID; + H5T_IEEE_F64BE_g = H5I_INVALID_HID; + H5T_IEEE_F64LE_g = H5I_INVALID_HID; + + H5T_STD_I8BE_g = H5I_INVALID_HID; + H5T_STD_I8LE_g = H5I_INVALID_HID; + H5T_STD_I16BE_g = H5I_INVALID_HID; + H5T_STD_I16LE_g = H5I_INVALID_HID; + H5T_STD_I32BE_g = H5I_INVALID_HID; + H5T_STD_I32LE_g = H5I_INVALID_HID; + H5T_STD_I64BE_g = H5I_INVALID_HID; + H5T_STD_I64LE_g = H5I_INVALID_HID; + H5T_STD_U8BE_g = H5I_INVALID_HID; + H5T_STD_U8LE_g = H5I_INVALID_HID; + H5T_STD_U16BE_g = H5I_INVALID_HID; + H5T_STD_U16LE_g = H5I_INVALID_HID; + H5T_STD_U32BE_g = H5I_INVALID_HID; + H5T_STD_U32LE_g = H5I_INVALID_HID; + H5T_STD_U64BE_g = H5I_INVALID_HID; + H5T_STD_U64LE_g = H5I_INVALID_HID; + H5T_STD_B8BE_g = H5I_INVALID_HID; + H5T_STD_B8LE_g = H5I_INVALID_HID; + H5T_STD_B16BE_g = H5I_INVALID_HID; + H5T_STD_B16LE_g = H5I_INVALID_HID; + H5T_STD_B32BE_g = H5I_INVALID_HID; + H5T_STD_B32LE_g = H5I_INVALID_HID; + H5T_STD_B64BE_g = H5I_INVALID_HID; + H5T_STD_B64LE_g = H5I_INVALID_HID; + H5T_STD_REF_OBJ_g = H5I_INVALID_HID; + H5T_STD_REF_DSETREG_g = H5I_INVALID_HID; + H5T_STD_REF_g = H5I_INVALID_HID; + + H5T_UNIX_D32BE_g = H5I_INVALID_HID; + H5T_UNIX_D32LE_g = H5I_INVALID_HID; + H5T_UNIX_D64BE_g = H5I_INVALID_HID; + H5T_UNIX_D64LE_g = H5I_INVALID_HID; + + H5T_C_S1_g = H5I_INVALID_HID; + + H5T_FORTRAN_S1_g = H5I_INVALID_HID; + + H5T_NATIVE_SCHAR_g = H5I_INVALID_HID; + H5T_NATIVE_UCHAR_g = H5I_INVALID_HID; + H5T_NATIVE_SHORT_g = H5I_INVALID_HID; + H5T_NATIVE_USHORT_g = H5I_INVALID_HID; + H5T_NATIVE_INT_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_g = H5I_INVALID_HID; + H5T_NATIVE_LONG_g = H5I_INVALID_HID; + H5T_NATIVE_ULONG_g = H5I_INVALID_HID; + H5T_NATIVE_LLONG_g = H5I_INVALID_HID; + H5T_NATIVE_ULLONG_g = H5I_INVALID_HID; + H5T_NATIVE_FLOAT16_g = H5I_INVALID_HID; + H5T_NATIVE_FLOAT_g = H5I_INVALID_HID; + H5T_NATIVE_DOUBLE_g = H5I_INVALID_HID; + H5T_NATIVE_LDOUBLE_g = H5I_INVALID_HID; + H5T_NATIVE_B8_g = H5I_INVALID_HID; + H5T_NATIVE_B16_g = H5I_INVALID_HID; + H5T_NATIVE_B32_g = H5I_INVALID_HID; + H5T_NATIVE_B64_g = H5I_INVALID_HID; + H5T_NATIVE_OPAQUE_g = H5I_INVALID_HID; + H5T_NATIVE_HADDR_g = H5I_INVALID_HID; + H5T_NATIVE_HSIZE_g = H5I_INVALID_HID; + H5T_NATIVE_HSSIZE_g = H5I_INVALID_HID; + H5T_NATIVE_HERR_g = H5I_INVALID_HID; + H5T_NATIVE_HBOOL_g = H5I_INVALID_HID; + + H5T_NATIVE_INT8_g = H5I_INVALID_HID; + H5T_NATIVE_UINT8_g = H5I_INVALID_HID; + H5T_NATIVE_INT_LEAST8_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_LEAST8_g = H5I_INVALID_HID; + H5T_NATIVE_INT_FAST8_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_FAST8_g = H5I_INVALID_HID; + + H5T_NATIVE_INT16_g = H5I_INVALID_HID; + H5T_NATIVE_UINT16_g = H5I_INVALID_HID; + H5T_NATIVE_INT_LEAST16_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_LEAST16_g = H5I_INVALID_HID; + H5T_NATIVE_INT_FAST16_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_FAST16_g = H5I_INVALID_HID; + + H5T_NATIVE_INT32_g = H5I_INVALID_HID; + H5T_NATIVE_UINT32_g = H5I_INVALID_HID; + H5T_NATIVE_INT_LEAST32_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_LEAST32_g = H5I_INVALID_HID; + H5T_NATIVE_INT_FAST32_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_FAST32_g = H5I_INVALID_HID; + + H5T_NATIVE_INT64_g = H5I_INVALID_HID; + H5T_NATIVE_UINT64_g = H5I_INVALID_HID; + H5T_NATIVE_INT_LEAST64_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_LEAST64_g = H5I_INVALID_HID; + H5T_NATIVE_INT_FAST64_g = H5I_INVALID_HID; + H5T_NATIVE_UINT_FAST64_g = H5I_INVALID_HID; n++; } /* end if */ @@ -2442,12 +2634,12 @@ H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T * * Purpose: Register a hard or soft conversion function for a data type * conversion path. The path is specified by the source and - * destination data types SRC_ID and DST_ID (for soft functions - * only the class of these types is important). If FUNC is a - * hard function then it replaces any previous path; if it's a - * soft function then it replaces all existing paths to which it - * applies and is used for any new path to which it applies as - * long as that path doesn't have a hard function. + * destination data types SRC and DST (for soft functions only the + * class of these types is important). If FUNC is a hard function + * then it replaces any previous path; if it's a soft function then + * it replaces all existing paths to which it applies and is used + * for any new path to which it applies as long as that path doesn't + * have a hard function. * * Return: Non-negative on success/Negative on failure * @@ -2537,14 +2729,14 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con old_path->dst->shared->type != dst->shared->type) continue; - if (NULL == (tmp_stype = H5T_copy(old_path->src, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy src datatype"); - if (NULL == (tmp_dtype = H5T_copy(old_path->dst, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy dst datatype"); - memset(&cdata, 0, sizeof cdata); cdata.command = H5T_CONV_INIT; if (conv->is_app) { + if (NULL == (tmp_stype = H5T_copy(old_path->src, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy src datatype"); + if (NULL == (tmp_dtype = H5T_copy(old_path->dst, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy dst datatype"); + if ((tmp_sid = H5I_register(H5I_DATATYPE, tmp_stype, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register ID for source datatype"); @@ -2566,12 +2758,8 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con continue; } /* end if */ } /* end if */ - else if ((conv->u.lib_func)(tmp_stype, tmp_dtype, &cdata, &tmp_ctx, 0, 0, 0, NULL, NULL) < 0) { - if (H5T_close(tmp_stype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - if (H5T_close(tmp_dtype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); - tmp_stype = tmp_dtype = NULL; + else if ((conv->u.lib_func)(old_path->src, old_path->dst, &cdata, &tmp_ctx, 0, 0, 0, NULL, NULL) < + 0) { if (H5E_clear_stack(NULL) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "unable to clear current error stack"); continue; @@ -2608,8 +2796,8 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con #endif } /* end if */ } /* end if */ - else if ((old_path->conv.u.lib_func)(tmp_stype, tmp_dtype, &(old_path->cdata), NULL, 0, 0, 0, - NULL, NULL) < 0) { + else if ((old_path->conv.u.lib_func)(old_path->src, old_path->dst, &(old_path->cdata), NULL, 0, 0, + 0, NULL, NULL) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), @@ -2633,22 +2821,12 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con tmp_sid = H5I_INVALID_HID; tmp_stype = NULL; } - else if (tmp_stype) { - if (H5T_close(tmp_stype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); - tmp_stype = NULL; - } if (tmp_did >= 0) { if (H5I_dec_ref(tmp_did) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); tmp_did = H5I_INVALID_HID; tmp_dtype = NULL; } - else if (tmp_dtype) { - if (H5T_close(tmp_dtype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); - tmp_dtype = NULL; - } /* We don't care about any failures during the freeing process */ if (H5E_clear_stack(NULL) < 0) @@ -3039,9 +3217,9 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *backgroun herr_t H5Treclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) { - H5T_t *type; - H5S_t *space; /* Dataspace for iteration */ - herr_t ret_value; /* Return value */ + const H5T_t *type; + H5S_t *space; /* Dataspace for iteration */ + herr_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("e", "iii*x", type_id, space_id, dxpl_id, buf); @@ -3049,7 +3227,7 @@ H5Treclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) /* Check args */ if (buf == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "'buf' pointer is NULL"); - if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + if (NULL == (type = (const H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid datatype"); if (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid dataspace"); @@ -4881,11 +5059,11 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2, bool superset) /*------------------------------------------------------------------------- * Function: H5T_path_find * - * Purpose: Library-internal wrapper to find the path which converts type - * SRC_ID to type DST_ID. + * Purpose: Library-internal wrapper to find the path which converts + * type SRC to type DST. * - * If SRC and DST are both null pointers then the special no-op - * conversion path is used. + * If SRC and DST are both null pointers then the special no-op + * conversion path is used. * * Return: Success: Pointer to the path, valid until the path * database is modified. @@ -4924,17 +5102,17 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst) /*------------------------------------------------------------------------- * Function: H5T__path_find_real * - * Purpose: Finds the path which converts type SRC_ID to type DST_ID, - * creating a new path if necessary. If FUNC is non-zero then - * it is set as the hard conversion function for that path - * regardless of whether the path previously existed. Changing - * the conversion function of a path causes statistics to be - * reset to zero after printing them. The NAME is used only - * when creating a new path and is just for debugging. + * Purpose: Finds the path which converts type SRC to type DST, creating + * a new path if necessary. If FUNC is non-zero then it is set + * as the hard conversion function for that path regardless of + * whether the path previously existed. Changing the conversion + * function of a path causes statistics to be reset to zero + * after printing them. The NAME is used only when creating a + * new path and is just for debugging. * - * If SRC and DST are both null pointers then the special no-op - * conversion path is used. This path is always stored as the - * first path in the path table. + * If SRC and DST are both null pointers then the special no-op + * conversion path is used. This path is always stored as the + * first path in the path table. * * Return: Success: Pointer to the path, valid until the path * database is modified. @@ -5078,13 +5256,18 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co (!table || (table && conv->is_app) || (table && !table->is_hard && !conv->is_app))) { assert(path != table); assert(NULL == path->conv.u.app_func); - if (path->src && (NULL == (tmp_stype = H5T_copy(path->src, H5T_COPY_ALL)))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy source datatype"); - if (path->dst && (NULL == (tmp_dtype = H5T_copy(path->dst, H5T_COPY_ALL)))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy destination datatype"); path->cdata.command = H5T_CONV_INIT; if (conv->is_app) { + /* Copy the conversion path's source and destination datatypes and + * register an ID for them so we can pass these to the application + * conversion function + */ + if (path->src && (NULL == (tmp_stype = H5T_copy(path->src, H5T_COPY_ALL)))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy source datatype"); + if (path->dst && (NULL == (tmp_dtype = H5T_copy(path->dst, H5T_COPY_ALL)))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy destination datatype"); + if (tmp_stype && ((src_id = H5I_register(H5I_DATATYPE, tmp_stype, false)) < 0)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register ID for source datatype"); @@ -5095,7 +5278,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co if ((conv->u.app_func)(src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, NULL, H5CX_get_dxpl()) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function"); } /* end if */ - else if ((conv->u.lib_func)(tmp_stype, tmp_dtype, &(path->cdata), &tmp_ctx, 0, 0, 0, NULL, NULL) < 0) + else if ((conv->u.lib_func)(path->src, path->dst, &(path->cdata), &tmp_ctx, 0, 0, 0, NULL, NULL) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to initialize conversion function"); if (src_id >= 0) { @@ -5104,22 +5287,12 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co src_id = H5I_INVALID_HID; tmp_stype = NULL; } - else if (tmp_stype) { - if (H5T_close(tmp_stype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); - tmp_stype = NULL; - } if (dst_id >= 0) { if (H5I_dec_ref(dst_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, NULL, "can't decrement reference on temporary ID"); dst_id = H5I_INVALID_HID; tmp_dtype = NULL; } - else if (tmp_dtype) { - if (H5T_close(tmp_dtype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); - tmp_dtype = NULL; - } path->conv = *conv; path->is_hard = true; @@ -5138,19 +5311,21 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co if (src->shared->type != H5T_g.soft[i].src || dst->shared->type != H5T_g.soft[i].dst) continue; - assert(tmp_stype == NULL); - assert(tmp_dtype == NULL); - - if (NULL == (tmp_stype = H5T_copy(path->src, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy source datatype"); - if (NULL == (tmp_dtype = H5T_copy(path->dst, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy destination datatype"); - path->cdata.command = H5T_CONV_INIT; if (H5T_g.soft[i].conv.is_app) { + /* Copy the conversion path's source and destination datatypes and + * register an ID for them so we can pass these to the application + * conversion function + */ + assert(tmp_stype == NULL); + assert(tmp_dtype == NULL); + if (NULL == (tmp_stype = H5T_copy(path->src, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy source datatype"); + if (NULL == (tmp_dtype = H5T_copy(path->dst, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy destination datatype"); + assert(src_id == H5I_INVALID_HID); assert(dst_id == H5I_INVALID_HID); - if ((src_id = H5I_register(H5I_DATATYPE, tmp_stype, false)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register ID for source datatype"); @@ -5167,7 +5342,7 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co path_init_error = true; } /* end if */ } /* end if */ - else if ((H5T_g.soft[i].conv.u.lib_func)(tmp_stype, tmp_dtype, &(path->cdata), &tmp_ctx, 0, 0, 0, + else if ((H5T_g.soft[i].conv.u.lib_func)(path->src, path->dst, &(path->cdata), &tmp_ctx, 0, 0, 0, NULL, NULL) < 0) { memset(&(path->cdata), 0, sizeof(H5T_cdata_t)); /*ignore the error*/ @@ -5190,22 +5365,12 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co src_id = H5I_INVALID_HID; tmp_stype = NULL; } - else if (tmp_stype) { - if (H5T_close(tmp_stype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); - tmp_stype = NULL; - } if (dst_id >= 0) { if (H5I_dec_ref(dst_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, NULL, "can't decrement reference on temporary ID"); dst_id = H5I_INVALID_HID; tmp_dtype = NULL; } - else if (tmp_dtype) { - if (H5T_close(tmp_dtype) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); - tmp_dtype = NULL; - } } /* end for */ if (!path->conv.u.app_func) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path"); @@ -5288,14 +5453,6 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co table = path; } /* end else-if */ - /* Set the flag to indicate both source and destination types are compound types - * for the optimization of data reading (in H5Dio.c). - * Make sure that path->are_compounds is only true for compound types. - */ - path->are_compounds = false; - if (H5T_COMPOUND == H5T_get_class(src, true) && H5T_COMPOUND == H5T_get_class(dst, true)) - path->are_compounds = true; - /* Set return value */ ret_value = path; @@ -5563,7 +5720,7 @@ H5T__compiler_conv(H5T_t *src, H5T_t *dst) *------------------------------------------------------------------------- */ herr_t -H5T_convert(H5T_path_t *tpath, H5T_t *src_type, H5T_t *dst_type, size_t nelmts, size_t buf_stride, +H5T_convert(H5T_path_t *tpath, const H5T_t *src_type, const H5T_t *dst_type, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) { H5T_conv_ctx_t conv_ctx = {0}; @@ -5656,8 +5813,9 @@ H5T_convert(H5T_path_t *tpath, H5T_t *src_type, H5T_t *dst_type, size_t nelmts, *------------------------------------------------------------------------- */ herr_t -H5T_convert_with_ctx(H5T_path_t *tpath, H5T_t *src_type, H5T_t *dst_type, const H5T_conv_ctx_t *conv_ctx, - size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) +H5T_convert_with_ctx(H5T_path_t *tpath, const H5T_t *src_type, const H5T_t *dst_type, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t bkg_stride, + void *buf, void *bkg) { herr_t ret_value = SUCCEED; diff --git a/src/H5Tconv.c b/src/H5Tconv.c index a37800bfed3..422e3110497 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -112,6 +112,14 @@ * at least as wide as the destination. Overflow can occur * when the source magnitude is too large for the destination. * + * fX: Floating-point values to integers where the destination is at least + * as wide as the source. This case cannot generate overflows. + * + * Xf: Integers to floating-point values where the source is at least as + * wide as the destination. Overflows can occur when the destination is + * narrower than the source. + * + * * The macros take a subset of these arguments in the order listed here: * * CDATA: A pointer to the H5T_cdata_t structure that was passed to the @@ -704,6 +712,99 @@ H5T_CONV(H5T_CONV_Fx, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ } while (0) +#define H5T_CONV_fX(STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + do { \ + HDcompile_assert(sizeof(ST) <= sizeof(DT)); \ + H5T_CONV(H5T_CONV_xX, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, N) \ + } while (0) + +#define H5T_CONV_Xf_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ + { \ + if (*(S) > (ST)(D_MAX) || (sprec < dprec && *(S) == (ST)(D_MAX))) { \ + H5T_conv_ret_t except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_HI, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, D, \ + conv_ctx->u.conv.cb_struct.user_data); \ + if (except_ret == H5T_CONV_UNHANDLED) \ + /* Let compiler convert if case is ignored by user handler*/ \ + *(D) = H5_GLUE3(H5T_NATIVE_, DTYPE, _POS_INF_g); \ + else if (except_ret == H5T_CONV_ABORT) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); \ + /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ + } \ + else if (*(S) < (ST)(D_MIN)) { \ + H5T_conv_ret_t except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_RANGE_LOW, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, S, D, \ + conv_ctx->u.conv.cb_struct.user_data); \ + if (except_ret == H5T_CONV_UNHANDLED) \ + /* Let compiler convert if case is ignored by user handler*/ \ + *(D) = H5_GLUE3(H5T_NATIVE_, DTYPE, _NEG_INF_g); \ + else if (except_ret == H5T_CONV_ABORT) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); \ + /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ + } \ + else if (sprec > dprec) { \ + unsigned low_bit_pos, high_bit_pos; \ + \ + /* Detect high & low bits set in source */ \ + H5T_HI_LO_BIT_SET(ST, *(S), low_bit_pos, high_bit_pos) \ + \ + /* Check for more bits of precision in src than available in dst */ \ + if ((high_bit_pos - low_bit_pos) >= dprec) { \ + H5T_conv_ret_t except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_PRECISION, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, \ + S, D, conv_ctx->u.conv.cb_struct.user_data); \ + if (except_ret == H5T_CONV_UNHANDLED) \ + /* Let compiler convert if case is ignored by user handler*/ \ + *(D) = (DT)(*(S)); \ + else if (except_ret == H5T_CONV_ABORT) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); \ + /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ + } \ + else \ + *(D) = (DT)(*(S)); \ + } \ + else \ + *(D) = (DT)(*(S)); \ + } +#define H5T_CONV_Xf_NOEX_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ + { \ + if (*(S) > (ST)(D_MAX)) \ + *(D) = H5_GLUE3(H5T_NATIVE_, DTYPE, _POS_INF_g); \ + else { \ + intmax_t s_cast = (intmax_t)(*(S)); \ + intmax_t d_cast = (intmax_t)(D_MAX); \ + \ + /* Check if source value would underflow destination. Do NOT do this \ + * by comparing against D_MIN casted to type ST here, as this will \ + * generally be undefined behavior (casting negative float value <= 1.0 \ + * to integer) for all floating point types and some compilers optimize \ + * this in a way that causes unexpected behavior. Instead, grab the \ + * absolute value of the source value first, then compare it to D_MAX. \ + */ \ + if (s_cast != INTMAX_MIN) \ + s_cast = imaxabs(s_cast); \ + else { \ + /* Handle two's complement integer representations where abs(INTMAX_MIN) \ + * can't be represented. Other representations will fall here as well, \ + * but this should be fine. \ + */ \ + s_cast = INTMAX_MAX; \ + d_cast -= 1; \ + } \ + \ + if (s_cast > d_cast) \ + *(D) = H5_GLUE3(H5T_NATIVE_, DTYPE, _NEG_INF_g); \ + else \ + *(D) = (DT)(*(S)); \ + } \ + } + +#define H5T_CONV_Xf(STYPE, DTYPE, ST, DT, D_MIN, D_MAX) \ + do { \ + HDcompile_assert(sizeof(ST) >= sizeof(DT)); \ + H5T_CONV(H5T_CONV_Xf, STYPE, DTYPE, ST, DT, D_MIN, D_MAX, Y) \ + } while (0) + /* Since all "no exception" cores do the same thing (assign the value in the * source location to the destination location, using casting), use one "core" * to do them all. @@ -1074,11 +1175,13 @@ typedef struct H5T_conv_struct_t { } H5T_conv_struct_t; /* Conversion data for H5T__conv_enum() */ -typedef struct H5T_enum_struct_t { - int base; /*lowest `in' value */ - unsigned length; /*num elements in arrays */ - int *src2dst; /*map from src to dst index */ -} H5T_enum_struct_t; +typedef struct H5T_conv_enum_t { + H5T_t *src_copy; /* cached copy of source datatype */ + H5T_t *dst_copy; /* cached copy of destination datatype */ + int base; /*lowest `in' value */ + unsigned length; /*num elements in arrays */ + int *src2dst; /*map from src to dst index */ +} H5T_conv_enum_t; /* Conversion data for the hardware conversion functions */ typedef struct H5T_conv_hw_t { @@ -1132,7 +1235,7 @@ H5FL_BLK_DEFINE_STATIC(ref_seq); *------------------------------------------------------------------------- */ herr_t -H5T__conv_noop(H5T_t H5_ATTR_UNUSED *src, H5T_t H5_ATTR_UNUSED *dst, H5T_cdata_t *cdata, +H5T__conv_noop(const H5T_t H5_ATTR_UNUSED *src, const H5T_t H5_ATTR_UNUSED *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t H5_ATTR_UNUSED nelmts, size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void H5_ATTR_UNUSED *buf, void H5_ATTR_UNUSED *background) @@ -1175,9 +1278,9 @@ H5T__conv_noop(H5T_t H5_ATTR_UNUSED *src, H5T_t H5_ATTR_UNUSED *dst, H5T_cdata_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_order_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background) +H5T__conv_order_opt(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, + const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *_buf, void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t *)_buf; size_t i; @@ -1580,9 +1683,9 @@ H5T__conv_order_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_order(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, - void H5_ATTR_UNUSED *background) +H5T__conv_order(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, + const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *_buf, void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t *)_buf; size_t i; @@ -1672,8 +1775,8 @@ H5T__conv_order(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_b_b(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, +H5T__conv_b_b(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, void H5_ATTR_UNUSED *background) { uint8_t *buf = (uint8_t *)_buf; @@ -1997,7 +2100,7 @@ H5T__conv_struct_free(H5T_conv_struct_t *priv) *------------------------------------------------------------------------- */ static herr_t -H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx) +H5T__conv_struct_init(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx) { H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv); int *src2dst = NULL; @@ -2243,8 +2346,8 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) *------------------------------------------------------------------------- */ herr_t -H5T__conv_struct(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) +H5T__conv_struct(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */ @@ -2352,6 +2455,7 @@ H5T__conv_struct(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_ * data point as small as possible with all the free space on the * right side. */ + tmp_conv_ctx.u.conv.recursive = true; for (u = 0, offset = 0; u < src->shared->u.compnd.nmembs; u++) { if (src2dst[u] < 0) continue; /*subsetting*/ @@ -2380,6 +2484,7 @@ H5T__conv_struct(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_ offset += src_memb->size; } /* end else */ } /* end for */ + tmp_conv_ctx.u.conv.recursive = false; /* * For each source member which will be present in the @@ -2388,6 +2493,7 @@ H5T__conv_struct(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_ * yet). Then copy the member to the destination offset in the * background buffer. */ + tmp_conv_ctx.u.conv.recursive = true; H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); for (int i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if (src2dst[i] < 0) @@ -2414,6 +2520,8 @@ H5T__conv_struct(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_ offset -= dst_memb->size; memmove(xbkg + dst_memb->offset, xbuf + offset, dst_memb->size); } /* end for */ + tmp_conv_ctx.u.conv.recursive = false; + assert(0 == offset); /* @@ -2488,7 +2596,7 @@ H5T__conv_struct(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_struct_opt(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ @@ -2647,6 +2755,7 @@ H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ * destination in the bkg buffer. Otherwise move the element as far * left as possible in the buffer. */ + tmp_conv_ctx.u.conv.recursive = true; for (u = 0, offset = 0; u < src->shared->u.compnd.nmembs; u++) { if (src2dst[u] < 0) continue; /*subsetting*/ @@ -2682,6 +2791,7 @@ H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ offset += src_memb->size; } /* end else */ } /* end else */ + tmp_conv_ctx.u.conv.recursive = false; /* * Work from right to left, converting those members that weren't @@ -2689,6 +2799,7 @@ H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ * is larger than the source) and them to their final position in the * bkg buffer. */ + tmp_conv_ctx.u.conv.recursive = true; H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); for (int i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if (src2dst[i] < 0) @@ -2718,7 +2829,8 @@ H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ } /* end for */ } /* end if */ } /* end for */ - } /* end else */ + tmp_conv_ctx.u.conv.recursive = false; + } /* end else */ if (no_stride) buf_stride = dst->shared->size; @@ -2740,6 +2852,37 @@ H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__conv_struct_opt() */ +/*------------------------------------------------------------------------- + * Function: H5T__conv_enum_free + * + * Purpose: Free the private data structure used by the enum conversion + * functions. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__conv_enum_free(H5T_conv_enum_t *priv) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_PACKAGE + + if (priv) { + free(priv->src2dst); + + if (priv->dst_copy && H5T_close(priv->dst_copy) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close copied source datatype"); + if (priv->src_copy && H5T_close(priv->src_copy) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close copied destination datatype"); + + free(priv); + } + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T__conv_enum_free() */ + /*------------------------------------------------------------------------- * Function: H5T__conv_enum_init * @@ -2752,131 +2895,201 @@ H5T__conv_struct_opt(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ static herr_t -H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) -{ - H5T_enum_struct_t *priv = NULL; /*private conversion data */ - int n; /*src value cast as native int */ - int domain[2] = {0, 0}; /*min and max source values */ - int *map = NULL; /*map from src value to dst idx */ - unsigned length; /*nelmts in map array */ - unsigned i, j; /*counters */ - herr_t ret_value = SUCCEED; /* Return value */ +H5T__conv_enum_init(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx) +{ + H5T_conv_enum_t *priv = NULL; /* Private conversion data */ + int *map = NULL; /* Map from src value to dst idx */ + bool rebuild_cache = false; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE cdata->need_bkg = H5T_BKG_NO; - if (NULL == (priv = (H5T_enum_struct_t *)(cdata->priv = H5MM_calloc(sizeof(*priv))))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - if (0 == src->shared->u.enumer.nmembs) - HGOTO_DONE(SUCCEED); - /* - * Check that the source symbol names are a subset of the destination - * symbol names and build a map from source member index to destination - * member index. - */ - H5T__sort_name(src, NULL); - H5T__sort_name(dst, NULL); - if (NULL == (priv->src2dst = (int *)H5MM_malloc(src->shared->u.enumer.nmembs * sizeof(int)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - for (i = 0, j = 0; i < src->shared->u.enumer.nmembs && j < dst->shared->u.enumer.nmembs; i++, j++) { - while (j < dst->shared->u.enumer.nmembs && - strcmp(src->shared->u.enumer.name[i], dst->shared->u.enumer.name[j]) != 0) - j++; - if (j >= dst->shared->u.enumer.nmembs) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, - "source type is not a subset of destination type"); - priv->src2dst[i] = (int)j; - } /* end for */ + priv = (H5T_conv_enum_t *)(cdata->priv); + if (!priv) { + if (NULL == (priv = (H5T_conv_enum_t *)(cdata->priv = calloc(1, sizeof(*priv))))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + rebuild_cache = true; + } + else { + /* Check if we need to rebuild our cache. For now, treat + * enums as different even if one is just a subset of the + * other + */ + if (cdata->command == H5T_CONV_CONV && conv_ctx->u.conv.recursive) + /* Recursive conversion; we can reuse the cache */ + rebuild_cache = false; + else { + if (0 != H5T_cmp(src, priv->src_copy, false) || 0 != H5T_cmp(dst, priv->dst_copy, false)) + rebuild_cache = true; + } + } - /* - * The conversion function will use an O(log N) lookup method for each - * value converted. However, if all of the following constraints are met - * then we can build a perfect hash table and use an O(1) lookup method. - * - * A: The source datatype size matches one of our native datatype - * sizes. - * - * B: After casting the source value bit pattern to a native type - * the size of the range of values is less than 20% larger than - * the number of values. - * - * If this special case is met then we use the source bit pattern cast as - * a native integer type as an index into the `val2dst'. The values of - * that array are the index numbers in the destination type or negative - * if the entry is unused. - * - * (This optimized algorithm doesn't work when the byte orders are different. - * The code such as "n = *((int*)(src->shared->u.enumer.value+i*src->shared->size));" - * can change the value significantly. i.g. if the source value is big-endian 0x0000000f, - * executing the casting on little-endian machine will get a big number 0x0f000000. - * Then it can't meet the condition - * "if(src->shared->u.enumer.nmembs<2 || (double)length/src->shared->u.enumer.nmembs<1.2)" - * Because this is the optimized code, we won't fix it. It should still work in some - * situations. SLU - 2011/5/24) - */ - if (1 == src->shared->size || sizeof(short) == src->shared->size || sizeof(int) == src->shared->size) { - for (i = 0; i < src->shared->u.enumer.nmembs; i++) { - if (1 == src->shared->size) - n = *((signed char *)((uint8_t *)src->shared->u.enumer.value + i)); - else if (sizeof(short) == src->shared->size) - n = *((short *)((void *)((uint8_t *)src->shared->u.enumer.value + (i * src->shared->size)))); - else - n = *((int *)((void *)((uint8_t *)src->shared->u.enumer.value + (i * src->shared->size)))); - if (0 == i) { - domain[0] = domain[1] = n; - } - else { - domain[0] = MIN(domain[0], n); - domain[1] = MAX(domain[1], n); - } - } /* end for */ + if (rebuild_cache) { + H5T_shared_t *src_sh; + H5T_shared_t *dst_sh; + size_t src_nmembs; + size_t dst_nmembs; + void *tmp_realloc; + + if (0 == src->shared->u.enumer.nmembs) + HGOTO_DONE(SUCCEED); + + /* Allocate everything we need to cache */ + if (priv->src_copy && H5T_close(priv->src_copy) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close copied source datatype"); + if (priv->dst_copy && H5T_close(priv->dst_copy) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close copied destination datatype"); - assert(domain[1] >= domain[0]); - length = (unsigned)(domain[1] - domain[0]) + 1; - if (src->shared->u.enumer.nmembs < 2 || - (double)length / src->shared->u.enumer.nmembs < (double)(1.2F)) { - priv->base = domain[0]; - priv->length = length; - if (NULL == (map = (int *)H5MM_malloc(length * sizeof(int)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - for (i = 0; i < length; i++) - map[i] = -1; /*entry unused*/ - for (i = 0; i < src->shared->u.enumer.nmembs; i++) { - if (1 == src->shared->size) - n = *((signed char *)((uint8_t *)src->shared->u.enumer.value + i)); - else if (sizeof(short) == src->shared->size) - n = *(( - short *)((void *)((uint8_t *)src->shared->u.enumer.value + (i * src->shared->size)))); + if (NULL == (priv->src_copy = H5T_copy(src, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy source datatype"); + if (NULL == (priv->dst_copy = H5T_copy(dst, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy destination datatype"); + + src_sh = priv->src_copy->shared; + dst_sh = priv->src_copy->shared; + src_nmembs = src_sh->u.enumer.nmembs; + dst_nmembs = dst_sh->u.enumer.nmembs; + + if (NULL == (tmp_realloc = realloc(priv->src2dst, src_nmembs * sizeof(int)))) { + free(priv->src2dst); + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, + "unable to allocate space for source to destination enum mapping"); + } + priv->src2dst = tmp_realloc; + + /* + * Check that the source symbol names are a subset of the destination + * symbol names and build a map from source member index to destination + * member index. + */ + H5T__sort_name(priv->src_copy, NULL); + H5T__sort_name(priv->dst_copy, NULL); + for (size_t i = 0, j = 0; i < src_nmembs && j < dst_nmembs; i++, j++) { + char *src_name = src_sh->u.enumer.name[i]; + char *dst_name = dst_sh->u.enumer.name[j]; + + while (j < dst_nmembs && strcmp(src_name, dst_name) != 0) + j++; + + if (j >= dst_nmembs) + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, + "source enum type is not a subset of destination enum type"); + + H5_CHECKED_ASSIGN(priv->src2dst[i], int, j, size_t); + } + + /* + * The conversion function will use an O(log N) lookup method for each + * value converted. However, if all of the following constraints are met + * then we can build a perfect hash table and use an O(1) lookup method. + * + * A: The source datatype size matches one of our native datatype + * sizes. + * + * B: After casting the source value bit pattern to a native type + * the size of the range of values is less than 20% larger than + * the number of values. + * + * If this special case is met then we use the source bit pattern cast as + * a native integer type as an index into the `val2dst'. The values of + * that array are the index numbers in the destination type or negative + * if the entry is unused. + * + * (This optimized algorithm doesn't work when the byte orders are different. + * The code such as "n = *((int *)((void *)((uint8_t *)src_sh->u.enumer.value + (i * + * src_sh->size))));" can change the value significantly. i.g. if the source value is big-endian + * 0x0000000f, executing the casting on little-endian machine will get a big number 0x0f000000. Then + * it can't meet the condition "if (src_nmembs < 2 || ((double)length / (double)src_nmembs < + * (double)(1.2F)))" Because this is the optimized code, we won't fix it. It should still work in some + * situations. SLU - 2011/5/24) + */ + if (1 == src_sh->size || sizeof(short) == src_sh->size || sizeof(int) == src_sh->size) { + unsigned length; + int domain[2] = {0, 0}; /* Min and max source values */ + + for (size_t i = 0; i < src_nmembs; i++) { + int n; + + if (1 == src_sh->size) + n = *((signed char *)((uint8_t *)src_sh->u.enumer.value + i)); + else if (sizeof(short) == src_sh->size) + n = *((short *)((void *)((uint8_t *)src_sh->u.enumer.value + (i * src_sh->size)))); else - n = *( - (int *)((void *)((uint8_t *)src->shared->u.enumer.value + (i * src->shared->size)))); - n -= priv->base; - assert(n >= 0 && (unsigned)n < priv->length); - assert(map[n] < 0); - map[n] = priv->src2dst[i]; - } /* end for */ + n = *((int *)((void *)((uint8_t *)src_sh->u.enumer.value + (i * src_sh->size)))); + if (0 == i) { + domain[0] = domain[1] = n; + } + else { + domain[0] = MIN(domain[0], n); + domain[1] = MAX(domain[1], n); + } + } + assert(domain[1] >= domain[0]); - /* - * Replace original src2dst array with our new one. The original - * was indexed by source member number while the new one is - * indexed by source values. - */ - H5MM_xfree(priv->src2dst); - priv->src2dst = map; - HGOTO_DONE(SUCCEED); + length = (unsigned)(domain[1] - domain[0]) + 1; + if (src_nmembs < 2 || ((double)length / (double)src_nmembs < (double)(1.2F))) { + priv->base = domain[0]; + priv->length = length; + + if (NULL == (map = malloc(length * sizeof(int)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed"); + + for (size_t i = 0; i < length; i++) + map[i] = -1; /*entry unused*/ + + for (size_t i = 0; i < src_nmembs; i++) { + int n; + + if (1 == src_sh->size) + n = *((signed char *)((uint8_t *)src_sh->u.enumer.value + i)); + else if (sizeof(short) == src_sh->size) + n = *((short *)((void *)((uint8_t *)src_sh->u.enumer.value + (i * src_sh->size)))); + else + n = *((int *)((void *)((uint8_t *)src_sh->u.enumer.value + (i * src_sh->size)))); + n -= priv->base; + assert(n >= 0 && (unsigned)n < priv->length); + assert(map[n] < 0); + map[n] = priv->src2dst[i]; + } + + /* + * Replace original src2dst array with our new one. The original + * was indexed by source member number while the new one is + * indexed by source values. + */ + free(priv->src2dst); + priv->src2dst = map; + + HGOTO_DONE(SUCCEED); + } } + + /* Sort source type by value and adjust src2dst[] appropriately */ + H5T__sort_value(priv->src_copy, priv->src2dst); } - /* Sort source type by value and adjust src2dst[] appropriately */ - H5T__sort_value(src, priv->src2dst); +#ifdef H5T_DEBUG + if (H5DEBUG(T)) { + fprintf(H5DEBUG(T), " Using %s mapping function%s\n", priv->length ? "O(1)" : "O(log N)", + priv->length ? "" : ", where N is the number of enum members"); + } +#endif done: if (ret_value < 0 && priv) { - H5MM_xfree(priv->src2dst); - H5MM_xfree(priv); + if (map) { + free(map); + priv->src2dst = NULL; + } + + if (H5T__conv_enum_free(priv) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't free enum conversion data"); + cdata->priv = NULL; } + FUNC_LEAVE_NOAPI(ret_value) } @@ -2892,17 +3105,20 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) *------------------------------------------------------------------------- */ herr_t -H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_enum(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, + void H5_ATTR_UNUSED *bkg) { - uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ - uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ - ssize_t src_delta, dst_delta; /*conversion strides */ - int n; /*src value cast as native int */ - H5T_enum_struct_t *priv = (H5T_enum_struct_t *)(cdata->priv); - H5T_conv_ret_t except_ret; /*return of callback function */ - size_t i; /*counters */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_conv_enum_t *priv = (H5T_conv_enum_t *)(cdata->priv); + H5T_shared_t *src_sh = NULL; + H5T_shared_t *dst_sh = NULL; + uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ + uint8_t *s = NULL, *d = NULL; /*src and dst BUF pointers */ + ssize_t src_delta, dst_delta; /*conversion strides */ + int n; /*src value cast as native int */ + H5T_conv_ret_t except_ret; /*return of callback function */ + size_t i; /*counters */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2921,23 +3137,18 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t if (H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype"); - if (H5T__conv_enum_init(src, dst, cdata) < 0) + if (H5T__conv_enum_init(src, dst, cdata, conv_ctx) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize private data"); break; - case H5T_CONV_FREE: -#ifdef H5T_DEBUG - if (H5DEBUG(T)) { - fprintf(H5DEBUG(T), " Using %s mapping function%s\n", priv->length ? "O(1)" : "O(log N)", - priv->length ? "" : ", where N is the number of enum members"); - } -#endif - if (priv) { - H5MM_xfree(priv->src2dst); - H5MM_xfree(priv); - } - cdata->priv = NULL; + case H5T_CONV_FREE: { + herr_t status = H5T__conv_enum_free(priv); + cdata->priv = NULL; + if (status < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free private conversion data"); + break; + } case H5T_CONV_CONV: if (NULL == src || NULL == dst) @@ -2949,13 +3160,12 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t if (H5T_ENUM != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype"); - /* priv->src2dst map was computed for certain sort keys. Make sure those same - * sort keys are used here during conversion. See H5T__conv_enum_init(). But - * we actually don't care about the source type's order when doing the O(1) - * conversion algorithm, which is turned on by non-zero priv->length */ - H5T__sort_name(dst, NULL); - if (!priv->length) - H5T__sort_value(src, NULL); + /* Reuse cache if possible, rebuild otherwise */ + if (H5T__conv_enum_init(src, dst, cdata, conv_ctx) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize private data"); + + src_sh = priv->src_copy->shared; + dst_sh = priv->dst_copy->shared; /* * Direction of conversion. @@ -2965,32 +3175,32 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t src_delta = dst_delta = (ssize_t)buf_stride; s = d = buf; } - else if (dst->shared->size <= src->shared->size) { - H5_CHECKED_ASSIGN(src_delta, ssize_t, src->shared->size, size_t); - H5_CHECKED_ASSIGN(dst_delta, ssize_t, dst->shared->size, size_t); + else if (dst_sh->size <= src_sh->size) { + H5_CHECKED_ASSIGN(src_delta, ssize_t, src_sh->size, size_t); + H5_CHECKED_ASSIGN(dst_delta, ssize_t, dst_sh->size, size_t); s = d = buf; } else { - H5_CHECK_OVERFLOW(src->shared->size, size_t, ssize_t); - H5_CHECK_OVERFLOW(dst->shared->size, size_t, ssize_t); - src_delta = -(ssize_t)src->shared->size; - dst_delta = -(ssize_t)dst->shared->size; - s = buf + (nelmts - 1) * src->shared->size; - d = buf + (nelmts - 1) * dst->shared->size; + H5_CHECK_OVERFLOW(src_sh->size, size_t, ssize_t); + H5_CHECK_OVERFLOW(dst_sh->size, size_t, ssize_t); + src_delta = -(ssize_t)src_sh->size; + dst_delta = -(ssize_t)dst_sh->size; + s = buf + (nelmts - 1) * src_sh->size; + d = buf + (nelmts - 1) * dst_sh->size; } - for (i = 0; i < nelmts; i++, s += src_delta, d += dst_delta) { - if (priv->length) { + if (priv->length) { + for (i = 0; i < nelmts; i++, s += src_delta, d += dst_delta) { /* Use O(1) lookup */ /* (The casting won't work when the byte orders are different. i.g. if the source value - * is big-endian 0x0000000f, the direct casting "n = *((int*)s);" will make it a big - * number 0x0f000000 on little-endian machine. But we won't fix it because it's an - * optimization code. Please also see the comment in the H5T__conv_enum_init() function. - * SLU - 2011/5/24) + * is big-endian 0x0000000f, the direct casting "n = *((int *)((void *)s));" will make + * it a big number 0x0f000000 on little-endian machine. But we won't fix it because it's + * an optimization code. Please also see the comment in the H5T__conv_enum_init() + * function. SLU - 2011/5/24) */ - if (1 == src->shared->size) + if (1 == src_sh->size) n = *((signed char *)s); - else if (sizeof(short) == src->shared->size) + else if (sizeof(short) == src_sh->size) n = *((short *)((void *)s)); else n = *((int *)((void *)s)); @@ -3005,28 +3215,30 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t conv_ctx->u.conv.dst_type_id, s, d, conv_ctx->u.conv.cb_struct.user_data); if (except_ret == H5T_CONV_UNHANDLED) - memset(d, 0xff, dst->shared->size); + memset(d, 0xff, dst_sh->size); else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); } else H5MM_memcpy(d, - (uint8_t *)dst->shared->u.enumer.value + - ((unsigned)priv->src2dst[n] * dst->shared->size), - dst->shared->size); - } /* end if */ - else { + (uint8_t *)dst_sh->u.enumer.value + + ((unsigned)priv->src2dst[n] * dst_sh->size), + dst_sh->size); + } + } + else { + for (i = 0; i < nelmts; i++, s += src_delta, d += dst_delta) { /* Use O(log N) lookup */ unsigned lt = 0; - unsigned rt = src->shared->u.enumer.nmembs; + unsigned rt = src_sh->u.enumer.nmembs; unsigned md = 0; int cmp; while (lt < rt) { - md = (lt + rt) / 2; - cmp = memcmp(s, (uint8_t *)src->shared->u.enumer.value + (md * src->shared->size), - src->shared->size); + md = (lt + rt) / 2; + cmp = + memcmp(s, (uint8_t *)src_sh->u.enumer.value + (md * src_sh->size), src_sh->size); if (cmp < 0) rt = md; else if (cmp > 0) @@ -3043,7 +3255,7 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t conv_ctx->u.conv.dst_type_id, s, d, conv_ctx->u.conv.cb_struct.user_data); if (except_ret == H5T_CONV_UNHANDLED) - memset(d, 0xff, dst->shared->size); + memset(d, 0xff, dst_sh->size); else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); @@ -3051,11 +3263,11 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t else { assert(priv->src2dst[md] >= 0); H5MM_memcpy(d, - (uint8_t *)dst->shared->u.enumer.value + - ((unsigned)priv->src2dst[md] * dst->shared->size), - dst->shared->size); + (uint8_t *)dst_sh->u.enumer.value + + ((unsigned)priv->src2dst[md] * dst_sh->size), + dst_sh->size); } /* end else */ - } /* end else */ + } } break; @@ -3084,13 +3296,12 @@ H5T__conv_enum(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_enum_numeric(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, +H5T__conv_enum_numeric(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t nelmts, size_t H5_ATTR_UNUSED buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *_buf, void H5_ATTR_UNUSED *bkg) { H5T_t *src_parent; /*parent type for src */ - H5T_t *tmp_type = NULL; /*temporary datatype for parent type */ H5T_path_t *tpath; /* Conversion information */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3126,11 +3337,8 @@ H5T__conv_enum_numeric(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, "unable to convert between src and dest datatype"); } else if (!H5T_path_noop(tpath)) { - if (NULL == (tmp_type = H5T_copy(src_parent, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "can't copy parent datatype"); - /* Convert the data */ - if (H5T_convert(tpath, tmp_type, dst, nelmts, buf_stride, bkg_stride, _buf, bkg) < 0) + if (H5T_convert(tpath, src_parent, dst, nelmts, buf_stride, bkg_stride, _buf, bkg) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); } break; @@ -3141,10 +3349,6 @@ H5T__conv_enum_numeric(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, } /* end switch */ done: - /* Release the temporary datatype used */ - if (tmp_type && (H5T_close(tmp_type) < 0)) - HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__conv_enum_numeric() */ @@ -3231,8 +3435,8 @@ H5T__conv_vlen_nested_free(uint8_t *buf, H5T_t *dt) *------------------------------------------------------------------------- */ herr_t -H5T__conv_vlen(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) +H5T__conv_vlen(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) { H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ H5T_conv_ctx_t tmp_conv_ctx = {0}; /* Temporary conversion context */ @@ -3544,10 +3748,12 @@ H5T__conv_vlen(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t } /* end if */ /* Convert VL sequence */ + tmp_conv_ctx.u.conv.recursive = true; if (H5T_convert_with_ctx(tpath, tsrc_cpy, tdst_cpy, &tmp_conv_ctx, seq_len, (size_t)0, (size_t)0, conv_buf, tmp_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); + tmp_conv_ctx.u.conv.recursive = false; } /* end if */ /* Write sequence to destination location */ @@ -3636,8 +3842,9 @@ H5T__conv_vlen(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_array(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, - size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void H5_ATTR_UNUSED *_bkg) +H5T__conv_array(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, + const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t nelmts, size_t buf_stride, + size_t bkg_stride, void *_buf, void H5_ATTR_UNUSED *_bkg) { H5T_conv_ctx_t tmp_conv_ctx = {0}; /* Temporary conversion context */ H5T_path_t *tpath; /* Type conversion path */ @@ -3764,6 +3971,7 @@ H5T__conv_array(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t } /* end if */ /* Perform the actual conversion */ + tmp_conv_ctx.u.conv.recursive = true; for (size_t elmtno = 0; elmtno < nelmts; elmtno++) { /* Copy the source array into the correct location for the destination */ memmove(dp, sp, src->shared->size); @@ -3777,6 +3985,7 @@ H5T__conv_array(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t sp += src_delta; dp += dst_delta; } /* end for */ + tmp_conv_ctx.u.conv.recursive = false; break; @@ -3820,8 +4029,9 @@ H5T__conv_array(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_ref(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, - size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg) +H5T__conv_ref(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, + const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t nelmts, size_t buf_stride, + size_t bkg_stride, void *buf, void *bkg) { uint8_t *s = NULL; /* source buffer */ uint8_t *d = NULL; /* destination buffer */ @@ -4030,8 +4240,9 @@ H5T__conv_ref(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H *------------------------------------------------------------------------- */ herr_t -H5T__conv_i_i(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_i_i(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ @@ -4477,8 +4688,9 @@ H5T__conv_i_i(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t * *------------------------------------------------------------------------- */ herr_t -H5T__conv_f_f(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_f_f(const H5T_t *src_p, const H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_atomic_t src; /*atomic source info */ @@ -5067,9 +5279,9 @@ H5T__conv_f_f(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_s_s(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, - size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, - void H5_ATTR_UNUSED *bkg) +H5T__conv_s_s(const H5T_t *src, const H5T_t *dst, H5T_cdata_t *cdata, + const H5T_conv_ctx_t H5_ATTR_UNUSED *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ @@ -5309,8 +5521,8 @@ H5T__conv_s_s(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, const H5T_conv_ctx_t H *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_schar_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(SCHAR, UCHAR, signed char, unsigned char, -, -); @@ -5328,8 +5540,8 @@ H5T__conv_schar_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uchar_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(UCHAR, SCHAR, unsigned char, signed char, -, SCHAR_MAX); @@ -5347,8 +5559,8 @@ H5T__conv_uchar_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_schar_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, SHORT, signed char, short, -, -); @@ -5366,7 +5578,7 @@ H5T__conv_schar_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_schar_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5385,8 +5597,8 @@ H5T__conv_schar_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uchar_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, SHORT, unsigned char, short, -, SHRT_MAX); @@ -5404,7 +5616,7 @@ H5T__conv_uchar_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_uchar_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5423,8 +5635,9 @@ H5T__conv_uchar_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_schar_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, INT, signed char, int, -, -); } @@ -5441,8 +5654,9 @@ H5T__conv_schar_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_schar_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, UINT, signed char, unsigned, -, -); } @@ -5459,8 +5673,9 @@ H5T__conv_schar_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uchar_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, INT, unsigned char, int, -, INT_MAX); } @@ -5477,8 +5692,9 @@ H5T__conv_uchar_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uchar_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, UINT, unsigned char, unsigned, -, -); } @@ -5495,8 +5711,9 @@ H5T__conv_uchar_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_schar_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, LONG, signed char, long, -, -); } @@ -5513,8 +5730,8 @@ H5T__conv_schar_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_schar_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SCHAR, ULONG, signed char, unsigned long, -, -); @@ -5532,8 +5749,9 @@ H5T__conv_schar_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uchar_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, LONG, unsigned char, long, -, LONG_MAX); } @@ -5550,8 +5768,8 @@ H5T__conv_uchar_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uchar_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UCHAR, ULONG, unsigned char, unsigned long, -, -); @@ -5569,8 +5787,8 @@ H5T__conv_uchar_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_schar_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SCHAR, LLONG, signed char, long long, -, -); @@ -5588,7 +5806,7 @@ H5T__conv_schar_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_schar_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5607,8 +5825,8 @@ H5T__conv_schar_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uchar_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UCHAR, LLONG, unsigned char, long long, -, LLONG_MAX); @@ -5626,7 +5844,7 @@ H5T__conv_uchar_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_uchar_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5645,8 +5863,8 @@ H5T__conv_uchar_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_short_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(SHORT, SCHAR, short, signed char, SCHAR_MIN, SCHAR_MAX); @@ -5664,8 +5882,8 @@ H5T__conv_short_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_short_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(SHORT, UCHAR, short, unsigned char, -, UCHAR_MAX); @@ -5683,7 +5901,7 @@ H5T__conv_short_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5702,7 +5920,7 @@ H5T__conv_ushort_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5721,7 +5939,7 @@ H5T__conv_ushort_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_short_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5740,7 +5958,7 @@ H5T__conv_short_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5759,8 +5977,9 @@ H5T__conv_ushort_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_short_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, INT, short, int, -, -); } @@ -5777,8 +5996,9 @@ H5T__conv_short_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_short_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, UINT, short, unsigned, -, -); } @@ -5795,8 +6015,9 @@ H5T__conv_short_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_ushort_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, INT, unsigned short, int, -, INT_MAX); } @@ -5813,8 +6034,8 @@ H5T__conv_ushort_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ushort_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(USHORT, UINT, unsigned short, unsigned, -, -); @@ -5832,8 +6053,9 @@ H5T__conv_ushort_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_short_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, LONG, short, long, -, -); } @@ -5850,8 +6072,8 @@ H5T__conv_short_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_short_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(SHORT, ULONG, short, unsigned long, -, -); @@ -5869,8 +6091,8 @@ H5T__conv_short_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ushort_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(USHORT, LONG, unsigned short, long, -, LONG_MAX); @@ -5888,7 +6110,7 @@ H5T__conv_ushort_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5907,8 +6129,8 @@ H5T__conv_ushort_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_short_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(SHORT, LLONG, short, long long, -, -); @@ -5926,7 +6148,7 @@ H5T__conv_short_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_short_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5945,7 +6167,7 @@ H5T__conv_short_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5964,7 +6186,7 @@ H5T__conv_ushort_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -5983,8 +6205,9 @@ H5T__conv_ushort_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(INT, SCHAR, int, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6001,8 +6224,9 @@ H5T__conv_int_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(INT, UCHAR, int, unsigned char, -, UCHAR_MAX); } @@ -6019,8 +6243,9 @@ H5T__conv_int_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(UINT, SCHAR, unsigned, signed char, -, SCHAR_MAX); } @@ -6037,8 +6262,9 @@ H5T__conv_uint_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); } @@ -6055,8 +6281,9 @@ H5T__conv_uint_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(INT, SHORT, int, short, SHRT_MIN, SHRT_MAX); } @@ -6073,8 +6300,9 @@ H5T__conv_int_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(INT, USHORT, int, unsigned short, -, USHRT_MAX); } @@ -6091,8 +6319,9 @@ H5T__conv_int_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(UINT, SHORT, unsigned, short, -, SHRT_MAX); } @@ -6109,8 +6338,8 @@ H5T__conv_uint_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uint_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(UINT, USHORT, unsigned, unsigned short, -, USHRT_MAX); @@ -6128,8 +6357,9 @@ H5T__conv_uint_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(INT, UINT, int, unsigned, -, -); } @@ -6146,8 +6376,9 @@ H5T__conv_int_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(UINT, INT, unsigned, int, -, INT_MAX); } @@ -6164,8 +6395,9 @@ H5T__conv_uint_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(INT, LONG, int, long, -, -); } @@ -6182,8 +6414,9 @@ H5T__conv_int_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(INT, LONG, int, unsigned long, -, -); } @@ -6200,8 +6433,9 @@ H5T__conv_int_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UINT, LONG, unsigned, long, -, LONG_MAX); } @@ -6218,8 +6452,9 @@ H5T__conv_uint_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UINT, ULONG, unsigned, unsigned long, -, -); } @@ -6236,8 +6471,9 @@ H5T__conv_uint_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(INT, LLONG, int, long long, -, -); } @@ -6254,8 +6490,9 @@ H5T__conv_int_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(INT, ULLONG, int, unsigned long long, -, -); } @@ -6272,8 +6509,9 @@ H5T__conv_int_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(UINT, LLONG, unsigned, long long, -, LLONG_MAX); } @@ -6290,8 +6528,8 @@ H5T__conv_uint_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uint_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uU(UINT, ULLONG, unsigned, unsigned long long, -, -); @@ -6309,8 +6547,9 @@ H5T__conv_uint_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, SCHAR, long, signed char, SCHAR_MIN, SCHAR_MAX); } @@ -6327,8 +6566,9 @@ H5T__conv_long_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, UCHAR, long, unsigned char, -, UCHAR_MAX); } @@ -6345,8 +6585,8 @@ H5T__conv_long_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ulong_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, SCHAR, unsigned long, signed char, -, SCHAR_MAX); @@ -6364,8 +6604,8 @@ H5T__conv_ulong_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ulong_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, UCHAR, unsigned long, unsigned char, -, UCHAR_MAX); @@ -6383,8 +6623,9 @@ H5T__conv_ulong_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, SHORT, long, short, SHRT_MIN, SHRT_MAX); } @@ -6401,8 +6642,8 @@ H5T__conv_long_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_long_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, USHORT, long, unsigned short, -, USHRT_MAX); @@ -6420,8 +6661,8 @@ H5T__conv_long_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ulong_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, SHORT, unsigned long, short, -, SHRT_MAX); @@ -6439,7 +6680,7 @@ H5T__conv_ulong_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ulong_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6458,8 +6699,9 @@ H5T__conv_ulong_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LONG, INT, long, int, INT_MIN, INT_MAX); } @@ -6476,8 +6718,9 @@ H5T__conv_long_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LONG, UINT, long, unsigned, -, UINT_MAX); } @@ -6494,8 +6737,9 @@ H5T__conv_long_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_ulong_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULONG, INT, unsigned long, int, -, INT_MAX); } @@ -6512,8 +6756,9 @@ H5T__conv_ulong_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_ulong_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULONG, UINT, unsigned long, unsigned, -, UINT_MAX); } @@ -6530,8 +6775,9 @@ H5T__conv_ulong_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_su(LONG, ULONG, long, unsigned long, -, -); } @@ -6548,8 +6794,9 @@ H5T__conv_long_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_ulong_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_us(ULONG, LONG, unsigned long, long, -, LONG_MAX); } @@ -6566,8 +6813,9 @@ H5T__conv_ulong_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_sS(LONG, LLONG, long, long long, -, -); } @@ -6584,8 +6832,8 @@ H5T__conv_long_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_long_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_sU(LONG, ULLONG, long, unsigned long long, -, -); @@ -6603,8 +6851,8 @@ H5T__conv_long_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ulong_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_uS(ULONG, LLONG, unsigned long, long long, -, LLONG_MAX); @@ -6622,7 +6870,7 @@ H5T__conv_ulong_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ulong_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6641,8 +6889,8 @@ H5T__conv_ulong_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_llong_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, SCHAR, long long, signed char, SCHAR_MIN, SCHAR_MAX); @@ -6660,8 +6908,8 @@ H5T__conv_llong_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_llong_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, UCHAR, long long, unsigned char, -, UCHAR_MAX); @@ -6679,7 +6927,7 @@ H5T__conv_llong_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6698,7 +6946,7 @@ H5T__conv_ullong_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6717,8 +6965,8 @@ H5T__conv_ullong_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_llong_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, SHORT, long long, short, SHRT_MIN, SHRT_MAX); @@ -6736,7 +6984,7 @@ H5T__conv_llong_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_llong_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6755,7 +7003,7 @@ H5T__conv_llong_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6774,7 +7022,7 @@ H5T__conv_ullong_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6793,8 +7041,9 @@ H5T__conv_ullong_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_llong_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, INT, long long, int, INT_MIN, INT_MAX); } @@ -6811,8 +7060,9 @@ H5T__conv_llong_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_llong_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, UINT, long long, unsigned, -, UINT_MAX); } @@ -6829,8 +7079,9 @@ H5T__conv_llong_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_ullong_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, INT, unsigned long long, int, -, INT_MAX); } @@ -6847,8 +7098,8 @@ H5T__conv_ullong_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ullong_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Uu(ULLONG, UINT, unsigned long long, unsigned, -, UINT_MAX); @@ -6866,8 +7117,9 @@ H5T__conv_ullong_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_llong_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_Ss(LLONG, LONG, long long, long, LONG_MIN, LONG_MAX); } @@ -6884,8 +7136,8 @@ H5T__conv_llong_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_llong_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Su(LLONG, ULONG, long long, unsigned long, -, ULONG_MAX); @@ -6903,8 +7155,8 @@ H5T__conv_llong_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ullong_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_Us(ULLONG, LONG, unsigned long long, long, -, LONG_MAX); @@ -6922,7 +7174,7 @@ H5T__conv_ullong_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6941,7 +7193,7 @@ H5T__conv_ullong_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_llong_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6960,7 +7212,7 @@ H5T__conv_llong_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6978,7 +7230,7 @@ H5T__conv_ullong_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_float_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -6996,7 +7248,7 @@ H5T__conv_float_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_float_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7014,7 +7266,7 @@ H5T__conv_float_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7032,7 +7284,7 @@ H5T__conv_double_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7050,7 +7302,7 @@ H5T__conv_double_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7068,7 +7320,7 @@ H5T__conv_ldouble_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7086,8 +7338,8 @@ H5T__conv_ldouble_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_schar_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); @@ -7104,7 +7356,7 @@ H5T__conv_schar_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_schar_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7122,7 +7374,7 @@ H5T__conv_schar_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_schar_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7140,8 +7392,8 @@ H5T__conv_schar_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uchar_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); @@ -7158,7 +7410,7 @@ H5T__conv_uchar_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_uchar_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7176,7 +7428,7 @@ H5T__conv_uchar_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_uchar_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7194,8 +7446,8 @@ H5T__conv_uchar_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_short_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); @@ -7212,7 +7464,7 @@ H5T__conv_short_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_short_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7230,7 +7482,7 @@ H5T__conv_short_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_short_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7248,7 +7500,7 @@ H5T__conv_short_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7266,7 +7518,7 @@ H5T__conv_ushort_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7284,7 +7536,7 @@ H5T__conv_ushort_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ushort_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7302,8 +7554,9 @@ H5T__conv_ushort_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, FLOAT, int, float, -, -); } @@ -7319,8 +7572,9 @@ H5T__conv_int_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_int_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, DOUBLE, int, double, -, -); } @@ -7336,8 +7590,8 @@ H5T__conv_int_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_int_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); @@ -7354,8 +7608,9 @@ H5T__conv_int_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_uint_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); } @@ -7371,8 +7626,8 @@ H5T__conv_uint_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_uint_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); @@ -7389,7 +7644,7 @@ H5T__conv_uint_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_uint_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7407,8 +7662,9 @@ H5T__conv_uint_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_long_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, FLOAT, long, float, -, -); } @@ -7424,8 +7680,8 @@ H5T__conv_long_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_long_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); @@ -7442,7 +7698,7 @@ H5T__conv_long_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_long_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7460,8 +7716,8 @@ H5T__conv_long_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ulong_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); @@ -7478,7 +7734,7 @@ H5T__conv_ulong_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ulong_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7496,7 +7752,7 @@ H5T__conv_ulong_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ulong_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7514,8 +7770,8 @@ H5T__conv_ulong_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_llong_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5T_CONV_xF(LLONG, FLOAT, long long, float, -, -); @@ -7532,7 +7788,7 @@ H5T__conv_llong_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_llong_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7551,7 +7807,7 @@ H5T__conv_llong_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ */ #ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE herr_t -H5T__conv_llong_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_llong_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7570,7 +7826,7 @@ H5T__conv_llong_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7588,7 +7844,7 @@ H5T__conv_ullong_float(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7607,7 +7863,7 @@ H5T__conv_ullong_double(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv */ #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE herr_t -H5T__conv_ullong_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ullong_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7626,8 +7882,8 @@ H5T__conv_ullong_ldouble(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_float_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -7646,8 +7902,8 @@ H5T__conv_float_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_float_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -7666,7 +7922,7 @@ H5T__conv_float_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7686,7 +7942,7 @@ H5T__conv_double_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7706,7 +7962,7 @@ H5T__conv_double_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7726,7 +7982,7 @@ H5T__conv_ldouble_schar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7746,8 +8002,8 @@ H5T__conv_ldouble_uchar(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_float_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -7766,7 +8022,7 @@ H5T__conv_float_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_float_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7786,7 +8042,7 @@ H5T__conv_float_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7806,7 +8062,7 @@ H5T__conv_double_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7826,7 +8082,7 @@ H5T__conv_double_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7846,7 +8102,7 @@ H5T__conv_ldouble_short(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7866,8 +8122,9 @@ H5T__conv_ldouble_ushort(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_float_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); @@ -7885,8 +8142,9 @@ H5T__conv_float_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_float_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); @@ -7904,8 +8162,9 @@ H5T__conv_float_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_double_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); @@ -7923,8 +8182,8 @@ H5T__conv_double_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_double_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -7943,8 +8202,8 @@ H5T__conv_double_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_ldouble_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -7963,7 +8222,7 @@ H5T__conv_ldouble_int(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -7983,8 +8242,9 @@ H5T__conv_ldouble_uint(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_float_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); @@ -8002,8 +8262,8 @@ H5T__conv_float_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ct *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_float_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -8022,8 +8282,8 @@ H5T__conv_float_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_double_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -8042,7 +8302,7 @@ H5T__conv_double_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8062,7 +8322,7 @@ H5T__conv_double_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8082,7 +8342,7 @@ H5T__conv_ldouble_long(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8102,8 +8362,8 @@ H5T__conv_ldouble_ulong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, +H5T__conv_float_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { H5_GCC_CLANG_DIAG_OFF("float-equal") @@ -8122,7 +8382,7 @@ H5T__conv_float_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_c *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_float_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8142,7 +8402,7 @@ H5T__conv_float_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8162,7 +8422,7 @@ H5T__conv_double_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_double_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8183,7 +8443,7 @@ H5T__conv_double_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv */ #ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG herr_t -H5T__conv_ldouble_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8205,7 +8465,7 @@ H5T__conv_ldouble_llong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv */ #ifdef H5T_CONV_INTERNAL_LDOUBLE_ULLONG herr_t -H5T__conv_ldouble_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, +H5T__conv_ldouble_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) { @@ -8215,6 +8475,255 @@ H5T__conv_ldouble_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con } #endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/ +/* Conversions for _Float16 type */ +#ifdef H5_HAVE__FLOAT16 +herr_t +H5T__conv_schar__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_xF(SCHAR, FLOAT16, signed char, H5__Float16, -, -); +} + +herr_t +H5T__conv_uchar__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_xF(UCHAR, FLOAT16, unsigned char, H5__Float16, -, -); +} + +herr_t +H5T__conv_short__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_xF(SHORT, FLOAT16, short, H5__Float16, -, -); +} + +herr_t +H5T__conv_ushort__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(USHORT, FLOAT16, unsigned short, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_int__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(INT, FLOAT16, int, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_uint__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(UINT, FLOAT16, unsigned int, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_long__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(LONG, FLOAT16, long, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_ulong__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(ULONG, FLOAT16, unsigned long, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_llong__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(LLONG, FLOAT16, long long, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_ullong__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Xf(ULLONG, FLOAT16, unsigned long long, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_float__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Ff(FLOAT, FLOAT16, float, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +herr_t +H5T__conv_double__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Ff(DOUBLE, FLOAT16, double, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} + +#ifdef H5T_CONV_INTERNAL_LDOUBLE_FLOAT16 +herr_t +H5T__conv_ldouble__Float16(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + /* Suppress warning about non-standard floating-point literal suffix */ + H5_GCC_CLANG_DIAG_OFF("pedantic") + H5T_CONV_Ff(LDOUBLE, FLOAT16, long double, H5__Float16, -FLT16_MAX, FLT16_MAX); + H5_GCC_CLANG_DIAG_ON("pedantic") +} +#endif + +herr_t +H5T__conv__Float16_schar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5_GCC_CLANG_DIAG_OFF("float-equal") + H5T_CONV_Fx(FLOAT16, SCHAR, H5__Float16, signed char, SCHAR_MIN, SCHAR_MAX); + H5_GCC_CLANG_DIAG_ON("float-equal") +} + +herr_t +H5T__conv__Float16_uchar(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5_GCC_CLANG_DIAG_OFF("float-equal") + H5T_CONV_Fx(FLOAT16, UCHAR, H5__Float16, unsigned char, 0, UCHAR_MAX); + H5_GCC_CLANG_DIAG_ON("float-equal") +} + +herr_t +H5T__conv__Float16_short(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5_GCC_CLANG_DIAG_OFF("float-equal") + H5T_CONV_Fx(FLOAT16, SHORT, H5__Float16, short, SHRT_MIN, SHRT_MAX); + H5_GCC_CLANG_DIAG_ON("float-equal") +} + +herr_t +H5T__conv__Float16_ushort(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, USHORT, H5__Float16, unsigned short, 0, USHRT_MAX); +} + +herr_t +H5T__conv__Float16_int(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, INT, H5__Float16, int, INT_MIN, INT_MAX); +} + +herr_t +H5T__conv__Float16_uint(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, UINT, H5__Float16, unsigned int, 0, UINT_MAX); +} + +herr_t +H5T__conv__Float16_long(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, LONG, H5__Float16, long, LONG_MIN, LONG_MAX); +} + +herr_t +H5T__conv__Float16_ulong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, ULONG, H5__Float16, unsigned long, 0, ULONG_MAX); +} + +herr_t +H5T__conv__Float16_llong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, LLONG, H5__Float16, long long, LLONG_MIN, LLONG_MAX); +} + +herr_t +H5T__conv__Float16_ullong(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fX(FLOAT16, ULLONG, H5__Float16, unsigned long long, 0, ULLONG_MAX); +} + +herr_t +H5T__conv__Float16_float(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fF(FLOAT16, FLOAT, H5__Float16, float, -, -); +} + +herr_t +H5T__conv__Float16_double(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fF(FLOAT16, DOUBLE, H5__Float16, double, -, -); +} + +herr_t +H5T__conv__Float16_ldouble(const H5T_t *st, const H5T_t *dt, H5T_cdata_t *cdata, + const H5T_conv_ctx_t *conv_ctx, size_t nelmts, size_t buf_stride, + size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +{ + H5T_CONV_fF(FLOAT16, LDOUBLE, H5__Float16, long double, -, -); +} +#endif + /*------------------------------------------------------------------------- * Function: H5T__conv_f_i * @@ -8227,8 +8736,9 @@ H5T__conv_ldouble_ullong(H5T_t *st, H5T_t *dt, H5T_cdata_t *cdata, const H5T_con *------------------------------------------------------------------------- */ herr_t -H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_f_i(const H5T_t *src_p, const H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_atomic_t src; /*atomic source info */ @@ -8249,8 +8759,9 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx uint8_t *int_buf = NULL; /*buffer for temporary value */ size_t buf_size; /*buffer size for temporary value */ size_t i; /*miscellaneous counters */ - size_t first; /*first bit(MSB) in an integer */ - ssize_t sfirst; /*a signed version of `first' */ + ssize_t msb_pos_s; /*first bit(MSB) in an integer */ + ssize_t new_msb_pos; /*MSB position after shifting mantissa by exponent */ + hssize_t shift_val; /*shift value when shifting mantissa by exponent */ bool truncated; /*if fraction value is dropped */ bool reverse; /*if reverse order of destination at the end */ H5T_conv_ret_t except_ret; /*return of callback function */ @@ -8314,8 +8825,11 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx /* Allocate enough space for the buffer holding temporary * converted value */ - buf_size = (size_t)(pow(2.0, (double)src.u.f.esize) / 8 + 1); - int_buf = (uint8_t *)H5MM_calloc(buf_size); + if (dst.prec / 8 > src_p->shared->size) + buf_size = (dst.prec + 7) / 8; + else + buf_size = src_p->shared->size; + int_buf = (uint8_t *)H5MM_calloc(buf_size); /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src_p->shared->size); @@ -8580,36 +9094,47 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx if (H5T_NORM_IMPLIED == src.u.f.norm) H5T__bit_inc(int_buf, src.u.f.msize, 8 * buf_size - src.u.f.msize); + /* + * What is the bit position for the most significant bit(MSB) of S + * which is set? This is checked before shifting and before possibly + * converting to a negative integer. Note that later use of this value + * assumes that H5T__bit_shift will always shift in 0 during a right + * shift. + */ + msb_pos_s = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, true); + + /* + * The temporary buffer has no bits set and must therefore be + * zero; nothing to do. + */ + if (msb_pos_s < 0) + goto padding; + /* * Shift mantissa part by exponent minus mantissa size(right shift), * or by mantissa size minus exponent(left shift). Example: Sequence * 10...010111, expo=20, expo-msize=-3. Right-shift the sequence, we get * 00010...10. The last three bits were dropped. */ - H5T__bit_shift(int_buf, expo - (ssize_t)src.u.f.msize, (size_t)0, buf_size * 8); + shift_val = expo - (ssize_t)src.u.f.msize; + H5T__bit_shift(int_buf, shift_val, (size_t)0, buf_size * 8); + + /* Calculate the new position of the MSB after shifting and + * skip to the padding section if we shifted exactly to 0 + * (MSB position is -1) + */ + new_msb_pos = msb_pos_s + shift_val; + if (new_msb_pos == -1) + goto padding; /* - * If expo is less than mantissa size, the frantional value is dropped off + * If expo is less than mantissa size, the fractional value is dropped off * during conversion. Set exception type to be "truncate" */ if ((size_t)expo < src.u.f.msize && conv_ctx->u.conv.cb_struct.func) truncated = true; - /* - * What is the bit position for the most significant bit(MSB) of S - * which is set? This is checked before converted to negative - * integer. - */ - sfirst = H5T__bit_find(int_buf, (size_t)0, 8 * buf_size, H5T_BIT_MSB, true); - first = (size_t)sfirst; - - if (sfirst < 0) { - /* - * The source has no bits set and must therefore be zero. - * Set the destination to zero - nothing to do. - */ - } - else if (H5T_SGN_NONE == dst.u.i.sign) { /*destination is unsigned*/ + if (H5T_SGN_NONE == dst.u.i.sign) { /*destination is unsigned*/ /* * Destination is unsigned. Library's default way: If the source value * is greater than the maximal destination value then it overflows, the @@ -8639,7 +9164,7 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx } } else { /*source is positive*/ - if (first >= dst.prec) { + if (new_msb_pos >= (ssize_t)dst.prec) { /*overflow*/ if (conv_ctx->u.conv.cb_struct .func) { /*If user's exception handler is present, use it*/ @@ -8663,7 +9188,7 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); } - else if (first < dst.prec) { + else { if (truncated && conv_ctx->u.conv.cb_struct .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ @@ -8675,9 +9200,11 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx conv_ctx->u.conv.cb_struct.user_data); } - if (except_ret == H5T_CONV_UNHANDLED) + if (except_ret == H5T_CONV_UNHANDLED) { /*copy source value into it if case is ignored by user handler*/ - H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, first + 1); + if (new_msb_pos >= 0) + H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, (size_t)new_msb_pos + 1); + } else if (except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = false; @@ -8691,7 +9218,7 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx } else if (H5T_SGN_2 == dst.u.i.sign) { /*Destination is signed*/ if (sign) { /*source is negative*/ - if (first < dst.prec - 1) { + if ((new_msb_pos >= 0) && ((size_t)new_msb_pos < dst.prec - 1)) { if (truncated && conv_ctx->u.conv.cb_struct .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ @@ -8705,8 +9232,8 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx if (except_ret == H5T_CONV_UNHANDLED) { /*If this case ignored by user handler*/ /*Convert to integer representation. Equivalent to ~(value - 1).*/ - H5T__bit_dec(int_buf, (size_t)0, 8 * buf_size); - H5T__bit_neg(int_buf, (size_t)0, 8 * buf_size); + H5T__bit_dec(int_buf, (size_t)0, dst.prec); + H5T__bit_neg(int_buf, (size_t)0, dst.prec); /*copy source value into destination*/ H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, dst.prec - 1); @@ -8749,7 +9276,7 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx } } else { /*source is positive*/ - if (first >= dst.prec - 1) { + if (new_msb_pos >= (ssize_t)dst.prec - 1) { /*overflow*/ if (conv_ctx->u.conv.cb_struct .func) { /*If user's exception handler is present, use it*/ @@ -8773,7 +9300,7 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx goto next; } } - else if (first < dst.prec - 1) { + else if (new_msb_pos < (ssize_t)dst.prec - 1) { if (truncated && conv_ctx->u.conv.cb_struct .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ @@ -8787,7 +9314,8 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx if (except_ret == H5T_CONV_UNHANDLED) { /*copy source value into it if case is ignored by user handler*/ - H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, first + 1); + if (new_msb_pos >= 0) + H5T__bit_copy(d, dst.offset, int_buf, (size_t)0, (size_t)new_msb_pos + 1); } else if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, @@ -8874,8 +9402,9 @@ H5T__conv_f_i(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx *------------------------------------------------------------------------- */ herr_t -H5T__conv_i_f(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, size_t nelmts, - size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +H5T__conv_i_f(const H5T_t *src_p, const H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx_t *conv_ctx, + size_t nelmts, size_t buf_stride, size_t H5_ATTR_UNUSED bkg_stride, void *buf, + void H5_ATTR_UNUSED *bkg) { /* Traversal-related variables */ H5T_atomic_t src; /*atomic source info */ @@ -8963,7 +9492,7 @@ H5T__conv_i_f(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx /* Allocate enough space for the buffer holding temporary * converted value */ - buf_size = (src.prec > dst.u.f.msize ? src.prec : dst.u.f.msize) / 8 + 1; + buf_size = ((src.prec > dst.u.f.msize ? src.prec : dst.u.f.msize) + 7) / 8; int_buf = (uint8_t *)H5MM_calloc(buf_size); /* Allocate space for order-reversed source buffer */ @@ -9189,7 +9718,8 @@ H5T__conv_i_f(H5T_t *src_p, H5T_t *dst_p, H5T_cdata_t *cdata, const H5T_conv_ctx goto padding; } } - else { + + if (!conv_ctx->u.conv.cb_struct.func || (except_ret == H5T_CONV_UNHANDLED)) { /*make destination infinity by setting exponent to maximal number and *mantissa to zero.*/ expo = expo_max; @@ -9334,7 +9864,7 @@ H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) *------------------------------------------------------------------------- */ herr_t -H5T_reclaim(H5T_t *type, H5S_t *space, void *buf) +H5T_reclaim(const H5T_t *type, H5S_t *space, void *buf) { H5S_sel_iter_op_t dset_op; /* Operator for iteration */ H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ @@ -9372,7 +9902,7 @@ H5T_reclaim(H5T_t *type, H5S_t *space, void *buf) *------------------------------------------------------------------------- */ herr_t -H5T_reclaim_cb(void *elem, H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, +H5T_reclaim_cb(void *elem, const H5T_t *dt, unsigned H5_ATTR_UNUSED ndim, const hsize_t H5_ATTR_UNUSED *point, void *op_data) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 76cddc7292b..d9f293071d9 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -34,6 +34,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5Ppublic.h" /* Property Lists */ #include "H5Tpkg.h" /* Datatypes */ diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 94db1553dc8..15a5522173b 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -67,15 +67,14 @@ H5Tenum_create(hid_t parent_id) } /* end H5Tenum_create() */ /*------------------------------------------------------------------------- - * Function: H5T__enum_create + * Function: H5T__enum_create * - * Purpose: Private function for H5Tenum_create. Create a new + * Purpose: Private function for H5Tenum_create. Create a new * enumeration data type based on the specified - * TYPE, which must be an integer type. - * - * Return: Success: new enumeration data type + * TYPE, which must be an integer type. * - * Failure: NULL + * Return: Success: new enumeration data type + * Failure: NULL * *------------------------------------------------------------------------- */ @@ -91,9 +90,11 @@ H5T__enum_create(const H5T_t *parent) /* Build new type */ if (NULL == (ret_value = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - ret_value->shared->type = H5T_ENUM; - ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL); - assert(ret_value->shared->parent); + ret_value->shared->type = H5T_ENUM; + + if (NULL == (ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, NULL, "unable to copy base datatype for enum"); + ret_value->shared->size = ret_value->shared->parent->shared->size; done: diff --git a/src/H5Tinit_float.c b/src/H5Tinit_float.c index 3213f00fece..de959b49735 100644 --- a/src/H5Tinit_float.c +++ b/src/H5Tinit_float.c @@ -27,6 +27,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -53,8 +54,8 @@ * Purpose: This macro takes a floating point type like `double' and * and detects byte order, mantissa location, exponent location, * sign bit location, presence or absence of implicit mantissa - * bit, and exponent bias and initializes a detected_t structure - * with those properties. + * bit, and exponent bias and initializes a H5T_fpoint_det_t + * structure with those properties. * * Note that these operations can raise floating-point * exceptions and building with some compiler options @@ -306,14 +307,17 @@ H5T__fix_order(int n, int last, int *perm, H5T_order_t *order) if (last <= 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "failed to detect byte order"); - /* We have at least three points to consider */ - if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { + if (perm[last] < perm[last - 1] && + /* Only check perm[last - 2] if we have more than 2 points to consider */ + ((last < 2) || (perm[last - 1] < perm[last - 2]))) { /* Little endian */ *order = H5T_ORDER_LE; for (int i = 0; i < n; i++) perm[i] = i; } - else if (perm[last] > perm[last - 1] && perm[last - 1] > perm[last - 2]) { + else if (perm[last] > perm[last - 1] && + /* Only check perm[last - 2] if we have more than 2 points to consider */ + ((last < 2) || (perm[last - 1] > perm[last - 2]))) { /* Big endian */ *order = H5T_ORDER_BE; for (int i = 0; i < n; i++) @@ -358,7 +362,7 @@ H5T__fix_order(int n, int last, int *perm, H5T_order_t *order) * Return: imp_bit will be set to 1 if the most significant bit * of the mantissa is discarded (ie, the mantissa has an * implicit `one' as the most significant bit). Otherwise, - * imp_bit will be set to zero zero. + * imp_bit will be set to zero. * * SUCCEED/FAIL *------------------------------------------------------------------------- @@ -570,6 +574,39 @@ H5T__init_native_float_types(void) */ H5T_native_order_g = det.order; +#ifdef H5_HAVE__FLOAT16 + /* H5T_NATIVE_FLOAT16 */ + + /* Get the type's characteristics */ + memset(&det, 0, sizeof(H5T_fpoint_det_t)); + DETECT_F(H5__Float16, det); + + /* Allocate and fill type structure */ + if (NULL == (dt = H5T__alloc())) + HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "datatype allocation failed"); + dt->shared->state = H5T_STATE_IMMUTABLE; + dt->shared->type = H5T_FLOAT; + dt->shared->size = det.size; + dt->shared->u.atomic.order = det.order; + dt->shared->u.atomic.offset = det.offset; + dt->shared->u.atomic.prec = det.prec; + dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO; + dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO; + dt->shared->u.atomic.u.f.sign = det.sign; + dt->shared->u.atomic.u.f.epos = det.epos; + dt->shared->u.atomic.u.f.esize = det.esize; + dt->shared->u.atomic.u.f.ebias = det.ebias; + dt->shared->u.atomic.u.f.mpos = det.mpos; + dt->shared->u.atomic.u.f.msize = det.msize; + dt->shared->u.atomic.u.f.norm = det.norm; + dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO; + + /* Register the type and set global variables */ + if ((H5T_NATIVE_FLOAT16_g = H5I_register(H5I_DATATYPE, dt, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "can't register ID for built-in datatype"); + H5T_NATIVE_FLOAT16_ALIGN_g = det.comp_align; +#endif + done: /* Clear any FE_INVALID exceptions from NaN handling */ if (feclearexcept(FE_INVALID) != 0) diff --git a/src/H5Tmodule.h b/src/H5Tmodule.h index f1b7b175f2e..35e748bac3f 100644 --- a/src/H5Tmodule.h +++ b/src/H5Tmodule.h @@ -712,6 +712,14 @@ * * * + * #H5T_NATIVE_FLOAT16 + * + * + * _Float16 + * + * + * + * * #H5T_NATIVE_FLOAT * * @@ -3732,8 +3740,8 @@ filled according to the value of this property. The padding can be: * datatypes. * * The currently supported text format used by #H5LTtext_to_dtype and #H5LTdtype_to_text is the - * data description language (DDL) and conforms to the \ref DDLBNF110. The portion of the - * \ref DDLBNF110 that defines HDF5 datatypes appears below. + * data description language (DDL) and conforms to the \ref DDLBNF114. The portion of the + * \ref DDLBNF114 that defines HDF5 datatypes appears below. * The definition of HDF5 datatypes from the HDF5 DDL * \code * ::= | | | @@ -3753,10 +3761,11 @@ filled according to the value of this property. The padding can be: * H5T_NATIVE_INT | H5T_NATIVE_UINT | * H5T_NATIVE_LONG | H5T_NATIVE_ULONG | * H5T_NATIVE_LLONG | H5T_NATIVE_ULLONG - * ::= H5T_IEEE_F32BE | H5T_IEEE_F32LE | + * ::= H5T_IEEE_F16BE | H5T_IEEE_F16LE | + * H5T_IEEE_F32BE | H5T_IEEE_F32LE | * H5T_IEEE_F64BE | H5T_IEEE_F64LE | - * H5T_NATIVE_FLOAT | H5T_NATIVE_DOUBLE | - * H5T_NATIVE_LDOUBLE + * H5T_NATIVE_FLOAT16 | H5T_NATIVE_FLOAT | + * H5T_NATIVE_DOUBLE | H5T_NATIVE_LDOUBLE *