diff --git a/.github/workflows/aocc-auto.yml b/.github/workflows/aocc-auto.yml new file mode 100644 index 00000000000..50eb1d29f32 --- /dev/null +++ b/.github/workflows/aocc-auto.yml @@ -0,0 +1,102 @@ +name: hdf5 1.14 PAR autotools aocc ompi + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + aocc_build_and_test: + name: "aocc ${{ inputs.build_mode }}" + runs-on: ubuntu-latest + steps: + - name: Get Sources + uses: actions/checkout@v4.1.1 + + - name: Install Dependencies + shell: bash + run: | + sudo apt update + sudo apt install -y autoconf automake libtool libtool-bin libaec-dev + sudo apt install -y doxygen libncurses-dev libquadmath0 libstdc++6 libxml2 + sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 + sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential + + - name: Install AOCC 4.1.0 + shell: bash + run: | + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar + tar -xvf aocc-compiler-4.1.0.tar + cd aocc-compiler-4.1.0 + bash install.sh + source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh + which clang + which flang + clang -v + + - name: Cache OpenMPI 4.1.5 installation + id: cache-openmpi-4_1_5 + uses: actions/cache@v4 + with: + path: /home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + key: ${{ runner.os }}-${{ runner.arch }}-openmpi-4_1_5-cache + + - name: Install OpenMPI 4.1.5 + if: ${{ steps.cache-openmpi-4_1_5.outputs.cache-hit != 'true' }} + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib + wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz + tar zxvf openmpi-4.1.5.tar.gz + cd openmpi-4.1.5 + ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + make + make install + + - name: Autotools Configure + env: + NPROCS: 2 + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc $GITHUB_WORKSPACE/configure \ + --prefix=/tmp \ + --enable-build-mode=${{ inputs.build_mode }} \ + --enable-shared \ + --enable-parallel \ + LDFLAGS="-L/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib \ + -L/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib" + + - name: Autotools Build + shell: bash + env: + NPROCS: 2 + run: | + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + make -j3 + working-directory: ${{ runner.workspace }}/build + + - name: Autotools Run Tests + env: + NPROCS: 2 + run: | + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + make check -j + working-directory: ${{ runner.workspace }}/build + + - name: Autotools Install + env: + NPROCS: 2 + run: | + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + make install + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/aocc-cmake.yml b/.github/workflows/aocc-cmake.yml new file mode 100644 index 00000000000..20ab7899057 --- /dev/null +++ b/.github/workflows/aocc-cmake.yml @@ -0,0 +1,92 @@ +name: hdf5 1.14 PAR CMake aocc ompi + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + aocc_build_and_test: + name: "aocc ${{ inputs.build_mode }}" + runs-on: ubuntu-latest + steps: + - name: Get Sources + uses: actions/checkout@v4.1.1 + + - name: Install Dependencies + shell: bash + run: | + sudo apt update + sudo apt install -y libaec-dev ninja-build + sudo apt install -y doxygen libncurses-dev libquadmath0 libstdc++6 libxml2 + sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 + sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential + + - name: Install AOCC 4.1.0 + shell: bash + run: | + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar + tar -xvf aocc-compiler-4.1.0.tar + cd aocc-compiler-4.1.0 + bash install.sh + source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh + which clang + which flang + clang -v + + - name: Cache OpenMPI 4.1.5 installation + id: cache-openmpi-4_1_5 + uses: actions/cache@v4 + with: + path: /home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + key: ${{ runner.os }}-${{ runner.arch }}-openmpi-4_1_5-cache + + - name: Install OpenMPI 4.1.5 + if: ${{ steps.cache-openmpi-4_1_5.outputs.cache-hit != 'true' }} + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib + wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz + tar zxvf openmpi-4.1.5.tar.gz + cd openmpi-4.1.5 + ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install + make + make install + + - name: CMake Configure + shell: bash + run: | + export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib + export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + CC=mpicc cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \ + -DHDF5_ENABLE_PARALLEL:BOOL=ON \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_BUILD_FORTRAN:BOOL=OFF \ + -DHDF5_BUILD_JAVA:BOOL=OFF \ + -DMPIEXEC_MAX_NUMPROCS:STRING="2" \ + $GITHUB_WORKSPACE + #cat src/libhdf5.settings + + - name: CMake Build + shell: bash + run: | + cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build + + - name: CMake Run Tests + shell: bash + run: | + ctest . --parallel 2 -C ${{ inputs.build_mode }} -V + working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/autotools.yml b/.github/workflows/autotools.yml index e61c14b69a8..1a2a49fc4bd 100644 --- a/.github/workflows/autotools.yml +++ b/.github/workflows/autotools.yml @@ -70,3 +70,17 @@ jobs: uses: ./.github/workflows/nvhpc-auto.yml with: build_mode: "production" + + call-release-auto-aocc: + name: "Autotools aocc Workflows" + uses: ./.github/workflows/aocc-auto.yml + with: + build_mode: "production" + + call-release-auto-cygwin: + name: "Autotools Cygwin Workflows" + uses: ./.github/workflows/cygwin-auto.yml + with: + build_mode: "production" + + \ No newline at end of file diff --git a/.github/workflows/cmake-ctest.yml b/.github/workflows/cmake-ctest.yml index f199836075d..20699b39fc1 100644 --- a/.github/workflows/cmake-ctest.yml +++ b/.github/workflows/cmake-ctest.yml @@ -12,6 +12,11 @@ on: description: "The common base name of the preset configuration name to control the build" required: true type: string + use_environ: + description: 'Environment to locate files' + type: string + required: true + default: snapshots permissions: contents: read @@ -41,6 +46,13 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + then + SOURCE_NAME_BASE=$(echo "hdfsrc") + else + SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT shell: bash # Get files created by release script @@ -67,7 +79,7 @@ jobs: - name: Run ctest (Windows) run: | - cd "${{ runner.workspace }}/hdf5/hdfsrc" + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" cmake --workflow --preset=${{ inputs.preset_name }}-MSVC --fresh shell: bash @@ -76,9 +88,9 @@ jobs: run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" - Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING -Destination ${{ runner.workspace }}/build114/hdf5/ - Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build114/hdf5/ - Copy-Item -Path ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-MSVC/README.md -Destination ${{ runner.workspace }}/build114/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build114/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build114/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-MSVC/README.md -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-MSVC/* -Destination ${{ runner.workspace}}/build114/hdf5/ -Include *.zip cd "${{ runner.workspace }}/build114" 7z a -tzip ${{ steps.set-file-base.outputs.FILE_BASE }}-win-vs2022_cl.zip hdf5 @@ -117,6 +129,13 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + then + SOURCE_NAME_BASE=$(echo "hdfsrc") + else + SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT # Get files created by release script - name: Get tgz-tarball (Linux) @@ -135,7 +154,7 @@ jobs: - name: Run ctest (Linux) run: | - cd "${{ runner.workspace }}/hdf5/hdfsrc" + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" cmake --workflow --preset=${{ inputs.preset_name }}-GNUC --fresh shell: bash @@ -144,8 +163,8 @@ jobs: run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build114/hdf5 - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC/*.tar.gz ${{ runner.workspace }}/build114/hdf5 cd "${{ runner.workspace }}/build114" @@ -157,10 +176,10 @@ jobs: run: | mkdir "${{ runner.workspace }}/builddeb" mkdir "${{ runner.workspace }}/builddeb/hdf5" - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/builddeb/hdf5 - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/builddeb/hdf5 - cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/builddeb/hdf5 - cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/*.deb ${{ runner.workspace }}/builddeb/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/builddeb/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/builddeb/hdf5 + cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/builddeb/hdf5 + cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC/*.deb ${{ runner.workspace }}/builddeb/hdf5 cd "${{ runner.workspace }}/builddeb" tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.deb hdf5 shell: bash @@ -170,10 +189,10 @@ jobs: run: | mkdir "${{ runner.workspace }}/buildrpm" mkdir "${{ runner.workspace }}/buildrpm/hdf5" - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/buildrpm/hdf5 - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/buildrpm/hdf5 - cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/buildrpm/hdf5 - cp ${{ runner.workspace }}/hdf5/build/${{ inputs.preset_name }}-GNUC/*.rpm ${{ runner.workspace }}/buildrpm/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/buildrpm/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/buildrpm/hdf5 + cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC/README.md ${{ runner.workspace }}/buildrpm/hdf5 + cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC/*.rpm ${{ runner.workspace }}/buildrpm/hdf5 cd "${{ runner.workspace }}/buildrpm" tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}-ubuntu-2204_gcc.rpm hdf5 shell: bash @@ -234,6 +253,13 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + then + SOURCE_NAME_BASE=$(echo "hdfsrc") + else + SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT # Get files created by release script - name: Get tgz-tarball (MacOS) @@ -261,18 +287,17 @@ jobs: - name: Run ctest (MacOS) id: run-ctest run: | - cd "${{ runner.workspace }}/hdf5/hdfsrc" + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" cmake --workflow --preset=${{ inputs.preset_name }}-OSX-Clang --fresh shell: bash - name: Publish binary (MacOS) id: publish-ctest-binary run: | - mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build114/hdf5 - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Clang/README.md ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Clang/*.tar.gz ${{ runner.workspace }}/build114/hdf5 cd "${{ runner.workspace }}/build114" @@ -308,6 +333,13 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + then + SOURCE_NAME_BASE=$(echo "hdfsrc") + else + SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT # Get files created by release script - name: Get tgz-tarball (Linux S3) @@ -326,7 +358,7 @@ jobs: - name: Run ctest (Linux S3) run: | - cd "${{ runner.workspace }}/hdf5/hdfsrc" + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" cmake --workflow --preset=${{ inputs.preset_name }}-GNUC-S3 --fresh shell: bash @@ -335,8 +367,8 @@ jobs: run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build114/hdf5 - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC-S3/README.md ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-GNUC-S3/*.tar.gz ${{ runner.workspace }}/build114/hdf5 cd "${{ runner.workspace }}/build114" @@ -381,6 +413,13 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + then + SOURCE_NAME_BASE=$(echo "hdfsrc") + else + SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT shell: bash # Get files created by release script @@ -411,7 +450,7 @@ jobs: CC: ${{ steps.setup-fortran.outputs.cc }} CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - cd "${{ runner.workspace }}/hdf5/hdfsrc" + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" cmake --workflow --preset=${{ inputs.preset_name }}-win-Intel --fresh shell: pwsh @@ -420,8 +459,8 @@ jobs: run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" - Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING -Destination ${{ runner.workspace }}/build114/hdf5/ - Copy-Item -Path ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build114/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING -Destination ${{ runner.workspace }}/build114/hdf5/ + Copy-Item -Path ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/README.md -Destination ${{ runner.workspace }}/build114/hdf5/ Copy-Item -Path ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/* -Destination ${{ runner.workspace }}/build114/hdf5/ -Include *.zip cd "${{ runner.workspace }}/build114" @@ -468,6 +507,13 @@ jobs: run: | FILE_NAME_BASE=$(echo "${{ inputs.file_base }}") echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT + if [[ '${{ inputs.use_environ }}' == 'snapshots' ]] + then + SOURCE_NAME_BASE=$(echo "hdfsrc") + else + SOURCE_NAME_BASE=$(echo "$FILE_NAME_BASE") + fi + echo "SOURCE_BASE=$SOURCE_NAME_BASE" >> $GITHUB_OUTPUT # Get files created by release script - name: Get tgz-tarball (Linux_intel) @@ -490,7 +536,7 @@ jobs: CC: ${{ steps.setup-fortran.outputs.cc }} CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - cd "${{ runner.workspace }}/hdf5/hdfsrc" + cd "${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}" cmake --workflow --preset=${{ inputs.preset_name }}-Intel --fresh shell: bash @@ -499,8 +545,8 @@ jobs: run: | mkdir "${{ runner.workspace }}/build114" mkdir "${{ runner.workspace }}/build114/hdf5" - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING ${{ runner.workspace }}/build114/hdf5 - cp ${{ runner.workspace }}/hdf5/hdfsrc/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING ${{ runner.workspace }}/build114/hdf5 + cp ${{ runner.workspace }}/hdf5/${{ steps.set-file-base.outputs.SOURCE_BASE }}/COPYING_LBNL_HDF5 ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/README.md ${{ runner.workspace }}/build114/hdf5 cp ${{ runner.workspace }}/hdf5/build114/${{ inputs.preset_name }}-Intel/*.tar.gz ${{ runner.workspace }}/build114/hdf5 cd "${{ runner.workspace }}/build114" diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index cca783ab762..8769e86107c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -73,3 +73,16 @@ jobs: uses: ./.github/workflows/nvhpc-cmake.yml with: build_mode: "Release" + + call-release-cmake-aocc: + name: "CMake aocc Workflows" + uses: ./.github/workflows/aocc-cmake.yml + with: + build_mode: "Release" + + call-release-cmake-cygwin: + name: "CMake Cygwin Workflows" + uses: ./.github/workflows/cygwin-cmake.yml + with: + build_mode: "Release" + \ No newline at end of file diff --git a/.github/workflows/cygwin-auto.yml b/.github/workflows/cygwin-auto.yml new file mode 100644 index 00000000000..64a35e41be7 --- /dev/null +++ b/.github/workflows/cygwin-auto.yml @@ -0,0 +1,62 @@ +name: hdf5 1.14 autotools cygwin + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + cygwin_build_and_test: + name: "cygwin ${{ inputs.build_mode }}" + runs-on: windows-latest + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf input + + - name: Get Sources + uses: actions/checkout@v4.1.1 + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: autoconf automake make gcc-fortran libtool zlib-devel m4 flex bison perl + + - name: Autotools Configure + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + sh ./autogen.sh + mkdir build + cd build + ../configure \ + --enable-build-mode=${{ inputs.build_mode }} \ + --enable-shared \ + --enable-fortran + + - name: Autotools Build + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + cd build + make -j3 + + - name: Autotools Run Tests + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + cd build +# make check -j ---- cache test fails + + - name: Autotools Install + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + cd build + make install diff --git a/.github/workflows/cygwin-cmake.yml b/.github/workflows/cygwin-cmake.yml new file mode 100644 index 00000000000..8fe586ee12c --- /dev/null +++ b/.github/workflows/cygwin-cmake.yml @@ -0,0 +1,63 @@ +name: hdf5 1.14 CMake cygwin + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + +permissions: + contents: read + +jobs: + cygwin_build_and_test: + name: "cygwin-${{ inputs.build_mode }}" + runs-on: windows-latest + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf input + + - name: Get Sources + uses: actions/checkout@v4.1.1 + + - name: Install Cygwin + uses: cygwin/cygwin-install-action@master + with: + packages: cmake gcc-fortran make ninja zlib-devel flex bison perl + + - name: CMake Configure + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + mkdir build + cd build + cmake -C ../config/cmake/cacheinit.cmake \ + -G Ninja \ + --log-level=VERBOSE \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF \ + -DHDF5_BUILD_CPP_LIB:BOOL=OFF \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + -DHDF5_BUILD_FORTRAN:BOOL=ON \ + -DHDF5_BUILD_JAVA:BOOL=OFF \ + .. + + - name: CMake Build + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + cd build + cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + + - name: CMake Run Tests + shell: C:\cygwin\bin\bash.exe -eo pipefail -o igncr '{0}' + run: | + export PATH=/usr/bin:$PATH + cd build + ctest . --parallel 2 -C ${{ inputs.build_mode }} -V +# ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -R "FORTRAN|H5TEST" diff --git a/.github/workflows/intel-auto.yml b/.github/workflows/intel-auto.yml index 42f45a65574..fa3e17573b3 100644 --- a/.github/workflows/intel-auto.yml +++ b/.github/workflows/intel-auto.yml @@ -12,49 +12,33 @@ permissions: contents: read jobs: - Intel_build_and_test: - name: "Intel ${{ inputs.build_mode }}" + intel_oneapi_linux: + name: "linux-oneapi ${{ inputs.build_mode }}" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 + - name: Get Sources + uses: actions/checkout@v4.1.1 - name: Install Dependencies + shell: bash run: | sudo apt-get update sudo apt-get install autoconf automake libtool libtool-bin libaec-dev - - name: Add oneAPI to apt - shell: bash - run: | - cd /tmp - wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB - sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main" - - - name: Install oneAPI dpcpp and fortran compiler - shell: bash - run: | - sudo apt update - sudo apt install -y intel-oneapi-compiler-dpcpp-cpp - sudo apt install -y intel-oneapi-compiler-fortran - sudo apt install -y intel-oneapi-mpi-devel - sudo apt-get install doxygen graphviz - sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - echo "CC=icx" >> $GITHUB_ENV - echo "CXX=icpx" >> $GITHUB_ENV - echo "FC=ifx" >> $GITHUB_ENV - - - name: Install oneAPI MKL library - shell: bash - run: | - sudo apt install -y intel-oneapi-mkl-devel + - name: Install oneAPI (Linux) + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: intel + version: '2024.0' - name: Autotools Configure shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin sh ./autogen.sh mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" @@ -63,37 +47,42 @@ jobs: --enable-shared \ --disable-fortran - # BUILD - name: Autotools Build + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin make -j3 working-directory: ${{ runner.workspace }}/build - # RUN TESTS - # NORMAL - name: Autotools Run Tests + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin - export SYCL_DEVICE_FILTER=opencl.cpu make check -j2 working-directory: ${{ runner.workspace }}/build - # INSTALL (note that this runs even when we don't run the tests) - name: Autotools Install + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin - export SYCL_DEVICE_FILTER=opencl.cpu make install working-directory: ${{ runner.workspace }}/build - name: Autotools Verify Install + shell: bash + env: + FC: ${{ steps.setup-fortran.outputs.fc }} + CC: ${{ steps.setup-fortran.outputs.cc }} + CXX: ${{ steps.setup-fortran.outputs.cxx }} run: | - source /opt/intel/oneapi/setvars.sh - export PATH=$PATH:/opt/intel/oneapi/compiler/2023.2.1/linux/bin - export SYCL_DEVICE_FILTER=opencl.cpu make check-install working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/intel-cmake.yml b/.github/workflows/intel-cmake.yml index 33a4badb7a4..b2b01f5dcdd 100644 --- a/.github/workflows/intel-cmake.yml +++ b/.github/workflows/intel-cmake.yml @@ -1,6 +1,5 @@ name: hdf5 1.14 CMake icx CI -# Controls when the action will run. Triggers the workflow on a call on: workflow_call: inputs: @@ -13,30 +12,28 @@ permissions: contents: read jobs: - # Linux (Ubuntu) w/ gcc + CMake - # - Intel_oneapi_linux: - name: "ubuntu-oneapi ${{ inputs.build_mode }}" + intel_oneapi_linux: + name: "linux-oneapi ${{ inputs.build_mode }}" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 + - name: Get Sources (Linux) + uses: actions/checkout@v4.1.1 - # Only CMake need ninja-build, but we just install it unilaterally - # libssl, etc. are needed for the ros3 VFD - - name: Install Linux Dependencies + - name: Install Dependencies (Linux) + shell: bash run: | sudo apt update sudo apt-get install ninja-build doxygen graphviz sudo apt install libssl3 libssl-dev libcurl4 libcurl4-openssl-dev - - name: add oneAPI to env + - name: Install oneAPI (Linux) uses: fortran-lang/setup-fortran@v1 id: setup-fortran with: compiler: intel - version: '2023.2' + version: '2024.0' - - name: CMake Configure with oneapi + - name: CMake Configure (Linux) shell: bash env: FC: ${{ steps.setup-fortran.outputs.fc }} @@ -45,14 +42,15 @@ jobs: run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja \ - -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - -DLIBAEC_USE_LOCALCONTENT=OFF \ - -DZLIB_USE_LOCALCONTENT=OFF \ - $GITHUB_WORKSPACE + cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -G Ninja \ + --log-level=VERBOSE \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DLIBAEC_USE_LOCALCONTENT=OFF \ + -DZLIB_USE_LOCALCONTENT=OFF \ + $GITHUB_WORKSPACE - # BUILD - - name: CMake Build + - name: CMake Build (Linux) shell: bash env: FC: ${{ steps.setup-fortran.outputs.fc }} @@ -62,8 +60,7 @@ jobs: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} working-directory: ${{ runner.workspace }}/build - # RUN TESTS - - name: CMake Run Tests + - name: CMake Run Tests (Linux) shell: bash env: FC: ${{ steps.setup-fortran.outputs.fc }} @@ -77,19 +74,20 @@ jobs: name: "windows-oneapi ${{ inputs.build_mode }}" runs-on: windows-latest steps: - - uses: actions/checkout@v4.1.1 + - name: Get Sources (Windows) + uses: actions/checkout@v4.1.1 - name: Install Dependencies (Windows) run: choco install ninja - - name: add oneAPI to env + - name: install oneAPI (Windows) uses: fortran-lang/setup-fortran@v1 id: setup-fortran with: compiler: intel - version: '2023.2' + version: '2024.0' - - name: CMake Configure with oneapi + - name: CMake Configure (Windows) shell: pwsh env: FC: ${{ steps.setup-fortran.outputs.fc }} @@ -100,8 +98,7 @@ jobs: Set-Location -Path "${{ runner.workspace }}\\build" cmake -C ${{ github.workspace }}/config/cmake/cacheinit.cmake -G Ninja -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} -DHDF5_BUILD_FORTRAN=ON -DLIBAEC_USE_LOCALCONTENT=OFF -DZLIB_USE_LOCALCONTENT=OFF ${{ github.workspace }} - # BUILD - - name: CMake Build + - name: CMake Build (Windows) shell: pwsh env: FC: ${{ steps.setup-fortran.outputs.fc }} @@ -111,8 +108,7 @@ jobs: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} working-directory: ${{ runner.workspace }}/build - # RUN TESTS - - name: CMake Run Tests + - name: CMake Run Tests (Windows) shell: pwsh env: FC: ${{ steps.setup-fortran.outputs.fc }} diff --git a/.github/workflows/linux-auto-aocc-ompi.yml b/.github/workflows/linux-auto-aocc-ompi.yml deleted file mode 100644 index c535bf71e55..00000000000 --- a/.github/workflows/linux-auto-aocc-ompi.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: hdf5 1.14 autotools aocc ompi - -on: - push: - pull_request: - branches: - - hdf5_1_14 - paths-ignore: - - '.github/CODEOWNERS' - - '.github/FUNDING.yml' - - 'doc/**' - - 'release_docs/**' - - 'ACKNOWLEDGEMENTS' - - 'COPYING**' - - '**.md' - -# Using concurrency to cancel any in-progress job or run -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.1 - - - name: Install System dependencies - run: | - sudo apt update - sudo apt install -y libaec-dev zlib1g-dev automake autoconf libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev doxygen openssl libtool libtool-bin build-essential libncurses-dev libquadmath0 libstdc++6 libxml2 - - name: Install AOCC 4.1.0 - run: | - wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0.tar - tar -xvf aocc-compiler-4.1.0.tar - cd aocc-compiler-4.1.0 - bash install.sh - source /home/runner/work/hdf5/hdf5/setenv_AOCC.sh - which clang - which flang - clang -v - - name: Cache OpenMPI 4.1.5 installation - id: cache-openmpi-4_1_5 - uses: actions/cache@v4 - with: - path: /home/runner/work/hdf5/hdf5/openmpi-4.1.5-install - key: ${{ runner.os }}-${{ runner.arch }}-openmpi-4_1_5-cache - - if: ${{ steps.cache-openmpi-4_1_5.outputs.cache-hit != 'true' }} - name: Install OpenMPI 4.1.5 - run: | - export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/usr/local/lib - wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz - tar zxvf openmpi-4.1.5.tar.gz - cd openmpi-4.1.5 - ./configure CC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/clang FC=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/bin/flang --prefix=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install - make - make install - - name: Install HDF5 - env: - NPROCS: 2 - run: | - export LD_LIBRARY_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib - export LD_RUN_PATH=/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib:/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib:/usr/local/lib - export PATH=/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/bin:/usr/local/bin:$PATH - ./autogen.sh - ./configure --prefix=/tmp --enable-parallel --enable-shared CC=mpicc LDFLAGS="-L/home/runner/work/hdf5/hdf5/aocc-compiler-4.1.0/lib -L/home/runner/work/hdf5/hdf5/openmpi-4.1.5-install/lib" - make -j - make check -j - make install - make uninstall diff --git a/.github/workflows/main-auto.yml b/.github/workflows/main-auto.yml index f8b806d220c..cad8decd49a 100644 --- a/.github/workflows/main-auto.yml +++ b/.github/workflows/main-auto.yml @@ -51,7 +51,6 @@ jobs: - name: Get Sources uses: actions/checkout@v4.1.1 - # AUTOTOOLS CONFIGURE - name: Autotools Configure run: | sh ./autogen.sh @@ -92,13 +91,10 @@ jobs: shell: bash if: ${{ inputs.thread_safety == 'enable' }} - # BUILD - name: Autotools Build run: make -j3 working-directory: ${{ runner.workspace }}/build - # RUN TESTS - # NORMAL - name: Autotools Run Tests run: make check -j2 working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/main-cmake-par.yml b/.github/workflows/main-cmake-par.yml index 8b5adb84f0e..0db234242f3 100644 --- a/.github/workflows/main-cmake-par.yml +++ b/.github/workflows/main-cmake-par.yml @@ -1,6 +1,5 @@ name: hdf5 1.14 PAR CMake CI -# Controls when the action will run. Triggers the workflow on a call on: workflow_call: inputs: @@ -12,9 +11,6 @@ on: permissions: contents: read -# A workflow run is made up of one or more jobs that can run sequentially or -# in parallel. We just have one job, but the matrix items defined below will -# run in parallel. jobs: # # The GitHub runners are inadequate for running parallel HDF5 tests, @@ -25,15 +21,10 @@ jobs: # CMake_build_parallel: name: "Parallel GCC-${{ inputs.build_mode }}" - # Don't run the action if the commit message says to skip CI - if: ${{ inputs.thread_safety != 'TS' }} - - # The type of runner that the job will run on runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # SETUP + - uses: actions/checkout@v4.1.1 + - name: Install Linux Dependencies run: | sudo apt update @@ -45,12 +36,8 @@ jobs: echo "CC=mpicc" >> $GITHUB_ENV echo "FC=mpif90" >> $GITHUB_ENV - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Get Sources - uses: actions/checkout@v4.1.1 - - # CMAKE CONFIGURE - name: CMake Configure + shell: bash run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" @@ -69,7 +56,6 @@ jobs: -DHDF5_ENABLE_ROS3_VFD:BOOL=OFF \ -DHDF5_PACK_EXAMPLES:BOOL=ON \ $GITHUB_WORKSPACE - shell: bash # BUILD - name: CMake Build diff --git a/.github/workflows/main-cmake-spc.yml b/.github/workflows/main-cmake-spc.yml index c5472858847..f969723a8a8 100644 --- a/.github/workflows/main-cmake-spc.yml +++ b/.github/workflows/main-cmake-spc.yml @@ -48,7 +48,6 @@ jobs: cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_TOOLCHAIN_FILE=config/toolchain/gcc.cmake \ -DBUILD_SHARED_LIBS=ON \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ @@ -109,7 +108,6 @@ jobs: cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_TOOLCHAIN_FILE=config/toolchain/gcc.cmake \ -DBUILD_SHARED_LIBS=ON \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ @@ -170,7 +168,6 @@ jobs: cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ -G Ninja \ -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_TOOLCHAIN_FILE=config/toolchain/gcc.cmake \ -DBUILD_SHARED_LIBS=ON \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ -DHDF5_ENABLE_PARALLEL:BOOL=OFF \ diff --git a/.github/workflows/main-cmake.yml b/.github/workflows/main-cmake.yml index 5d36b6aa4a4..f4978e81718 100644 --- a/.github/workflows/main-cmake.yml +++ b/.github/workflows/main-cmake.yml @@ -49,7 +49,6 @@ jobs: # No Fortran, parallel, or VFDs that rely on POSIX things - name: "Windows MSVC" os: windows-latest - toolchain: "" cpp: ON fortran: OFF java: ON @@ -83,7 +82,6 @@ jobs: mirror_vfd: ON direct_vfd: ON ros3_vfd: ON - toolchain: "-DCMAKE_TOOLCHAIN_FILE=config/toolchain/gcc.cmake" generator: "-G Ninja" run_tests: true @@ -106,12 +104,9 @@ jobs: mirror_vfd: ON direct_vfd: OFF ros3_vfd: OFF - toolchain: "-DCMAKE_TOOLCHAIN_FILE=config/toolchain/clang.cmake" generator: "-G Ninja" run_tests: true - - # Sets the job's name from the properties name: "${{ matrix.name }}-${{ inputs.build_mode }}-${{ inputs.thread_safety }}" @@ -123,18 +118,11 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - - # - # SETUP - # - #Useful for debugging - name: Dump matrix context run: echo '${{ toJSON(matrix) }}' - # Only CMake need ninja-build, but we just install it unilaterally - # libssl, etc. are needed for the ros3 VFD - - name: Install Linux Dependencies + - name: Install CMake Dependencies (Linux) run: | sudo apt update sudo apt-get install ninja-build graphviz @@ -174,15 +162,14 @@ jobs: # # CMAKE CONFIGURE # - - name: CMake Configure run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ ${{ matrix.generator }} \ + --log-level=VERBOSE \ -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - ${{ matrix.toolchain }} \ -DBUILD_SHARED_LIBS=ON \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ -DHDF5_ENABLE_DOXY_WARNINGS=ON \ @@ -202,7 +189,6 @@ jobs: shell: bash if: ${{ inputs.thread_safety != 'TS' }} - - name: CMake Configure (Thread-Safe) run: | mkdir "${{ runner.workspace }}/build" @@ -210,7 +196,6 @@ jobs: cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ ${{ matrix.generator }} \ -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ - ${{ matrix.toolchain }} \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=${{ (matrix.os != 'windows-latest') }} \ -DHDF5_ENABLE_ALL_WARNINGS=ON \ @@ -234,7 +219,6 @@ jobs: # # BUILD # - - name: CMake Build run: cmake --build . --parallel 3 --config ${{ inputs.build_mode }} working-directory: ${{ runner.workspace }}/build @@ -242,25 +226,17 @@ jobs: # # RUN TESTS # - - # NORMAL - - name: CMake Run Tests run: ctest . --parallel 2 -C ${{ inputs.build_mode }} -V working-directory: ${{ runner.workspace }}/build if: ${{ matrix.run_tests && (inputs.thread_safety != 'TS') }} # THREAD-SAFE - - name: CMake Run Thread-Safe Tests run: ctest . --parallel 2 -C ${{ inputs.build_mode }} -V -R ttsafe working-directory: ${{ runner.workspace }}/build if: ${{ matrix.run_tests && (inputs.thread_safety == 'TS') }} - # - # INSTALL (note that this runs even when we don't run the tests) - # - - name: CMake Run Package run: cpack -C ${{ inputs.build_mode }} -V working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e9805a8c24..4084f1771ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,3 +37,9 @@ jobs: uses: ./.github/workflows/cmake.yml if: "!contains(github.event.head_commit.message, 'skip-ci')" +# workflow-msys2-autotools: +# name: "CMake msys2 Workflows" +# uses: ./.github/workflows/msys2-auto.yml +# with: +# build_mode: "production" +# build_option: "--enable-production" diff --git a/.github/workflows/mingw-cmake.yml b/.github/workflows/mingw-cmake.yml new file mode 100644 index 00000000000..e97c1f8e92c --- /dev/null +++ b/.github/workflows/mingw-cmake.yml @@ -0,0 +1,91 @@ +name: hdf5 1.14 CMake MinGW + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + shared: + description: "shared true/false" + required: true + type: string + netcdf: + description: "netcdf true/false" + required: true + type: string + +permissions: + contents: read + +jobs: + mingw_build_and_test: + name: "mingw-${{ inputs.build_mode }}-NC=${{ inputs.netcdf }}" + if: "!contains(github.event.head_commit.message, 'skip-ci')" + runs-on: ubuntu-latest + steps: + - name: Get Sources + uses: actions/checkout@v4.1.1 + + - name: Install Dependencies + shell: bash + run: | + sudo apt update + sudo apt-get install -y ninja-build libtirpc-dev graphviz + + - name: Install MinGW + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + + - name: Install Doxygen + uses: ssciwr/doxygen-install@v1 + with: + version: "1.9.7" + + - name: CMake Configure + shell: bash + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake -C $GITHUB_WORKSPACE/config/cmake/cacheinit.cmake \ + -G Ninja \ + --log-level=VERBOSE \ + -DCMAKE_BUILD_TYPE=${{ inputs.build_mode }} \ + -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/config/toolchain/mingw64.cmake \ + -DBUILD_SHARED_LIBS:BOOL=${{ inputs.shared }} \ + -DHDF4_BUILD_EXAMPLES:BOOL=ON \ + -DBUILD_JPEG_WITH_PIC:BOOL=ON \ + -DHDF4_ENABLE_NETCDF:BOOL=${{ inputs.netcdf }} \ + -DHDF4_BUILD_FORTRAN:BOOL=OFF \ + -DHDF4_BUILD_JAVA:BOOL=OFF \ + -DHDF4_BUILD_DOC:BOOL=ON \ + -DJPEG_USE_LOCALCONTENT:BOOL=OFF \ + -DLIBAEC_USE_LOCALCONTENT:BOOL=OFF \ + -DZLIB_USE_LOCALCONTENT:BOOL=OFF \ + -DHDF4_PACK_EXAMPLES:BOOL=ON \ + -DHDF4_PACKAGE_EXTLIBS:BOOL=ON \ + $GITHUB_WORKSPACE + + - name: CMake Build + shell: bash + run: | + cmake --build . --parallel 3 --config ${{ inputs.build_mode }} + working-directory: ${{ runner.workspace }}/build + + - name: CMake Run Tests + shell: bash + run: | + ctest . --parallel 2 -C ${{ inputs.build_mode }} -V + if: false + + - name: CMake Package + shell: bash + run: | + cpack -C ${{ inputs.build_mode }} -V + working-directory: ${{ runner.workspace }}/build + + - name: List files in the space + run: | + ls -l ${{ runner.workspace }}/build diff --git a/.github/workflows/msys2-auto.yml b/.github/workflows/msys2-auto.yml new file mode 100644 index 00000000000..adf84da517d --- /dev/null +++ b/.github/workflows/msys2-auto.yml @@ -0,0 +1,66 @@ +name: hdf5 1.14 Autotools MSys2 + +on: + workflow_call: + inputs: + build_mode: + description: "release vs. debug build" + required: true + type: string + build_option: + description: "--enable-production or --disable-production" + required: true + type: string + +permissions: + contents: read + +jobs: + msys2_build_and_test: + runs-on: windows-latest + strategy: + matrix: + include: + - { icon: '⬛', sys: mingw32 } + - { icon: '🟦', sys: mingw64 } + - { icon: '🟨', sys: ucrt64 } + - { icon: '🟧', sys: clang64 } + name: ${{ matrix.icon }} msys2-${{ matrix.sys }}-${{ inputs.build_mode }} + defaults: + run: + shell: msys2 {0} + steps: + - name: Get Sources + uses: actions/checkout@v4.1.1 + + - name: '${{ matrix.icon }} Setup MSYS2' + uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.sys}} + update: true + install: >- + git + autotools + pacboy: >- + toolchain:p + libjpeg-turbo:p + + - name: Autotools Configure + run: | + sh ./autogen.sh + mkdir "$GITHUB_WORKSPACE/build" + cd "$GITHUB_WORKSPACE/build" + LDFLAGS="-lws2_32" $GITHUB_WORKSPACE/configure \ + ${{ inputs.build_option }} \ + --disable-netcdf \ + --enable-static-exec + + - name: Autotools Build + run: | + make -j3 + working-directory: $GITHUB_WORKSPACE/build + + - name: Autotools Run Tests + run: | + make check -j + working-directory: $GITHUB_WORKSPACE/build diff --git a/.github/workflows/nvhpc-auto.yml b/.github/workflows/nvhpc-auto.yml index 542eebea2e9..b29cf8f2f55 100644 --- a/.github/workflows/nvhpc-auto.yml +++ b/.github/workflows/nvhpc-auto.yml @@ -16,28 +16,31 @@ jobs: name: "nvhpc ${{ inputs.build_mode }}" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 + - name: Get Sources + uses: actions/checkout@v4.1.1 - name: Install Dependencies + shell: bash run: | sudo apt-get update sudo apt-get install autoconf automake libtool libtool-bin libaec-dev sudo apt-get install doxygen graphviz - sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 m4 flex bison cmake libzip-dev openssl build-essential + sudo apt install -y zlib1g-dev libcurl4-openssl-dev libjpeg-dev wget curl bzip2 + sudo apt install -y m4 flex bison cmake libzip-dev openssl build-essential - name: Install NVHPC shell: bash - run: | + run: | curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list sudo apt-get update -y sudo apt-get install -y nvhpc-23-9 - echo "CC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpicc" >> $GITHUB_ENV - echo "FC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpifort" >> $GITHUB_ENV echo "NVHPCSDK=/opt/nvidia/hpc_sdk" >> $GITHUB_ENV echo "OMPI_CXX=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin/nvc++" >> $GITHUB_ENV echo "OMPI_CC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin/nvc" >> $GITHUB_ENV echo "OMPI_FC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin/nvfortran" >> $GITHUB_ENV + echo "CC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpicc" >> $GITHUB_ENV + echo "FC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpifort" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/lib" >> $GITHUB_ENV echo "DESTDIR=/tmp" >> $GITHUB_ENV @@ -55,9 +58,7 @@ jobs: --enable-fortran \ --enable-shared \ --enable-parallel - #cat config.log - # BUILD - name: Autotools Build shell: bash run: | @@ -65,16 +66,15 @@ jobs: make -j3 working-directory: ${{ runner.workspace }}/build - # RUN TESTS - # NORMAL - name: Autotools Run Tests + shell: bash run: | export PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin:$PATH make check -j working-directory: ${{ runner.workspace }}/build - # INSTALL (note that this runs even when we don't run the tests) - name: Autotools Install + shell: bash run: | export PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin:$PATH make install diff --git a/.github/workflows/nvhpc-cmake.yml b/.github/workflows/nvhpc-cmake.yml index b0b3143e9bb..5d014de2a54 100644 --- a/.github/workflows/nvhpc-cmake.yml +++ b/.github/workflows/nvhpc-cmake.yml @@ -16,9 +16,10 @@ jobs: name: "nvhpc ${{ inputs.build_mode }}" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.1 + - name: Get Sources + uses: actions/checkout@v4.1.1 - - name: Install Linux dependencies + - name: Install Dependencies shell: bash run: | sudo apt update @@ -28,21 +29,21 @@ jobs: - name: Install NVHPC shell: bash - run: | + run: | curl https://developer.download.nvidia.com/hpc-sdk/ubuntu/DEB-GPG-KEY-NVIDIA-HPC-SDK | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg echo 'deb [signed-by=/usr/share/keyrings/nvidia-hpcsdk-archive-keyring.gpg] https://developer.download.nvidia.com/hpc-sdk/ubuntu/amd64 /' | sudo tee /etc/apt/sources.list.d/nvhpc.list sudo apt-get update -y sudo apt-get install -y nvhpc-23-9 - echo "CC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpicc" >> $GITHUB_ENV - echo "FC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpifort" >> $GITHUB_ENV echo "NVHPCSDK=/opt/nvidia/hpc_sdk" >> $GITHUB_ENV echo "OMPI_CXX=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin/nvc++" >> $GITHUB_ENV echo "OMPI_CC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin/nvc" >> $GITHUB_ENV echo "OMPI_FC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin/nvfortran" >> $GITHUB_ENV + echo "CC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpicc" >> $GITHUB_ENV + echo "FC=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin/mpifort" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/cuda/12.2/lib64:/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/lib" >> $GITHUB_ENV echo "DESTDIR=/tmp" >> $GITHUB_ENV - - name: CMake Configure with nvc + - name: CMake Configure shell: bash run: | export PATH=/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/comm_libs/openmpi4/bin:/opt/nvidia/hpc_sdk/Linux_x86_64/23.9/compilers/bin:$PATH @@ -59,16 +60,13 @@ jobs: -DHDF5_BUILD_JAVA:BOOL=OFF \ -DMPIEXEC_MAX_NUMPROCS:STRING="2" \ $GITHUB_WORKSPACE - cat src/libhdf5.settings - # BUILD - name: CMake Build shell: bash run: | cmake --build . --parallel 3 --config ${{ inputs.build_mode }} working-directory: ${{ runner.workspace }}/build - # RUN TESTS - name: CMake Run Tests shell: bash run: | diff --git a/.github/workflows/release-files.yml b/.github/workflows/release-files.yml index f0ab34d0891..0ae37cc3929 100644 --- a/.github/workflows/release-files.yml +++ b/.github/workflows/release-files.yml @@ -44,9 +44,6 @@ jobs: with: fetch-depth: 0 - - run: | - git checkout ${{ inputs.file_sha }} - - uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 # v1.7.2 id: "tag_create" with: @@ -178,8 +175,6 @@ 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75061178db1..a56bf3b083a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,88 +27,37 @@ jobs: TAG: ${{ inputs.use_tag }} run: echo "RELEASE_TAG=$TAG" >> $GITHUB_OUTPUT -# tarball.yml will be used for releases when pre-tag actions are implemented -# call-workflow-tarball: -# needs: log-the-inputs -# uses: ./.github/workflows/tarball.yml -# with: -# use_tag: ${{ inputs.use_tag }} -# use_environ: release - - create-files-ctest: + call-workflow-tarball: needs: log-the-inputs - runs-on: ubuntu-latest - outputs: - file_base: ${{ steps.set-file-base.outputs.FILE_BASE }} - steps: - - name: Set file base name - id: set-file-base - run: | - FILE_NAME_BASE=$(echo "${{ needs.log-the-inputs.outputs.rel_tag }}") - echo "FILE_BASE=$FILE_NAME_BASE" >> $GITHUB_OUTPUT - shell: bash - - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - name: Get Sources - uses: actions/checkout@v4.1.1 - with: - path: hdfsrc - - - name: Zip Folder - run: | - zip -r ${{ steps.set-file-base.outputs.FILE_BASE }}.zip ./hdfsrc - tar -zcvf ${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz ./hdfsrc - - - name: List files in the repository - run: | - ls -l ${{ github.workspace }} - ls $GITHUB_WORKSPACE - - # Save files created by release script - - name: Save tgz-tarball - uses: actions/upload-artifact@v4 - with: - name: tgz-tarball - path: ${{ steps.set-file-base.outputs.FILE_BASE }}.tar.gz - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - - - name: Save zip-tarball - uses: actions/upload-artifact@v4 - with: - name: zip-tarball - path: ${{ steps.set-file-base.outputs.FILE_BASE }}.zip - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` - - - name: Save NEWSLETTER - uses: actions/upload-artifact@v4 - with: - name: NEWSLETTER - path: ./hdfsrc/release_docs/NEWSLETTER.txt - if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + uses: ./.github/workflows/tarball.yml + with: +# use_tag: ${{ inputs.use_tag }} + use_environ: release call-workflow-ctest: - needs: create-files-ctest + needs: call-workflow-tarball uses: ./.github/workflows/cmake-ctest.yml with: - file_base: ${{ needs.create-files-ctest.outputs.file_base }} + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} preset_name: ci-StdShar + use_environ: release call-workflow-abi: - needs: [log-the-inputs, create-files-ctest, call-workflow-ctest] + needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest] uses: ./.github/workflows/abi-report.yml with: file_ref: '1_14_3' - file_base: ${{ needs.create-files-ctest.outputs.file_base }} + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }} use_environ: release call-workflow-release: - needs: [log-the-inputs, create-files-ctest, call-workflow-ctest, call-workflow-abi] + needs: [log-the-inputs, call-workflow-tarball, call-workflow-ctest, call-workflow-abi] permissions: contents: write # In order to allow tag creation uses: ./.github/workflows/release-files.yml with: - file_base: ${{ needs.create-files-ctest.outputs.file_base }} + file_base: ${{ needs.call-workflow-tarball.outputs.file_base }} file_branch: ${{ needs.log-the-inputs.outputs.rel_tag }} file_sha: ${{ needs.log-the-inputs.outputs.rel_tag }} use_tag: ${{ needs.log-the-inputs.outputs.rel_tag }} diff --git a/.github/workflows/remove-files.yml b/.github/workflows/remove-files.yml index edac1158c9d..c2a897db24d 100644 --- a/.github/workflows/remove-files.yml +++ b/.github/workflows/remove-files.yml @@ -1,4 +1,4 @@ -name: hdf5 dev remove-files +name: hdf5 1.14 remove-files # Controls when the action will run. Triggers the workflow on a schedule on: diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index b9c0e116a49..dbd68fd110d 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -18,18 +18,14 @@ if (NOT ZLIB_USE_LOCALCONTENT) else () set (ZLIB_URL ${TGZPATH}/${ZLIB_TGZ_NAME}) endif () -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Filter ZLIB file is ${ZLIB_URL}") -endif () +message (VERBOSE "Filter ZLIB file is ${ZLIB_URL}") if (NOT LIBAEC_USE_LOCALCONTENT) set (SZIP_URL ${LIBAEC_TGZ_ORIGPATH}/${LIBAEC_TGZ_NAME}) else () set (SZIP_URL ${TGZPATH}/${LIBAEC_TGZ_NAME}) endif () -if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") - message (VERBOSE "Filter SZIP file is ${SZIP_URL}") -endif () +message (VERBOSE "Filter SZIP file is ${SZIP_URL}") include (ExternalProject) #option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO GIT TGZ)" "NO") diff --git a/CMakeLists.txt b/CMakeLists.txt index 36bb53bf29a..f81eb594b37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -653,7 +653,7 @@ endif () if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") set (H5_HAVE_EMBEDDED_LIBINFO 0) else () - option (HDF5_ENABLE_EMBEDDED_LIBINFO "embed library info into executables" ON) + option (HDF5_ENABLE_EMBEDDED_LIBINFO "Embed library info into executables" ON) if (HDF5_ENABLE_EMBEDDED_LIBINFO) set (H5_HAVE_EMBEDDED_LIBINFO 1) endif () @@ -911,8 +911,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/HDF5Examples/C/H5VDS/h5ex_vds-eiger.c b/HDF5Examples/C/H5VDS/h5ex_vds-eiger.c index 0629d734cb7..8a41de6f269 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-eiger.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-eiger.c @@ -89,7 +89,7 @@ main(void) status = H5Pset_virtual(dcpl, vspace, "f-%b.h5", "/A", src_space); /* Create a virtual dataset */ - dset = H5Dcreate2(file, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, DATASET, H5T_STD_I32LE, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(vspace); status = H5Sclose(src_space); status = H5Dclose(dset); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds-exc.c b/HDF5Examples/C/H5VDS/h5ex_vds-exc.c index 10bb68c75c2..de26911b342 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-exc.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-exc.c @@ -120,7 +120,7 @@ main(void) } /* Create a virtual dataset */ - dset = H5Dcreate2(file, DATASET, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, DATASET, H5T_STD_I32LE, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(space); status = H5Sclose(nsrc_space); status = H5Sclose(lsrc_space); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds-exclim.c b/HDF5Examples/C/H5VDS/h5ex_vds-exclim.c index 6bebe76e3c1..61b3078cdbc 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-exclim.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-exclim.c @@ -114,7 +114,7 @@ main(void) } /* Create a virtual dataset */ - dset = H5Dcreate2(file, DATASET, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, DATASET, H5T_STD_I32LE, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(space); status = H5Sclose(nsrc_space); status = H5Sclose(lsrc_space); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim-maxmin.c b/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim-maxmin.c index 8ef996a8e17..9ca030a4052 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim-maxmin.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim-maxmin.c @@ -95,7 +95,7 @@ main(void) src_space = H5Screate_simple(RANK, dims, dims_max); dcpl = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_chunk(dcpl, RANK, chunk_dims); - dset = H5Dcreate2(file, SRC_DATASET[i], H5T_NATIVE_INT, src_space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, SRC_DATASET[i], H5T_STD_I32LE, src_space, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); status = H5Sclose(src_space); status = H5Pclose(dcpl); @@ -145,7 +145,7 @@ main(void) H5Sselect_none(vspace); /* Create a virtual dataset */ - vdset = H5Dcreate2(vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + vdset = H5Dcreate2(vfile, DATASET, H5T_STD_I32LE, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(vspace); status = H5Sclose(src_space); status = H5Pclose(dcpl); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim.c b/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim.c index fadfb790a5d..71a8ddaac9a 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-percival-unlim.c @@ -92,7 +92,7 @@ main(void) src_space = H5Screate_simple(RANK, dims, dims_max); dcpl = H5Pcreate(H5P_DATASET_CREATE); status = H5Pset_chunk(dcpl, RANK, chunk_dims); - dset = H5Dcreate2(file, SRC_DATASET[i], H5T_NATIVE_INT, src_space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, SRC_DATASET[i], H5T_STD_I32LE, src_space, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); status = H5Sclose(src_space); status = H5Pclose(dcpl); @@ -142,7 +142,7 @@ main(void) H5Sselect_none(vspace); /* Create a virtual dataset */ - vdset = H5Dcreate2(vfile, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + vdset = H5Dcreate2(vfile, DATASET, H5T_STD_I32LE, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(vspace); status = H5Sclose(src_space); status = H5Pclose(dcpl); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds-percival.c b/HDF5Examples/C/H5VDS/h5ex_vds-percival.c index edbef18a9b0..75e1653da95 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-percival.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-percival.c @@ -80,12 +80,12 @@ main(void) file = H5Fcreate(SRC_FILE[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); src_space = H5Screate_simple(RANK, dims, NULL); - dset = H5Dcreate2(file, SRC_DATASET[i], H5T_NATIVE_INT, src_space, H5P_DEFAULT, H5P_DEFAULT, - H5P_DEFAULT); - status = H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - status = H5Sclose(src_space); - status = H5Dclose(dset); - status = H5Fclose(file); + dset = + H5Dcreate2(file, SRC_DATASET[i], H5T_STD_I32LE, src_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + status = H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + status = H5Sclose(src_space); + status = H5Dclose(dset); + status = H5Fclose(file); } file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -130,7 +130,7 @@ main(void) H5Sselect_none(vspace); /* Create a virtual dataset */ - dset = H5Dcreate2(file, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, DATASET, H5T_STD_I32LE, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(vspace); status = H5Sclose(src_space); status = H5Dclose(dset); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds-simpleIO.c b/HDF5Examples/C/H5VDS/h5ex_vds-simpleIO.c index 3bd3133e551..52be8f5da77 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds-simpleIO.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds-simpleIO.c @@ -69,7 +69,7 @@ main(void) */ file = H5Fcreate(SRC_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); space = H5Screate_simple(RANK, dims, NULL); - dset = H5Dcreate2(file, SRC_DATASET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dset = H5Dcreate2(file, SRC_DATASET, H5T_STD_I32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata[0]); status = H5Sclose(space); status = H5Dclose(dset); @@ -94,7 +94,7 @@ main(void) status = H5Pset_virtual(dcpl, vspace, SRC_FILE, SRC_DATASET, src_space); /* Create a virtual dataset */ - dset = H5Dcreate2(file, DATASET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, DATASET, H5T_STD_I32LE, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(vspace); status = H5Sclose(src_space); status = H5Dclose(dset); diff --git a/HDF5Examples/C/H5VDS/h5ex_vds.c b/HDF5Examples/C/H5VDS/h5ex_vds.c index 96a81374de2..77219e87f03 100644 --- a/HDF5Examples/C/H5VDS/h5ex_vds.c +++ b/HDF5Examples/C/H5VDS/h5ex_vds.c @@ -87,7 +87,7 @@ main(void) file = H5Fcreate(SRC_FILE[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); space = H5Screate_simple(RANK1, dims, NULL); - dset = H5Dcreate2(file, SRC_DATASET[i], H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + dset = H5Dcreate2(file, SRC_DATASET[i], H5T_STD_I32LE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); status = H5Sclose(space); status = H5Dclose(dset); @@ -127,7 +127,7 @@ main(void) } /* Create a virtual dataset. */ - dset = H5Dcreate2(file, DATASET, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dset = H5Dcreate2(file, DATASET, H5T_STD_I32LE, space, H5P_DEFAULT, dcpl, H5P_DEFAULT); status = H5Sclose(space); status = H5Sclose(src_space); status = H5Dclose(dset); diff --git a/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90 b/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90 index faef397871f..e44fdf0c2a9 100644 --- a/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90 +++ b/HDF5Examples/FORTRAN/H5D/h5ex_d_extern.F90 @@ -40,7 +40,7 @@ PROGRAM main INTEGER :: i, j ! This change was introduced in the 1.8.12 release #if H5_VERSION_GE(1,8,12) - INTEGER(OFF_T) :: offset = 0 ! Offset, in bytes, from thebeginning of the file to the + INTEGER(OFF_T) :: offset = 0 ! Offset, in bytes, from the beginning of the file to the ! location in the file where the data starts. #else INTEGER :: offset = 0 diff --git a/HDF5Examples/config/cmake/runTest.cmake b/HDF5Examples/config/cmake/runTest.cmake index 3507c3482d5..cc433b1e518 100644 --- a/HDF5Examples/config/cmake/runTest.cmake +++ b/HDF5Examples/config/cmake/runTest.cmake @@ -167,7 +167,7 @@ if (TEST_FIND_RESULT GREATER -1) endif () # if the output file needs Storage text removed -if (TEST_MASK) +if (TEST_MASK_STORE) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") @@ -205,6 +205,13 @@ if (TEST_MASK_ERROR) endif () # remove text from the output file +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "${TEST_MASK}" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +# replace text from the output file if (TEST_FILTER) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") diff --git a/README.md b/README.md index 944b3255fea..a272a7264d5 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ HDF5 version 1.14.4-1 currently under development *Please refer to the release_docs/INSTALL file for installation instructions.* This repository contains a high-performance library's source code and a file format -specification that implement the HDF5® data model. The model has been adopted across -many industries and this implementation has become a de facto data management standard +specification that implements the HDF5® data model. The model has been adopted across +many industries, and this implementation has become a de facto data management standard in science, engineering, and research communities worldwide. The HDF Group is the developer, maintainer, and steward of HDF5 software. Find more @@ -30,10 +30,10 @@ The latest doxygen documentation generated on changes to HDF5 1.14.x is availabl https://hdfgroup.github.io/hdf5/ -See the [RELEASE.txt](/release_docs/RELEASE.txt) file in the [release_docs/](/release_docs/) directory for information specific +See the [RELEASE.txt](release_docs/RELEASE.txt) file in the [release_docs/](release_docs/) directory for information specific to the features and updates included in this release of the library. -Several more files are located within the [release_docs/](/release_docs/) directory with specific +Several more files are located within the [release_docs/](release_docs/) directory with specific details for several common platforms and configurations. INSTALL - Start Here. General instructions for compiling and installing the library diff --git a/acsite.m4 b/acsite.m4 deleted file mode 100644 index 1782033dc84..00000000000 --- a/acsite.m4 +++ /dev/null @@ -1,53 +0,0 @@ -dnl ------------------------------------------------------------------------- -dnl ------------------------------------------------------------------------- -dnl -dnl Copyright by The HDF Group. -dnl All rights reserved. -dnl -dnl This file is part of HDF5. The full HDF5 copyright notice, including -dnl terms governing use, modification, and redistribution, is contained in -dnl the COPYING file, which can be found at the root of the source code -dnl dnl distribution tree, or in https://www.hdfgroup.org/licenses. -dnl dnl If you do not have access to either file, you may request a copy from -dnl dnl help@hdfgroup.org. -dnl -dnl Macros for HDF5 Fortran -dnl -dnl ------------------------------------------------------------------------- -dnl ------------------------------------------------------------------------- - -dnl ------------------------------------------------------------------------- -dnl _AC_SYS_LARGEFILE_MACRO_VALUE -dnl -dnl The following macro overrides the autoconf macro of the same name -dnl with this custom definition. This macro performs the same checks as -dnl autoconf's native _AC_SYS_LARGEFILE_MACRO_VALUE, but will also set -dnl AM_CPPFLAGS with the appropriate -D defines so additional configure -dnl sizeof checks do not fail. -dnl -# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, -# CACHE-VAR, -# DESCRIPTION, -# PROLOGUE, [FUNCTION-BODY]) -# ---------------------------------------------------------- -m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE], -[AC_CACHE_CHECK([for $1 value needed for large files], [$3], -[while :; do - m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([$5], [$6])], - [$3=no; break]) - m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([@%:@define $1 $2 -$5], [$6])], - [$3=$2; break]) - $3=unknown - break -done]) -case $$3 in #( - no | unknown) ;; - *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]) - AM_CPPFLAGS="-D$1=$$3 $AM_CPPFLAGS";; -esac -rm -rf conftest*[]dnl -])# _AC_SYS_LARGEFILE_MACRO_VALUE - diff --git a/bin/cmakehdf5 b/bin/cmakehdf5 index 6d31b3450f9..bdd724f4a14 100755 --- a/bin/cmakehdf5 +++ b/bin/cmakehdf5 @@ -1,4 +1,5 @@ #!/bin/sh +echo "Deprecated: This will be removed in a future release" # Build and Test HDF5 using cmake. # Copyright: The HDF Group, 2012-14 diff --git a/bin/h5cc.in b/bin/h5cc.in index e4d43684e3c..bb290df7aa4 100644 --- a/bin/h5cc.in +++ b/bin/h5cc.in @@ -327,27 +327,27 @@ if test "x$do_link" = "xyes"; then fi link_args="$link_args -L${libdir}" - case "$kind" in - gcc|linux*) - # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags. - # It appears to want none of them specified. - case "$host_os" in - darwin*) flag="" ;; - *) flag="-Wl,-rpath -Wl," ;; - esac - ;; - hpux*) flag="-Wl,+b -Wl," ;; - freebsd*|solaris*) flag="-R" ;; - rs6000*|aix*) flag="-L" ;; - sgi) flag="-rpath " ;; - *) flag="" ;; - esac - - if test -n "$flag"; then - shared_link="${flag}${libdir}" - fi - - if test "x$USE_SHARED_LIB" != "xyes"; then + if test "x$USE_SHARED_LIB" = "xyes"; then + case "$kind" in + gcc|linux*) + # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags. + # It appears to want none of them specified. + case "$host_os" in + darwin*) flag="" ;; + *) flag="-Wl,-rpath -Wl," ;; + esac + ;; + hpux*) flag="-Wl,+b -Wl," ;; + freebsd*|solaris*) flag="-R" ;; + rs6000*|aix*) flag="-L" ;; + sgi) flag="-rpath " ;; + *) flag="" ;; + esac + + if test -n "$flag"; then + shared_link="${flag}${libdir}" + fi + else # The "-lhdf5" & "-lhdf5_hl" flags are in here already...This is a static # compile though, so change it to the static version (.a) of the library. new_libraries="" diff --git a/bin/trace b/bin/trace index c620b805368..5941f3a89a8 100755 --- a/bin/trace +++ b/bin/trace @@ -31,6 +31,7 @@ $Source = ""; "H5A_operator1_t" => "Ao", "H5A_operator2_t" => "AO", "hbool_t" => "b", + "bool" => "b", "H5AC_cache_config_t" => "Cc", "H5AC_cache_image_config_t" => "CC", "double" => "d", @@ -74,6 +75,7 @@ $Source = ""; "H5F_file_space_type_t" => "Ft", "H5F_libver_t" => "Fv", "H5G_iterate_t" => "Gi", + "H5G_info_t" => "GI", "H5G_obj_t" => "Go", "H5G_stat_t" => "Gs", "hsize_t" => "h", @@ -199,7 +201,7 @@ $Source = ""; "H5FD_t" => "#", "H5FD_hdfs_fapl_t" => "#", "H5FD_mirror_fapl_t" => "#", - "H5FD_onion_fapl_t" => "#", + "H5FD_onion_fapl_t" => "#", "H5FD_ros3_fapl_t" => "#", "H5FD_splitter_vfd_config_t" => "#", "H5L_class_t" => "#", @@ -305,10 +307,18 @@ sub rewrite_func ($$$$$) { $trace = "H5TRACE0(\"$rettype\", \"\");\n"; $argtrace = "H5ARG_TRACE0(\"\")"; } else { - # Split arguments. First convert `/*in,out*/' to get rid of the - # comma and remove lines beginning with a '#', then split the arguments - # on commas. - $args =~ s/(\/\*\s*in),\s*(out\s*\*\/)/$1_$2/g; # Get rid of comma in 'in,out' + # Split arguments + # + # First remove: + # * /*in*/, /*out*/, /*in_out*/, and /*in,out*/ comments + # * preprocessor lines that start with # + # * H5FL_TRACKING_PARAMS macros (free list code only) + # + # then split the function arguments on commas + $args =~ s/\/\*\s*in\s*\*\///g; # Get rid of /*in*/ + $args =~ s/\/\*\s*out\s*\*\///g; # Get rid of /*out*/ + $args =~ s/\/\*\s*in,\s*out\s*\*\///g; # Get rid of /*in,out*/ + $args =~ s/\/\*\s*in_out\s*\*\///g; # Get rid of /*in_out*/ $args =~ s/H5FL_TRACK_PARAMS//g; # Remove free list macro $args =~ s/\n#.*?\n/\n/g; # Remove lines beginning with '#' my @args = split /,[\s\n]*/, $args; @@ -320,8 +330,7 @@ sub rewrite_func ($$$$$) { next; } unless ($arg=~/^((\s*[a-z_A-Z](\w|\*)*\s+)+(\s*\*\s*|\s*const\s*|\s*volatile\s*)*) - ([a-z_A-Z]\w*)(\[.*?\])? - (\s*\/\*\s*(in|out|in_out)\s*\*\/)?\s*$/x) { + ([a-z_A-Z]\w*)(\[.*?\])?\s*$/x) { errmesg $file, $name, "unable to parse \`$arg\'"; goto error; } else { diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index e838b4ffb4d..e629a800c76 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -605,4 +605,16 @@ Attribute::~Attribute() } } +//-------------------------------------------------------------------------- +// Function: Copy assignment operator +Attribute & +Attribute::operator=(const Attribute &original) +{ + if (&original != this) { + setId(original.id); + } + + return *this; +} + } // namespace H5 diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 6851e1ac765..970110274b4 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -78,6 +78,9 @@ class H5_DLLCPP Attribute : public AbstractDs, public H5Location { // Destructor: properly terminates access to this attribute. virtual ~Attribute() override; + // Copy assignment operator. + Attribute &operator=(const Attribute &original); + #ifndef DOXYGEN_SHOULD_SKIP_THIS protected: // Sets the attribute id. diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 8f4ee7e490c..f45b54e8dde 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -645,6 +645,8 @@ DSetCreatPropList::setFletcher32() const /// the total size is larger than the size of a dataset then the /// dataset can be extended (provided the data space also allows /// the extending). +///\note On Windows, off_t is typically a 32-bit signed long value, which +/// limits the valid offset that can be set to 2 GiB. //-------------------------------------------------------------------------- void DSetCreatPropList::setExternal(const char *name, off_t offset, hsize_t size) const @@ -693,6 +695,8 @@ DSetCreatPropList::getExternalCount() const /// external file name will not be returned. If \a offset or /// \a size are null pointers then the corresponding information /// will not be returned. +///\note On Windows, off_t is typically a 32-bit signed long value, which +/// limits the valid offset that can be returned to 2 GiB. //-------------------------------------------------------------------------- void DSetCreatPropList::getExternal(unsigned idx, size_t name_size, char *name, off_t &offset, hsize_t &size) const diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 35e9d26bfa3..248e71f9571 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -274,4 +274,16 @@ Group::~Group() } } +//-------------------------------------------------------------------------- +// Function: Copy assignment operator +Group & +Group::operator=(const Group &original) +{ + if (&original != this) { + setId(original.id); + } + + return *this; +} + } // namespace H5 diff --git a/c++/src/H5Group.h b/c++/src/H5Group.h index cb9b0920f84..9c89dd1599a 100644 --- a/c++/src/H5Group.h +++ b/c++/src/H5Group.h @@ -67,6 +67,9 @@ class H5_DLLCPP Group : public H5Object, public CommonFG { // Destructor virtual ~Group() override; + // Copy assignment operator. + Group &operator=(const Group &original); + // Creates a copy of an existing group using its id. Group(const hid_t group_id); diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index e666ba96b92..a5c584c8465 100644 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -314,27 +314,27 @@ if test "x$do_link" = "xyes"; then fi link_args="$link_args -L${libdir}" - case "$kind" in - gcc|linux*) - # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags. - # It appears to want none of them specified. - case "$host_os" in - darwin*) flag="" ;; - *) flag="-Wl,-rpath -Wl," ;; - esac - ;; - hpux*) flag="-Wl,+b -Wl," ;; - freebsd*|solaris*) flag="-R" ;; - rs6000*|aix*) flag="-L" ;; - sgi) flag="-rpath " ;; - *) flag="" ;; - esac - - if test -n "$flag"; then - shared_link="${flag}${libdir}" - fi - - if test "x$USE_SHARED_LIB" != "xyes"; then + if test "x$USE_SHARED_LIB" = "xyes"; then + case "$kind" in + gcc|linux*) + # MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags. + # It appears to want none of them specified. + case "$host_os" in + darwin*) flag="" ;; + *) flag="-Wl,-rpath -Wl," ;; + esac + ;; + hpux*) flag="-Wl,+b -Wl," ;; + freebsd*|solaris*) flag="-R" ;; + rs6000*|aix*) flag="-L" ;; + sgi) flag="-rpath " ;; + *) flag="" ;; + esac + + if test -n "$flag"; then + shared_link="${flag}${libdir}" + fi + else # The "-lhdf5" & "-lhdf5_hl" flags are in here already...This is a static # compile though, so change it to the static version (.a) of the library. new_libraries="" diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp index 5bfd34c9a28..26be0681c2d 100644 --- a/c++/test/tfilter.cpp +++ b/c++/test/tfilter.cpp @@ -140,7 +140,6 @@ static void test_szip_filter(H5File &file1) { #ifdef H5_HAVE_FILTER_SZIP - int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK; unsigned szip_pixels_per_block = 4; @@ -149,6 +148,8 @@ test_szip_filter(H5File &file1) if (h5_szip_can_encode() == 1) { char *tconv_buf = new char[1000]; + auto points = new int[DSET_DIM1][DSET_DIM2]; + auto check = new int[DSET_DIM1][DSET_DIM2]; try { const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; @@ -201,6 +202,8 @@ test_szip_filter(H5File &file1) } delete[] tconv_buf; + delete[] points; + delete[] check; } // if szip presents else { SKIPPED(); 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 37f306e1526..0eee171617f 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -78,7 +78,9 @@ if (WINDOWS) endif () if (NOT UNIX AND NOT CYGWIN) set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1) - set (${HDF_PREFIX}_HAVE_TIMEZONE 1) + if (MSVC_VERSION GREATER_EQUAL 1900) + set (${HDF_PREFIX}_HAVE_TIMEZONE 1) + endif () set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1) set (${HDF_PREFIX}_HAVE_LIBWS2_32 1) set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1) @@ -141,7 +143,8 @@ 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 () #----------------------------------------------------------------------------- @@ -210,85 +213,59 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) endmacro () #----------------------------------------------------------------------------- -# Check for large file support +# Platform-specific flags #----------------------------------------------------------------------------- -# The linux-lfs option is deprecated. -set (LINUX_LFS 0) - set (HDF_EXTRA_C_FLAGS) -set (HDF_EXTRA_FLAGS) -if (MINGW OR NOT WINDOWS) - if (CMAKE_SYSTEM_NAME MATCHES "Linux") - # Linux Specific flags - # This was originally defined as _POSIX_SOURCE which was updated to - # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX - # functionality so clock_gettime and CLOCK_MONOTONIC are defined - # correctly. This was later updated to 200112L so that - # posix_memalign() is visible for the direct VFD code on Linux - # systems. - # POSIX feature information can be found in the gcc manual at: - # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L) - - # Need to add this so that O_DIRECT is visible for the direct - # VFD on Linux systems. - set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE) - - option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) - mark_as_advanced (HDF_ENABLE_LARGE_FILE) - if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) - set (msg "Performing TEST_LFS_WORKS") - try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_DIR}/HDFTests.c - COMPILE_DEFINITIONS "-DTEST_LFS_WORKS" - ) - # The LARGEFILE definitions were from the transition period - # and are probably no longer needed. The FILE_OFFSET_BITS - # check should be generalized for all POSIX systems as it - # is in the Autotools. - if (TEST_LFS_WORKS_COMPILE) - if (TEST_LFS_WORKS_RUN MATCHES 0) - set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) - set (LARGEFILE 1) - set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE) - message (VERBOSE "${msg}... yes") - else () - set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (VERBOSE "${msg}... no") - file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n" - ) - endif () - else () - set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg}) - message (VERBOSE "${msg}... no") - file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Test TEST_LFS_WORKS Compile failed\n" - ) - endif () - endif () - set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS}) - endif () +# Linux-specific flags +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + # This was originally defined as _POSIX_SOURCE which was updated to + # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX + # functionality so clock_gettime and CLOCK_MONOTONIC are defined + # correctly. This was later updated to 200112L so that + # posix_memalign() is visible for the direct VFD code on Linux + # systems. Even later, this was changed to 200809L to support + # pread/pwrite in VFDs. + # + # POSIX feature information can be found in the gcc manual at: + # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L) + + # Need to add this so that O_DIRECT is visible for the direct + # VFD on Linux systems. + set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE) + + # Set up large file support. This is only necessary on 32-bit systems + # but is used on all Linux systems. It has no effect on 64-bit systems + # so it's not worth hacking up a 32/64-bit test to selectively include it. + # + # The library currently does not use any of the 64-flavored API calls + # or types + set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_LARGEFILE_SOURCE) + set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_FILE_OFFSET_BITS=64) + + set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_C_FLAGS}) endif () -#----------------------------------------------------------------------------- -# Check for HAVE_OFF64_T functionality -#----------------------------------------------------------------------------- -if (MINGW OR NOT WINDOWS) - HDF_FUNCTION_TEST (HAVE_OFF64_T) - if (${HDF_PREFIX}_HAVE_OFF64_T) - CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64) - endif () +# As of 2024, both AIX and Solaris are uncommon, but still exist! The default +# compiler options are also often set to -m32, which produces 32-bit binaries. - CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) +# 32-bit AIX compiles might require _LARGE_FILES, but we don't have a system on +# which to test this (yet). +# +# https://www.ibm.com/docs/en/aix/7.1?topic=volumes-writing-programs-that-access-large-files - CHECK_STRUCT_HAS_MEMBER("struct stat64" st_blocks "sys/types.h;sys/stat.h" HAVE_STAT64_STRUCT) - if (HAVE_STAT64_STRUCT) - CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) - endif () +# 32-bit Solaris probably needs _LARGEFILE_SOURCE and _FILE_OFFSET_BITS=64, +# as in Linux, above. +# +# 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 () #----------------------------------------------------------------------------- @@ -356,11 +333,7 @@ if (MINGW OR NOT WINDOWS) endif () HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T) -HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T) -if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T) - set (${HDF_PREFIX}_SIZEOF_OFF64_T 0) -endif () -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 @@ -473,62 +446,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. @@ -686,38 +603,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 () @@ -738,7 +637,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) @@ -891,7 +790,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") @@ -901,14 +801,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 () @@ -970,3 +873,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 2ca50271d15..cd898cdff21 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -68,6 +68,9 @@ /* Define if we have Fortran intrinsic STORAGE_SIZE */ #cmakedefine H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@ +/* Define if Fortran supports allocatable character */ +#cmakedefine H5_FORTRAN_HAVE_CHAR_ALLOC @H5_FORTRAN_HAVE_CHAR_ALLOC@ + /* Determine the size of C long double */ #cmakedefine H5_FORTRAN_SIZEOF_LONG_DOUBLE @H5_FORTRAN_SIZEOF_LONG_DOUBLE@ @@ -128,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@ @@ -140,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@ @@ -213,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@ @@ -280,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@ @@ -363,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. */ @@ -387,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@ @@ -535,9 +541,6 @@ #define H5_SIZEOF_LONG_LONG 8 #endif -/* The size of `off64_t', as computed by sizeof. */ -#cmakedefine H5_SIZEOF_OFF64_T @H5_SIZEOF_OFF64_T@ - /* The size of `off_t', as computed by sizeof. */ #cmakedefine H5_SIZEOF_OFF_T @H5_SIZEOF_OFF_T@ @@ -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/HDF5DeveloperBuild.cmake b/config/cmake/HDF5DeveloperBuild.cmake index 40efb0e0711..f8ccc2f7bef 100644 --- a/config/cmake/HDF5DeveloperBuild.cmake +++ b/config/cmake/HDF5DeveloperBuild.cmake @@ -139,16 +139,6 @@ if (HDF5_ENABLE_DEBUG_H5T_REF) list (APPEND HDF5_DEBUG_APIS H5T_REF_DEBUG) endif () -# HDF5 module debug definitions for debug code which may add -# considerable amounts of overhead when enabled and is usually -# only useful for specific circumstances rather than general -# developer use. -option (HDF5_ENABLE_DEBUG_H5B "Enable debugging of H5B module" OFF) -mark_as_advanced (HDF5_ENABLE_DEBUG_H5B) -if (HDF5_ENABLE_DEBUG_H5B) - list (APPEND HDF5_DEBUG_APIS H5B_DEBUG) -endif () - option (HDF5_ENABLE_DEBUG_H5B2 "Enable debugging of H5B2 module" OFF) mark_as_advanced (HDF5_ENABLE_DEBUG_H5B2) if (HDF5_ENABLE_DEBUG_H5B2) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index d34876c0834..73b4f742b48 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -124,6 +124,15 @@ else () message (FATAL_ERROR "Fortran compiler requires either intrinsic functions SIZEOF or STORAGE_SIZE") endif () +# Check to see of Fortran supports allocatable character +READ_SOURCE("PROGRAM PROG_CHAR_ALLOC" "END PROGRAM PROG_CHAR_ALLOC" SOURCE_CODE) +check_fortran_source_compiles (${SOURCE_CODE} FORTRAN_CHAR_ALLOC SRC_EXT f90) +if (${FORTRAN_CHAR_ALLOC}) + set (${HDF_PREFIX}_FORTRAN_HAVE_CHAR_ALLOC 1) +else () + set (${HDF_PREFIX}_FORTRAN_HAVE_CHAR_ALLOC 0) +endif () + #----------------------------------------------------------------------------- # Determine the available KINDs for REALs and INTEGERs #----------------------------------------------------------------------------- diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 7bddad0f776..007747a6166 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -375,11 +375,8 @@ if (HDF5_ENABLE_DEBUG_APIS) H5D_DEBUG H5D_CHUNK_DEBUG H5F_DEBUG - H5HL_DEBUG - H5I_DEBUG H5MM_DEBUG H5O_DEBUG - H5S_DEBUG H5T_DEBUG H5Z_DEBUG ) diff --git a/config/cmake/HDFTests.c b/config/cmake/HDFTests.c index 095f1134cc2..0f0600abd81 100644 --- a/config/cmake/HDFTests.c +++ b/config/cmake/HDFTests.c @@ -89,40 +89,6 @@ int main () #endif /* DEV_T_IS_SCALAR */ -#ifdef HAVE_OFF64_T - -#include - -int main(void) -{ - off64_t n = 0; - return (int)n; -} -#endif - -#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 @@ -137,58 +103,3 @@ main(void) #endif } #endif - -#ifdef TEST_LFS_WORKS - -/* Return 0 when LFS is available and 1 otherwise. */ - -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE -#define _LARGE_FILES -#define _FILE_OFFSET_BITS 64 - -#include -#include -#include -#include - -#define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - -int main(int argc, char **argv) -{ - - /* Check that off_t can hold 2^63 - 1 and perform basic operations... */ - if (OFF_T_64 % 2147483647 != 1) - return 1; - - /* stat breaks on SCO OpenServer */ - struct stat buf; - stat(argv[0], &buf); - if (!S_ISREG(buf.st_mode)) - return 2; - - FILE *file = fopen(argv[0], "r"); - off_t offset = ftello(file); - fseek(file, offset, SEEK_CUR); - fclose(file); - return 0; -} -#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/HDFUseFortran.cmake b/config/cmake/HDFUseFortran.cmake index 1389aaf2dfa..2d53a506124 100644 --- a/config/cmake/HDFUseFortran.cmake +++ b/config/cmake/HDFUseFortran.cmake @@ -19,14 +19,6 @@ set (HDF_PREFIX "H5") include (CheckFortranSourceRuns) include (CheckFortranSourceCompiles) -#------------------------------------------------------------------------------- -# Fix Fortran flags if we are compiling statically on Windows using -# Windows_MT.cmake from config/cmake/UserMacros -#------------------------------------------------------------------------------- -if (BUILD_STATIC_CRT_LIBS) - TARGET_STATIC_CRT_FLAGS () -endif () - #----------------------------------------------------------------------------- # Detect name mangling convention used between Fortran and C #----------------------------------------------------------------------------- @@ -78,6 +70,13 @@ set (STORAGE_SIZE_CODE END PROGRAM " ) +set (CHAR_ALLOC + " + PROGRAM main + CHARACTER(:), ALLOCATABLE :: str + END PROGRAM + " +) set (ISO_FORTRAN_ENV_CODE " PROGRAM main @@ -132,6 +131,7 @@ check_fortran_source_compiles (${STORAGE_SIZE_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_S check_fortran_source_compiles (${ISO_FORTRAN_ENV_CODE} ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV SRC_EXT f90) check_fortran_source_compiles (${REALISNOTDOUBLE_CODE} ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE SRC_EXT f90) check_fortran_source_compiles (${ISO_C_BINDING_CODE} ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING SRC_EXT f90) +check_fortran_source_compiles (${CHAR_ALLOC} ${HDF_PREFIX}_FORTRAN_HAVE_CHAR_ALLOC SRC_EXT f90) #----------------------------------------------------------------------------- # Add debug information (intel Fortran : JB) diff --git a/config/cmake/LIBAEC/CMakeLists.txt b/config/cmake/LIBAEC/CMakeLists.txt index 379902b3ec0..11f79414e2a 100644 --- a/config/cmake/LIBAEC/CMakeLists.txt +++ b/config/cmake/LIBAEC/CMakeLists.txt @@ -127,7 +127,7 @@ endif () # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -Wno-deprecated-non-prototype") + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") endif () #----------------------------------------------------------------------------- diff --git a/config/cmake/UserMacros/Windows_MT.cmake b/config/cmake/UserMacros/Windows_MT.cmake index c8edbe4a0d1..351c99108e7 100644 --- a/config/cmake/UserMacros/Windows_MT.cmake +++ b/config/cmake/UserMacros/Windows_MT.cmake @@ -20,34 +20,10 @@ # INCLUDE(path_to_file/WINDOWS_MT.cmake) #----------------------------------------------------------------------------- -# Option to Build with Static CRT libraries on Windows -#------------------------------------------------------------------------------- -macro (TARGET_STATIC_CRT_FLAGS) - if (MSVC AND NOT BUILD_SHARED_LIBS) - foreach (flag_var - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - if (${flag_var} MATCHES "/MD") - string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif () - endforeach () - foreach (flag_var - CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_RELEASE - CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_RELWITHDEBINFO) - if (${flag_var} MATCHES "/libs:dll") - string (REGEX REPLACE "/libs:dll" "/libs:static" ${flag_var} "${${flag_var}}") - endif () - endforeach () - set (WIN_COMPILE_FLAGS "") - set (WIN_LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - endif () -endmacro () - +# Option to Build with Static CRT libraries on Windows (USE WITH CAUTION!!!) #----------------------------------------------------------------------------- -option (BUILD_STATIC_CRT_LIBS "Build With Static CRT Libraries" OFF) -mark_as_advanced (BUILD_STATIC_CRT_LIBS) -if (BUILD_STATIC_CRT_LIBS) - TARGET_STATIC_CRT_FLAGS () +option (HDF5_BUILD_STATIC_CRT_LIBS "Build With Static Windows CRT Libraries" OFF) +mark_as_advanced (HDF5_BUILD_STATIC_CRT_LIBS) +if (HDF5_BUILD_STATIC_CRT_LIBS) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif () diff --git a/config/cmake/ZLIB/CMakeLists.txt b/config/cmake/ZLIB/CMakeLists.txt index 09f67b0dcf6..529f1446a58 100644 --- a/config/cmake/ZLIB/CMakeLists.txt +++ b/config/cmake/ZLIB/CMakeLists.txt @@ -132,7 +132,7 @@ if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -Wno-strict-prototypes") endif () if (CMAKE_C_COMPILER_ID MATCHES "IntelLLVM" OR CMAKE_C_COMPILER_ID MATCHES "[Cc]lang") - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -Wno-deprecated-non-prototype -Wno-implicit-function-declaration") + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -Wno-implicit-function-declaration") endif () #----------------------------------------------------------------------------- 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/cmake/runTest.cmake b/config/cmake/runTest.cmake index 4257c442c6a..ff9732e0821 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -167,7 +167,7 @@ if (TEST_FIND_RESULT GREATER -1) endif () # if the output file needs Storage text removed -if (TEST_MASK) +if (TEST_MASK_STORE) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) string (REGEX REPLACE "Storage:[^\n]+\n" "Storage:
\n" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") @@ -205,8 +205,16 @@ if (TEST_MASK_ERROR) endif () # remove text from the output file +if (TEST_MASK) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (REGEX REPLACE "${TEST_MASK}" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +endif () + +# replace text from the output file if (TEST_FILTER) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + message (STATUS "TEST_FILTER: ${TEST_FILTER} TEST_FILTER_REPLACE: ${TEST_FILTER_REPLACE}") string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}") file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") endif () diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake index 4f7eb4b9391..ad6cd44014b 100644 --- a/config/cmake/scripts/CTestScript.cmake +++ b/config/cmake/scripts/CTestScript.cmake @@ -117,37 +117,6 @@ else () set (CTEST_GIT_options "pull") endif () set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}") - else () - ## -------------------------- - ## use subversion to get source - #----------------------------------------------------------------------------- - ## cygwin does not handle the find_package() call - ## -------------------------- - set (CTEST_UPDATE_COMMAND "SVNCommand") - if (NOT SITE_CYGWIN}) - find_package (Subversion) - set (CTEST_SVN_COMMAND "${Subversion_SVN_EXECUTABLE}") - set (CTEST_UPDATE_COMMAND "${Subversion_SVN_EXECUTABLE}") - else () - set (CTEST_SVN_COMMAND "/usr/bin/svn") - set (CTEST_UPDATE_COMMAND "/usr/bin/svn") - endif () - - if (NOT EXISTS "${CTEST_SOURCE_DIRECTORY}") - set (NEED_REPOSITORY_CHECKOUT 1) - endif () - - if (NOT CTEST_REPO_VERSION) - set (CTEST_REPO_VERSION "HEAD") - endif () - if (${NEED_REPOSITORY_CHECKOUT}) - set (CTEST_CHECKOUT_COMMAND - "\"${CTEST_SVN_COMMAND}\" co ${REPOSITORY_URL} \"${CTEST_SOURCE_DIRECTORY}\" -r ${CTEST_REPO_VERSION}") - else () - if (CTEST_REPO_VERSION) - set (CTEST_SVN_UPDATE_OPTIONS "-r ${CTEST_REPO_VERSION}") - endif () - endif () endif () endif () endif () diff --git a/config/conclude.am b/config/conclude.am index 227f0d3dbd8..a1fda99ba35 100644 --- a/config/conclude.am +++ b/config/conclude.am @@ -294,10 +294,12 @@ if MIRROR_VFD_CONDITIONAL # VFD_LIST += mirror endif if ROS3_VFD_CONDITIONAL - VFD_LIST += ros3 + # This would require a custom test suite + # VFD_LIST += ros3 endif if HDFS_VFD_CONDITIONAL - VFD_LIST += hdfs + # This would require a custom test suite + # VFD_LIST += hdfs endif if SUBFILING_VFD_CONDITIONAL # Several VFD tests fail with Subfiling since it 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 1045255f4e9..6e54d8075e5 100644 --- a/configure.ac +++ b/configure.ac @@ -194,12 +194,25 @@ saved_user_LDFLAGS="$LDFLAGS" saved_user_CPPFLAGS="$CPPFLAGS" ## Strip out -Werror from CFLAGS since that can cause checks to fail when -## compiling the test program fails due to warnings -CFLAGS="`echo $CFLAGS | sed -e 's/-Werror//g'`" -CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-Werror//g'`" -FCFLAGS="`echo $FCFLAGS | sed -e 's/-Werror//g'`" -JAVACFLAGS="`echo $JAVACFLAGS | sed -e 's/-Werror//g'`" -CPPFLAGS="`echo $CPPFLAGS | sed -e 's/-Werror//g'`" +## compiling test programs fails due to warnings +## +## Regex: +## +## -Werror Literal -Werror +## \( Start optional capturing group +## = Literal equals sign +## [^[:space:]-] Non-space characters +## \+ 1 or more of the above +## \) End optional capturing group +## \? 0 or 1 capturing group matches +## +WERROR_SED= "sed -e 's/-Werror\(=[^[:space:]]\+\)\?//g'" + +CFLAGS="`echo $CFLAGS | $WERROR_SED`" +CXXFLAGS="`echo $CXXFLAGS | $WERROR_SED`" +FCFLAGS="`echo $FCFLAGS | $WERROR_SED`" +JAVACFLAGS="`echo $JAVACFLAGS | $WERROR_SED`" +CPPFLAGS="`echo $CPPFLAGS | $WERROR_SED`" ## Support F9X variable to define Fortran compiler if FC variable is ## not used. This should be deprecated in the future. @@ -546,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 ## @@ -652,6 +768,8 @@ if test "X$HDF_FORTRAN" = "Xyes"; then if test "X$HAVE_F2003_REQUIREMENTS" = "Xno"; then AC_MSG_ERROR([Fortran compiler lacks required Fortran 2003 features; unsupported Fortran 2003 compiler, remove --enable-fortran]) fi + ## Checking if the compiler supports fortran character being allocatable + PAC_HAVE_CHAR_ALLOC ## -------------------------------------------------------------------- ## Define wrappers for the C compiler to use Fortran function names @@ -741,6 +859,10 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF]) fi + if test "X$HAVE_CHAR_ALLOC_FORTRAN" = "Xyes"; then + AC_DEFINE([FORTRAN_HAVE_CHAR_ALLOC], [1], [Define if Fortran supports allocatable character]) + fi + ## See if C_LONG_DOUBLE is available PAC_PROG_FC_HAVE_C_LONG_DOUBLE @@ -1422,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 @@ -1440,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" ;; @@ -1454,31 +1576,14 @@ if test "X${enable_shared}" = "Xyes"; then fi ## ---------------------------------------------------------------------- -## Use the macro _AC_SYS_LARGEFILE_MACRO_VALUE to test defines -## that might need to be set for largefile support to behave -## correctly. This macro is defined in acsite.m4 and overrides -## the version provided by Autoconf (as of v2.65). The custom -## macro additionally adds the appropriate defines to AM_CPPFLAGS -## so that later configure checks have them visible. - -## Check for _FILE_OFFSET_BITS -_AC_SYS_LARGEFILE_MACRO_VALUE([_FILE_OFFSET_BITS], [64], - [ac_cv_sys_file_offset_bits], - [Number of bits in a file offset, on hosts where this is settable.], - [_AC_SYS_LARGEFILE_TEST_INCLUDES]) - -## Check for _LARGE_FILES -if test "$ac_cv_sys_file_offset_bits" = unknown; then - _AC_SYS_LARGEFILE_MACRO_VALUE([_LARGE_FILES], [1], - [ac_cv_sys_large_files], - [Define for large files, on AIX-style hosts.], - [_AC_SYS_LARGEFILE_TEST_INCLUDES]) -fi +## Set up large file support + +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 @@ -1508,11 +1613,16 @@ 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]) H5_CPPFLAGS="-D_GNU_SOURCE -D__USE_MINGW_ANSI_STDIO $H5_CPPFLAGS" ;; + *cygwin*) + AC_DEFINE([HAVE_CYGWIN], [1], [Define if using Cygwin]) + H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" + ;; esac ## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible @@ -1917,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 @@ -2038,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]) ;; *) @@ -2069,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]) @@ -2117,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 ## @@ -2566,8 +2704,8 @@ AC_SUBST([INTERNAL_DEBUG_OUTPUT]) ## too specialized or have huge performance hits. These ## are not listed in the "all" packages list. ## -## all_packages="AC,B,B2,D,F,FA,FL,FS,HL,I,MM,O,S,T,Z" -all_packages="AC,B2,CX,D,F,HL,I,MM,O,S,T,Z" +## all_packages="AC,B2,CX,D,F,FA,FL,FS,MM,O,T,Z" +all_packages="AC,B2,CX,D,F,MM,O,T,Z" case "X-$INTERNAL_DEBUG_OUTPUT" in X-yes|X-all) @@ -3541,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 484f5010ab0..25d491164cf 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/H5E_examples.c b/doxygen/examples/H5E_examples.c index deea838ea6b..bd0ac614fbb 100644 --- a/doxygen/examples/H5E_examples.c +++ b/doxygen/examples/H5E_examples.c @@ -6,6 +6,9 @@ #include #include +#define RESET "\x1b[0m" +#define RED "\x1b[31m" + int main(void) { @@ -34,8 +37,8 @@ main(void) } // push a custom error message onto the default stack - if (H5Epush2(H5E_DEFAULT, __FILE__, __FUNCTION__, __LINE__, cls, major, minor, "Hello, Error!\n") < - 0) { + if (H5Epush2(H5E_DEFAULT, __FILE__, __FUNCTION__, __LINE__, cls, major, minor, "%s Hello, error %s\n", + RED, RESET) < 0) { ret_val = EXIT_FAILURE; goto fail_push; } 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 4c280469056..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 @@ -63,6 +69,11 @@ if (H5_FORTRAN_HAVE_C_SIZEOF) set (CMAKE_H5_FORTRAN_HAVE_C_SIZEOF 1) endif () +set (CMAKE_H5_FORTRAN_HAVE_CHAR_ALLOC 0) +if (H5_FORTRAN_HAVE_CHAR_ALLOC) + set (CMAKE_H5_FORTRAN_HAVE_CHAR_ALLOC 1) +endif () + configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${HDF5_F90_BINARY_DIR}/H5config_f.inc @ONLY) configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.cmake ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY) diff --git a/fortran/src/H5Aff.F90 b/fortran/src/H5Aff.F90 index a55773a0c1f..c2de9853f20 100644 --- a/fortran/src/H5Aff.F90 +++ b/fortran/src/H5Aff.F90 @@ -591,8 +591,8 @@ SUBROUTINE h5aclose_f(attr_id, hdferr) INTEGER, INTENT(OUT) :: hdferr INTERFACE - INTEGER FUNCTION H5Aclose(attr_id) BIND(C, NAME='H5Aclose') - IMPORT :: HID_T + INTEGER(C_INT) FUNCTION H5Aclose(attr_id) BIND(C, NAME='H5Aclose') + IMPORT :: HID_T, C_INT IMPLICIT NONE INTEGER(HID_T), INTENT(IN), VALUE :: attr_id END FUNCTION H5Aclose diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 7e3a25f0938..316c9ad9a5d 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -20,43 +20,15 @@ #include "H5f90.h" #include "H5Eprivate.h" -/****if* H5Ef/h5eclear_c +/****if* H5Ef/h5eprint_c * NAME - * h5eclear_c - * PURPOSE - * Call H5Eclear to clear the error stack for the current thread - * INPUTS - * - * OUTPUTS - * - * RETURNS - * 0 on success, -1 on failure - * SOURCE - */ -int_f -h5eclear_c(hid_t_f *estack_id) -/******/ -{ - int_f ret_value = 0; - - /* - * Call H5Eclear function. - */ - if (H5Eclear2((hid_t)*estack_id) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - -/****if* H5Ef/h5eprint_c1 - * NAME - * h5eprint_c1 + * h5eprint_c * PURPOSE * Call H5Eprint to print the error stack in a default manner. * INPUTS - * name - file name - * namelen - length of name + * err_stack - error stack identifier + * name - file name + * namelen - length of name * OUTPUTS * * RETURNS @@ -64,22 +36,24 @@ h5eclear_c(hid_t_f *estack_id) * SOURCE */ int_f -h5eprint_c1(_fcd name, int_f *namelen) +h5eprint_c(hid_t_f *err_stack, _fcd name, size_t_f *namelen) /******/ { FILE *file = NULL; char *c_name = NULL; int_f ret_value = 0; - if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) - HGOTO_DONE(FAIL); - if (NULL == (file = fopen(c_name, "a"))) - HGOTO_DONE(FAIL); + if (namelen) { + if (NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) + HGOTO_DONE(FAIL); + if (NULL == (file = fopen(c_name, "a"))) + HGOTO_DONE(FAIL); + } /* * Call H5Eprint2 function. */ - if (H5Eprint2(H5E_DEFAULT, file) < 0) + if (H5Eprint2((hid_t)*err_stack, file) < 0) HGOTO_DONE(FAIL); done: @@ -91,122 +65,6 @@ h5eprint_c1(_fcd name, int_f *namelen) return ret_value; } -/****if* H5Ef/h5eprint_c2 - * NAME - * h5eprint_c2 - * PURPOSE - * Call H5Eprint to print the error stack to stderr - * in a default manner. - * INPUTS - * - * OUTPUTS - * - * RETURNS - * 0 on success, -1 on failure - * SOURCE - */ -int_f -h5eprint_c2(void) -/******/ -{ - int_f ret_value = 0; - - /* - * Call H5Eprint2 function. - */ - if (H5Eprint2(H5E_DEFAULT, NULL) < 0) - HGOTO_DONE(FAIL); - -done: - return ret_value; -} - -/****if* H5Ef/h5eget_major_c - * NAME - * h5eget_major_c - * PURPOSE - * Get a character string describing an error specified by a - * major error number. - * INPUTS - * error_no - Major error number - * OUTPUTS - * name - character string describing the error - * RETURNS - * 0 on success, -1 on failure - * SOURCE - */ -int_f -h5eget_major_c(int_f *error_no, _fcd name, size_t_f *namelen) -/******/ -{ - char *c_name = NULL; - size_t c_namelen = (size_t)*namelen; - int_f ret_value = 0; - - if (c_namelen > 0) - c_name = (char *)malloc(c_namelen + 1); - - if (!c_name) - HGOTO_DONE(FAIL); - - /* - * Call H5Eget_msg function. - */ - H5Eget_msg((hid_t)*error_no, NULL, c_name, c_namelen); - HD5packFstring((char *)c_name, _fcdtocp(name), c_namelen); - if (!strcmp(c_name, "Invalid major error number")) - HGOTO_DONE(FAIL); - -done: - if (c_name) - free(c_name); - - return ret_value; -} - -/****if* H5Ef/h5eget_minor_c - * NAME - * h5eget_minor_c - * PURPOSE - * Get a character string describing an error specified by a - * minor error number. - * INPUTS - * error_no - Major error number - * OUTPUTS - * name - character string describing the error - * RETURNS - * 0 on success, -1 on failure - * SOURCE - */ -int_f -h5eget_minor_c(int_f *error_no, _fcd name, size_t_f *namelen) -/******/ -{ - char *c_name = NULL; - size_t c_namelen = (size_t)*namelen; - int_f ret_value = 0; - - if (c_namelen > 0) - c_name = (char *)malloc(c_namelen + 1); - - if (!c_name) - HGOTO_DONE(FAIL); - - /* - * Call H5Eget_msg function. - */ - H5Eget_msg((hid_t)*error_no, NULL, c_name, c_namelen); - HD5packFstring((char *)c_name, _fcdtocp(name), c_namelen); - if (!strcmp(c_name, "Invalid minor error number")) - HGOTO_DONE(FAIL); - -done: - if (c_name) - free(c_name); - - return ret_value; -} - /****if* H5Ef/h5eset_auto2_c * NAME * h5eset_auto2_c @@ -221,18 +79,6 @@ h5eget_minor_c(int_f *error_no, _fcd name, size_t_f *namelen) * 0 on success, -1 on failure * SOURCE */ -/* int_f */ -/* h5eset_auto2_c(hid_t_f *estack_id, H5E_auto2_t *func, void *client_data) */ -/* /\******\/ */ -/* { */ -/* int ret_val = -1; */ -/* herr_t status = -1; */ - -/* status = H5Eset_auto2((hid_t)*estack_id, *func, client_data); */ -/* if (status >= 0) ret_val = 0; */ -/* return ret_val; */ -/* } */ - int_f h5eset_auto2_c(int_f *printflag, hid_t_f *estack_id, H5E_auto2_t func, void *client_data) /******/ @@ -251,3 +97,39 @@ h5eset_auto2_c(int_f *printflag, hid_t_f *estack_id, H5E_auto2_t func, void *cli return ret_val; } + +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) +/******/ +{ + + 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 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, 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); + +done: + if (c_msg) + free(c_msg); + return ret_value; +} diff --git a/fortran/src/H5Eff.F90 b/fortran/src/H5Eff.F90 index 4ef18c126f3..162a7508085 100644 --- a/fortran/src/H5Eff.F90 +++ b/fortran/src/H5Eff.F90 @@ -34,15 +34,43 @@ ! to the Windows dll file 'hdf5_fortrandll.def.in' in the fortran/src directory. ! This is needed for Windows based operating systems. ! +! MISSING: H5Eauto_is_v2, H5Eget_auto2 MODULE H5E USE H5GLOBAL + USE H5fortkit IMPLICIT NONE INTEGER, PARAMETER :: PRINTON = 1 !< Turn on automatic printing of errors INTEGER, PARAMETER :: PRINTOFF = 0 !< Turn off automatic printing of errors +!> @brief h5e_error_t derived type + TYPE, BIND(C) :: h5e_error_t + INTEGER(HID_T) :: cls_id !< Class ID + INTEGER(HID_T) :: maj_num !< Major error ID + INTEGER(HID_T) :: min_num !< Minor error number + INTEGER(C_INT) :: line !< Line in file where error occurs + TYPE(C_PTR) :: func_name !< Function in which error occurred + TYPE(C_PTR) :: file_name !< File in which error occurred + TYPE(C_PTR) :: desc !< Optional supplied description + END TYPE h5e_error_t + + INTERFACE h5eprint_f + MODULE PROCEDURE h5eprint1_f + MODULE PROCEDURE h5eprint2_f + END INTERFACE h5eprint_f + + INTERFACE + INTEGER FUNCTION h5eprint_c(err_stack, name, namelen) BIND(C,NAME='h5eprint_c') + IMPORT :: C_CHAR, HID_T, C_PTR + IMPLICIT NONE + INTEGER(HID_T) :: err_stack + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name + TYPE(C_PTR), VALUE :: namelen + END FUNCTION h5eprint_c + END INTERFACE + CONTAINS !> @@ -62,19 +90,20 @@ SUBROUTINE h5eclear_f(hdferr, estack_id) INTEGER(HID_T) :: estack_id_default INTERFACE - INTEGER FUNCTION h5eclear_c(estack_id_default) BIND(C,NAME='h5eclear_c') - IMPORT :: HID_T + INTEGER(C_INT) FUNCTION H5Eclear(err_stack) BIND(C,NAME='H5Eclear2') + IMPORT :: C_INT, HID_T IMPLICIT NONE - INTEGER(HID_T) :: estack_id_default - END FUNCTION h5eclear_c + INTEGER(HID_T), VALUE :: err_stack + END FUNCTION H5Eclear END INTERFACE estack_id_default = H5E_DEFAULT_F IF(PRESENT(estack_id)) estack_id_default = estack_id - hdferr = h5eclear_c(estack_id_default) + hdferr = INT(H5Eclear(estack_id_default)) END SUBROUTINE h5eclear_f +#ifdef H5_DOXYGEN !> !! \ingroup FH5E !! @@ -83,34 +112,66 @@ END SUBROUTINE h5eclear_f !! \param hdferr \fortran_error !! \param name Name of the file that contains print output !! -!! See C API: @ref H5Eprint2() +!! \note If \p name is not specified, the output will be sent to +!! the standard error (stderr). +!! +!! \attention Deprecated. +!! +!! See C API: @ref H5Eprint1() !! SUBROUTINE h5eprint_f(hdferr, name) CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: name INTEGER, INTENT(OUT) :: hdferr - INTEGER :: namelen + END SUBROUTINE h5eprint_f - INTERFACE - INTEGER FUNCTION h5eprint_c1(name, namelen) BIND(C,NAME='h5eprint_c1') - IMPORT :: C_CHAR - IMPLICIT NONE - INTEGER :: namelen - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: name - END FUNCTION h5eprint_c1 - END INTERFACE +!! \ingroup FH5E +!! +!! \brief Prints the error stack in a default manner. +!! +!! \param err_stack Error stack identifier +!! \param hdferr \fortran_error +!! \param name Name of the file that contains print output +!! +!! \note If \p name is not specified, the output will be sent to +!! the standard error (stderr). +!! +!! See C API: @ref H5Eprint2() +!! + SUBROUTINE h5eprint_f(err_stack, hdferr, name) + INTEGER(HID_T) , INTENT(IN) :: err_stack + INTEGER , INTENT(OUT) :: hdferr + CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: name + END SUBROUTINE h5eprint_f - INTERFACE - INTEGER FUNCTION h5eprint_c2() BIND(C,NAME='h5eprint_c2') - END FUNCTION h5eprint_c2 - END INTERFACE +#else + + SUBROUTINE h5eprint1_f(hdferr, name) + CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: name + INTEGER, INTENT(OUT) :: hdferr + + CALL h5eprint2_f(H5E_DEFAULT_F, hdferr, name) + + END SUBROUTINE h5eprint1_f + + SUBROUTINE h5eprint2_f(err_stack, hdferr, name) + INTEGER(HID_T), INTENT(IN) :: err_stack + CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: name + INTEGER, INTENT(OUT) :: hdferr + + INTEGER(SIZE_T), TARGET :: namelen + TYPE(C_PTR) :: c_namelen IF (PRESENT(name)) THEN - namelen = LEN(NAME) - hdferr = h5eprint_c1(name, namelen) + namelen = LEN(NAME, SIZE_T) + c_namelen = C_LOC(namelen) + hdferr = h5eprint_c(err_stack, name, c_namelen) ELSE - hdferr = h5eprint_c2() + hdferr = h5eprint_c(err_stack, C_NULL_CHAR, C_NULL_PTR) ENDIF - END SUBROUTINE h5eprint_f + END SUBROUTINE h5eprint2_f + +#endif + !> !! \ingroup FH5E !! @@ -121,25 +182,23 @@ END SUBROUTINE h5eprint_f !! \param namelen Number of characters in the name buffer. !! \param hdferr \fortran_error !! +!! \attention Deprecated: use H5Eget_msg_f() instead. +!! !! See C API: @ref H5Eget_major() !! SUBROUTINE h5eget_major_f(error_no, name, namelen, hdferr) - INTEGER, INTENT(IN) :: error_no - CHARACTER(LEN=*), INTENT(OUT) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen + INTEGER(HID_T) , INTENT(IN) :: error_no + CHARACTER(LEN=*), INTENT(OUT) :: name + INTEGER(SIZE_T) , INTENT(INOUT) :: namelen INTEGER, INTENT(OUT) :: hdferr - INTERFACE - INTEGER FUNCTION h5eget_major_c(error_no, name, namelen) BIND(C,NAME='h5eget_major_c') - IMPORT :: C_CHAR - IMPORT :: SIZE_T - IMPLICIT NONE - INTEGER :: error_no - CHARACTER(KIND=C_CHAR), DIMENSION(*) :: name - INTEGER(SIZE_T), INTENT(IN) :: namelen - END FUNCTION h5eget_major_c - END INTERFACE - hdferr = h5eget_major_c(error_no, name, namelen) + INTEGER :: msg_type + INTEGER(SIZE_T) :: namelen2 + + namelen2 = namelen + + CALL H5Eget_msg_f(error_no, msg_type, name, hdferr, namelen2) + END SUBROUTINE h5eget_major_f !> !! \ingroup FH5E @@ -150,23 +209,20 @@ END SUBROUTINE h5eget_major_f !! \param name Character string describing the error. !! \param hdferr \fortran_error !! +!! \attention Deprecated: use H5Eget_msg_f() instead. +!! !! See C API: @ref H5Eget_minor() !! SUBROUTINE h5eget_minor_f(error_no, name, hdferr) - INTEGER, INTENT(IN) :: error_no + INTEGER(HID_T) , INTENT(IN) :: error_no CHARACTER(LEN=*), INTENT(OUT) :: name INTEGER, INTENT(OUT) :: hdferr - INTERFACE - INTEGER FUNCTION h5eget_minor_c(error_no, name) BIND(C,NAME='h5eget_minor_c') - IMPORT :: C_CHAR - INTEGER :: error_no - CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name - END FUNCTION h5eget_minor_c - END INTERFACE - hdferr = h5eget_minor_c(error_no, name) - END SUBROUTINE h5eget_minor_f + INTEGER :: msg_type + CALL H5Eget_msg_f(error_no, msg_type, name, hdferr) + + END SUBROUTINE h5eget_minor_f !> !! \ingroup FH5E !! @@ -214,6 +270,701 @@ END FUNCTION h5eset_auto2_c hdferr = h5eset_auto2_c(printflag, estack_id_default, func_default, client_data_default) END SUBROUTINE h5eset_auto_f +!> +!! \ingroup FH5E +!! +!! \brief Pushes a new error record onto an error stack. +!! +!! \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 hdferr \fortran_error +!! \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(). +!! Furthermore, special characters, such as ANSI escapes, +!! will only be interpreted correctly if the Fortran equivalent +!! is used. For example, to print \p msg "TEXT" in red and has +!! a space after the text would be: +!!

    +!! \code +!! (..., "%s TEXT %s"//C_NEW_LINE, hdferr, ..., arg1=ACHAR(27)//"[31m", arg2=ACHAR(27)//"[0m" ) +!! \endcode +!!
    Using "\n" instead of C_NEW_LINE will not be interpereted correctly, and similarly, +!! using "\x1B" instead of ACHAR(27) +!! +!! +!! See C API: @ref H5Epush2() +!! + 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 + 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 + + 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) :: 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, & + arg7_def = C_NULL_PTR, arg8_def = C_NULL_PTR, & + arg9_def = C_NULL_PTR, arg10_def = C_NULL_PTR, & + arg11_def = C_NULL_PTR, arg12_def = C_NULL_PTR, & + arg13_def = C_NULL_PTR, arg14_def = C_NULL_PTR, & + arg15_def = C_NULL_PTR, arg16_def = C_NULL_PTR, & + arg17_def = C_NULL_PTR, arg18_def = C_NULL_PTR, & + arg19_def = C_NULL_PTR, arg20_def = C_NULL_PTR + + INTERFACE + 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, & + arg16, arg17, arg18, arg19, arg20) BIND(C, NAME='h5epush_c') + + IMPORT :: C_CHAR, C_INT, C_PTR + 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 :: 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(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)) + IF (PRESENT(arg4)) arg4_def = C_LOC(arg4(1:1)) + IF (PRESENT(arg5)) arg5_def = C_LOC(arg5(1:1)) + IF (PRESENT(arg6)) arg6_def = C_LOC(arg6(1:1)) + IF (PRESENT(arg7)) arg7_def = C_LOC(arg7(1:1)) + IF (PRESENT(arg8)) arg8_def = C_LOC(arg8(1:1)) + IF (PRESENT(arg9)) arg9_def = C_LOC(arg9(1:1)) + IF (PRESENT(arg10)) arg10_def = C_LOC(arg10(1:1)) + IF (PRESENT(arg11)) arg11_def = C_LOC(arg11(1:1)) + IF (PRESENT(arg12)) arg12_def = C_LOC(arg12(1:1)) + IF (PRESENT(arg13)) arg13_def = C_LOC(arg13(1:1)) + IF (PRESENT(arg14)) arg14_def = C_LOC(arg14(1:1)) + IF (PRESENT(arg15)) arg15_def = C_LOC(arg15(1:1)) + IF (PRESENT(arg16)) arg16_def = C_LOC(arg16(1:1)) + IF (PRESENT(arg17)) arg17_def = C_LOC(arg17(1:1)) + IF (PRESENT(arg18)) arg18_def = C_LOC(arg18(1:1)) + 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, 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 +!! +!! \brief Registers a client library or application program to the HDF5 error API. +!! +!! \param cls_name Name of the error class +!! \param lib_name Name of the client library or application to which the error class belongs +!! \param version Version of the client library or application to which the error class belongs. It can be NULL. +!! \param class_id Class identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eregister_class() +!! + SUBROUTINE h5eregister_class_f(cls_name, lib_name, version, class_id, hdferr) + IMPLICIT NONE + CHARACTER(LEN=*), INTENT(IN) :: cls_name + CHARACTER(LEN=*), INTENT(IN) :: lib_name + CHARACTER(LEN=*), INTENT(IN) :: version + INTEGER(HID_T) , INTENT(OUT) :: class_id + INTEGER, INTENT(OUT) :: hdferr + + CHARACTER(LEN=LEN_TRIM(cls_name)+1,KIND=C_CHAR) :: c_cls_name + CHARACTER(LEN=LEN_TRIM(lib_name)+1,KIND=C_CHAR) :: c_lib_name + CHARACTER(LEN=LEN_TRIM(version)+1,KIND=C_CHAR) :: c_version + INTERFACE + INTEGER(HID_T) FUNCTION H5Eregister_class(cls_name, lib_name, version) & + BIND(C,NAME='H5Eregister_class') + IMPORT :: C_CHAR + IMPORT :: HID_T + IMPLICIT NONE + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: cls_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: lib_name + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: version + + END FUNCTION H5Eregister_class + END INTERFACE + + c_cls_name = TRIM(cls_name)//C_NULL_CHAR + c_lib_name = TRIM(lib_name)//C_NULL_CHAR + c_version = TRIM(version)//C_NULL_CHAR + + class_id = H5Eregister_class(c_cls_name, c_lib_name, c_version) + + hdferr = 0 + IF(class_id.LT.0) hdferr = -1 + + END SUBROUTINE h5eregister_class_f +!> +!! \ingroup FH5E +!! +!! \brief Removes an error class. +!! +!! \param class_id Class identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eunregister_class() +!! + SUBROUTINE h5eunregister_class_f(class_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: class_id + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Eunregister_class(class_id) BIND(C, NAME='H5Eunregister_class') + IMPORT :: HID_T, C_INT + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN), VALUE :: class_id + END FUNCTION H5Eunregister_class + END INTERFACE + + hdferr = INT(H5Eunregister_class(class_id)) + + END SUBROUTINE h5eunregister_class_f +!> +!! \ingroup FH5E +!! +!! \brief Adds a major or minor error message to an error class. +!! +!! \param class_id An error class identifier +!! \param msg_type The type of the error message +!! \param msg Error message +!! \param err_id Error identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Ecreate_msg() +!! + SUBROUTINE h5ecreate_msg_f(class_id, msg_type, msg, err_id, hdferr) + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: class_id + INTEGER , INTENT(IN) :: msg_type + CHARACTER(LEN=*), INTENT(IN) :: msg + INTEGER(HID_T) , INTENT(OUT) :: err_id + INTEGER, INTENT(OUT) :: hdferr + + CHARACTER(LEN=LEN_TRIM(msg)+1,KIND=C_CHAR) :: c_msg + + INTERFACE + INTEGER(HID_T) FUNCTION H5Ecreate_msg(class_id, msg_type, msg) & + BIND(C,NAME='H5Ecreate_msg') + IMPORT :: C_CHAR, C_INT + IMPORT :: HID_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: class_id + INTEGER(C_INT), VALUE :: msg_type + CHARACTER(KIND=C_CHAR), DIMENSION(*) :: msg + END FUNCTION H5Ecreate_msg + END INTERFACE + + c_msg = TRIM(msg)//C_NULL_CHAR + + err_id = H5Ecreate_msg(class_id, INT(msg_type, C_INT), c_msg) + + hdferr = 0 + IF(err_id.LT.0) hdferr = -1 + + END SUBROUTINE h5ecreate_msg_f +!> +!! \ingroup FH5E +!! +!! \brief Closes an error message. +!! +!! \param err_id An error message identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eclose_msg() +!! + SUBROUTINE h5eclose_msg_f(err_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: err_id + INTEGER, INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Eclose_msg(err_id) BIND(C, NAME='H5Eclose_msg') + IMPORT :: HID_T, C_INT + IMPLICIT NONE + INTEGER(HID_T), VALUE :: err_id + END FUNCTION H5Eclose_msg + END INTERFACE + + hdferr = INT(H5Eclose_msg(err_id)) + + END SUBROUTINE h5eclose_msg_f +!> +!! \ingroup FH5E +!! +!! \brief Retrieves an error message. +!! +!! \param msg_id Error message identifier +!! \param msg_type The type of the error message. Valid values are H5E_MAJOR_F and H5E_MINOR_F. +!! \param msg Error message buffer +!! \param hdferr \fortran_error +!! \param msg_size The length of error message to be returned by this function +!! +!! If \p msg_size is omitted, the API will copy up to the length of \p msg, and it +!! is the application's responsibility to provide a large enough buffer. If \p msg_size +!! is zero, the required buffer size will be returned, and \p msg is not accessed. +!! If \p msg_size is greater than zero, the function will copy up to the length +!! of \p msg_size info \p msg. +!! +!! See C API: @ref H5Eget_msg() +!! + SUBROUTINE H5Eget_msg_f(msg_id, msg_type, msg, hdferr, msg_size) + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: msg_id + INTEGER , INTENT(OUT) :: msg_type + CHARACTER(LEN=*) :: msg + INTEGER , INTENT(OUT) :: hdferr + INTEGER(SIZE_T) , INTENT(INOUT), OPTIONAL :: msg_size + + CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(:), ALLOCATABLE, TARGET :: c_msg + INTEGER(C_INT) :: c_msg_type + TYPE(C_PTR) :: f_ptr + INTEGER(SIZE_T) :: msg_cp_sz + INTEGER(SIZE_T) :: c_msg_size + + INTERFACE + INTEGER(SIZE_T) FUNCTION H5Eget_msg(msg_id, msg_type, msg, size) & + BIND(C,NAME='H5Eget_msg') + IMPORT :: C_CHAR, C_PTR, C_INT + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: msg_id + INTEGER(C_INT) :: msg_type + TYPE(C_PTR) , VALUE :: msg + INTEGER(SIZE_T), VALUE :: size + END FUNCTION H5Eget_msg + END INTERFACE + + hdferr = 0 + msg_cp_sz = 0 + IF(PRESENT(msg_size))THEN + IF(msg_size .EQ. 0)THEN + c_msg_size = H5Eget_msg(msg_id, c_msg_type, C_NULL_PTR, 0_SIZE_T) + + IF(PRESENT(msg_size)) msg_size = c_msg_size + msg_type = INT(c_msg_type) + + IF(c_msg_size.LT.0) hdferr = -1 + RETURN + ELSE + msg_cp_sz = msg_size + ENDIF + ENDIF + + IF(msg_cp_sz.EQ.0) msg_cp_sz = LEN(msg) + + ALLOCATE(c_msg(1:msg_cp_sz+1), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + 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_SIZE_T) + + CALL HD5c2fstring(msg, c_msg, msg_cp_sz, msg_cp_sz+1_SIZE_T) + + DEALLOCATE(c_msg) + + IF(PRESENT(msg_size))THEN + msg_size = c_msg_size + ENDIF + + msg_type = INT(c_msg_type) + + IF(c_msg_size.LT.0) hdferr = -1 + + END SUBROUTINE H5Eget_msg_f + +!> +!! \ingroup FH5E +!! +!! \brief Retrieves the number of error messages in an error stack. +!! +!! \param error_stack_id An error message identifier +!! \param count Number of error messages in \p err_id +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eget_num() +!! + SUBROUTINE h5eget_num_f(error_stack_id, count, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: error_stack_id + INTEGER(SIZE_T), INTENT(OUT) :: count + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(SIZE_T) FUNCTION H5Eget_num(error_stack_id) BIND(C, NAME='H5Eget_num') + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: error_stack_id + END FUNCTION H5Eget_num + END INTERFACE + + count = H5Eget_num(error_stack_id) + + hdferr = 0 + IF(count.LT.0) hdferr = -1 + + END SUBROUTINE h5eget_num_f + +!> +!! \ingroup FH5E +!! +!! \brief Walks the specified error stack, calling the specified function. +!! +!! \param err_stack Error stack identifier +!! \param direction Direction in which the error stack is to be walked +!! \param op Function to be called for each error encountered +!! \param op_data Data to be passed to func +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Ewalk2() +!! + SUBROUTINE h5ewalk_f(err_stack, direction, op, op_data, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: err_stack + INTEGER , INTENT(IN) :: direction + TYPE(C_FUNPTR) , INTENT(IN) :: op + TYPE(C_PTR) , INTENT(INOUT) :: op_data ! Declare INOUT to bypass gfortran 4.8.5 issue + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Ewalk(err_stack, direction, op, op_data) & + BIND(C, NAME='H5Ewalk2') + IMPORT :: HID_T, C_FUNPTR, C_PTR, C_INT + IMPLICIT NONE + INTEGER(HID_T), VALUE :: err_stack + INTEGER(C_INT), VALUE :: direction + TYPE(C_FUNPTR), VALUE :: op + TYPE(C_PTR) , VALUE :: op_data + END FUNCTION H5Ewalk + END INTERFACE + + hdferr = INT(H5Ewalk(err_stack, INT(direction, C_INT), op, op_data)) + + END SUBROUTINE h5ewalk_f + +!> +!! \ingroup FH5E +!! +!! \brief Retrieves an error message. +!! +!! \param class_id Error class identifier +!! \param name Buffer for the error class name +!! \param hdferr \fortran_error +!! \param size The maximum number of characters of the class name to be returned by this function in \p name. +!! +!! If \p size is omitted, the API will copy up to the length of \p name, and it +!! is the application's responsibility to provide a large enough buffer. If \p size +!! is zero, the required buffer size will be returned, and \p name is not accessed. +!! If \p size is greater than zero, the function will copy up to the length +!! of \p size info \p name. +!! +!! See C API: @ref H5Eget_class_name() +!! + SUBROUTINE H5Eget_class_name_f(class_id, name, hdferr, size) + IMPLICIT NONE + + INTEGER(HID_T) , INTENT(IN) :: class_id + CHARACTER(LEN=*) :: name + INTEGER , INTENT(OUT) :: hdferr + INTEGER(SIZE_T) , INTENT(INOUT), OPTIONAL :: size + + CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(:), ALLOCATABLE, TARGET :: c_name + TYPE(C_PTR) :: f_ptr + INTEGER(SIZE_T) :: name_cp_sz + INTEGER(SIZE_T) :: c_size + + INTERFACE + INTEGER(SIZE_T) FUNCTION H5Eget_class_name(class_id, name, size) & + BIND(C,NAME='H5Eget_class_name') + IMPORT :: C_PTR, C_CHAR + IMPORT :: HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , VALUE :: class_id + TYPE(C_PTR) , VALUE :: name + INTEGER(SIZE_T), VALUE :: size + END FUNCTION H5Eget_class_name + END INTERFACE + + hdferr = 0 + name_cp_sz = 0 + IF(PRESENT(size))THEN + IF(size .EQ. 0)THEN + c_size = H5Eget_class_name(class_id, C_NULL_PTR, 0_SIZE_T) + + IF(PRESENT(size)) size = c_size + IF(c_size.LT.0) hdferr = -1 + RETURN + ELSE + name_cp_sz = size + ENDIF + ENDIF + + IF(name_cp_sz.EQ.0) name_cp_sz = LEN(name) + + ALLOCATE(c_name(1:name_cp_sz+1), stat=hdferr) + IF (hdferr .NE. 0) THEN + hdferr = -1 + RETURN + ENDIF + f_ptr = C_LOC(c_name) + c_size = H5Eget_class_name(class_id, f_ptr, name_cp_sz+1_SIZE_T) + + CALL HD5c2fstring(name, c_name, name_cp_sz, name_cp_sz+1_SIZE_T) + DEALLOCATE(c_name) + + IF(PRESENT(size))THEN + size = c_size + ENDIF + + IF(c_size.LT.0) hdferr = -1 + + END SUBROUTINE H5Eget_class_name_f + +!> +!! \ingroup FH5E +!! +!! \brief Appends one error stack to another, optionally closing the source stack. +!! +!! \param dst_stack_id Error stack identifier +!! \param src_stack_id Error stack identifier +!! \param close_source_stack Flag to indicate whether to close the source stack +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eappend_stack() +!! + SUBROUTINE H5Eappend_stack_f(dst_stack_id, src_stack_id, close_source_stack, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN) :: dst_stack_id + INTEGER(HID_T), INTENT(IN) :: src_stack_id + LOGICAL , INTENT(IN) :: close_source_stack + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Eappend_stack(dst_stack_id, src_stack_id, close_source_stack) & + BIND(C, NAME='H5Eappend_stack') + IMPORT :: HID_T, C_BOOL, C_INT + IMPLICIT NONE + INTEGER(HID_T) , VALUE :: dst_stack_id + INTEGER(HID_T) , VALUE :: src_stack_id + LOGICAL(C_BOOL), VALUE :: close_source_stack + END FUNCTION H5Eappend_stack + END INTERFACE + + hdferr = INT(H5Eappend_stack(dst_stack_id, src_stack_id, LOGICAL(close_source_stack, C_BOOL))) + + END SUBROUTINE H5Eappend_stack_f + +!> +!! \ingroup FH5E +!! +!! \brief Returns a copy of the current error stack. +!! +!! \param err_stack_id Error stack identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eget_current_stack() +!! + SUBROUTINE H5Eget_current_stack_f(err_stack_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(OUT) :: err_stack_id + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(HID_T) FUNCTION H5Eget_current_stack() BIND(C, NAME='H5Eget_current_stack') + IMPORT :: HID_T + IMPLICIT NONE + END FUNCTION H5Eget_current_stack + END INTERFACE + + err_stack_id = H5Eget_current_stack() + + hdferr = 0 + IF(err_stack_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Eget_current_stack_f + +!> +!! \ingroup FH5E +!! +!! \brief Replaces the current error stack. +!! +!! \param err_stack_id Error stack identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eset_current_stack() +!! + SUBROUTINE H5Eset_current_stack_f(err_stack_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN ) :: err_stack_id + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Eset_current_stack(err_stack_id) BIND(C, NAME='H5Eset_current_stack') + IMPORT :: C_INT, HID_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: err_stack_id + END FUNCTION H5Eset_current_stack + END INTERFACE + + hdferr = INT(H5Eset_current_stack(err_stack_id)) + + END SUBROUTINE H5Eset_current_stack_f + +!> +!! \ingroup FH5E +!! +!! \brief Closes an error stack handle. +!! +!! \param err_stack_id Error stack identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Eclose_stack() +!! + SUBROUTINE H5Eclose_stack_f(err_stack_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(IN ) :: err_stack_id + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Eclose_stack(err_stack_id) BIND(C, NAME='H5Eclose_stack') + IMPORT :: C_INT, HID_T + IMPLICIT NONE + INTEGER(HID_T), VALUE :: err_stack_id + END FUNCTION H5Eclose_stack + END INTERFACE + + hdferr = INT(H5Eclose_stack(err_stack_id)) + + END SUBROUTINE H5Eclose_stack_f + +!> +!! \ingroup FH5E +!! +!! \brief Creates a new, empty error stack. +!! +!! \param err_stack_id Error stack identifier +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Ecreate_stack() +!! + SUBROUTINE H5Ecreate_stack_f(err_stack_id, hdferr) + IMPLICIT NONE + INTEGER(HID_T), INTENT(OUT) :: err_stack_id + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(HID_T) FUNCTION H5Ecreate_stack() BIND(C, NAME='H5Ecreate_stack') + IMPORT :: HID_T + IMPLICIT NONE + END FUNCTION H5Ecreate_stack + END INTERFACE + + err_stack_id = H5Ecreate_stack() + + hdferr = 0 + IF(err_stack_id.LT.0) hdferr = -1 + + END SUBROUTINE H5Ecreate_stack_f + +!> +!! \ingroup FH5E +!! +!! \brief Deletes specified number of error messages from the error stack. +!! +!! \param err_stack_id Error stack identifier +!! \param count The number of error messages to be deleted from the top of error stack +!! \param hdferr \fortran_error +!! +!! See C API: @ref H5Epop() +!! + SUBROUTINE H5Epop_f(err_stack_id, count, hdferr) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN ) :: err_stack_id + INTEGER(SIZE_T), INTENT(IN ) :: count + INTEGER , INTENT(OUT) :: hdferr + + INTERFACE + INTEGER(C_INT) FUNCTION H5Epop(err_stack_id, count) BIND(C, NAME='H5Epop') + IMPORT :: C_INT, HID_T, SIZE_T + IMPLICIT NONE + INTEGER(HID_T) , VALUE :: err_stack_id + INTEGER(SIZE_T), VALUE :: count + END FUNCTION H5Epop + END INTERFACE + + hdferr = INT(H5Epop(err_stack_id, count)) + + END SUBROUTINE H5Epop_f END MODULE H5E diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index 90a74f7cf4f..ab6765a8874 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -1615,6 +1615,9 @@ END SUBROUTINE h5pget_filter_f !! \param bytes Size of the external file data. !! \param hdferr \fortran_error !! +!! \note On Windows, off_t is typically a 32-bit signed long value, which +!! limits the valid offset that can be set to 2 GiB. +!! !! See C API: @ref H5Pset_external() !! SUBROUTINE h5pset_external_f(prp_id, name, offset, bytes, hdferr) @@ -1686,9 +1689,12 @@ END SUBROUTINE h5pget_external_count_f !! \param bytes Size of the external file data. !! \param hdferr \fortran_error !! +!! \note On Windows, off_t is typically a 32-bit signed long value, which +!! limits the valid offset that can be returned to 2 GiB. +!! !! See C API: @ref H5Pget_external() !! - SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset,bytes, hdferr) + SUBROUTINE h5pget_external_f(prp_id, idx, name_size, name, offset, bytes, hdferr) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: prp_id INTEGER, INTENT(IN) :: idx @@ -6250,7 +6256,7 @@ END FUNCTION h5pget_virtual_filename IF(INT(h5pget_virtual_filename(dcpl_id, index, f_ptr, INT(LEN(name)+1,SIZE_T)), SIZE_T).LT.0)THEN hdferr = -1 ELSE - CALL HD5c2fstring(name,c_name,LEN(name)) + CALL HD5c2fstring(name, c_name, LEN(name,KIND=SIZE_T), LEN(name,KIND=SIZE_T)+1_SIZE_T ) ENDIF ENDIF @@ -6304,7 +6310,7 @@ END FUNCTION h5pget_virtual_dsetname IF(INT(h5pget_virtual_dsetname(dcpl_id, index, f_ptr, INT(LEN(name)+1,SIZE_T)), SIZE_T).LT.0)THEN hdferr = -1 ELSE - CALL HD5c2fstring(name,c_name,LEN(name)) + CALL HD5c2fstring(name, c_name, LEN(name,KIND=SIZE_T), LEN(name,KIND=SIZE_T)+1_SIZE_T ) ENDIF ENDIF diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90 index 4467a59b171..66d098bfab6 100644 --- a/fortran/src/H5VLff.F90 +++ b/fortran/src/H5VLff.F90 @@ -343,7 +343,7 @@ END FUNCTION H5VLget_connector_name IF(INT(H5VLget_connector_name(obj_id, c_name, l), SIZE_T).LT.0)THEN hdferr = H5I_INVALID_HID_F ELSE - CALL HD5c2fstring(name,c_name,LEN(name)) + CALL HD5c2fstring(name, c_name, LEN(name,KIND=SIZE_T), LEN(name,KIND=SIZE_T)+1_SIZE_T ) ENDIF ENDIF diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake index 4330ca2e85f..44da2befead 100644 --- a/fortran/src/H5config_f.inc.cmake +++ b/fortran/src/H5config_f.inc.cmake @@ -67,6 +67,9 @@ #define H5_FORTRAN_HAVE_C_SIZEOF #endif +! Define if allocatable character is supported +#define H5_FORTRAN_HAVE_CHAR_ALLOC @H5_FORTRAN_HAVE_CHAR_ALLOC@ + ! Define if the intrinsic function C_LONG_DOUBLE exists #define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@ diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 65fd68a431e..cb2ec185735 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -35,6 +35,9 @@ ! Define if the intrinsic function C_SIZEOF exists #undef FORTRAN_HAVE_C_SIZEOF +! Define if Fortran supports allocatable character +#undef FORTRAN_HAVE_CHAR_ALLOC + ! Define if the intrinsic function C_LONG_DOUBLE exists #undef FORTRAN_HAVE_C_LONG_DOUBLE diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 0fe1b2017a1..0da371f5e17 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -553,12 +553,15 @@ H5_FCDLL int_f h5iis_valid_c(hid_t_f *obj_id, int_f *c_valid); * Functions from H5Ef.c */ -H5_FCDLL int_f h5eclear_c(hid_t_f *estack_id); -H5_FCDLL int_f h5eprint_c1(_fcd name, int_f *namelen); -H5_FCDLL int_f h5eprint_c2(void); -H5_FCDLL int_f h5eget_major_c(int_f *error_no, _fcd name, size_t_f *namelen); -H5_FCDLL int_f h5eget_minor_c(int_f *error_no, _fcd name, size_t_f *namelen); +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, _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/src/H5fortkit.F90 b/fortran/src/H5fortkit.F90 index b745c22e5ee..70d7087d65e 100644 --- a/fortran/src/H5fortkit.F90 +++ b/fortran/src/H5fortkit.F90 @@ -25,6 +25,8 @@ !***** MODULE H5fortkit + USE H5FORTRAN_TYPES, ONLY : SIZE_T + CONTAINS !****if* H5fortkit/HD5c2fstring @@ -32,28 +34,35 @@ MODULE H5fortkit ! HD5c2fstring ! INPUTS ! cstring - C string stored as a string array of size 'len' of string size LEN=1 -! len - length of Fortran string +! f_len - length of Fortran string +! c_len - length of C array ! OUTPUT -! fstring - Fortran string array of LEN=1 +! fstring - Fortran string LEN=1 ! PURPOSE -! Copies a Fortran array of strings having a length of one to a fortran string and removes the C Null +! Copies a C array of strings having a length of one to a fortran string and removes the C Null ! terminator. The Null terminator is returned from C when calling the C APIs directly. ! ! The fortran standard does not allow C_LOC to be used on a character string of ! length greater than one, which is why we use the array of characters instead. ! ! SOURCE - SUBROUTINE HD5c2fstring(fstring,cstring,len) + SUBROUTINE HD5c2fstring(fstring,cstring,f_len,c_len) !***** IMPLICIT NONE - INTEGER :: i - INTEGER :: len - CHARACTER(LEN=len) :: fstring - CHARACTER(LEN=1), DIMENSION(1:len) :: cstring + INTEGER(SIZE_T) :: i + INTEGER(SIZE_T) :: f_len + INTEGER(SIZE_T) :: c_len + CHARACTER(*) :: fstring + CHARACTER(LEN=1), DIMENSION(1:c_len) :: cstring + + INTEGER(SIZE_T) :: f_len_max fstring = '' - DO i = 1, len + f_len_max = LEN(fstring, KIND=SIZE_T) + DO i = 1, c_len + IF (i .GT. f_len_max) EXIT + IF (i .GT. f_len) EXIT IF (cstring(i)(1:1)==CHAR(0)) EXIT fstring(i:i) = cstring(i)(1:1) END DO diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am index 44561f62c14..8d8396fcbff 100644 --- a/fortran/src/Makefile.am +++ b/fortran/src/Makefile.am @@ -143,10 +143,11 @@ FORTRAN_API=yes # modules they depend upon are actually made. *sigh* H5f90global.lo: $(srcdir)/H5f90global.F90 H5fortran_types.lo H5_buildiface.lo: $(srcdir)/H5_buildiface.F90 +H5fortkit.lo: $(srcdir)/H5fortkit.F90 H5fortran_types.lo H5_ff.lo: $(srcdir)/H5_ff.F90 H5Fff.lo H5f90global.lo H5Aff.lo: $(srcdir)/H5Aff.F90 H5f90global.lo H5Dff.lo: $(srcdir)/H5Dff.F90 H5f90global.lo H5_ff.lo H5Sff.lo -H5Eff.lo: $(srcdir)/H5Eff.F90 H5f90global.lo +H5Eff.lo: $(srcdir)/H5Eff.F90 H5f90global.lo H5fortkit.lo H5ESff.lo: $(srcdir)/H5ESff.F90 H5f90global.lo H5Fff.lo: $(srcdir)/H5Fff.F90 H5f90global.lo H5Gff.lo: $(srcdir)/H5Gff.F90 H5f90global.lo H5Pff.lo diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 6d7329a183a..f92c523aaff 100644 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -308,20 +308,20 @@ if test "x$do_link" = "xyes"; then fi link_args="$link_args -L${libdir}" - case "$host_os" in - linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;; - hpux*) flag="-Wl,+b -Wl," ;; - freebsd*|solaris*) flag="-R" ;; - rs6000*|aix*) flag="-L" ;; - sgi) flag="-rpath " ;; - *) flag="" ;; - esac - - if test -n "$flag"; then - shared_link="${flag}${libdir}" - fi - - if test "x$USE_SHARED_LIB" != "xyes"; then + if test "x$USE_SHARED_LIB" = "xyes"; then + case "$host_os" in + linux*) flag="@fortran_linux_linker_option@-rpath -Wl," ;; + hpux*) flag="-Wl,+b -Wl," ;; + freebsd*|solaris*) flag="-R" ;; + rs6000*|aix*) flag="-L" ;; + sgi) flag="-rpath " ;; + *) flag="" ;; + esac + + if test -n "$flag"; then + shared_link="${flag}${libdir}" + fi + else # The hdf5 library "-l" flags are in here already. This is a static # compile though, so change it to the static versions (.a) of the libraries. new_libraries="" diff --git a/fortran/src/hdf5_fortrandll.def.in b/fortran/src/hdf5_fortrandll.def.in index e29488f8cee..56f54acbf75 100644 --- a/fortran/src/hdf5_fortrandll.def.in +++ b/fortran/src/hdf5_fortrandll.def.in @@ -106,10 +106,26 @@ H5D_mp_H5DWRITE_CHUNK_F H5D_mp_H5DREAD_CHUNK_F ; H5E H5E_mp_H5ECLEAR_F -H5E_mp_H5EPRINT_F +H5E_mp_H5EPRINT1_F +H5E_mp_H5EPRINT2_F H5E_mp_H5EGET_MAJOR_F H5E_mp_H5EGET_MINOR_F H5E_mp_H5ESET_AUTO_F +H5E_mp_H5EREGISTER_CLASS_F +H5E_mp_H5EUNREGISTER_CLASS_F +H5E_mp_H5ECREATE_MSG_F +H5E_mp_H5ECLOSE_MSG_F +H5E_mp_H5EGET_MSG_F +H5E_mp_H5EPUSH_F +H5E_mp_H5EGET_NUM_F +H5E_mp_H5EWALK_F +H5E_mp_H5EGET_CLASS_NAME_F +H5E_mp_H5EAPPEND_STACK_F +H5E_mp_H5EGET_CURRENT_STACK_F +H5E_mp_H5ESET_CURRENT_STACK_F +H5E_mp_H5ECREATE_STACK_F +H5E_mp_H5ECLOSE_STACK_F +H5E_mp_H5EPOP_F ; H5ES H5ES_mp_H5ESCREATE_F H5ES_mp_H5ESGET_COUNT_F diff --git a/fortran/test/fortranlib_test_F03.F90 b/fortran/test/fortranlib_test_F03.F90 index 85ab74432d0..50240ce6ed1 100644 --- a/fortran/test/fortranlib_test_F03.F90 +++ b/fortran/test/fortranlib_test_F03.F90 @@ -55,13 +55,12 @@ PROGRAM fortranlibtest_F03 total_error = total_error + 1 ENDIF - ret_total_error = 0 -! PROBLEMS with C -! CALL test_error(ret_total_error) -! CALL write_test_status(ret_total_error, ' Test error API based on data I/O', total_error) - WRITE(*,*) + ret_total_error = 0 + CALL test_error(ret_total_error) + CALL write_test_status(ret_total_error, ' Testing error API based on data I/O', total_error) + ret_total_error = 0 CALL test_array_compound_atomic(ret_total_error) CALL write_test_status(ret_total_error, ' Testing 1-D Array of Compound Datatypes Functionality', total_error) @@ -175,6 +174,10 @@ PROGRAM fortranlibtest_F03 CALL test_obj_info(ret_total_error) CALL write_test_status(ret_total_error, ' Testing object info functions ', total_error) + ret_total_error = 0 + CALL test_error_stack(ret_total_error) + CALL write_test_status(ret_total_error, ' Test error H5E API stack operations', total_error) + ! write(*,*) ! write(*,*) '=========================================' ! write(*,*) 'Testing VDS ' diff --git a/fortran/test/tH5E.F90 b/fortran/test/tH5E.F90 index 0550bc8778e..5cf761477d6 100644 --- a/fortran/test/tH5E.F90 +++ b/fortran/test/tH5E.F90 @@ -48,8 +48,6 @@ SUBROUTINE error_report_test(cleanup, total_error) CHARACTER(LEN=8), PARAMETER :: err_filename = "err_file"! Error output file CHARACTER(LEN=80) :: fix_err_filename - - INTEGER(HID_T) :: file_id ! File identifier INTEGER(HID_T) :: grp_id ! Group identifier INTEGER :: error, tmp_error, err_flag diff --git a/fortran/test/tH5E_F03.F90 b/fortran/test/tH5E_F03.F90 index c2bf74be061..b538e20c530 100644 --- a/fortran/test/tH5E_F03.F90 +++ b/fortran/test/tH5E_F03.F90 @@ -47,48 +47,129 @@ 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 - ! data that was registered with H5Eset_auto_f - INTEGER :: data_inout + INTEGER(HID_T), VALUE :: estack_id - PRINT*, " " - PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, WITH DATA" - PRINT*, " -This message should be written to standard out- " - PRINT*, " Data Values Passed In =", data_inout - PRINT*, " " + ! data that was registered with H5Eset_auto_f + ! INTEGER :: data_inout ! another option + ! or + TYPE(C_PTR), VALUE :: data_inout - data_inout = 10*data_inout + INTEGER, POINTER :: iunit - my_hdf5_error_handler = 1 ! this is not used by the C routine + CALL C_F_POINTER(data_inout, iunit) - END FUNCTION my_hdf5_error_handler + ! iunit = data_inout - INTEGER FUNCTION my_hdf5_error_handler_nodata(estack_id, data_inout) bind(C) + WRITE(iunit,'(A)') "H5Eset_auto_f_msg" + WRITE(iunit,'(I0)') iunit - ! This error function handle works with only version 2 error stack + iunit = 10*iunit - IMPLICIT NONE + my_hdf5_error_handler = 1 ! this is not used by the C routine - ! estack_id is always passed from C as: H5E_DEFAULT - INTEGER(HID_T) :: estack_id - ! data that was registered with H5Eset_auto_f - TYPE(C_PTR) :: data_inout + END FUNCTION my_hdf5_error_handler - PRINT*, " " - PRINT*, " Subtest: H5Eset_auto_f custom error message with callback, NO DATA" - PRINT*, " -This message should be written to standard out- " - PRINT*, " " + !------------------------------------------------------------------------- + ! Function: custom_print_cb + ! + ! Purpose: Callback function to print error stack in customized way. + ! + !------------------------------------------------------------------------- + ! + INTEGER(C_INT) FUNCTION custom_print_cb(n, err_desc, op_data) BIND(C) - my_hdf5_error_handler_nodata = 1 ! this is not used by the C routine + IMPLICIT NONE - END FUNCTION my_hdf5_error_handler_nodata + INTEGER(SIZE_T), PARAMETER :: MSG_SIZE = 64 + + INTEGER(C_INT), VALUE :: n + TYPE(h5e_error_t) :: err_desc + TYPE(C_PTR) :: op_data + + CHARACTER(LEN=MSG_SIZE) :: maj + CHARACTER(LEN=MSG_SIZE) :: minn + CHARACTER(LEN=MSG_SIZE) :: cls + INTEGER(SIZE_T) :: size + INTEGER :: msg_type + + 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 + RETURN + ENDIF + + IF(TRIM(cls).NE."Custom error class")THEN + custom_print_cb = -1 + RETURN + ENDIF + + size = 3 + CALL H5Eget_class_name_f(err_desc%cls_id, cls, error, size) + IF(error .LT.0)THEN + custom_print_cb = -1 + RETURN + ENDIF + IF(TRIM(cls).NE."Cus")THEN + custom_print_cb = -1 + RETURN + ENDIF + + size = 0 + CALL H5Eget_class_name_f(err_desc%cls_id, "", error, size) + IF(error .LT.0)THEN + custom_print_cb = -1 + RETURN + ENDIF + IF(size.NE.18)THEN + custom_print_cb = -1 + RETURN + ENDIF + + size = MSG_SIZE + CALL H5Eget_msg_f(err_desc%maj_num, msg_type, maj, error, size) + IF(error .LT.0)THEN + custom_print_cb = -1 + RETURN + ENDIF + + CALL h5eget_major_f(err_desc%maj_num, maj, size, error) + IF("MAJOR MSG".NE.TRIM(maj))THEN + custom_print_cb = -1 + RETURN + ENDIF + + IF(error .LT. 0)THEN + custom_print_cb = -1 + RETURN + ENDIF + + CALL h5eget_minor_f(err_desc%min_num, minn, error) + IF(error .LT. 0)THEN + custom_print_cb = -1 + RETURN + ENDIF + IF("MIN MSG".NE.TRIM(minn))THEN + custom_print_cb = -1 + RETURN + ENDIF + + custom_print_cb = 0 + + END FUNCTION custom_print_cb END MODULE test_my_hdf5_error_handler @@ -103,98 +184,313 @@ SUBROUTINE test_error(total_error) IMPLICIT NONE - INTEGER(hid_t), PARAMETER :: FAKE_ID = -1 INTEGER :: total_error INTEGER(hid_t) :: file - INTEGER(hid_t) :: dataset, space - INTEGER(hsize_t), DIMENSION(1:2) :: dims INTEGER :: error - INTEGER, DIMENSION(:), POINTER :: ptr_data INTEGER, TARGET :: my_hdf5_error_handler_data + INTEGER, TARGET :: iunit TYPE(C_PTR) :: f_ptr TYPE(C_FUNPTR) :: func + CHARACTER(LEN=180) :: chr180 + INTEGER :: idx + INTEGER(HID_T) :: fapl - TYPE(C_PTR), TARGET :: f_ptr1 + LOGICAL :: status - INTEGER, DIMENSION(1:1) :: array_shape + ! set the error stack to the customized routine - my_hdf5_error_handler_data = 99 - CALL h5fcreate_f("terror.h5", H5F_ACC_TRUNC_F, file, error) - CALL check("h5fcreate_f", error, total_error) + iunit = 12 + OPEN(iunit, FILE="stderr.txt") - ! Create the data space - dims(1) = 10 - dims(2) = 20 - CALL H5Screate_simple_f(2, dims, space, error) - CALL check("h5screate_simple_f", error, total_error) + my_hdf5_error_handler_data = iunit ! ** SET THE CUSTOMIZED PRINTING OF ERROR STACK ** ! set the customized error handling routine - func = c_funloc(my_hdf5_error_handler) + func = C_FUNLOC(my_hdf5_error_handler) ! set the data sent to the customized routine - f_ptr = c_loc(my_hdf5_error_handler_data) + f_ptr = C_LOC(my_hdf5_error_handler_data) - ! turn on automatic printing, and use a custom error routine with input data CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) + CALL check("H5Eset_auto_f", error, total_error) - ! Create the erring dataset - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - CALL verify("h5dcreate_f", error, -1, total_error) + ! If a fapl is not created, then the test will fail when using + ! check-passthrough-vol because the callback function is called twice, gh #4137. + CALL h5pcreate_f(H5P_DATASET_ACCESS_F, fapl, error) + CALL check("h5pcreate_f", error, total_error) + CALL h5fopen_f("DOESNOTEXIST", H5F_ACC_RDONLY_F, file, error, fapl) + CALL VERIFY("h5fopen_f", error, -1, total_error) + CALL h5pclose_f(fapl,error) + CALL check("h5pclose_f", error, total_error) -!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(1),10, total_error) -!!$ CALL verify("H5Eset_auto_f",my_hdf5_error_handler_data(2),20, total_error) + CLOSE(iunit) -!!$ ! Test enabling and disabling default printing -!!$ -!!$ CALL H5Eget_auto_f(H5E_DEFAULT_F, func1, f_ptr1, error) -!!$ CALL verify("H5Eget_auto_f", error, 0, total_error) + OPEN(iunit, FILE="stderr.txt") - ! PRINT*,c_associated(f_ptr1) + READ(iunit,'(A)') chr180 + idx = INDEX(string=chr180,substring="H5Eset_auto_f_msg") + IF(idx.EQ.0) CALL check("H5Eset_auto_f", -1, total_error) + READ(iunit, *) idx + CALL VERIFY("H5Eset_auto_f", idx, iunit, total_error) + CALL VERIFY("H5Eset_auto_f", my_hdf5_error_handler_data, 10*iunit, total_error) - ALLOCATE(ptr_data(1:2)) - ptr_data = 0 - array_shape(1) = 2 - CALL C_F_POINTER(f_ptr1, ptr_data, array_shape) + CLOSE(iunit, STATUS='delete') - ! ptr_data => f_ptr1(1) + CALL H5Eset_auto_f(0, error) + CALL check("H5Eset_auto_f", error, total_error) - ! PRINT*,ptr_data(1) + CALL h5fopen_f("DOESNOTEXIST", H5F_ACC_RDONLY_F, file, error) + CALL VERIFY("h5fopen_f", error, -1, total_error) -!!$ if(old_data != NULL) -!!$ TEST_ERROR; -!!$#ifdef H5_USE_16_API -!!$ if (old_func != (H5E_auto_t)H5Eprint) -!!$ TEST_ERROR; -!!$#else H5_USE_16_API -!!$ if (old_func != (H5E_auto2_t)H5Eprint2) -!!$ TEST_ERROR; -!!$#endif H5_USE_16_API + INQUIRE(file="H5Etest.txt", EXIST=status) + IF(status)THEN + CALL VERIFY("H5Eset_auto_f", error, -1, total_error) + ENDIF +END SUBROUTINE test_error - ! set the customized error handling routine - func = c_funloc(my_hdf5_error_handler_nodata) - ! set the data sent to the customized routine as null - f_ptr = C_NULL_PTR - ! turn on automatic printing, and use a custom error routine with no input data - CALL H5Eset_auto_f(1, error, H5E_DEFAULT_F, func, f_ptr) +SUBROUTINE test_error_stack(total_error) - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) - CALL verify("h5dcreate_f", error, -1, total_error) + IMPLICIT NONE + INTEGER :: total_error + INTEGER :: error + INTEGER(HID_T) :: cls_id, major, minor, estack_id, estack_id1, estack_id2 + CHARACTER(LEN=18) :: file + CHARACTER(LEN=18) :: func + INTEGER :: line + TYPE(C_PTR) :: ptr1 + + INTEGER :: msg_type + CHARACTER(LEN=9) :: maj_mesg = "MAJOR MSG" + CHARACTER(LEN=7) :: min_mesg = "MIN MSG" + !file status + LOGICAL :: status + CHARACTER(LEN=180) :: chr180 + INTEGER :: idx + INTEGER(SIZE_T) :: count + CHARACTER(LEN=64), TARGET :: stderr + TYPE(C_FUNPTR) :: func_ptr + +#ifdef H5_FORTRAN_HAVE_CHAR_ALLOC + CHARACTER(:), ALLOCATABLE :: msg_alloc +#endif + + CHARACTER(LEN=9) :: chr9 + INTEGER(SIZE_T) :: msg_size + + CALL h5eregister_class_f("Custom error class", "H5E_F03", "0.1", cls_id, error) + CALL check("H5Eregister_class_f", error, total_error) + + CALL H5Ecreate_msg_f(cls_id, H5E_MAJOR_F, maj_mesg, major, error) + CALL check("H5Ecreate_msg_f", error, 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" + func = "FUNC" + line = 99 + + 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, 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) + CALL check("h5eget_num_f", error, total_error) + CALL VERIFY("h5eget_num_f", count, 1_SIZE_T, total_error) + + msg_size = 0 + CALL H5Eget_msg_f(major, msg_type, chr9, error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MAJOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 9_SIZE_T, total_error) + + ! Check when a shorter buffer length is passed as the msg_size + msg_size = 3 + CALL H5Eget_msg_f(major, msg_type, chr9, error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MAJOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 9_SIZE_T, total_error) + CALL VERIFY("H5Eget_msg_f", TRIM(chr9), maj_mesg(1:3), total_error) + + ! Check when a exact size buffer length is passed as the msg_size + msg_size = 9 + CALL H5Eget_msg_f(major, msg_type, chr9, error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MAJOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 9_SIZE_T, total_error) + CALL VERIFY("H5Eget_msg_f", TRIM(chr9), maj_mesg(1:9), total_error) + + msg_size = 0 + CALL H5Eget_msg_f(minor, msg_type, chr9, error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MINOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 7_SIZE_T, total_error) + + ! Check when a shorter buffer length is passed as the msg_size + msg_size = 3 + CALL H5Eget_msg_f(minor, msg_type, chr9, error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MINOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 7_SIZE_T, total_error) + CALL VERIFY("H5Eget_msg_f", TRIM(chr9), min_mesg(1:3), total_error) + + ! Check when a larger buffer length is passed as the msg_size + msg_size = 9 + CALL H5Eget_msg_f(minor, msg_type, chr9, error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MINOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 7_SIZE_T, total_error) + CALL VERIFY("H5Eget_msg_f", TRIM(chr9), min_mesg(1:7), total_error) + + ! Check with an allocatable character of the exact size +#ifdef H5_FORTRAN_HAVE_CHAR_ALLOC + msg_size = 0 + CALL H5Eget_msg_f(minor, msg_type, "", error, msg_size) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MINOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_size, 7_SIZE_T, total_error) + + ALLOCATE(CHARACTER(LEN=msg_size) :: msg_alloc) + CALL H5Eget_msg_f(minor, msg_type, msg_alloc, error) + CALL check("H5Eget_msg_f", error, total_error) + CALL VERIFY("H5Eget_msg_f", msg_type, H5E_MINOR_F, total_error) + CALL VERIFY("H5Eget_msg_f", msg_alloc, min_mesg, total_error) +#endif + + CALL h5eprint_f(H5E_DEFAULT_F, error) + CALL check("h5eprint_f", error, total_error) + CALL h5eprint_f(error) + CALL check("h5eprint_f", error, total_error) + + INQUIRE(file="H5Etest.txt", EXIST=status) + IF(status)THEN + OPEN(UNIT=12, FILE="H5Etest.txt", status='old') + CLOSE(12, STATUS='delete') + ENDIF + + CALL h5eprint_f(estack_id, error, "H5Etest.txt") + CALL check("h5eprint_f", error, total_error) + + INQUIRE(file="H5Etest.txt", EXIST=status) + IF(.NOT.status)THEN + CALL check("h5eprint_f", -1, total_error) + ELSE +! The contents of the file should be: +! Custom error class-DIAG: Error detected in H5E_F03 (0.1) thread 0: +! #000: FILE line 99 in FUNC(): ERROR TEXT +! +! major: MAJOR MSG +! minor: MIN MSG + OPEN(UNIT=12, FILE="H5Etest.txt", status='old') - ! turn on automatic printing with h5eprint_f which prints an error stack in the default manner. + READ(12,'(A)') chr180 + idx = INDEX(string=chr180,substring="Custom error class") + IF(idx.EQ.0) CALL check("h5eprint_f1", -1, total_error) + idx = INDEX(string=chr180,substring="H5E_F03") + IF(idx.EQ.0) CALL check("h5eprint_f2", -1, total_error) + idx = INDEX(string=chr180,substring="0.1") + IF(idx.EQ.0) CALL check("h5eprint_f3", -1, total_error) - ! func = c_funloc(h5eprint_f) - ! CALL H5Eset_auto_f(0, error, H5E_DEFAULT_F, func, C_NULL_PTR) + READ(12,'(A)') chr180 + idx = INDEX(string=chr180,substring="FILE") + IF(idx.EQ.0) CALL check("h5eprint_f4", -1, total_error) + idx = INDEX(string=chr180,substring="99") + IF(idx.EQ.0) CALL check("h5eprint_f5", -1, total_error) + idx = INDEX(string=chr180,substring="FUNC") + IF(idx.EQ.0) CALL check("h5eprint_f6", -1, total_error) + idx = INDEX(string=chr180,substring="ERROR TEXT") + IF(idx.EQ.0) CALL check("h5eprint_f7", -1, total_error) - CALL H5Eset_auto_f(0, error) - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + READ(12,'()') - CALL H5Eset_auto_f(1, error) - CALL h5dcreate_f(FAKE_ID,"a_dataset",H5T_NATIVE_INTEGER, space, dataset, error) + READ(12,"(A)") chr180 + idx = INDEX(string=chr180,substring=maj_mesg) + IF(idx.EQ.0) CALL check("h5eprint_f", -1, total_error) -END SUBROUTINE test_error + READ(12,"(A)") chr180 + idx = INDEX(string=chr180,substring=min_mesg) + IF(idx.EQ.0) CALL check("h5eprint_f", -1, total_error) + + CLOSE(12, STATUS='delete') + ENDIF + + stderr = "** Print error stack in customized way **"//C_NULL_CHAR + ptr1 = C_LOC(stderr(1:1)) + func_ptr = C_FUNLOC(custom_print_cb) + + 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) + CALL check("h5eget_num_f", error, total_error) + CALL VERIFY("h5eget_num_f", count, 1_SIZE_T, total_error) + + CALL H5Ecreate_stack_f(estack_id2, error) + CALL check("H5Ecreate_stack_f", error, total_error) + + CALL H5Eappend_stack_f(estack_id2, estack_id, .FALSE., error) + CALL check("H5Eappend_stack_f", error, total_error) + + CALL h5eget_num_f(estack_id2, count, error) + CALL check("h5eget_num_f", error, total_error) + CALL VERIFY("h5eget_num_f", count, 1_SIZE_T, total_error) + + ! Copy error stack, which clears the original + CALL H5Eget_current_stack_f(estack_id1, error) + CALL check("H5Eget_current_stack_f", error, total_error) + + CALL h5eget_num_f(estack_id1, count, error) + CALL check("h5eget_num_f", error, total_error) + CALL VERIFY("h5eget_num_f", count, 0_SIZE_T, total_error) + + CALL H5Eclose_stack_f(estack_id2, error) + CALL check(" H5Eclose_stack_f", error, total_error) + + CALL H5Eclose_stack_f(estack_id, error) + CALL check("H5Eclose_stack_f", error, total_error) + + CALL H5Eclose_stack_f(estack_id1, error) + CALL check("H5Eclose_stack_f", error, total_error) + + CALL h5ecreate_stack_f(estack_id1, error) + CALL check("h5ecreate_stack_f", error, total_error) + + ! push a custom error message onto the stack + 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 + CALL check("H5Eset_current_stack_f", error, total_error) + + CALL h5eget_num_f(H5E_DEFAULT_F, count, error) + CALL check("h5eget_num_f", error, total_error) + CALL VERIFY("h5eget_num_f", count, 1_SIZE_T, total_error) + + CALL h5epop_f(H5E_DEFAULT_F, 1_size_t, error) + CALL check("h5epop_f", error, total_error) + + CALL h5eget_num_f(H5E_DEFAULT_F, count, error) + CALL check("h5eget_num_f", error, total_error) + CALL VERIFY("h5eget_num_f", count, 0_SIZE_T, total_error) + + CALL H5Eclose_msg_f(major, error) + CALL check("H5Eclose_msg_f", error, total_error) + + CALL H5Eclose_msg_f(minor, error) + CALL check("H5Eclose_msg_f", error, total_error) + + CALL h5eunregister_class_f(cls_id, error) + CALL check("H5Eunregister_class_f", error, total_error) + +END SUBROUTINE test_error_stack END MODULE TH5E_F03 diff --git a/fortran/test/tH5I.F90 b/fortran/test/tH5I.F90 index a5fedb97c95..7d97219b177 100644 --- a/fortran/test/tH5I.F90 +++ b/fortran/test/tH5I.F90 @@ -308,9 +308,12 @@ SUBROUTINE identifier_test(cleanup, total_error) ! Clear the error stack from the file close failure CALL h5eset_auto_f(1, error) CALL h5eclear_f(error) + CALL check("h5eclear_f",error,total_error) + CALL h5eclear_f(error, H5P_DEFAULT_F) + CALL check("h5eclear_f",error,total_error) - if(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) - CALL check("h5_cleanup_f", error, total_error) + IF(cleanup) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) + CALL check("h5_cleanup_f", error, total_error) RETURN END SUBROUTINE identifier_test diff --git a/fortran/test/tH5T_F03.F90 b/fortran/test/tH5T_F03.F90 index 08dfa226168..65804d0d091 100644 --- a/fortran/test/tH5T_F03.F90 +++ b/fortran/test/tH5T_F03.F90 @@ -1441,7 +1441,7 @@ SUBROUTINE t_enum(total_error) ! ! Create dataspace. Setting maximum size to be the current size. ! - CALL h5screate_simple_f(2, dims, space, total_error) + CALL h5screate_simple_f(2, dims, space, error) CALL check("h5screate_simple_f",error, total_error) ! ! Create the dataset and write the enumerated data to it. 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/java/src/hdf/hdf5lib/HDF5Constants.java b/java/src/hdf/hdf5lib/HDF5Constants.java index 57f88eba83d..e071c8c61b8 100644 --- a/java/src/hdf/hdf5lib/HDF5Constants.java +++ b/java/src/hdf/hdf5lib/HDF5Constants.java @@ -1093,6 +1093,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(); @@ -1173,6 +1177,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(); @@ -2576,6 +2582,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(); @@ -2656,6 +2666,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 e031db6bae3..253358259f9 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -2673,6 +2673,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; @@ -2873,6 +2883,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.f90 b/m4/aclocal_fc.f90 index d485f77e4ce..939988f64aa 100644 --- a/m4/aclocal_fc.f90 +++ b/m4/aclocal_fc.f90 @@ -55,6 +55,10 @@ PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS ptr = C_LOC(ichr(1:1)) END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS +PROGRAM PROG_CHAR_ALLOC + CHARACTER(:), ALLOCATABLE :: str +END PROGRAM PROG_CHAR_ALLOC + !---- START ----- Check to see C_BOOL is different from LOGICAL MODULE l_type_mod USE ISO_C_BINDING diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index 5e476269b16..f7427924ee2 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -106,6 +106,18 @@ AC_DEFUN([PAC_PROG_FC_STORAGE_SIZE],[ ]) +dnl See if the fortran compiler supports allocatable character + +AC_DEFUN([PAC_HAVE_CHAR_ALLOC],[ + HAVE_CHAR_ALLOC_FORTRAN="no" + AC_MSG_CHECKING([if Fortran compiler supports allocatable character]) + TEST_SRC="`sed -ne '/PROGRAM PROG_CHAR_ALLOC/,/END PROGRAM PROG_CHAR_ALLOC/p' $srcdir/m4/aclocal_fc.f90`" + AC_LINK_IFELSE([$TEST_SRC], [AC_MSG_RESULT([yes]) + HAVE_CHAR_ALLOC_FORTRAN="yes"], + [AC_MSG_RESULT([no])]) + +]) + dnl Check to see C_LONG_DOUBLE is available AC_DEFUN([PAC_PROG_FC_HAVE_C_LONG_DOUBLE],[ @@ -147,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 ae99955ac90..84bf892840e 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -968,13 +968,10 @@ VII. User Defined Options for HDF5 Libraries with CMake ======================================================================== Support for User Defined macros and options has been added. The file -UserMacros.cmake has an example of the technique. In the folder, -config/cmake/UserMacros, is an implementation for Windows Visual Studio -users for linking libraries to the static CRT - Windows_MT.cmake. +UserMacros.cmake has an example of the technique. -Copy the contents of the file, both macro and option, into the -UserMacros.cmake file. Then enable the option to the CMake configuration, -build and test process. +Replace the template code with your macro in the UserMacros.cmake file. +Then enable the option to the CMake configuration, build and test process. ======================================================================== @@ -1107,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 084d8921d4b..ef896457763 100644 --- a/release_docs/NEWSLETTER.txt +++ b/release_docs/NEWSLETTER.txt @@ -1,5 +1,4 @@ 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 @@ -24,12 +23,14 @@ 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. - Configuration: - ------------- -* Deprecated and removed old SZIP library in favor of LIBAEC library + +* Added support for _Float16 16-bit floating-point datatype - LIBAEC library has been used in HDF5 binaries as the szip library of choice - for a few years. We removed the options for using the old SZIP library. All - current szip and libaec options only work for building the libaec library. + 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 474ece3e1be..ac520ba3179 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -13,9 +13,9 @@ HDF5 source. Note that documentation in the links below will be updated at the time of each final release. -Links to HDF5 documentation can be found on The HDF5 web page: +Links to HDF5 documentation can be found on: - https://portal.hdfgroup.org/display/HDF5/HDF5 + https://portal.hdfgroup.org/documentation/ The official HDF5 releases can be obtained from: @@ -24,7 +24,7 @@ The official HDF5 releases can be obtained from: Changes from release to release and new features in the HDF5-1.14.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: @@ -47,6 +47,78 @@ New Features Configuration: ------------- + - Deprecate bin/cmakehdf5 script + + With the improvements made in CMake since version 3.23 and the addition + of CMake preset files, this script is no longer necessary. + + See INSTALL_CMake.txt file, Section X: Using CMakePresets.json for compiling + + - Overhauled LFS support checks + + In 2024, we can assume that Large File Support (LFS) exists on all + systems we support, though it may require flags to enable it, + particularly when building 32-bit binaries. The HDF5 source does + not use any of the 64-bit specific API calls (e.g., ftello64) + or explicit 64-bit offsets via off64_t. + + Autotools + + * We now use AC_SYS_LARGEFILE to determine how to support LFS. We + previously used a custom m4 script for this. + + CMake + + * The HDF_ENABLE_LARGE_FILE option (advanced) has been removed + * We no longer run a test program to determine if LFS works, which + will help with cross-compiling + * On Linux we now unilaterally set -D_LARGEFILE_SOURCE and + -D_FILE_OFFSET_BITS=64, regardless of 32/64 bit system. CMake + doesn't offer a nice equivalent to AC_SYS_LARGEFILE and since + those options do nothing on 64-bit systems, this seems safe and + covers all our bases. We don't set -D_LARGEFILE64_SOURCE since + we don't use any of the POSIX 64-bit specific API calls like + ftello64, as noted above. + * We didn't test for LFS support on non-Linux platforms. We've added + comments for how LFS should probably be supported on AIX and Solaris, + which seem to be alive, though uncommon. PRs would be appreciated if + anyone wishes to test this. + + This overhaul also fixes GitHub #2395, which points out that the LFS flags + used when building with CMake differ based on whether CMake has been + run before. The LFS check program that caused this problem no longer exists. + + - The CMake HDF5_ENABLE_DEBUG_H5B option has been removed + + This enabled some additional version-1 B-tree checks. These have been + removed so the option is no longer necessary. + + This option was CMake-only and marked as advanced. + + - New option for building with static CRT in Windows + + The following option has been added: + HDF5_BUILD_STATIC_CRT_LIBS "Build With Static Windows CRT Libraries" OFF + Because our minimum CMake is 3.18, the macro to change runtime flags no longer + works as CMake changed the default behavior in CMake 3.15. + + Fixes GitHub issue #3984 + + - Added support for the new MSVC preprocessor + + Microsoft added support for a new, standards-conformant preprocessor + to MSVC, which can be enabled with the /Zc:preprocessor option. This + preprocessor would trip over our HDopen() variadic function-like + macro, which uses a feature that only works with the legacy preprocessor. + + ifdefs have been added that select the correct HDopen() form and + allow building HDF5 with the /Zc:preprocessor option. + + The HDopen() macro is located in an internal header file and only + affects building the HDF5 library from source. + + Fixes GitHub #2515 + - Renamed HDF5_ENABLE_USING_MEMCHECKER to HDF5_USING_ANALYSIS_TOOL The HDF5_USING_ANALYSIS_TOOL is used to indicate to test macros that @@ -110,7 +182,187 @@ 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 + breaking them down into individual I/O requests, one for each entry + in the I/O vectors provided. This could result in poor I/O performance + for features in HDF5 that utilize vector I/O, such as parallel I/O + to filtered datasets. The Subfiling VFD now properly handles vector + I/O requests in their entirety, resulting in fewer I/O calls, improved + vector I/O performance and improved vector I/O memory efficiency. + + - Added a simple cache to the read-only S3 (ros3) VFD + + The read-only S3 VFD now caches the first N bytes of a file stored + in S3 to avoid a lot of small I/O operations when opening files. + This cache is per-file and created when the file is opened. + + N is currently 16 MiB or the size of the file, whichever is smaller. + + Addresses GitHub issue #3381 + + - Added new API function H5Pget_actual_selection_io_mode() + + This function allows the user to determine if the library performed + selection I/O, vector I/O, or scalar (legacy) I/O during the last HDF5 + operation performed with the provided DXPL. + + - Added support for in-place type conversion in most cases + + In-place type conversion allows the library to perform type conversion + without an intermediate type conversion buffer. This can improve + performance by allowing I/O in a single operation over the entire + selection instead of being limited by the size of the intermediate buffer. + Implemented for I/O on contiguous and chunked datasets when the selection + is contiguous in memory and when the memory datatype is not smaller than + the file datatype. + + - Changed selection I/O to be on by default when using the MPIO file driver + + - Added support for selection I/O in the MPIO file driver + + Previously, only vector I/O operations were supported. Support for + selection I/O should improve performance and reduce memory uses in some + cases. + + - Changed the error handling for a not found path in the find plugin process. + + While attempting to load a plugin the HDF5 library will fail if one of the + directories in the plugin paths does not exist, even if there are more paths + to check. Instead of exiting the function with an error, just logged the error + and continue processing the list of paths to check. + + - Implemented support for temporary security credentials for the Read-Only + S3 (ROS3) file driver. + + When using temporary security credentials, one also needs to specify a + session/security token next to the access key id and secret access key. + This token can be specified by the new API function H5Pset_fapl_ros3_token(). + The API function H5Pget_fapl_ros3_token() can be used to retrieve + the currently set token. + + - Added a Subfiling VFD configuration file prefix environment variable + + The Subfiling VFD now checks for values set in a new environment + variable "H5FD_SUBFILING_CONFIG_FILE_PREFIX" to determine if the + application has specified a pathname prefix to apply to the file + path for its configuration file. For example, this can be useful + for cases where the application wishes to write subfiles to a + machine's node-local storage while placing the subfiling configuration + file on a file system readable by all machine nodes. + + - Added H5Pset_selection_io(), H5Pget_selection_io(), and + H5Pget_no_selection_io_cause() API functions to manage the selection I/O + feature. This can be used to enable collective I/O with type conversion, + or it can be used with custom VFDs that support vector or selection I/O. + + - Added H5Pset_modify_write_buf() and H5Pget_modify_write_buf() API + functions to allow the library to modify the contents of write buffers, in + order to avoid malloc/memcpy. Currently only used for type conversion + with selection I/O. Parallel Library: @@ -120,7 +372,13 @@ New Features Fortran Library: ---------------- - - Add API support for Fortran MPI_F08 module definitions: + - Added Fortran H5E APIs: + h5eregister_class_f, h5eunregister_class_f, h5ecreate_msg_f, h5eclose_msg_f + h5eget_msg_f, h5epush_f, h5eget_num_f, h5ewalk_f, h5eget_class_name_f, + h5eappend_stack_f, h5eget_current_stack_f, h5eset_current_stack_f, h5ecreate_stack_f, + h5eclose_stack_f, h5epop_f, h5eprint_f (C h5eprint v2 signature) + + - Added API support for Fortran MPI_F08 module definitions: Adds support for MPI's MPI_F08 module datatypes: type(MPI_COMM) and type(MPI_INFO) for HDF5 APIs: H5PSET_FAPL_MPIO_F, H5PGET_FAPL_MPIO_F, H5PSET_MPI_PARAMS_F, H5PGET_MPI_PARAMS_F Ref. #3951 @@ -187,8 +445,111 @@ Support for new platforms, languages and compilers Bug Fixes since HDF5-1.14.3 release =================================== + Configuration: + ------------- + - Fix Autotools -Werror cleanup + + The Autotools temporarily scrub -Werror(=whatever) from CFLAGS, etc. + so configure checks don't trip over warnings generated by configure + check programs. The sed line originally only scrubbed -Werror but not + -Werror=something, which would cause errors when the '=something' was + left behind in CFLAGS. + + The sed line has been updated to handle -Werror=something lines. + + Fixes one issue raised in #3872 + Library ------- + - 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 + within a compound or array within another variable length type, and + overwriting data with a shorter (top level) variable length sequence, an + error could occur. This has been fixed. + + - Fixed asserts raised by large values of H5Pset_est_link_info() parameters + + If large values for est_num_entries and/or est_name_len were passed + to H5Pset_est_link_info(), the library would attempt to create an + object header NIL message to reserve enough space to hold the links in + compact form (i.e., concatenated), which could exceed allowable object + header message size limits and trip asserts in the library. + + This bug only occurred when using the HDF5 1.8 file format or later and + required the product of the two values to be ~64k more than the size + of any links written to the group, which would cause the library to + write out a too-large NIL spacer message to reserve the space for the + unwritten links. + + The library now inspects the phase change values to see if the dataset + is likely to be compact and checks the size to ensure any NIL spacer + messages won't be larger than the library allows. + + Fixes GitHub #1632 + - Fixed a bug where H5Tset_fields does not account for any offset set for a floating-point datatype when determining if values set for spos, epos, esize, mpos and msize make sense for the datatype @@ -283,6 +644,15 @@ Bug Fixes since HDF5-1.14.3 release of MPI-2 maintenance and testing since version HDF5 1.12. + - 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 ------------ - @@ -334,7 +704,11 @@ Bug Fixes since HDF5-1.14.3 release Fortran API ----------- - - + - Fixed: HDF5 fails to compile with -Werror=lto-type-mismatch + + Removed the use of the offending C stub wrapper. + + Fixes GitHub issue #3987 High-Level Library @@ -373,12 +747,75 @@ Bug Fixes since HDF5-1.14.3 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 + versions of OpenMPI less than version 5. This would cause the MPI + atomicity tests for parallel HDF5 to sporadically fail when run + with OpenMPI. Testphdf5 now checks if OpenMPI is being used and will + skip running the atomicity tests if the major version of OpenMPI is + < 5. + + - Fixed a testing failure in testphdf5 on Cray machines + + On some Cray machines, what appears to be a bug in Cray MPICH was causing + calls to H5Fis_accessible to create a 0-byte file with strange Unix + permissions. This was causing an H5Fdelete file deletion test in the + testphdf5 program to fail due to a just-deleted HDF5 file appearing to + still be accessible on the file system. The issue in Cray MPICH has been + worked around for the time being by resetting the MPI_Info object on the + File Access Property List used to MPI_INFO_NULL before passing it to the + H5Fis_accessible call. + + - A bug was fixed in the HDF5 API test random datatype generation code + + A bug in the random datatype generation code could cause test failures + when trying to generate an enumeration datatype that has duplicated + name/value pairs in it. This has now been fixed. + + - A bug was fixed in the HDF5 API test VOL connector registration checking code + + The HDF5 API test code checks to see if the VOL connector specified by the + HDF5_VOL_CONNECTOR environment variable (if any) is registered with the library + before attempting to run tests with it so that testing can be skipped and an + error can be returned when a VOL connector fails to register successfully. + Previously, this code didn't account for VOL connectors that specify extra + configuration information in the HDF5_VOL_CONNECTOR environment variable and + would incorrectly report that the specified VOL connector isn't registered + due to including the configuration information as part of the VOL connector + name being checked for registration status. This has now been fixed. + + - Fixed Fortran 2003 test with gfortran-v13, optimization levels O2,O3 + + Fixes failing Fortran 2003 test with gfortran, optimization level O2,O3 + with -fdefault-real-16. Fixes GH #2928. Platforms Tested =================== + - HDF5 supports the latest macOS versions, including the current and two + preceding releases. As new major macOS versions become available, HDF5 + will discontinue support for the oldest version and add the latest + version to its list of compatible systems, along with the previous two + releases. + + Linux 5.16.14-200.fc35 GNU gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) + #1 SMP x86_64 GNU/Linux GNU Fortran (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) + Fedora35 clang version 13.0.0 (Fedora 13.0.0-3.fc35) + (cmake and autotools) + Linux 5.19.0-1023-aws GNU gcc, gfortran, g++ #24-Ubuntu SMP x86_64 GNU/Linux (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 Ubuntu 22.04 Ubuntu clang version 14.0.0-1ubuntu1 @@ -386,11 +823,6 @@ Platforms Tested ifort (IFORT) 2021.9.0 20230302 (cmake and autotools) - Linux 5.16.14-200.fc35 GNU gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) - #1 SMP x86_64 GNU/Linux GNU Fortran (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9) - Fedora35 clang version 13.0.0 (Fedora 13.0.0-3.fc35) - (cmake and autotools) - Linux 5.14.21-cray_shasta_c cray-mpich/8.1.23 #1 SMP x86_64 GNU/Linux cce/15.0.0 (frontier) gcc/12.2.0 @@ -542,6 +974,10 @@ Known Problems The subsetting option in ph5diff currently will fail and should be avoided. The subsetting option works correctly in serial h5diff. + Flang Fortran compilation will fail (last check version 17) due to not yet + implemented: (1) derived type argument passed by value (H5VLff.F90), + and (2) support for REAL with KIND = 2 in intrinsic SPACING used in testing. + Several tests currently fail on certain platforms: MPI_TEST-t_bigio fails with spectrum-mpi on ppc64le platforms. @@ -554,11 +990,14 @@ Known Problems in the HDF5 source. Please report any new problems found to help@hdfgroup.org. + File space may not be released when overwriting or deleting certain nested + variable length or reference types. + 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/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt index 0cd75dfa73d..a691647f51d 100644 --- a/release_docs/USING_HDF5_CMake.txt +++ b/release_docs/USING_HDF5_CMake.txt @@ -213,7 +213,6 @@ set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_${LIB_TYPE}_LIBRARY}) set (example hdf_example) add_executable (${example} ${PROJECT_SOURCE_DIR}/${example}.c) -TARGET_C_PROPERTIES (${example} PRIVATE ${LIB_TYPE}) target_link_libraries (${example} ${LINK_LIBS}) enable_testing () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0e5e6788be..a19126c8291 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1065,7 +1065,6 @@ if (BUILD_STATIC_LIBS) target_compile_definitions(${HDF5_LIB_TARGET} PUBLIC ${HDF_EXTRA_C_FLAGS} - ${HDF_EXTRA_FLAGS} PRIVATE "$<$:H5_DEBUG_API>" # Enable tracing of the API "$<$:${HDF5_DEBUG_APIS}>" @@ -1100,7 +1099,6 @@ if (BUILD_SHARED_LIBS) PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" ${HDF_EXTRA_C_FLAGS} - ${HDF_EXTRA_FLAGS} PRIVATE "$<$:H5_HAVE_THREADSAFE>" "$<$:H5_DEBUG_API>" # Enable tracing of the API diff --git a/src/H5.c b/src/H5.c index 54b0b18a28c..6ee7aa582a8 100644 --- a/src/H5.c +++ b/src/H5.c @@ -481,10 +481,10 @@ H5_term_library(void) fprintf(stderr, "HDF5: infinite loop closing library\n"); fprintf(stderr, " %s\n", loop); #ifndef NDEBUG - HDabort(); -#endif /* NDEBUG */ - } /* end if */ - } /* end if */ + abort(); +#endif + } + } } /* Free open debugging streams */ @@ -654,7 +654,7 @@ H5get_free_list_sizes(size_t *reg_size /*out*/, size_t *arr_size /*out*/, size_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "xxxx", reg_size, arr_size, blk_size, fac_size); + H5TRACE4("e", "*z*z*z*z", reg_size, arr_size, blk_size, fac_size); /* Call the free list function to actually get the sizes */ if (H5FL_get_free_list_sizes(reg_size, arr_size, blk_size, fac_size) < 0) @@ -814,7 +814,7 @@ H5get_libversion(unsigned *majnum /*out*/, unsigned *minnum /*out*/, unsigned *r herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "xxx", majnum, minnum, relnum); + H5TRACE3("e", "*Iu*Iu*Iu", majnum, minnum, relnum); /* Set the version information */ if (majnum) @@ -831,18 +831,18 @@ H5get_libversion(unsigned *majnum /*out*/, unsigned *minnum /*out*/, unsigned *r /*------------------------------------------------------------------------- * Function: H5check_version * - * Purpose: Verifies that the arguments match the version numbers - * compiled into the library. This function is intended to be - * called from user to verify that the versions of header files - * compiled into the application match the version of the hdf5 - * library. - * Within major.minor.release version, the expectation - * is that all release versions are compatible, exceptions to - * this rule must be added to the VERS_RELEASE_EXCEPTIONS list. + * Purpose: Verifies that the arguments match the version numbers + * compiled into the library. This function is intended to be + * called from user to verify that the versions of header files + * compiled into the application match the version of the hdf5 + * library. * - * Return: Success: SUCCEED + * Within major.minor.release version, the expectation + * is that all release versions are compatible, exceptions to + * this rule must be added to the VERS_RELEASE_EXCEPTIONS list. * - * Failure: abort() + * Return: Success: SUCCEED + * Failure: abort() * *------------------------------------------------------------------------- */ @@ -909,7 +909,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) /* Bail out now. */ fputs("Bye...\n", stderr); - HDabort(); + abort(); case 1: /* continue with a warning */ /* Note that the warning message is embedded in the format string.*/ @@ -949,7 +949,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) /* Bail out now. */ fputs("Bye...\n", stderr); - HDabort(); + abort(); case 1: /* continue with a warning */ /* Note that the warning message is embedded in the format string.*/ @@ -1216,7 +1216,7 @@ H5is_library_threadsafe(bool *is_ts /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE1("e", "x", is_ts); + H5TRACE1("e", "*b", is_ts); if (is_ts) { #ifdef H5_HAVE_THREADSAFE @@ -1251,7 +1251,7 @@ H5is_library_terminating(bool *is_terminating /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE1("e", "x", is_terminating); + H5TRACE1("e", "*b", is_terminating); assert(is_terminating); diff --git a/src/H5A.c b/src/H5A.c index c183c85eec3..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 */ @@ -25,10 +24,7 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5ESprivate.h" /* Event Sets */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Opkg.h" /* Object headers */ #include "H5Sprivate.h" /* Dataspace functions */ #include "H5VLprivate.h" /* Virtual Object Layer */ @@ -1036,7 +1032,7 @@ H5Aread(hid_t attr_id, hid_t dtype_id, void *buf /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iix", attr_id, dtype_id, buf); + H5TRACE3("e", "ii*x", attr_id, dtype_id, buf); /* Synchronously read the data */ if (H5A__read_api_common(attr_id, dtype_id, buf, NULL, NULL) < 0) @@ -1064,7 +1060,7 @@ H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "*s*sIuiixi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id); + H5TRACE7("e", "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id); /* Set up request token pointer for asynchronous operation */ if (H5ES_NONE != es_id) @@ -1078,7 +1074,7 @@ H5Aread_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE7(__func__, "*s*sIuiixi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0) + H5ARG_TRACE7(__func__, "*s*sIuii*xi", app_file, app_func, app_line, attr_id, dtype_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "can't insert token into event set"); @@ -1257,7 +1253,7 @@ H5Aget_name(hid_t attr_id, size_t buf_size, char *buf /*out*/) ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "izx", attr_id, buf_size, buf); + H5TRACE3("Zs", "iz*s", attr_id, buf_size, buf); /* check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -1308,7 +1304,7 @@ H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("Zs", "i*sIiIohxzi", loc_id, obj_name, idx_type, order, n, name, size, lapl_id); + H5TRACE8("Zs", "i*sIiIoh*szi", loc_id, obj_name, idx_type, order, n, name, size, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1416,7 +1412,7 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", attr_id, ainfo); + H5TRACE2("e", "i*Ai", attr_id, ainfo); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR))) @@ -1458,7 +1454,7 @@ H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*s*sxi", loc_id, obj_name, attr_name, ainfo, lapl_id); + H5TRACE5("e", "i*s*s*Aii", loc_id, obj_name, attr_name, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) @@ -1515,7 +1511,7 @@ H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); + H5TRACE7("e", "i*sIiIoh*Aii", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id); /* Check args */ if (H5I_ATTR == H5I_get_type(loc_id)) diff --git a/src/H5AC.c b/src/H5AC.c index b752803ed55..5f9df26aba1 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -40,7 +40,7 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ -#include "H5Iprivate.h" /* IDs */ +#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/H5Adeprec.c b/src/H5Adeprec.c index 7ff2b06d69b..25dd6627d6d 100644 --- a/src/H5Adeprec.c +++ b/src/H5Adeprec.c @@ -35,7 +35,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 0cbe462dea8..b5d2601ba7f 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -31,9 +31,8 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ @@ -676,15 +675,14 @@ H5A__open_by_name(const H5G_loc_t *loc, const char *obj_name, const char *attr_n herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) { - uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ - 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 */ - hid_t src_id = -1, dst_id = -1; /* temporary type IDs*/ - 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 */ + uint8_t *tconv_buf = NULL; /* datatype conv buffer*/ + 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 */ + 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 */ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE_TAG(attr->oloc.addr) @@ -721,11 +719,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 ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), false)) < - 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); - /* 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 +743,9 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) } /* Perform datatype conversion. */ - if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed"); + 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 */ H5MM_memcpy(buf, tconv_buf, (dst_type_size * nelmts)); @@ -768,10 +762,6 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) done: /* Release resources */ - if (src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object"); - if (dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object"); if (tconv_buf) tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); if (bkg_buf) @@ -798,15 +788,14 @@ H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf) herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) { - uint8_t *tconv_buf = NULL; /* datatype conv buffer */ - 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*/ - hid_t src_id = -1, dst_id = -1; /* temporary type IDs */ - 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 */ + uint8_t *tconv_buf = NULL; /* datatype conv buffer */ + 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*/ + 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 */ herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE_TAG(attr->oloc.addr) @@ -839,10 +828,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 ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), false)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(attr->shared->dt, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); - /* 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))) @@ -875,8 +860,9 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) } /* Perform datatype conversion */ - if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, tconv_buf, bkg_buf) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed"); + 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 */ if (attr->shared->data) @@ -906,10 +892,6 @@ H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf) done: /* Release resources */ - if (src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object"); - if (dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object"); if (tconv_buf) tconv_buf = H5FL_BLK_FREE(attr_buf, tconv_buf); if (bkg_buf) @@ -2078,13 +2060,11 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info) { H5A_t *attr_dst = NULL; /* Destination attribute */ - hid_t tid_src = -1; /* Datatype ID for source datatype */ - hid_t tid_dst = -1; /* Datatype ID for destination datatype */ - hid_t tid_mem = -1; /* Datatype ID for memory datatype */ + 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 */ @@ -2194,29 +2174,16 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size /* Check if we need to convert data */ if (H5T_detect_class(attr_src->shared->dt, H5T_VLEN, false) > 0) { H5T_path_t *tpath_src_mem, *tpath_mem_dst; /* Datatype conversion paths */ - H5T_t *dt_mem; /* Memory datatype */ 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 */ - /* Create datatype ID for src datatype */ - if ((tid_src = H5I_register(H5I_DATATYPE, attr_src->shared->dt, false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register source file datatype"); - /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(attr_src->shared->dt, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, "unable to register memory datatype"); - - /* create variable-length datatype at the destination file */ - if ((tid_dst = H5I_register(H5I_DATATYPE, attr_dst->shared->dt, false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, - "unable to register destination file datatype"); /* Set up the conversion functions */ if (NULL == (tpath_src_mem = H5T_path_find(attr_src->shared->dt, dt_mem))) @@ -2250,12 +2217,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"); @@ -2272,7 +2233,8 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, NULL, "memory allocation failed"); /* Convert from source file to memory */ - if (H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) + if (H5T_convert(tpath_src_mem, attr_src->shared->dt, dt_mem, nelmts, (size_t)0, (size_t)0, buf, + bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "datatype conversion NULLed"); H5MM_memcpy(reclaim_buf, buf, buf_size); @@ -2282,12 +2244,13 @@ H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, bool *recompute_size memset(bkg_buf, 0, buf_size); /* Convert from memory to destination file */ - if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg_buf) < 0) + if (H5T_convert(tpath_mem_dst, dt_mem, attr_dst->shared->dt, nelmts, (size_t)0, (size_t)0, buf, + bkg_buf) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "datatype conversion NULLed"); H5MM_memcpy(attr_dst->shared->data, buf, attr_dst->shared->data_size); - if (H5T_reclaim(tid_mem, buf_space, reclaim_buf) < 0) + if (H5T_reclaim(dt_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, NULL, "unable to reclaim variable-length data"); } /* end if */ else { @@ -2311,20 +2274,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 (tid_src > 0) - /* Don't decrement ID, we want to keep underlying datatype */ - if (NULL == H5I_remove(tid_src)) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "Can't decrement temporary datatype ID"); - if (tid_dst > 0) - /* Don't decrement ID, we want to keep underlying datatype */ - if (NULL == H5I_remove(tid_dst)) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "Can't decrement temporary datatype ID"); - if (tid_mem > 0) - /* Decrement the memory datatype ID, it's transient */ - if (H5I_dec_ref(tid_mem) < 0) - HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, NULL, "Can't decrement temporary datatype 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) @@ -2415,7 +2368,7 @@ H5A__attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *attr_src, H5O_l /* Check for expanding references */ if (cpy_info->expand_ref) { /* Copy objects referenced in source buffer to destination file and set destination elements */ - if (H5O_copy_expand_ref(file_src, H5I_INVALID_HID, attr_src->shared->dt, attr_src->shared->data, + if (H5O_copy_expand_ref(file_src, attr_src->shared->dt, attr_src->shared->data, attr_src->shared->data_size, file_dst, attr_dst->shared->data, cpy_info) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, FAIL, "unable to copy reference attribute"); diff --git a/src/H5Atest.c b/src/H5Atest.c index 1d18b444cbc..141f5110160 100644 --- a/src/H5Atest.c +++ b/src/H5Atest.c @@ -31,7 +31,6 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Apkg.h" /* Attributes */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5B.c b/src/H5B.c index 9d89218d62f..5a7a23853c5 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -12,9 +12,9 @@ /*------------------------------------------------------------------------- * - * Created: H5B.c + * Created: H5B.c * - * Purpose: Implements balanced, sibling-linked, N-ary trees + * Purpose: Implements balanced, sibling-linked, N-ary trees * capable of storing any type of data with unique key * values. * @@ -101,10 +101,9 @@ #include "H5Bpkg.h" /* B-link trees */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ /****************/ /* Local Macros */ @@ -236,9 +235,6 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out */ if (H5AC_insert_entry(f, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache"); -#ifdef H5B_DEBUG - H5B__assert(f, *addr_p, shared->type, udata); -#endif done: if (ret_value < 0) { @@ -253,7 +249,7 @@ H5B_create(H5F_t *f, const H5B_class_t *type, void *udata, haddr_t *addr_p /*out } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B_create() */ /*lint !e818 Can't make udata a pointer to const */ +} /* end H5B_create() */ /*------------------------------------------------------------------------- * Function: H5B_find @@ -399,23 +395,6 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_ if (H5CX_get_btree_split_ratios(split_ratios) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree split ratios"); -#ifdef H5B_DEBUG - if (H5DEBUG(B)) { - const char *side; - - if (!H5_addr_defined(bt_ud->bt->left) && !H5_addr_defined(bt_ud->bt->right)) - side = "ONLY"; - else if (!H5_addr_defined(bt_ud->bt->right)) - side = "RIGHT"; - else if (!H5_addr_defined(bt_ud->bt->left)) - side = "LEFT"; - else - side = "MIDDLE"; - fprintf(H5DEBUG(B), "H5B__split: %3u {%5.3f,%5.3f,%5.3f} %6s", shared->two_k, split_ratios[0], - split_ratios[1], split_ratios[2], side); - } -#endif - /* * Decide how to split the children of the old node among the old node * and the new node. @@ -437,10 +416,6 @@ H5B__split(H5F_t *f, H5B_ins_ud_t *bt_ud, unsigned idx, void *udata, H5B_ins_ud_ else if (idx >= nleft && 0 == nleft) nleft++; nright = shared->two_k - nleft; -#ifdef H5B_DEBUG - if (H5DEBUG(B)) - fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); -#endif /* * Create the new B-tree node. @@ -649,11 +624,6 @@ H5B_insert(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) if (H5AC_unprotect(f, H5AC_BT, split_bt_ud.addr, split_bt_ud.bt, split_bt_ud.cache_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to unprotect new child"); -#ifdef H5B_DEBUG - if (ret_value >= 0) - H5B__assert(f, addr, type, udata); -#endif - FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_insert() */ @@ -944,14 +914,9 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 #endif /* H5_STRICT_FORMAT_CHECKS */ } else if (cmp) { - /* - * We couldn't figure out which branch to follow out of this node. THIS - * IS A MAJOR PROBLEM THAT NEEDS TO BE FIXED --rpm. - */ - assert("INTERNAL HDF5 ERROR (contact rpm)" && 0); -#ifdef NDEBUG - HDabort(); -#endif /* NDEBUG */ + /* We couldn't figure out which branch to follow out of this node */ + HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, + "internal error: could not determine which branch to follow out of this node"); } else if (bt->level > 0) { /* @@ -1054,15 +1019,7 @@ H5B__insert_helper(H5F_t *f, H5B_ins_ud_t *bt_ud, const H5B_class_t *type, uint8 if (split_bt_ud->bt) { H5MM_memcpy(md_key, H5B_NKEY(split_bt_ud->bt, shared, 0), type->sizeof_nkey); ret_value = H5B_INS_RIGHT; -#ifdef H5B_DEBUG - /* - * The max key in the original left node must be equal to the min key - * in the new node. - */ - cmp = (type->cmp2)(H5B_NKEY(bt, shared, bt->nchildren), udata, H5B_NKEY(split_bt_ud->bt, shared, 0)); - assert(0 == cmp); -#endif - } /* end if */ + } else ret_value = H5B_INS_NOOP; @@ -1544,9 +1501,6 @@ H5B_remove(H5F_t *f, const H5B_class_t *type, haddr_t addr, void *udata) H5B__remove_helper(f, addr, type, 0, lt_key, <_key_changed, udata, rt_key, &rt_key_changed)) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to remove entry from B-tree"); -#ifdef H5B_DEBUG - H5B__assert(f, addr, type, udata); -#endif done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5B_remove() */ 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/H5B2dbg.c b/src/H5B2dbg.c index 83a70eb5311..0977a4c96d2 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -28,10 +28,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5B2pkg.h" /* v2 B-trees */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5B2pkg.h" /* v2 B-trees */ +#include "H5Eprivate.h" /* Error handling */ /****************/ /* Local Macros */ 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/H5Bdbg.c b/src/H5Bdbg.c index 73eccecd0a8..6bbda059320 100644 --- a/src/H5Bdbg.c +++ b/src/H5Bdbg.c @@ -14,7 +14,7 @@ * * Created: H5Bdbg.c * - * Purpose: Debugging routines for B-link tree package. + * Purpose: Debugging routines for B-link tree package * *------------------------------------------------------------------------- */ @@ -36,10 +36,9 @@ /*------------------------------------------------------------------------- * Function: H5B_debug * - * Purpose: Prints debugging info about a B-tree. + * Purpose: Prints debugging info about a B-tree * * Return: Non-negative on success/Negative on failure - * *------------------------------------------------------------------------- */ herr_t @@ -54,9 +53,7 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 FUNC_ENTER_NOAPI(FAIL) - /* - * Check arguments. - */ + /* Check arguments */ assert(f); assert(H5_addr_defined(addr)); assert(stream); @@ -130,27 +127,21 @@ H5B_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, const H5 } /* end H5B_debug() */ /*------------------------------------------------------------------------- - * Function: H5B__assert - * - * Purpose: Verifies that the tree is structured correctly. - * - * Return: Success: SUCCEED + * Function: H5B__verify_structure * - * Failure: aborts if something is wrong. + * Purpose: Verifies that the tree is structured correctly * + * Return: SUCCEED/FAIL *------------------------------------------------------------------------- */ -#ifdef H5B_DEBUG herr_t -H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) +H5B__verify_structure(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) { H5B_t *bt = NULL; H5UC_t *rc_shared; /* Ref-counted shared info */ H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ - int ncell, cmp; - static int ncalls = 0; - herr_t status; + int cmp; herr_t ret_value = SUCCEED; /* Return value */ /* A queue of child data */ @@ -162,70 +153,79 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) FUNC_ENTER_PACKAGE - if (0 == ncalls++) { - if (H5DEBUG(B)) - fprintf(H5DEBUG(B), "H5B: debugging B-trees (expensive)\n"); - } /* end if */ - /* Get shared info for B-tree */ if (NULL == (rc_shared = (type->get_shared)(f, udata))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object"); - shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - assert(shared); + if (NULL == (shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared))) + HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's ref counted shared info"); /* Initialize the queue */ cache_udata.f = f; cache_udata.type = type; cache_udata.rc_shared = rc_shared; - bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG); - assert(bt); - shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared); - assert(shared); - cur = (struct child_t *)H5MM_calloc(sizeof(struct child_t)); - assert(cur); + + if (NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "can't protect B-tree node"); + + if (NULL == (shared = (H5B_shared_t *)H5UC_GET_OBJ(bt->rc_shared))) + HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't get B-tree shared data"); + + if (NULL == (cur = (struct child_t *)H5MM_calloc(sizeof(struct child_t)))) + HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "can't allocate memory for queue"); + cur->addr = addr; cur->level = bt->level; head = tail = cur; - status = H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET); - assert(status >= 0); + if (H5AC_unprotect(f, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "can't unprotect B-tree node"); + bt = NULL; /* Make certain future references will be caught */ - /* - * Do a breadth-first search of the tree. New nodes are added to the end + /* Do a breadth-first search of the tree. New nodes are added to the end * of the queue as the `cur' pointer is advanced toward the end. We don't * remove any nodes from the queue because we need them in the uniqueness * test. */ - for (ncell = 0; cur; ncell++) { - bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG); - assert(bt); + while (cur) { + if (NULL == (bt = (H5B_t *)H5AC_protect(f, H5AC_BT, cur->addr, &cache_udata, H5AC__READ_ONLY_FLAG))) + HGOTO_ERROR(H5E_BTREE, H5E_CANTPROTECT, FAIL, "can't protect B-tree node"); /* Check node header */ - assert(bt->level == cur->level); - if (cur->next && cur->next->level == bt->level) - assert(H5_addr_eq(bt->right, cur->next->addr)); - else - assert(!H5_addr_defined(bt->right)); - if (prev && prev->level == bt->level) - assert(H5_addr_eq(bt->left, prev->addr)); - else - assert(!H5_addr_defined(bt->left)); + if (bt->level != cur->level) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "B-tree level incorrect"); + + if (cur->next && cur->next->level == bt->level) { + if (!H5_addr_eq(bt->right, cur->next->addr)) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "right address should not equal next"); + } + else { + if (H5_addr_defined(bt->right)) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "bt->right should be HADDR_UNDEF"); + } + + if (prev && prev->level == bt->level) { + if (!H5_addr_eq(bt->left, prev->addr)) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "left address should not equal previous"); + } + else { + if (H5_addr_defined(bt->left)) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "bt->left should be HADDR_UNDEF"); + } if (cur->level > 0) { - unsigned u; - - for (u = 0; u < bt->nchildren; u++) { - /* - * Check that child nodes haven't already been seen. If they + for (unsigned u = 0; u < bt->nchildren; u++) { + /* Check that child nodes haven't already been seen. If they * have then the tree has a cycle. */ for (tmp = head; tmp; tmp = tmp->next) - assert(H5_addr_ne(tmp->addr, bt->child[u])); + if (!H5_addr_ne(tmp->addr, bt->child[u])) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "cycle detected in tree"); /* Add the child node to the end of the queue */ - tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t)); - assert(tmp); + if (NULL == (tmp = (struct child_t *)H5MM_calloc(sizeof(struct child_t)))) + HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "can't allocate memory for child node"); + tmp->addr = bt->child[u]; tmp->level = bt->level - 1; tail->next = tmp; @@ -233,28 +233,29 @@ H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata) /* Check that the keys are monotonically increasing */ cmp = (type->cmp2)(H5B_NKEY(bt, shared, u), udata, H5B_NKEY(bt, shared, u + 1)); - assert(cmp < 0); - } /* end for */ - } /* end if */ + if (cmp >= 0) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, FAIL, "keys not monotonically increasing"); + } + } /* Release node */ - status = H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET); - assert(status >= 0); + if (H5AC_unprotect(f, H5AC_BT, cur->addr, bt, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "can't unprotect B-tree node"); + bt = NULL; /* Make certain future references will be caught */ /* Advance current location in queue */ prev = cur; cur = cur->next; - } /* end for */ + } /* Free all entries from queue */ while (head) { tmp = head->next; H5MM_xfree(head); head = tmp; - } /* end while */ + } done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5B__assert() */ -#endif /* H5B_DEBUG */ +} /* end H5B__verify_structure() */ diff --git a/src/H5Bpkg.h b/src/H5Bpkg.h index f50bd48ac2e..d1ad647ae7d 100644 --- a/src/H5Bpkg.h +++ b/src/H5Bpkg.h @@ -26,8 +26,8 @@ #include "H5Bprivate.h" /* Other private headers needed by this file */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5FLprivate.h" /* Free Lists */ /**************************/ /* Package Private Macros */ @@ -35,13 +35,15 @@ /* Get the native key at a given index */ #define H5B_NKEY(b, shared, idx) ((b)->native + (shared)->nkey[(idx)]) -#define LEVEL_BITS 8 /* # of bits for node level: 1 byte */ + +/* # of bits for node level: 1 byte */ +#define LEVEL_BITS 8 /****************************/ /* Package Private Typedefs */ /****************************/ -/* The B-tree node as stored in memory... */ +/* The B-tree node as stored in memory */ typedef struct H5B_t { H5AC_info_t cache_info; /* Information for H5AC cache functions */ /* MUST be first field in structure */ @@ -78,8 +80,8 @@ H5FL_EXTERN(H5B_t); /* Package Private Prototypes */ /******************************/ H5_DLL herr_t H5B__node_dest(H5B_t *bt); -#ifdef H5B_DEBUG -herr_t H5B__assert(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata); -#endif + +/* For debugging */ +H5_DLL herr_t H5B__verify_structure(H5F_t *f, haddr_t addr, const H5B_class_t *type, void *udata); #endif /*H5Bpkg_H*/ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index a1d84efd1e7..f93fa9c5d82 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -31,16 +31,6 @@ /* Library Private Macros */ /**************************/ -/* - * Feature: Define this constant if you want to check B-tree consistency - * after each B-tree operation. Note that this slows down the - * library considerably! Debugging the B-tree depends on assert() - * being enabled. - */ -#ifdef NDEBUG -#undef H5B_DEBUG -#endif - /****************************/ /* Library Private Typedefs */ /****************************/ 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/H5CX.c b/src/H5CX.c index c46c58af35e..cdc6467a09f 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -300,9 +300,9 @@ typedef struct H5CX_t { bool no_selection_io_cause_valid; /* Whether reason for not performing selection I/O is valid */ uint32_t - actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */ - hbool_t actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ - hbool_t actual_selection_io_mode_valid; /* Whether actual selection I/O mode is valid */ + actual_selection_io_mode; /* Actual selection I/O mode used (H5D_ACTUAL_SELECTION_IO_MODE_NAME) */ + bool actual_selection_io_mode_set; /* Whether actual selection I/O mode is set */ + bool actual_selection_io_mode_valid; /* Whether actual selection I/O mode is valid */ /* Cached LCPL properties */ H5T_cset_t encoding; /* Link name character encoding */ @@ -759,6 +759,28 @@ H5CX__get_context(void) } /* end H5CX__get_context() */ #endif /* H5_HAVE_THREADSAFE */ +/*------------------------------------------------------------------------- + * Function: H5CX_pushed + * + * Purpose: Returns whether or not an API context has been pushed. + * + * Return: true/false + * + *------------------------------------------------------------------------- + */ +bool +H5CX_pushed(void) +{ + H5CX_node_t **head = NULL; /* Pointer to head of API context list */ + + FUNC_ENTER_NOAPI_NOERR + + head = H5CX_get_my_context(); /* Get the pointer to the head of the API context, for this thread */ + assert(head); + + FUNC_LEAVE_NOAPI(*head != NULL); +} + /*------------------------------------------------------------------------- * Function: H5CX__push_common * diff --git a/src/H5CXprivate.h b/src/H5CXprivate.h index 76812ee55ef..2a49d9ef031 100644 --- a/src/H5CXprivate.h +++ b/src/H5CXprivate.h @@ -60,6 +60,7 @@ typedef struct H5CX_state_t { H5_DLL herr_t H5CX_push(void); H5_DLL herr_t H5CX_pop(bool update_dxpl_props); #endif /* H5private_H */ +H5_DLL bool H5CX_pushed(void); H5_DLL void H5CX_push_special(void); H5_DLL bool H5CX_is_def_dxpl(void); 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/H5Cimage.c b/src/H5Cimage.c index b9690540afd..ec1af787d5e 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -40,7 +40,6 @@ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ /****************/ 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/H5Ctag.c b/src/H5Ctag.c index 8da6c137fdc..71eb24d2577 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -37,7 +37,6 @@ #include "H5Eprivate.h" /* Error Handling */ #include "H5Fpkg.h" /* Files */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5MMprivate.h" /* Memory management */ /****************/ /* Local Macros */ diff --git a/src/H5D.c b/src/H5D.c index c1f662b4bbf..10f647c9cb9 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -679,7 +679,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", dset_id, allocation); + H5TRACE2("e", "i*Ds", dset_id, allocation); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -1053,7 +1053,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, hid_t file_space_i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iiiiix", dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); + H5TRACE6("e", "iiiii*x", dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); /* Read the data */ if (H5D__read_api_common(1, &dset_id, &mem_type_id, &mem_space_id, &file_space_id, dxpl_id, &buf, NULL, @@ -1083,7 +1083,7 @@ H5Dread_async(const char *app_file, const char *app_func, unsigned app_line, hid herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE10("e", "*s*sIuiiiiixi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, + H5TRACE10("e", "*s*sIuiiiii*xi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id); /* Set up request token pointer for asynchronous operation */ @@ -1099,7 +1099,7 @@ H5Dread_async(const char *app_file, const char *app_func, unsigned app_line, hid if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE10(__func__, "*s*sIuiiiiixi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) + H5ARG_TRACE10(__func__, "*s*sIuiiiii*xi", app_file, app_func, app_line, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set"); @@ -1124,7 +1124,7 @@ H5Dread_multi(size_t count, hid_t dset_id[], hid_t mem_type_id[], hid_t mem_spac herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "z*i*i*i*iix", count, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); + H5TRACE7("e", "z*i*i*i*ii**x", count, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf); if (count == 0) HGOTO_DONE(SUCCEED); @@ -1159,7 +1159,7 @@ H5Dread_multi_async(const char *app_file, const char *app_func, unsigned app_lin herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE11("e", "*s*sIuz*i*i*i*iixi", app_file, app_func, app_line, count, dset_id, mem_type_id, + H5TRACE11("e", "*s*sIuz*i*i*i*ii**xi", app_file, app_func, app_line, count, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id); /* Set up request token pointer for asynchronous operation */ @@ -1175,7 +1175,7 @@ H5Dread_multi_async(const char *app_file, const char *app_func, unsigned app_lin if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE11(__func__, "*s*sIuz*i*i*i*iixi", app_file, app_func, app_line, count, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) + H5ARG_TRACE11(__func__, "*s*sIuz*i*i*i*ii**xi", app_file, app_func, app_line, count, dset_id, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_DATASET, H5E_CANTINSERT, FAIL, "can't insert token into event set"); @@ -1201,7 +1201,7 @@ H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fil herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ii*h*Iux", dset_id, dxpl_id, offset, filters, buf); + H5TRACE5("e", "ii*h*Iu*x", dset_id, dxpl_id, offset, filters, buf); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -1581,7 +1581,7 @@ H5Dscatter(H5D_scatter_func_t op, void *op_data, hid_t type_id, hid_t dst_space_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "DS*xiix", op, op_data, type_id, dst_space_id, dst_buf); + H5TRACE5("e", "DS*xii*x", op, op_data, type_id, dst_space_id, dst_buf); /* Check args */ if (op == NULL) @@ -1674,7 +1674,7 @@ H5Dgather(hid_t src_space_id, const void *src_buf, hid_t type_id, size_t dst_buf herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*xizxDg*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data); + H5TRACE7("e", "i*xiz*xDg*x", src_space_id, src_buf, type_id, dst_buf_size, dst_buf, op, op_data); /* Check args */ if (NULL == (src_space = (H5S_t *)H5I_object_verify(src_space_id, H5I_DATASPACE))) @@ -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"); @@ -1906,7 +1906,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *s herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iiix", dataset_id, type_id, space_id, size); + H5TRACE4("e", "iii*h", dataset_id, type_id, space_id, size); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object(dataset_id))) @@ -2201,7 +2201,7 @@ H5Dget_chunk_index_type(hid_t dset_id, H5D_chunk_index_t *idx_type /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", dset_id, idx_type); + H5TRACE2("e", "i*Dk", dset_id, idx_type); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -2243,7 +2243,7 @@ H5Dget_chunk_storage_size(hid_t dset_id, const hsize_t *offset, hsize_t *chunk_n herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*hx", dset_id, offset, chunk_nbytes); + H5TRACE3("e", "i*h*h", dset_id, offset, chunk_nbytes); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -2294,7 +2294,7 @@ H5Dget_num_chunks(hid_t dset_id, hid_t fspace_id, hsize_t *nchunks /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iix", dset_id, fspace_id, nchunks); + H5TRACE3("e", "ii*h", dset_id, fspace_id, nchunks); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) @@ -2346,7 +2346,7 @@ H5Dget_chunk_info(hid_t dset_id, hid_t fspace_id, hsize_t chk_index, hsize_t *of herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE7("e", "iihxxxx", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size); + H5TRACE7("e", "iih*h*Iu*a*h", dset_id, fspace_id, chk_index, offset, filter_mask, addr, size); /* Check arguments */ if (NULL == offset && NULL == filter_mask && NULL == addr && NULL == size) @@ -2415,7 +2415,7 @@ H5Dget_chunk_info_by_coord(hid_t dset_id, const hsize_t *offset, unsigned *filte herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*hxxx", dset_id, offset, filter_mask, addr, size); + H5TRACE5("e", "i*h*Iu*a*h", dset_id, offset, filter_mask, addr, size); /* Check arguments */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(dset_id, H5I_DATASET))) diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index 4f8a867974e..6c32c26f345 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -31,7 +31,6 @@ #include "H5Fprivate.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File space management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index c8bad760e71..e5b690e95c1 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,10 +180,9 @@ typedef struct H5D_chunk_it_ud3_t { bool do_convert; /* Whether to perform type conversions */ /* needed for converting variable-length data */ - hid_t tid_src; /* Datatype ID for source datatype */ - hid_t tid_dst; /* Datatype ID for destination datatype */ - hid_t tid_mem; /* Datatype ID for memory datatype */ 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 */ @@ -1061,6 +1061,10 @@ H5D__chunk_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) fm->single_space = NULL; fm->single_piece_info = NULL; + /* Initialize selection type in memory and file */ + fm->msel_type = H5S_SEL_ERROR; + fm->fsel_type = H5S_SEL_ERROR; + /* Check if the memory space is scalar & make equivalent memory space */ if ((sm_ndims = H5S_GET_EXTENT_NDIMS(dinfo->mem_space)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimension number"); @@ -1178,7 +1182,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; @@ -1281,10 +1284,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; @@ -1292,7 +1291,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 */ @@ -1331,11 +1331,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"); @@ -1350,7 +1345,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 */ @@ -1368,8 +1364,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() */ @@ -1977,9 +1971,8 @@ H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *dinfo, H5D_io_info_t *io_in do { /* Reset current dimension's location to 0 */ scaled[curr_dim] = start_scaled[curr_dim]; - coords[curr_dim] = - start_coords[curr_dim]; /*lint !e771 The start_coords will always be initialized */ - end[curr_dim] = (coords[curr_dim] + fm->chunk_dim[curr_dim]) - 1; + coords[curr_dim] = start_coords[curr_dim]; + end[curr_dim] = (coords[curr_dim] + fm->chunk_dim[curr_dim]) - 1; /* Decrement current dimension */ curr_dim--; @@ -4590,8 +4583,8 @@ H5D__chunk_lock(const H5D_io_info_t H5_ATTR_NDEBUG_UNUSED *io_info, const H5D_ds /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ if (H5D__fill_init(&fb_info, chunk, NULL, NULL, NULL, NULL, - &dset->shared->dcpl_cache.fill, dset->shared->type, - dset->shared->type_id, (size_t)0, chunk_size) < 0) + &dset->shared->dcpl_cache.fill, dset->shared->type, (size_t)0, + chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize fill buffer info"); fb_info_init = true; @@ -5020,8 +5013,8 @@ H5D__chunk_allocate(const H5D_t *dset, bool full_overwrite, const hsize_t old_di /* Initialize the fill value buffer */ /* (delay allocating fill buffer for VL datatypes until refilling) */ if (H5D__fill_init(&fb_info, NULL, H5D__chunk_mem_alloc, pline, H5D__chunk_mem_free, pline, - &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, - (size_t)0, orig_chunk_size) < 0) + &dset->shared->dcpl_cache.fill, dset->shared->type, (size_t)0, + orig_chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); fb_info_init = true; @@ -5793,8 +5786,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, bool new_unfilt_chunk) if (!udata->fb_info_init) { H5_CHECK_OVERFLOW(udata->elmts_per_chunk, uint32_t, size_t); if (H5D__fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, - dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, - chunk_size) < 0) + dset->shared->type, (size_t)udata->elmts_per_chunk, chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); udata->fb_info_init = true; } /* end if */ @@ -6576,6 +6568,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 */ + 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 */ @@ -6608,9 +6601,9 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) /* Check parameter for type conversion */ if (udata->do_convert) { - if (H5T_detect_class(udata->dt_src, H5T_VLEN, false) > 0) + if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) is_vlen = true; - else if ((H5T_get_class(udata->dt_src, false) == H5T_REFERENCE) && + else if ((H5T_get_class(dt_src, false) == H5T_REFERENCE) && (udata->file_src != udata->idx_info_dst->f)) fix_ref = true; else @@ -6702,20 +6695,19 @@ 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; - H5S_t *buf_space = udata->buf_space; - hid_t tid_src = udata->tid_src; - hid_t tid_dst = udata->tid_dst; - hid_t tid_mem = udata->tid_mem; - 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); - if (H5T_convert(tpath_src_mem, tid_src, tid_mem, (size_t)udata->nelmts, (size_t)0, (size_t)0, buf, + if (H5T_convert(tpath_src_mem, dt_src, dt_mem, (size_t)udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "datatype conversion failed"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, H5_ITER_ERROR, "datatype conversion failed"); /* Copy into another buffer, to reclaim memory later */ H5MM_memcpy(reclaim_buf, buf, reclaim_buf_size); @@ -6724,20 +6716,20 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) memset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5_ITER_ERROR, "datatype conversion failed"); + if (H5T_convert(tpath_mem_dst, dt_mem, dt_dst, udata->nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, H5_ITER_ERROR, "datatype conversion failed"); /* Reclaim space from variable length data */ - if (H5T_reclaim(tid_mem, buf_space, reclaim_buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADITER, H5_ITER_ERROR, "unable to reclaim variable-length data"); + if (H5T_reclaim(dt_mem, buf_space, reclaim_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to reclaim variable-length data"); } /* end if */ else if (fix_ref) { /* Check for expanding references */ /* (background buffer has already been zeroed out, if not expanding) */ if (udata->cpy_info->expand_ref) { /* Copy the reference elements */ - if (H5O_copy_expand_ref(udata->file_src, udata->tid_src, udata->dt_src, buf, nbytes, - udata->idx_info_dst->f, bkg, udata->cpy_info) < 0) + if (H5O_copy_expand_ref(udata->file_src, dt_src, buf, nbytes, udata->idx_info_dst->f, bkg, + udata->cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy reference attribute"); } /* end if */ @@ -6813,32 +6805,31 @@ H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) */ herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, - H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, + H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, H5T_t *dt_src, const H5O_pline_t *pline_src, H5O_copy_t *cpy_info) { - H5D_chunk_it_ud3_t udata; /* User data for iteration callback */ - H5D_chk_idx_info_t idx_info_dst; /* Dest. chunked index info */ - H5D_chk_idx_info_t idx_info_src; /* Source chunked index info */ - int sndims; /* Rank of dataspace */ - hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ - hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ - H5O_pline_t _pline; /* Temporary pipeline info */ - const H5O_pline_t *pline; /* Pointer to pipeline info to use */ - H5T_path_t *tpath_src_mem = NULL, *tpath_mem_dst = NULL; /* Datatype conversion paths */ - hid_t tid_src = -1; /* Datatype ID for source datatype */ - hid_t tid_dst = -1; /* Datatype ID for destination datatype */ - hid_t tid_mem = -1; /* Datatype ID for memory datatype */ - size_t buf_size; /* Size of copy buffer */ - size_t reclaim_buf_size; /* Size of reclaim buffer */ - void *buf = NULL; /* Buffer for copying data */ - 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 */ - herr_t ret_value = SUCCEED; /* Return value */ + H5D_chunk_it_ud3_t udata; /* User data for iteration callback */ + H5D_chk_idx_info_t idx_info_dst; /* Dest. chunked index info */ + H5D_chk_idx_info_t idx_info_src; /* Source chunked index info */ + int sndims; /* Rank of dataspace */ + hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ + hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ + H5O_pline_t _pline; /* Temporary pipeline info */ + const H5O_pline_t *pline; /* Pointer to pipeline info to use */ + H5T_path_t *tpath_src_mem = NULL; /* Source datatype conversion path */ + H5T_path_t *tpath_mem_dst = NULL; /* Memory datatype conversion path */ + H5T_t *dt_dst = NULL; /* Destination datatype */ + H5T_t *dt_mem = NULL; /* Memory datatype */ + size_t buf_size; /* Size of copy buffer */ + size_t reclaim_buf_size; /* Size of reclaim buffer */ + void *buf = NULL; /* Buffer for copying data */ + 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 */ + 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 */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -6896,14 +6887,8 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk "unable to set up index-specific chunk copying information"); copy_setup_done = true; - /* Create datatype ID for src datatype */ - if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); - /* If there's a VLEN source datatype, set up type conversion information */ if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) { - H5T_t *dt_dst; /* Destination datatype */ - H5T_t *dt_mem; /* Memory datatype */ size_t mem_dt_size; /* Memory datatype size */ size_t tmp_dt_size; /* Temp. datatype size */ size_t max_dt_size; /* Max atatype size */ @@ -6913,10 +6898,6 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { - (void)H5T_close_real(dt_mem); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); - } /* end if */ /* create variable-length datatype at the destination file */ if (NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) @@ -6925,10 +6906,6 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { - (void)H5T_close_real(dt_dst); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); - } /* end if */ /* Set up the conversion functions */ if (NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) @@ -6956,12 +6933,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; @@ -7008,10 +6979,9 @@ H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk udata.buf = buf; udata.bkg = bkg; udata.buf_size = buf_size; - udata.tid_src = tid_src; - udata.tid_mem = tid_mem; - udata.tid_dst = tid_dst; udata.dt_src = dt_src; + udata.dt_dst = dt_dst; + udata.dt_mem = dt_mem; udata.do_convert = do_convert; udata.tpath_src_mem = tpath_src_mem; udata.tpath_mem_dst = tpath_mem_dst; @@ -7057,14 +7027,15 @@ 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"); - if (tid_src > 0 && H5I_dec_ref(tid_src) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (tid_dst > 0 && H5I_dec_ref(tid_dst) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (tid_mem > 0 && H5I_dec_ref(tid_mem) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype 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"); + if (dt_dst && (H5T_close(dt_dst) < 0)) + 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) @@ -7342,8 +7313,7 @@ H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size /* Initialize the fill value buffer */ if (H5D__fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, - &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, - udata->dset->shared->type_id, (size_t)0, len) < 0) + &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, (size_t)0, len) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); fb_info_init = true; diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 4a8fa0d61c6..864d4963a6e 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -127,7 +127,7 @@ H5D__compact_fill(const H5D_t *dset) /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ if (H5D__fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, NULL, NULL, NULL, NULL, - &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, + &dset->shared->dcpl_cache.fill, dset->shared->type, (size_t)0, dset->shared->layout.storage.u.compact.size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); fb_info_init = true; @@ -470,13 +470,12 @@ herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info) { - hid_t tid_src = -1; /* Datatype ID for source datatype */ - hid_t tid_dst = -1; /* Datatype ID for destination datatype */ - hid_t tid_mem = -1; /* Datatype ID for memory datatype */ + 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 */ @@ -496,16 +495,9 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if (shared_fo != NULL) storage_src = &(shared_fo->layout.storage.u.compact); - /* Create datatype ID for src datatype, so it gets freed */ - if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); - /* 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 */ - H5T_t *dt_dst; /* Destination datatype */ - H5T_t *dt_mem; /* Memory datatype */ - 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 */ @@ -516,10 +508,6 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { - (void)H5T_close_real(dt_mem); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); - } /* end if */ /* create variable-length datatype at the destination file */ if (NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) @@ -528,10 +516,6 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { - (void)H5T_close_real(dt_dst); - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); - } /* end if */ /* Set up the conversion functions */ if (NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) @@ -563,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"); @@ -584,8 +562,8 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); /* Convert from source file to memory */ - if (H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + if (H5T_convert(tpath_src_mem, dt_src, dt_mem, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Copy into another buffer, to reclaim memory later */ H5MM_memcpy(reclaim_buf, buf, buf_size); @@ -594,13 +572,13 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds memset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + if (H5T_convert(tpath_mem_dst, dt_mem, dt_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); H5MM_memcpy(storage_dst->buf, buf, storage_dst->size); - if (H5T_reclaim(tid_mem, buf_space, reclaim_buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data"); + if (H5T_reclaim(dt_mem, buf_space, reclaim_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reclaim variable-length data"); } /* end if */ else if (H5T_get_class(dt_src, false) == H5T_REFERENCE) { if (f_src != f_dst) { @@ -608,7 +586,7 @@ H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_ds if (cpy_info->expand_ref) { /* Copy objects referenced in source buffer to destination file and set destination elements */ - if (H5O_copy_expand_ref(f_src, tid_src, dt_src, storage_src->buf, storage_src->size, f_dst, + if (H5O_copy_expand_ref(f_src, dt_src, storage_src->buf, storage_src->size, f_dst, storage_dst->buf, cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute"); } /* end if */ @@ -628,14 +606,15 @@ 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"); - if (tid_src > 0 && H5I_dec_ref(tid_src) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (tid_dst > 0 && H5I_dec_ref(tid_dst) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (tid_mem > 0 && H5I_dec_ref(tid_mem) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype 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"); + if (dt_dst && (H5T_close(dt_dst) < 0)) + 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 2a9f178ce8c..d9137b9479a 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -36,9 +36,7 @@ #include "H5Iprivate.h" /* IDs */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5FOprivate.h" /* File objects */ #include "H5Oprivate.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ #include "H5PBprivate.h" /* Page Buffer */ #include "H5VMprivate.h" /* Vector and array functions */ @@ -239,7 +237,7 @@ H5D__contig_fill(H5D_t *dset) /* Initialize the fill value buffer */ if (H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, - dset->shared->type, dset->shared->type_id, npoints, max_temp_buf) < 0) + dset->shared->type, npoints, max_temp_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info"); fb_info_init = true; @@ -1596,9 +1594,6 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f H5T_path_t *tpath_src_mem = NULL, *tpath_mem_dst = NULL; /* Datatype conversion paths */ H5T_t *dt_dst = NULL; /* Destination datatype */ H5T_t *dt_mem = NULL; /* Memory datatype */ - hid_t tid_src = -1; /* Datatype ID for source datatype */ - hid_t tid_dst = -1; /* Datatype ID for destination datatype */ - hid_t tid_mem = -1; /* Datatype ID for memory datatype */ size_t src_dt_size = 0; /* Source datatype size */ size_t mem_dt_size = 0; /* Memory datatype size */ size_t dst_dt_size = 0; /* Destination datatype size */ @@ -1613,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 */ @@ -1643,21 +1637,11 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f H5_CHECK_OVERFLOW(total_src_nbytes, hsize_t, size_t); buf_size = MIN(H5D_TEMP_BUF_SIZE, (size_t)total_src_nbytes); - /* Create datatype ID for src datatype. We may or may not use this ID, - * but this ensures that the src datatype will be freed. - */ - if ((tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); - /* If there's a VLEN source datatype, set up type conversion information */ if (H5T_detect_class(dt_src, H5T_VLEN, false) > 0) { /* create a memory copy of the variable-length datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { - (void)H5T_close_real(dt_mem); - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); - } /* end if */ /* create variable-length datatype at the destination file */ if (NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) @@ -1666,10 +1650,6 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { - (void)H5T_close_real(dt_dst); - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); - } /* end if */ /* Set up the conversion functions */ if (NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) @@ -1706,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 */ @@ -1793,8 +1767,8 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f /* Perform datatype conversion, if necessary */ if (is_vlen) { /* Convert from source file to memory */ - if (H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + if (H5T_convert(tpath_src_mem, dt_src, dt_mem, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Copy into another buffer, to reclaim memory later */ H5MM_memcpy(reclaim_buf, buf, mem_nbytes); @@ -1803,18 +1777,18 @@ H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f memset(bkg, 0, buf_size); /* Convert from memory to destination file */ - if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + if (H5T_convert(tpath_mem_dst, dt_mem, dt_dst, nelmts, (size_t)0, (size_t)0, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Reclaim space from variable length data */ - if (H5T_reclaim(tid_mem, buf_space, reclaim_buf) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data"); + if (H5T_reclaim(dt_mem, buf_space, reclaim_buf) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to reclaim variable-length data"); } /* end if */ else if (fix_ref) { /* Check for expanding references */ if (cpy_info->expand_ref) { /* Copy the reference elements */ - if (H5O_copy_expand_ref(f_src, tid_src, dt_src, buf, buf_size, f_dst, bkg, cpy_info) < 0) + if (H5O_copy_expand_ref(f_src, dt_src, buf, buf_size, f_dst, bkg, cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute"); /* After fix ref, copy the new reference elements to the buffer to write out */ @@ -1836,14 +1810,15 @@ 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"); - if (tid_src > 0 && H5I_dec_ref(tid_src) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (tid_dst > 0 && H5I_dec_ref(tid_dst) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (tid_mem > 0 && H5I_dec_ref(tid_mem) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype 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"); + if (dt_dst && (H5T_close(dt_dst) < 0)) + 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/H5Ddbg.c b/src/H5Ddbg.c index 22777b434cf..d8a9234675c 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -20,7 +20,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 04ab2cc09e2..e763a9b7b2e 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -306,15 +306,18 @@ 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) { - 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); /* Check args */ - if (H5I_DATATYPE != H5I_get_type(type_id) || buf == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument"); + if (buf == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "'buf' pointer is NULL"); + 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"); if (!(H5S_has_extent(space))) @@ -330,7 +333,7 @@ H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) H5CX_set_dxpl(dxpl_id); /* Call internal routine */ - ret_value = H5T_reclaim(type_id, space, buf); + ret_value = H5T_reclaim(type, space, buf); done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 8f23acd3405..56609844021 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -29,11 +29,9 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5VMprivate.h" /* Vector and array functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -118,7 +116,6 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_ 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 */ - hid_t src_id = -1, dst_id = -1; /* Temporary type IDs */ size_t dst_type_size; /* Size of destination type*/ herr_t ret_value = SUCCEED; /* Return value */ @@ -169,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 ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); - - if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register types for conversion"); - } /* 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. @@ -202,8 +190,8 @@ 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_id, dst_id, (size_t)nelmts, (size_t)0, (size_t)0, tmp_buf, bkg_buf) < - 0) + 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"); /* Allocate the chunk selection iterator */ @@ -252,8 +240,8 @@ 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_id, dst_id, (size_t)1, (size_t)0, (size_t)0, elem_ptr, bkg_ptr) < - 0) + 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"); /* Point at element buffer */ @@ -273,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_id != (-1) && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if (dst_id != (-1) && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); if (tmp_buf) tmp_buf = H5FL_BLK_FREE(type_conv, tmp_buf); if (elem_wb && H5WB_unwrap(elem_wb) < 0) @@ -301,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, - const H5T_t *dset_type, hid_t dset_type_id, 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 */ @@ -311,7 +295,6 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat assert(fb_info); assert(fill); assert(dset_type); - assert(dset_type_id > 0); /* Reset fill buffer information */ memset(fb_info, 0, sizeof(*fb_info)); @@ -319,7 +302,6 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat /* Cache constant information from the dataset */ fb_info->fill = fill; fb_info->file_type = dset_type; - fb_info->file_tid = dset_type_id; fb_info->fill_alloc_func = alloc_func; fb_info->fill_alloc_info = alloc_info; fb_info->fill_free_func = free_func; @@ -339,8 +321,6 @@ H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocat /* Create temporary datatype for conversion operation */ if (NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy file datatype"); - if ((fb_info->mem_tid = H5I_register(H5I_DATATYPE, fb_info->mem_type, false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); /* Retrieve sizes of memory & file datatypes */ fb_info->mem_elmt_size = H5T_get_size(fb_info->mem_type); @@ -516,7 +496,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) memset(fb_info->bkg_buf, 0, fb_info->max_elmt_size); /* Type convert the dataset buffer, to copy any VL components */ - if (H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_tid, fb_info->mem_tid, (size_t)1, (size_t)0, + if (H5T_convert(fb_info->fill_to_mem_tpath, fb_info->file_type, fb_info->mem_type, (size_t)1, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed"); @@ -540,7 +520,7 @@ H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts) H5MM_memcpy(buf, fb_info->fill_buf, fb_info->fill_buf_size); /* Type convert the dataset buffer, to copy any VL components */ - if (H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_tid, fb_info->file_tid, nelmts, (size_t)0, + if (H5T_convert(fb_info->mem_to_dset_tpath, fb_info->mem_type, fb_info->file_type, nelmts, (size_t)0, (size_t)0, fb_info->fill_buf, fb_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed"); @@ -622,9 +602,7 @@ H5D__fill_term(H5D_fill_buf_info_t *fb_info) /* Free other resources for vlen fill values */ if (fb_info->has_vlen_fill_type) { - if (fb_info->mem_tid > 0) - H5I_dec_ref(fb_info->mem_tid); - else if (fb_info->mem_type) + if (fb_info->mem_type) (void)H5T_close_real(fb_info->mem_type); if (fb_info->bkg_buf) fb_info->bkg_buf = H5FL_BLK_FREE(type_conv, fb_info->bkg_buf); diff --git a/src/H5Dint.c b/src/H5Dint.c index b37d35cfdc5..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, hid_t type_id, 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); @@ -1787,8 +1788,8 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id) case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "not implemented yet"); - } /* end switch */ /*lint !e788 All appropriate cases are covered */ - } /* end else */ + } /* end switch */ + } /* end else */ /* If "old" fill value size is 0 (undefined), map it to -1 */ if (fill_prop->size == 0) @@ -1972,8 +1973,8 @@ H5D_close(H5D_t *dataset) assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout"); -#endif /* NDEBUG */ - } /* end switch */ /*lint !e788 All appropriate cases are covered */ +#endif + } /* end switch */ /* Destroy any cached layout information for the dataset */ if (dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) @@ -2136,8 +2137,8 @@ H5D_mult_refresh_close(hid_t dset_id) assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout"); -#endif /* NDEBUG */ - } /* end switch */ /*lint !e788 All appropriate cases are covered */ +#endif + } /* end switch */ /* Destroy any cached layout information for the dataset */ if (dataset->shared->layout.ops->dest && (dataset->shared->layout.ops->dest)(dataset) < 0) @@ -2346,8 +2347,8 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, bool full_overwrite assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout"); -#endif /* NDEBUG */ - } /* end switch */ /*lint !e788 All appropriate cases are covered */ +#endif + } /* end switch */ /* Check if we need to initialize the space */ if (must_init_space) { @@ -2467,8 +2468,8 @@ H5D__init_storage(H5D_t *dset, bool full_overwrite, hsize_t old_dim[]) assert("not implemented yet" && 0); #ifdef NDEBUG HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout"); -#endif /* NDEBUG */ - } /* end switch */ /*lint !e788 All appropriate cases are covered */ +#endif + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -2523,7 +2524,7 @@ H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size) case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset type"); - } /*lint !e788 All appropriate cases are covered */ + } done: FUNC_LEAVE_NOAPI_TAG(ret_value) @@ -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, hid_t type_id, 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; @@ -2634,7 +2635,7 @@ H5D__vlen_get_buf_size_cb(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ FUNC_ENTER_PACKAGE /* Sanity check */ - assert(H5I_DATATYPE == H5I_get_type(type_id)); + assert(type); assert(point); assert(op_data); @@ -2643,11 +2644,11 @@ H5D__vlen_get_buf_size_cb(void H5_ATTR_UNUSED *elem, hid_t type_id, unsigned H5_ HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, H5_ITER_ERROR, "can't select point"); { - dset_info.dset = vlen_bufsize->dset; - dset_info.mem_space = vlen_bufsize->mspace; - dset_info.file_space = vlen_bufsize->fspace; - dset_info.buf.vp = vlen_bufsize->common.fl_tbuf; - dset_info.mem_type_id = type_id; + dset_info.dset = vlen_bufsize->dset; + dset_info.mem_space = vlen_bufsize->mspace; + dset_info.file_space = vlen_bufsize->fspace; + dset_info.buf.vp = vlen_bufsize->common.fl_tbuf; + dset_info.mem_type = type; /* Read in the point (with the custom VL memory allocator) */ if (H5D__read(1, &dset_info) < 0) @@ -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"); @@ -2729,9 +2730,8 @@ H5D__vlen_get_buf_size(H5D_t *dset, hid_t type_id, hid_t space_id, hsize_t *size vlen_bufsize.common.size = 0; /* Call H5S_select_iterate with args, etc. */ - dset_op.op_type = H5S_SEL_ITER_OP_APP; - dset_op.u.app_op.op = H5D__vlen_get_buf_size_cb; - dset_op.u.app_op.type_id = type_id; + dset_op.op_type = H5S_SEL_ITER_OP_LIB; + dset_op.u.lib_op = H5D__vlen_get_buf_size_cb; ret_value = H5S_select_iterate(&bogus, type, space, &dset_op, &vlen_bufsize); @@ -2829,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 */ @@ -2837,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"); @@ -3561,6 +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 *dst_type = NULL; + H5T_t *tmp_type = NULL; hid_t new_dcpl_id = FAIL; hid_t ret_value = H5I_INVALID_HID; /* Return value */ @@ -3646,43 +3648,31 @@ H5D_get_create_plist(const H5D_t *dset) /* Convert disk form of fill value into memory form */ if (!H5T_path_noop(tpath)) { - hid_t dst_id, src_id; /* Source & destination datatypes for type conversion */ uint8_t *bkg_buf = NULL; /* Background conversion buffer */ size_t bkg_size; /* Size of background buffer */ - /* Wrap copies of types to convert */ - dst_id = H5I_register(H5I_DATATYPE, H5T_copy(copied_fill.type, H5T_COPY_TRANSIENT), false); - if (dst_id < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); - src_id = H5I_register(H5I_DATATYPE, H5T_copy(dset->shared->type, H5T_COPY_ALL), false); - if (src_id < 0) { - H5I_dec_ref(dst_id); - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); - } /* end if */ + 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)); - if (H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + if (H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed"); - } /* end if */ /* Convert fill value */ - if (H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, copied_fill.buf, - bkg_buf) < 0) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + 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"); } /* end if */ /* Release local resources */ - if (H5I_dec_ref(src_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object"); - if (H5I_dec_ref(dst_id) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to close temporary object"); if (bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); } /* end if */ @@ -3713,6 +3703,9 @@ H5D_get_create_plist(const H5D_t *dset) ret_value = new_dcpl_id; done: + if (tmp_type && (H5T_close(tmp_type) < 0)) + HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to close temporary datatype"); + if (ret_value < 0) { if (new_dcpl_id > 0) if (H5I_dec_app_ref(new_dcpl_id) < 0) diff --git a/src/H5Dio.c b/src/H5Dio.c index 611518d3fc0..62bb48c2a26 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -24,12 +24,9 @@ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Sprivate.h" /* Dataspace */ -#include "H5VLnative_private.h" /* Native VOL connector */ - /****************/ /* Local Macros */ /****************/ @@ -46,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, hid_t mem_type_id); +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 @@ -157,7 +155,7 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) H5AC_tag(dset_info[i].dset->oloc.addr, &prev_tag); /* Set up datatype info for operation */ - if (H5D__typeinfo_init(&io_info, &(dset_info[i]), dset_info[i].mem_type_id) < 0) + if (H5D__typeinfo_init(&io_info, &(dset_info[i]), dset_info[i].mem_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info"); /* Make certain that the number of elements in each selection is the same, and cache nelmts in @@ -577,7 +575,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file"); /* Set up datatype info for operation */ - if (H5D__typeinfo_init(&io_info, &(dset_info[i]), dset_info[i].mem_type_id) < 0) + if (H5D__typeinfo_init(&io_info, &(dset_info[i]), dset_info[i].mem_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info"); /* Various MPI based checks */ @@ -1040,12 +1038,10 @@ 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, hid_t mem_type_id) +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; - const H5T_t *src_type; /* Source datatype */ - const H5T_t *dst_type; /* Destination datatype */ H5Z_data_xform_t *data_transform; /* Data transform info */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1054,6 +1050,7 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t /* Check args */ assert(io_info); assert(dset_info); + assert(mem_type); /* Set convenience pointers */ type_info = &dset_info->type_info; @@ -1068,21 +1065,16 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t memset(type_info, 0, sizeof(*type_info)); /* Get the memory & dataset datatypes */ - if (NULL == (type_info->mem_type = (const H5T_t *)H5I_object_verify(mem_type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + type_info->mem_type = mem_type; type_info->dset_type = dset->shared->type; if (io_info->op_type == H5D_IO_OP_WRITE) { - src_type = type_info->mem_type; - dst_type = dset->shared->type; - type_info->src_type_id = mem_type_id; - type_info->dst_type_id = dset->shared->type_id; + type_info->src_type = mem_type; + type_info->dst_type = dset->shared->type; } /* end if */ else { - src_type = dset->shared->type; - dst_type = type_info->mem_type; - type_info->src_type_id = dset->shared->type_id; - type_info->dst_type_id = mem_type_id; + type_info->src_type = dset->shared->type; + type_info->dst_type = mem_type; } /* end else */ /* Locate the type conversion function and dataspace conversion @@ -1092,7 +1084,7 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t * enough value in xfer_parms since turning off datatype conversion also * turns off background preservation. */ - if (NULL == (type_info->tpath = H5T_path_find(src_type, dst_type))) + if (NULL == (type_info->tpath = H5T_path_find(type_info->src_type, type_info->dst_type))) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype"); /* Retrieve info from API context */ @@ -1100,8 +1092,8 @@ H5D__typeinfo_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hid_t HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info"); /* Precompute some useful information */ - type_info->src_type_size = H5T_get_size(src_type); - type_info->dst_type_size = H5T_get_size(dst_type); + type_info->src_type_size = H5T_get_size(type_info->src_type); + type_info->dst_type_size = H5T_get_size(type_info->dst_type); type_info->is_conv_noop = H5T_path_noop(type_info->tpath); type_info->is_xform_noop = H5Z_xform_noop(data_transform); if (type_info->is_xform_noop && type_info->is_conv_noop) { diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 25effdf5f1a..8ac13f70fec 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -135,7 +135,7 @@ H5D__layout_set_io_ops(const H5D_t *dataset) case H5D_NLAYOUTS: default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unknown storage method"); - } /* end switch */ /*lint !e788 All appropriate cases are covered */ + } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) 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 b6976e6a067..307629f7718 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -30,11 +30,11 @@ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #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 @@ -615,7 +615,7 @@ H5D__mpio_debug_init(void) H5D__mpio_parse_debug_str(debug_str); if (H5DEBUG(D)) - debug_stream = H5DEBUG(D); + debug_stream = stdout; H5D_mpio_debug_inited = true; @@ -1412,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 = H5DEBUG(D); + debug_stream = H5DEBUG(D) ? stdout : NULL; } #endif @@ -3279,7 +3279,7 @@ H5D__mpio_collective_filtered_chunk_io_setup(const H5D_io_info_t *io_info, const (H5MM_free_t)H5D__chunk_mem_free, (void *)&di[dset_idx].dset->shared->dcpl_cache.pline, &di[dset_idx].dset->shared->dcpl_cache.fill, di[dset_idx].dset->shared->type, - di[dset_idx].dset->shared->type_id, 0, curr_dset_info->file_chunk_size) < 0) + 0, curr_dset_info->file_chunk_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill value buffer"); curr_dset_info->fb_info_init = true; diff --git a/src/H5Dnone.c b/src/H5Dnone.c index d4eb9188840..b319bd26fc6 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -34,7 +34,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ #include "H5VMprivate.h" /* Vector functions */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index dc842e8825b..684780e8e85 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -118,11 +118,11 @@ /* Typedef for datatype information for raw data I/O operation */ 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_path_t *tpath; /* Datatype conversion path */ - hid_t src_type_id; /* Source datatype ID */ - hid_t dst_type_id; /* Destination datatype ID */ + const H5T_t *mem_type; /* Pointer to memory datatype */ + const H5T_t *dset_type; /* Pointer to dataset 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 */ size_t src_type_size; /* Size of source type */ @@ -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; - hid_t mem_type_id; /* memory datatype ID */ + 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; @@ -603,8 +603,6 @@ typedef struct H5D_fill_buf_info_t { size_t bkg_buf_size; /* Size of background buffer */ H5T_t *mem_type; /* Pointer to memory datatype */ const H5T_t *file_type; /* Pointer to file datatype */ - hid_t mem_tid; /* ID for memory version of disk datatype */ - hid_t file_tid; /* ID for disk 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 */ @@ -742,8 +740,8 @@ H5_DLL herr_t H5D__chunk_addrmap(const H5D_t *dset, haddr_t chunk_addr[]); H5_DLL herr_t H5D__chunk_update_cache(H5D_t *dset); H5_DLL herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, - const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, - const H5O_pline_t *pline_src, H5O_copy_t *cpy_info); + const H5S_extent_t *ds_extent_src, H5T_t *dt_src, const H5O_pline_t *pline_src, + H5O_copy_t *cpy_info); H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t *layout, hsize_t *btree_size); H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, FILE *stream); H5_DLL herr_t H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *store); @@ -786,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, - const H5T_t *dset_type, hid_t dset_type_id, 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/H5Dscatgath.c b/src/H5Dscatgath.c index 9b60d81b2b0..997c72c115e 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -24,7 +24,6 @@ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ /****************/ @@ -576,8 +575,8 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ /* * Perform datatype conversion. */ - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, - dset_info->type_info.dst_type_id, smine_nelmts, (size_t)0, (size_t)0, tmp_buf, + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type, + dset_info->type_info.dst_type, smine_nelmts, (size_t)0, (size_t)0, tmp_buf, io_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); @@ -772,8 +771,8 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset /* * Perform datatype conversion. */ - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, - dset_info->type_info.dst_type_id, smine_nelmts, (size_t)0, (size_t)0, tmp_buf, + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type, + dset_info->type_info.dst_type, smine_nelmts, (size_t)0, (size_t)0, tmp_buf, io_info->bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); } /* end else */ @@ -975,10 +974,9 @@ H5D__scatgath_read_select(H5D_io_info_t *io_info) /* * Perform datatype conversion. */ - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, - dset_info->type_info.dst_type_id, - (size_t)io_info->sel_pieces[i]->piece_points, (size_t)0, (size_t)0, - tmp_bufs[i], tmp_bkg_buf) < 0) + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type, + dset_info->type_info.dst_type, (size_t)io_info->sel_pieces[i]->piece_points, + (size_t)0, (size_t)0, tmp_bufs[i], tmp_bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Do the data transform after the conversion (since we're using type mem_type) */ @@ -1232,8 +1230,8 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) /* * Perform datatype conversion. */ - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, - dset_info->type_info.dst_type_id, + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type, + dset_info->type_info.dst_type, (size_t)io_info->sel_pieces[i]->piece_points, (size_t)0, (size_t)0, tmp_write_buf, tmp_bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); @@ -1292,10 +1290,9 @@ H5D__scatgath_write_select(H5D_io_info_t *io_info) * Perform datatype conversion. */ assert(j < bkg_pieces); - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, - dset_info->type_info.dst_type_id, - (size_t)io_info->sel_pieces[i]->piece_points, (size_t)0, (size_t)0, - tmp_write_buf, bkg_bufs[j]) < 0) + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type, + dset_info->type_info.dst_type, (size_t)io_info->sel_pieces[i]->piece_points, + (size_t)0, (size_t)0, tmp_write_buf, bkg_bufs[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Advance to next background buffer */ diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index dd9f2353d7b..a08fa10d871 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -30,9 +30,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5MFprivate.h" /* File space management */ -#include "H5VMprivate.h" /* Vector functions */ /****************/ /* Local Macros */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 3ed78208bca..d6ab1a8836c 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -2678,11 +2678,11 @@ H5D__virtual_read_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdset { /* Initialize source_dinfo */ - source_dinfo.dset = source_dset->dset; - source_dinfo.mem_space = source_dset->projected_mem_space; - source_dinfo.file_space = projected_src_space; - source_dinfo.buf.vp = dset_info->buf.vp; - source_dinfo.mem_type_id = dset_info->type_info.dst_type_id; + source_dinfo.dset = source_dset->dset; + source_dinfo.mem_space = source_dset->projected_mem_space; + source_dinfo.file_space = projected_src_space; + source_dinfo.buf.vp = dset_info->buf.vp; + source_dinfo.mem_type = dset_info->type_info.dst_type; /* Read in the point (with the custom VL memory allocator) */ if (H5D__read(1, &source_dinfo) < 0) @@ -2875,11 +2875,11 @@ H5D__virtual_write_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdse { /* Initialize source_dinfo */ - source_dinfo.dset = source_dset->dset; - source_dinfo.mem_space = source_dset->projected_mem_space; - source_dinfo.file_space = projected_src_space; - source_dinfo.buf.cvp = dset_info->buf.cvp; - source_dinfo.mem_type_id = dset_info->type_info.dst_type_id; + source_dinfo.dset = source_dset->dset; + source_dinfo.mem_space = source_dset->projected_mem_space; + source_dinfo.file_space = projected_src_space; + source_dinfo.buf.cvp = dset_info->buf.cvp; + source_dinfo.mem_type = dset_info->type_info.dst_type; /* Read in the point (with the custom VL memory allocator) */ if (H5D__write(1, &source_dinfo) < 0) diff --git a/src/H5E.c b/src/H5E.c index 30fb376e575..36f07048e94 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -534,7 +534,7 @@ H5Eget_class_name(hid_t class_id, char *name /*out*/, size_t size) ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "ixz", class_id, name, size); + H5TRACE3("Zs", "i*sz", class_id, name, size); /* Get the error class */ if (NULL == (cls = (H5E_cls_t *)H5I_object_verify(class_id, H5I_ERROR_CLASS))) @@ -774,7 +774,7 @@ H5Eget_msg(hid_t msg_id, H5E_type_t *type /*out*/, char *msg_str /*out*/, size_t ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API_NOCLEAR((-1)) - H5TRACE4("Zs", "ixxz", msg_id, type, msg_str, size); + H5TRACE4("Zs", "i*Et*sz", msg_id, type, msg_str, size); /* Get the message object */ if (NULL == (msg = (H5E_msg_t *)H5I_object_verify(msg_id, H5I_ERROR_MSG))) @@ -876,8 +876,7 @@ H5E__get_current_stack(void) FUNC_ENTER_PACKAGE /* Get a pointer to the current error stack */ - if (NULL == (current_stack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' - in non-threaded case */ + if (NULL == (current_stack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get current error stack"); /* Allocate a new error stack */ @@ -992,8 +991,7 @@ H5E__set_current_stack(H5E_t *estack) assert(estack); /* Get a pointer to the current error stack */ - if (NULL == (current_stack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' - in non-threaded case */ + if (NULL == (current_stack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Empty current error stack */ @@ -1114,8 +1112,7 @@ H5Eget_num(hid_t error_stack_id) /* Need to check for errors */ if (error_stack_id == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, (-1), "can't get current error stack"); } /* end if */ else { @@ -1176,8 +1173,7 @@ H5Epop(hid_t err_stack, size_t count) /* Need to check for errors */ if (err_stack == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); } /* end if */ else { @@ -1360,8 +1356,7 @@ H5E__print2(hid_t err_stack, FILE *stream) /* Need to check for errors */ if (err_stack == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); } /* end if */ else { @@ -1403,8 +1398,7 @@ H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t stack_func, voi /* Need to check for errors */ if (err_stack == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); } /* end if */ else { @@ -1446,11 +1440,10 @@ H5Eget_auto2(hid_t estack_id, H5E_auto2_t *func /*out*/, void **client_data /*ou /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(FAIL) - H5TRACE3("e", "ixx", estack_id, func, client_data); + H5TRACE3("e", "i*EA**x", estack_id, func, client_data); if (estack_id == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); } /* end if */ else { @@ -1509,8 +1502,7 @@ H5Eset_auto2(hid_t estack_id, H5E_auto2_t func, void *client_data) H5TRACE3("e", "iEA*x", estack_id, func, client_data); if (estack_id == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); } /* end if */ else { @@ -1568,8 +1560,7 @@ H5Eauto_is_v2(hid_t estack_id, unsigned *is_stack) H5TRACE2("e", "i*Iu", estack_id, is_stack); if (estack_id == H5E_DEFAULT) { - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); } /* end if */ else { diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 36494d3dec5..74a3abe2189 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -35,10 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ diff --git a/src/H5EAdblkpage.c b/src/H5EAdblkpage.c index c13b5196828..1fd04b2ee8c 100644 --- a/src/H5EAdblkpage.c +++ b/src/H5EAdblkpage.c @@ -36,7 +36,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5EApkg.h" /* Extensible Arrays */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ 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/H5EApkg.h b/src/H5EApkg.h index e8b5a13e8d4..3dd2a2da516 100644 --- a/src/H5EApkg.h +++ b/src/H5EApkg.h @@ -27,6 +27,7 @@ /* Other private headers needed by this file */ #include "H5FLprivate.h" /* Free Lists */ +#include "H5VMprivate.h" /* Vectors and arrays */ /**************************/ /* Package Private Macros */ diff --git a/src/H5ES.c b/src/H5ES.c index 038b7199ccd..1c8b0876e11 100644 --- a/src/H5ES.c +++ b/src/H5ES.c @@ -35,7 +35,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5ESpkg.h" /* Event Sets */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -161,7 +160,7 @@ H5ESget_count(hid_t es_id, size_t *count /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", es_id, count); + H5TRACE2("e", "i*z", es_id, count); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { @@ -202,7 +201,7 @@ H5ESget_op_counter(hid_t es_id, uint64_t *op_counter /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", es_id, op_counter); + H5TRACE2("e", "i*UL", es_id, op_counter); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { @@ -252,7 +251,7 @@ H5ESget_requests(hid_t es_id, H5_iter_order_t order, hid_t *connector_ids, void herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIo*i**xzx", es_id, order, connector_ids, requests, array_len, count); + H5TRACE6("e", "iIo*i**xz*z", es_id, order, connector_ids, requests, array_len, count); /* Check arguments */ if (NULL == (es = H5I_object_verify(es_id, H5I_EVENTSET))) @@ -304,7 +303,7 @@ H5ESwait(hid_t es_id, uint64_t timeout, size_t *num_in_progress /*out*/, hbool_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iULxx", es_id, timeout, num_in_progress, op_failed); + H5TRACE4("e", "iUL*z*b", es_id, timeout, num_in_progress, op_failed); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { @@ -344,7 +343,7 @@ H5EScancel(hid_t es_id, size_t *num_not_canceled /*out*/, hbool_t *op_failed /*o herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", es_id, num_not_canceled, op_failed); + H5TRACE3("e", "i*z*b", es_id, num_not_canceled, op_failed); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { @@ -384,7 +383,7 @@ H5ESget_err_status(hid_t es_id, hbool_t *err_status /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", es_id, err_status); + H5TRACE2("e", "i*b", es_id, err_status); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { @@ -423,7 +422,7 @@ H5ESget_err_count(hid_t es_id, size_t *num_errs /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", es_id, num_errs); + H5TRACE2("e", "i*z", es_id, num_errs); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { @@ -467,7 +466,7 @@ H5ESget_err_info(hid_t es_id, size_t num_err_info, H5ES_err_info_t err_info[] /* herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "izxx", es_id, num_err_info, err_info, num_cleared); + H5TRACE4("e", "iz*#*z", es_id, num_err_info, err_info, num_cleared); /* Passing H5ES_NONE is valid, but a no-op */ if (H5ES_NONE != es_id) { diff --git a/src/H5ESlist.c b/src/H5ESlist.c index 1022e639f1b..90eef90fab6 100644 --- a/src/H5ESlist.c +++ b/src/H5ESlist.c @@ -32,10 +32,9 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5ESpkg.h" /* Event Sets */ -#include "H5FLprivate.h" /* Free Lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5ESpkg.h" /* Event Sets */ /****************/ /* Local Macros */ diff --git a/src/H5Edeprec.c b/src/H5Edeprec.c index d4a2ee98a42..471630c724d 100644 --- a/src/H5Edeprec.c +++ b/src/H5Edeprec.c @@ -248,8 +248,7 @@ H5Eprint1(FILE *stream) FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Print error stack */ @@ -282,8 +281,7 @@ H5Ewalk1(H5E_direction_t direction, H5E_walk1_t func, void *client_data) FUNC_ENTER_API_NOCLEAR(FAIL) /*NO TRACE*/ - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Walk the error stack */ @@ -317,11 +315,10 @@ H5Eget_auto1(H5E_auto1_t *func /*out*/, void **client_data /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "xx", func, client_data); + H5TRACE2("e", "*Ea**x", func, client_data); /* Retrieve default error stack */ - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Get the automatic error reporting information */ @@ -370,8 +367,7 @@ H5Eset_auto1(H5E_auto1_t func, void *client_data) FUNC_ENTER_API_NOCLEAR(FAIL) H5TRACE2("e", "Ea*x", func, client_data); - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Get the automatic error reporting information */ diff --git a/src/H5Eint.c b/src/H5Eint.c index 17d8fdd92cd..a4ba5b2d4b9 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -709,8 +709,7 @@ H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line /* Check for 'default' error stack */ if (estack == NULL) - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_DONE(FAIL); /* @@ -827,8 +826,7 @@ H5E_clear_stack(H5E_t *estack) /* Check for 'default' error stack */ if (estack == NULL) - if (NULL == (estack = H5E__get_my_stack())) /*lint !e506 !e774 Make lint 'constant value Boolean' in - non-threaded case */ + if (NULL == (estack = H5E__get_my_stack())) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack"); /* Empty the error stack */ diff --git a/src/H5Epublic.h b/src/H5Epublic.h index a22c9c6efd9..0d5993e84d4 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -250,12 +250,12 @@ H5_DLL herr_t H5Eclose_msg(hid_t err_id); * -------------------------------------------------------------------------- * \ingroup H5E * - * \brief Adds a major error message to an error class + * \brief Adds a major or minor error message to an error class * * \param[in] cls An error class identifier * \param[in] msg_type The type of the error message - * \param[in] msg Major error message - * \return \herr_t + * \param[in] msg Error message + * \return An error ID (success), H5I_INVALID_HID (failure) * * \details H5Ecreate_msg() adds an error message to an error class defined by * client library or application program. The error message can be @@ -625,7 +625,7 @@ H5_DLL herr_t H5Eauto_is_v2(hid_t err_stack, unsigned *is_stack); * \brief Retrieves an error message * * \param[in] msg_id Error message identifier - * \param[out] type The type of the error message Valid values are #H5E_MAJOR + * \param[out] type The type of the error message. Valid values are #H5E_MAJOR * and #H5E_MINOR. * \param[out] msg Error message buffer * \param[in] size The length of error message to be returned by this function @@ -651,7 +651,8 @@ H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size * \brief Retrieves the number of error messages in an error stack * * \estack_id{error_stack_id} - * \return Returns a non-negative value on success; otherwise returns a negative value. + * \return Returns number of error messages in an error stack on + * success; otherwise returns a negative value. * * \details H5Eget_num() retrieves the number of error records in the error * stack specified by \p error_stack_id (including major, minor @@ -916,7 +917,7 @@ H5_DLL herr_t H5Ewalk1(H5E_direction_t direction, H5E_walk1_t func, void *client * error number * * \param[in] maj Major error number - * \return \herr_t + * \return Pointer to the message (success), or NULL (failure) * * \deprecated 1.8.0 Function deprecated in this release. * @@ -939,7 +940,7 @@ H5_DLL char *H5Eget_major(H5E_major_t maj); * error number * * \param[in] min Minor error number - * \return \herr_t + * \return Pointer to the message (success), or NULL (failure) * * \deprecated 1.8.0 Function deprecated and return type changed in this release. * diff --git a/src/H5F.c b/src/H5F.c index d814503ddf7..ee4fd71af64 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -344,7 +344,7 @@ H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list / ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE4("Zs", "iIuzx", file_id, types, max_objs, oid_list); + H5TRACE4("Zs", "iIuz*i", file_id, types, max_objs, oid_list); /* Check arguments */ if (0 == (types & H5F_OBJ_ALL)) @@ -437,7 +437,7 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl_id, void **file_handle /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iix", file_id, fapl_id, file_handle); + H5TRACE3("e", "ii**x", file_id, fapl_id, file_handle); /* Check args */ if (!file_handle) @@ -1567,7 +1567,7 @@ H5Fget_intent(hid_t file_id, unsigned *intent_flags /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, intent_flags); + H5TRACE2("e", "i*Iu", file_id, intent_flags); /* If no intent flags were passed in, exit quietly */ if (intent_flags) { @@ -1607,7 +1607,7 @@ H5Fget_fileno(hid_t file_id, unsigned long *fnumber /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, fnumber); + H5TRACE2("e", "i*Ul", file_id, fnumber); /* If no fnumber pointer was passed in, exit quietly */ if (fnumber) { @@ -1692,7 +1692,7 @@ H5Fget_filesize(hid_t file_id, hsize_t *size /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, size); + H5TRACE2("e", "i*h", file_id, size); /* Check args */ if (!size) @@ -1760,7 +1760,7 @@ H5Fget_file_image(hid_t file_id, void *buf /*out*/, size_t buf_len) ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "ixz", file_id, buf, buf_len); + H5TRACE3("Zs", "i*xz", file_id, buf, buf_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -1807,7 +1807,7 @@ H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, config); + H5TRACE2("e", "i*Cc", file_id, config); /* Check args */ if ((NULL == config) || (config->version != H5AC__CURR_CACHE_CONFIG_VERSION)) @@ -1890,7 +1890,7 @@ H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, hit_rate); + H5TRACE2("e", "i*d", file_id, hit_rate); /* Check args */ if (NULL == hit_rate) @@ -1935,7 +1935,7 @@ H5Fget_mdc_size(hid_t file_id, size_t *max_size /*out*/, size_t *min_clean_size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ixxxx", file_id, max_size, min_clean_size, cur_size, cur_num_entries); + H5TRACE5("e", "i*z*z*z*Is", file_id, max_size, min_clean_size, cur_size, cur_num_entries); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -2032,7 +2032,7 @@ H5Fget_name(hid_t obj_id, char *name /*out*/, size_t size) ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "ixz", obj_id, name, size); + H5TRACE3("Zs", "i*sz", obj_id, name, size); /* Check the type */ type = H5I_get_type(obj_id); @@ -2085,7 +2085,7 @@ H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", obj_id, finfo); + H5TRACE2("e", "i*FI", obj_id, finfo); /* Check args */ if (!finfo) @@ -2134,7 +2134,7 @@ H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, info); + H5TRACE2("e", "i*!", file_id, info); /* Check args */ if (!info) @@ -2179,7 +2179,7 @@ H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE4("Zs", "iFmzx", file_id, type, nsects, sect_info); + H5TRACE4("Zs", "iFmz*!", file_id, type, nsects, sect_info); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -2400,7 +2400,7 @@ H5Fget_mdc_logging_status(hid_t file_id, hbool_t *is_enabled /*out*/, hbool_t *i herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", file_id, is_enabled, is_currently_logging); + H5TRACE3("e", "i*b*b", file_id, is_enabled, is_currently_logging); /* Sanity check */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -2561,7 +2561,7 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2] /*out*/, unsigne herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "ixxxxx", file_id, accesses, hits, misses, evictions, bypasses); + H5TRACE6("e", "i*Iu*Iu*Iu*Iu*Iu", file_id, accesses, hits, misses, evictions, bypasses); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -2608,7 +2608,7 @@ H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr /*out*/, hsize_t *image herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", file_id, image_addr, image_len); + H5TRACE3("e", "i*a*h", file_id, image_addr, image_len); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -2646,7 +2646,7 @@ H5Fget_eoa(hid_t file_id, haddr_t *eoa /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, eoa); + H5TRACE2("e", "i*a", file_id, eoa); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -2727,7 +2727,7 @@ H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, minimize); + H5TRACE2("e", "i*b", file_id, minimize); /* Check args */ if (NULL == minimize) diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 5aa06f6039a..2920dd1aaeb 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -35,10 +35,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ diff --git a/src/H5FAdbg.c b/src/H5FAdbg.c index e28f67887b8..1e624b3e13c 100644 --- a/src/H5FAdbg.c +++ b/src/H5FAdbg.c @@ -35,7 +35,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FApkg.h" /* Fixed Arrays */ -#include "H5Oprivate.h" /* Object Header */ #include "H5VMprivate.h" /* Vector functions */ /****************/ 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/H5FD.c b/src/H5FD.c index ae4b43946d8..f8ad0275d34 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -30,7 +30,6 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDpkg.h" /* File Drivers */ @@ -974,7 +973,7 @@ H5FDquery(const H5FD_t *file, unsigned long *flags /*out*/) int ret_value = 0; FUNC_ENTER_API((-1)) - H5TRACE2("Is", "*#x", file, flags); + H5TRACE2("Is", "*#*Ul", file, flags); /* Check arguments */ if (!file) @@ -1406,7 +1405,7 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*#Mtiazx", file, type, dxpl_id, addr, size, buf); + H5TRACE6("e", "*#Mtiaz*x", file, type, dxpl_id, addr, size, buf); /* Check arguments */ if (!file) @@ -1508,7 +1507,7 @@ H5FDread_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[], herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "*#iIu*Mt*a*zx", file, dxpl_id, count, types, addrs, sizes, bufs); + H5TRACE7("e", "*#iIu*Mt*a*z**x", file, dxpl_id, count, types, addrs, sizes, bufs); /* Check arguments */ if (!file) @@ -1677,7 +1676,7 @@ H5FDread_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*#MtiIu*i*i*a*zx", file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, + H5TRACE9("e", "*#MtiIu*i*i*a*z**x", file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs); /* Check arguments */ @@ -1878,7 +1877,7 @@ H5FDread_vector_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*#MtiIu*i*i*a*zx", file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, + H5TRACE9("e", "*#MtiIu*i*i*a*z**x", file, type, dxpl_id, count, mem_space_ids, file_space_ids, offsets, element_sizes, bufs); /* Check arguments */ @@ -2617,7 +2616,7 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*#ix", file, fapl_id, file_handle); + H5TRACE3("e", "*#i**x", file, fapl_id, file_handle); /* Check arguments */ if (!file) @@ -2761,7 +2760,7 @@ H5FDdriver_query(hid_t driver_id, unsigned long *flags /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", driver_id, flags); + H5TRACE2("e", "i*Ul", driver_id, flags); /* Check arguments */ if (NULL == flags) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 1aa8d4bf19c..f169b6581f2 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -393,7 +393,7 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, " @@ -565,7 +565,7 @@ H5Pget_core_write_tracking(hid_t plist_id, hbool_t *is_enabled /*out*/, size_t * herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, is_enabled, page_size); + H5TRACE3("e", "i*b*z", plist_id, is_enabled, page_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -642,7 +642,7 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment /*out*/, hbool_t *backing_stor herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", fapl_id, increment, backing_store); + H5TRACE3("e", "i*z*b", fapl_id, increment, backing_store); if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); @@ -767,7 +767,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr 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"); 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 @@ -777,7 +777,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr if ((fd = HDopen(name, o_flags, H5_POSIX_CREATE_MODE_RW)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file"); 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 */ @@ -871,8 +871,8 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr * partial results, and the end of the file. */ - uint8_t *mem = file->mem; /* memory pointer for writes */ - HDoff_t offset = (HDoff_t)0; /* offset for reading */ + uint8_t *mem = file->mem; /* memory pointer for writes */ + HDoff_t offset = 0; /* offset for reading */ while (size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ @@ -900,7 +900,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR( H5E_IO, H5E_READERROR, NULL, @@ -1567,7 +1567,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 +1620,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 +1656,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 +1690,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 d370cd0b552..5dbd43a9601 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -298,7 +298,7 @@ H5Pget_fapl_direct(hid_t fapl_id, size_t *boundary /*out*/, size_t *block_size / herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ixxx", fapl_id, boundary, block_size, cbuf_size); + H5TRACE4("e", "i*z*z*z", fapl_id, boundary, block_size, cbuf_size); if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); @@ -476,10 +476,10 @@ 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"); 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))) @@ -541,8 +541,8 @@ 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, (HDoff_t)0)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file") + if (-1 == HDftruncate(file->fd, 0)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to truncate file"); } } else { @@ -554,8 +554,8 @@ 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, (HDoff_t)0, SEEK_SET) < 0) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, NULL, "unable to seek to proper position") + if (HDlseek(file->fd, 0, SEEK_SET) < 0) + 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 +603,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 +862,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 +870,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 +902,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 +930,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 +1042,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 +1079,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 +1120,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 +1132,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 +1156,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 +1168,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 +1244,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 +1259,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 +1301,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 +1335,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 +1361,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/H5FDfamily.c b/src/H5FDfamily.c index 323909fe20e..9899b2e1906 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -31,7 +31,6 @@ #include "H5FDdrvr_module.h" /* This source code file is part of the H5FD driver module */ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ @@ -383,7 +382,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize /*out*/, hid_t *memb_fapl_id /* herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", fapl_id, msize, memb_fapl_id); + H5TRACE3("e", "i*h*i", fapl_id, msize, memb_fapl_id); if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); diff --git a/src/H5FDhdfs.c b/src/H5FDhdfs.c index 3bd2502e232..140e5df8f7e 100644 --- a/src/H5FDhdfs.c +++ b/src/H5FDhdfs.c @@ -600,7 +600,7 @@ H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_dst /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, fa_dst); + H5TRACE2("e", "i*#", fapl_id, fa_dst); #if HDFS_DEBUG fprintf(stdout, "called %s.\n", __func__); diff --git a/src/H5FDhdfs.h b/src/H5FDhdfs.h index e5f7173fce2..3150a45801b 100644 --- a/src/H5FDhdfs.h +++ b/src/H5FDhdfs.h @@ -41,71 +41,49 @@ extern "C" { #endif -/**************************************************************************** - * - * Structure: H5FD_hdfs_fapl_t - * - * Purpose: - * - * H5FD_hdfs_fapl_t is a public structure that is used to pass - * configuration information to the appropriate HDFS VFD via the FAPL. - * A pointer to an instance of this structure is a parameter to - * H5Pset_fapl_hdfs() and H5Pget_fapl_hdfs(). - * - * - * - * `version` (int32_t) - * - * Version number of the `H5FD_hdfs_fapl_t` structure. Any instance passed - * to the above calls must have a recognized version number, or an error - * will be flagged. - * - * This field should be set to `H5FD__CURR_HDFS_FAPL_T_VERSION`. - * - * `namenode_name` (const char[]) - * - * Name of "Name Node" to access as the HDFS server. - * - * Must not be longer than `H5FD__HDFS_NODE_NAME_SPACE`. - * - * TBD: Can be NULL. - * - * `namenode_port` (int32_t) TBD - * - * Port number to use to connect with Name Node. - * - * TBD: If 0, uses a default port. - * - * `kerberos_ticket_cache` (const char[]) - * - * Path to the location of the Kerberos authentication cache. - * - * Must not be longer than `H5FD__HDFS_KERB_CACHE_PATH_SPACE`. - * - * TBD: Can be NULL. - * - * `user_name` (const char[]) +/** + * The version number of the H5FD_hdfs_fapl_t configuration + * structure for the #H5FD_HDFS driver + */ +#define H5FD__CURR_HDFS_FAPL_T_VERSION 1 + +/** Max size of the node name */ +#define H5FD__HDFS_NODE_NAME_SPACE 128 +/** Max size of the user name */ +#define H5FD__HDFS_USER_NAME_SPACE 128 +/** Max size of the kerberos cache path */ +#define H5FD__HDFS_KERB_CACHE_PATH_SPACE 128 + +/** + *\struct H5FD_hdfs_fapl_t + * \brief Configuration structure for H5Pset_fapl_hdfs() / H5Pget_fapl_hdfs() * - * Username to use when accessing file. + * \details H5FD_hdfs_fapl_t is a public structure that is used to pass + * configuration data to the #H5FD_HDFS driver via a File Access + * Property List. A pointer to an instance of this structure is + * a parameter to H5Pset_fapl_hdfs() and H5Pget_fapl_hdfs(). * - * Must not be longer than `H5FD__HDFS_USER_NAME_SPACE`. + * \var int32_t H5FD_hdfs_fapl_t::version + * Version number of the H5FD_hdfs_fapl_t structure. Any instance passed + * to H5Pset_fapl_hdfs() / H5Pget_fapl_hdfs() must have a recognized version + * number or an error will be raised. Currently, this field should be set + * to #H5FD__CURR_HDFS_FAPL_T_VERSION. * - * TBD: Can be NULL. + * \var char H5FD_hdfs_fapl_t::namenode_name[H5FD__HDFS_NODE_NAME_SPACE + 1] + * Name of "Name Node" to access as the HDFS server * - * `stream_buffer_size` (int32_t) + * \var int32_t H5FD_hdfs_fapl_t::namenode_port + * Port number to use to connect with Name Node * - * Size (in bytes) of the file read stream buffer. + * \var char H5FD_hdfs_fapl_t::user_name[H5FD__HDFS_USER_NAME_SPACE + 1] + * Username to use when accessing file * - * TBD: If -1, relies on a default value. + * \var char H5FD_hdfs_fapl_t::kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1] + * Path to the location of the Kerberos authentication cache * - ****************************************************************************/ - -#define H5FD__CURR_HDFS_FAPL_T_VERSION 1 - -#define H5FD__HDFS_NODE_NAME_SPACE 128 -#define H5FD__HDFS_USER_NAME_SPACE 128 -#define H5FD__HDFS_KERB_CACHE_PATH_SPACE 128 - + * \var int32_t H5FD_hdfs_fapl_t::stream_buffer_size + * Size (in bytes) of the file read stream buffer + */ typedef struct H5FD_hdfs_fapl_t { int32_t version; char namenode_name[H5FD__HDFS_NODE_NAME_SPACE + 1]; @@ -124,16 +102,35 @@ H5_DLL hid_t H5FD_hdfs_init(void); /** * \ingroup FAPL * - * \todo Add missing documentation + * \brief Modifies the file access property list to use the #H5FD_HDFS driver + * + * \fapl_id + * \param[in] fa Pointer to #H5FD_HDFS driver configuration structure + * + * \returns \herr_t + * + * \details H5Pset_fapl_hdfs() modifies the file access property list to use the + * #H5FD_HDFS driver. + * + * \since 1.10.6 */ -H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out); +H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa); /** * \ingroup FAPL * - * \todo Add missing documentation + * \brief Queries a File Access Property List for #H5FD_HDFS file driver properties + * + * \fapl_id + * \param[out] fa_out Pointer to #H5FD_HDFS driver configuration structure + * \returns \herr_t + * + * \details H5Pget_fapl_hdfs() queries the #H5FD_HDFS driver properties as set + * by H5Pset_fapl_hdfs(). + * + * \since 1.10.6 */ -H5_DLL herr_t H5Pset_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa); +H5_DLL herr_t H5Pget_fapl_hdfs(hid_t fapl_id, H5FD_hdfs_fapl_t *fa_out); #ifdef __cplusplus } diff --git a/src/H5FDint.c b/src/H5FDint.c index 5d3a80212ef..a0b2c7d1ecb 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -376,7 +376,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs size_t size = 0; H5FD_mem_t type = H5FD_MEM_DEFAULT; hid_t dxpl_id = H5I_INVALID_HID; /* DXPL for operation */ - hbool_t is_raw = FALSE; /* Does this include raw data */ + bool is_raw = false; /* Does this include raw data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -461,7 +461,7 @@ H5FD_read_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addrs /* Check for raw data operation */ if (type == H5FD_MEM_DRAW) - is_raw = TRUE; + is_raw = true; } } @@ -618,7 +618,7 @@ H5FD_write_vector(H5FD_t *file, uint32_t count, H5FD_mem_t types[], haddr_t addr H5FD_mem_t type = H5FD_MEM_DEFAULT; hid_t dxpl_id; /* DXPL for operation */ haddr_t eoa = HADDR_UNDEF; /* EOA for file */ - hbool_t is_raw = FALSE; /* Does this include raw data */ + bool is_raw = false; /* Does this include raw data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index e35a6a65c4a..c9ec69941ff 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -514,7 +514,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Get the file stats */ 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 +661,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 +1163,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) @@ -1229,7 +1229,7 @@ H5FD__log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); if (file->fa.flags & H5FD_LOG_LOC_READ) fprintf(file->logfp, "Error! Reading: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n", @@ -1382,7 +1382,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) @@ -1448,7 +1448,7 @@ H5FD__log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, ha int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); if (file->fa.flags & H5FD_LOG_LOC_WRITE) fprintf(file->logfp, "Error! Writing: %10" PRIuHADDR "-%10" PRIuHADDR " (%10zu bytes)\n", @@ -1587,7 +1587,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 +1664,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 +1698,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 +1724,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.c b/src/H5FDmirror.c index 8ddffb09cc1..baf6ed5a7d5 100644 --- a/src/H5FDmirror.c +++ b/src/H5FDmirror.c @@ -1263,7 +1263,7 @@ H5Pget_fapl_mirror(hid_t fapl_id, H5FD_mirror_fapl_t *fa_dst /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, fa_dst); + H5TRACE2("e", "i*#", fapl_id, fa_dst); LOG_OP_CALL(__func__); 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/H5FDmpi.c b/src/H5FDmpi.c index f247c3478f8..bfa21253af8 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -15,12 +15,9 @@ */ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ #include "H5FDmpi.h" /* Common MPI file driver */ -#include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_PARALLEL diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 8aae79e2899..2668b27cead 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -38,7 +38,7 @@ static hid_t H5FD_MPIO_g = 0; /* Whether to allow collective I/O operations */ /* (Can be changed by setting "HDF5_MPI_OPT_TYPES" environment variable to '0' or '1') */ -hbool_t H5FD_mpi_opt_types_g = true; +bool H5FD_mpi_opt_types_g = true; /* Whether the driver initialized MPI on its own */ static bool H5FD_mpi_self_initialized = false; @@ -439,7 +439,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", fapl_id, comm, info); + H5TRACE3("e", "i*Mc*Mi", fapl_id, comm, info); /* Set comm and info in case we have problems */ if (comm) @@ -541,7 +541,7 @@ H5Pget_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t *xfer_mode /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", dxpl_id, xfer_mode); + H5TRACE2("e", "i*Dt", dxpl_id, xfer_mode); /* Check arguments */ if (NULL == (plist = H5P_object_verify(dxpl_id, H5P_DATASET_XFER))) diff --git a/src/H5FDonion.c b/src/H5FDonion.c index a16338b1dc4..65b7fa51dd8 100644 --- a/src/H5FDonion.c +++ b/src/H5FDonion.c @@ -1667,7 +1667,7 @@ H5FDonion_get_revision_count(const char *filename, hid_t fapl_id, uint64_t *revi herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*six", filename, fapl_id, revision_count); + H5TRACE3("e", "*si*UL", filename, fapl_id, revision_count); /* Check args */ if (!filename || !strcmp(filename, "")) diff --git a/src/H5FDperform.c b/src/H5FDperform.c index 62097f11aaa..f07abd44ec7 100644 --- a/src/H5FDperform.c +++ b/src/H5FDperform.c @@ -19,11 +19,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FDpkg.h" /* File Drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FDpkg.h" /* File Drivers */ +#include "H5Iprivate.h" /* IDs */ /*------------------------------------------------------------------------- * Function: H5FDperform_init diff --git a/src/H5FDros3.c b/src/H5FDros3.c index c6aea0e327a..321a0a0d9bb 100644 --- a/src/H5FDros3.c +++ b/src/H5FDros3.c @@ -35,9 +35,12 @@ #ifdef H5_HAVE_ROS3_VFD -/* toggle function call prints: 1 turns on +/* toggle debugging; pick a level */ -#define ROS3_DEBUG 0 +#define ROS3_DEBUG_NONE 0 +#define ROS3_DEBUG_TRACE_API 1 +#define ROS3_DEBUG_TRACE_INTERNAL 2 +#define ROS3_DEBUG ROS3_DEBUG_NONE /* toggle stats collection and reporting */ @@ -315,18 +318,18 @@ H5FD_ros3_init(void) if (H5I_INVALID_HID == H5FD_ROS3_g) { HGOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register ros3"); } - } #if ROS3_STATS - /* pre-compute statsbin boundaries - */ - for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) { - unsigned long long value = 0; + /* pre-compute statsbin boundaries */ + /* do it only during initial registration */ + for (bin_i = 0; bin_i < ROS3_STATS_BIN_COUNT; bin_i++) { + unsigned long long value = 0; - ROS3_STATS_POW(bin_i, &value) - ros3_stats_boundaries[bin_i] = value; - } + ROS3_STATS_POW(bin_i, &value) + ros3_stats_boundaries[bin_i] = value; + } #endif + } ret_value = H5FD_ROS3_g; @@ -456,7 +459,7 @@ H5Pget_fapl_ros3(hid_t fapl_id, H5FD_ros3_fapl_t *fa_dst /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, fa_dst); + H5TRACE2("e", "i*#", fapl_id, fa_dst); #if ROS3_DEBUG fprintf(stdout, "H5Pget_fapl_ros3() called.\n"); @@ -605,7 +608,7 @@ H5Pget_fapl_ros3_token(hid_t fapl_id, size_t size, char *token_dst /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE3("e", "izx", fapl_id, size, token_dst); + H5TRACE3("e", "iz*s", fapl_id, size, token_dst); #if ROS3_DEBUG fprintf(stdout, "H5Pget_fapl_ros3_token() called.\n"); @@ -858,7 +861,7 @@ ros3_reset_stats(H5FD_ros3_t *file) FUNC_ENTER_PACKAGE -#if ROS3_DEBUG +#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL printf("ros3_reset_stats() called\n"); #endif @@ -1169,8 +1172,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) * PRINT OVERVIEW * ******************/ - fprintf(stream, "TOTAL READS: %llu (%llu meta, %llu raw)\n", count_raw + count_meta, count_meta, - count_raw); + fprintf(stream, "TOTAL READS: %lu (%lu meta, %lu raw)\n", count_raw + count_meta, count_meta, count_raw); fprintf(stream, "TOTAL BYTES: %llu (%llu meta, %llu raw)\n", bytes_raw + bytes_meta, bytes_meta, bytes_raw); @@ -1294,7 +1296,7 @@ ros3_fprint_stats(FILE *stream, const H5FD_ros3_t *file) re_dub /= 1024.0; assert(suffix_i < sizeof(suffixes)); - fprintf(stream, " %8.3f%c %7d %7d %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub, + fprintf(stream, " %8.3f%c %7llu %7llu %8.3f%c %8.3f%c %8.3f%c %8.3f%c\n", re_dub, suffixes[suffix_i], /* bin ceiling */ m->count, /* metadata reads */ r->count, /* raw data reads */ @@ -1342,17 +1344,17 @@ H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file) assert(file != NULL); assert(file->s3r_handle != NULL); - /* Close the underlying request handle - */ - if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) - HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle"); - #if ROS3_STATS /* TODO: mechanism to re-target stats printout */ if (ros3_fprint_stats(stdout, file) == FAIL) HGOTO_ERROR(H5E_INTERNAL, H5E_ERROR, FAIL, "problem while writing file statistics"); #endif /* ROS3_STATS */ + /* Close the underlying request handle + */ + if (FAIL == H5FD_s3comms_s3r_close(file->s3r_handle)) + HGOTO_ERROR(H5E_VFL, H5E_CANTCLOSEFILE, FAIL, "unable to close S3 request handle"); + /* Release the file info */ H5MM_xfree(file->cache); file = H5FL_FREE(H5FD_ros3_t, file); @@ -1381,7 +1383,7 @@ H5FD__ros3_close(H5FD_t H5_ATTR_UNUSED *_file) * + fapl secret_id * + fapl secret_key * - * tl;dr -> check URL, check crentials + * tl;dr -> check URL, check credentials * * Return: * @@ -1510,7 +1512,7 @@ H5FD__ros3_query(const H5FD_t H5_ATTR_UNUSED *_file, unsigned long *flags) { FUNC_ENTER_PACKAGE_NOERR -#if ROS3_DEBUG +#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL fprintf(stdout, "H5FD__ros3_query() called.\n"); #endif @@ -1547,7 +1549,7 @@ H5FD__ros3_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) FUNC_ENTER_PACKAGE_NOERR -#if ROS3_DEBUG +#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL fprintf(stdout, "H5FD__ros3_get_eoa() called.\n"); #endif @@ -1575,7 +1577,7 @@ H5FD__ros3_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) FUNC_ENTER_PACKAGE_NOERR -#if ROS3_DEBUG +#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL fprintf(stdout, "H5FD__ros3_set_eoa() called.\n"); #endif @@ -1606,7 +1608,7 @@ H5FD__ros3_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) FUNC_ENTER_PACKAGE_NOERR -#if ROS3_DEBUG +#if ROS3_DEBUG >= ROS3_DEBUG_TRACE_INTERNAL fprintf(stdout, "H5FD__ros3_get_eof() called.\n"); #endif diff --git a/src/H5FDros3.h b/src/H5FDros3.h index 217af2d01b6..f7d59c83c89 100644 --- a/src/H5FDros3.h +++ b/src/H5FDros3.h @@ -100,7 +100,7 @@ * \def H5FD_ROS3_MAX_SECRET_TOK_LEN * Maximum string length for specifying the session/security token. */ -#define H5FD_ROS3_MAX_SECRET_TOK_LEN 1024 +#define H5FD_ROS3_MAX_SECRET_TOK_LEN 4096 /** *\struct H5FD_ros3_fapl_t diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c index dae1149ae60..2b7b5419c61 100644 --- a/src/H5FDs3comms.c +++ b/src/H5FDs3comms.c @@ -47,9 +47,14 @@ #ifdef H5_HAVE_ROS3_VFD -/* toggle debugging (enable with 1) +/* toggle debugging: pick a level */ -#define S3COMMS_DEBUG 0 +#define S3COMMS_DEBUG_NONE 0 +#define S3COMMS_DEBUG_REQUESTS 1 +#define S3COMMS_DEBUG_TRACE_API 2 +#define S3COMMS_DEBUG_TRACE_INTERNAL 3 +#define S3COMMS_DEBUG_HEADERS 4 +#define S3COMMS_DEBUG 0 /* manipulate verbosity of CURL output * operates separately from S3COMMS_DEBUG @@ -213,7 +218,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS fprintf(stdout, "called H5FD_s3comms_hrb_node_set."); printf("NAME: %s\n", name); printf("VALUE: %s\n", value); @@ -292,7 +297,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove node from empty list"); else { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("CREATE NEW\n"); fflush(stdout); #endif @@ -323,7 +328,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) is_looking = false; if (value == NULL) { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("REMOVE HEAD\n"); fflush(stdout); #endif @@ -333,39 +338,39 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) *L = node_ptr->next; -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("FREEING CAT (node)\n"); fflush(stdout); #endif H5MM_xfree(node_ptr->cat); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("FREEING LOWERNAME (node)\n"); fflush(stdout); #endif H5MM_xfree(node_ptr->lowername); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("FREEING NAME (node)\n"); fflush(stdout); #endif H5MM_xfree(node_ptr->name); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("FREEING VALUE (node)\n"); fflush(stdout); #endif H5MM_xfree(node_ptr->value); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("MAGIC OK? %s\n", (node_ptr->magic == S3COMMS_HRB_NODE_MAGIC) ? "YES" : "NO"); fflush(stdout); #endif assert(node_ptr->magic == S3COMMS_HRB_NODE_MAGIC); node_ptr->magic += 1ul; -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("FREEING POINTER\n"); fflush(stdout); #endif H5MM_xfree(node_ptr); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("FREEING WORKING LOWERNAME\n"); fflush(stdout); #endif @@ -373,7 +378,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) lowername = NULL; } else { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("MODIFY HEAD\n"); fflush(stdout); #endif @@ -403,7 +408,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove a node 'before' head"); else { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("PREPEND NEW HEAD\n"); fflush(stdout); #endif @@ -432,7 +437,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); else { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("APPEND A NODE\n"); fflush(stdout); #endif @@ -455,7 +460,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) if (value == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "trying to remove absent node"); else { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("INSERT A NODE\n"); fflush(stdout); #endif @@ -484,7 +489,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) hrb_node_t *tmp = node_ptr->next; node_ptr->next = tmp->next; -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("REMOVE A NODE\n"); fflush(stdout); #endif @@ -501,7 +506,7 @@ H5FD_s3comms_hrb_node_set(hrb_node_t **L, const char *name, const char *value) lowername = NULL; } else { -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS printf("MODIFY A NODE\n"); fflush(stdout); #endif @@ -597,7 +602,7 @@ H5FD_s3comms_hrb_destroy(hrb_t **_buf) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS fprintf(stdout, "called H5FD_s3comms_hrb_destroy.\n"); #endif @@ -658,7 +663,7 @@ H5FD_s3comms_hrb_init_request(const char *_verb, const char *_resource, const ch FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_hrb_init_request.\n"); #endif @@ -762,7 +767,7 @@ H5FD_s3comms_s3r_close(s3r_t *handle) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG > S3COMMS_DEBUG_TRACE_API fprintf(stdout, "called H5FD_s3comms_s3r_close.\n"); #endif @@ -863,7 +868,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_s3r_getsize.\n"); #endif @@ -911,7 +916,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "HTTP metadata buffer overrun"); else if (sds.size == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "No HTTP metadata"); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL else fprintf(stdout, "GETSIZE: OK\n"); #endif @@ -945,8 +950,8 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle) handle->filesize = (size_t)content_length; -#if S3COMMS_DEBUG - fprintf(stdout, "FILESIZE: %zu\n", handle->filesize); +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_REQUESTS + fprintf(stdout, " -- size: %ju\n", content_length); #endif /********************** @@ -1014,7 +1019,7 @@ H5FD_s3comms_s3r_open(const char *url, const char *region, const char *id, const FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_API fprintf(stdout, "called H5FD_s3comms_s3r_open.\n"); #endif @@ -1212,7 +1217,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_API fprintf(stdout, "called H5FD_s3comms_s3r_read.\n"); #endif @@ -1273,7 +1278,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to format HTTP Range value"); } -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_HEADERS fprintf(stdout, "%s: Bytes %" PRIuHADDR " - %" PRIuHADDR ", Request Size: %zu\n", handle->httpverb, offset, offset + len - 1, len); #endif @@ -1304,7 +1309,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) authorization = (char *)H5MM_malloc(512 + H5FD_ROS3_MAX_SECRET_TOK_LEN + 1); if (authorization == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot make space for authorization variable."); - /* 2048 := approximate max length... + /* 4608 := approximate max length... * 67 * + 8 @@ -1312,7 +1317,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) * + 128 * + 20 * + 128 - * + 1024 + * + 4096 */ char buffer2[256 + 1]; /* -> String To Sign -> Credential */ char iso8601now[ISO8601_SIZE]; @@ -1386,6 +1391,10 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) } if (rangebytesstr != NULL) { +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_REQUESTS + fprintf(stdout, " -- request: %lu %zu\n", (size_t)offset, len); + +#endif if (FAIL == H5FD_s3comms_hrb_node_set(&headers, "Range", rangebytesstr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to set range header"); if (headers == NULL) @@ -1495,7 +1504,7 @@ H5FD_s3comms_s3r_read(s3r_t *handle, haddr_t offset, size_t len, void *dest) HGOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "curl cannot perform request"); #endif -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL if (dest != NULL) { fprintf(stdout, "len: %d\n", (int)len); fprintf(stdout, "CHECKING FOR BUFFER OVERFLOW\n"); @@ -1645,7 +1654,7 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c size_t sh_size = (size_t)_sh_size; size_t cr_len = 0; /* working length of canonical request str */ size_t sh_len = 0; /* working length of signed headers str */ - char tmpstr[1024]; + char tmpstr[H5FD_ROS3_MAX_SECRET_TOK_LEN]; /* "query params" refers to the optional element in the URL, e.g. * http://bucket.aws.com/myfile.txt?max-keys=2&prefix=J @@ -1659,7 +1668,7 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_aws_canonical_request.\n"); #endif @@ -1691,8 +1700,8 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c assert(node->magic == S3COMMS_HRB_NODE_MAGIC); - ret = snprintf(tmpstr, 1024, "%s:%s\n", node->lowername, node->value); - if (ret < 0 || ret >= 1024) + ret = snprintf(tmpstr, sizeof(tmpstr), "%s:%s\n", node->lowername, node->value); + if (ret < 0 || ret >= (int)sizeof(tmpstr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to concatenate HTTP header %s:%s", node->lowername, node->value); cr_len += strlen(tmpstr); @@ -1700,8 +1709,8 @@ H5FD_s3comms_aws_canonical_request(char *canonical_request_dest, int _cr_size, c HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not enough space in canonical request"); strcat(canonical_request_dest, tmpstr); - ret = snprintf(tmpstr, 1024, "%s;", node->lowername); - if (ret < 0 || ret >= 1024) + ret = snprintf(tmpstr, sizeof(tmpstr), "%s;", node->lowername); + if (ret < 0 || ret >= (int)sizeof(tmpstr)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to append semicolon to lowername %s", node->lowername); sh_len += strlen(tmpstr); @@ -1765,7 +1774,7 @@ H5FD_s3comms_bytes_to_hex(char *dest, const unsigned char *msg, size_t msg_len, FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_bytes_to_hex.\n"); #endif @@ -1806,7 +1815,7 @@ H5FD_s3comms_free_purl(parsed_url_t *purl) { FUNC_ENTER_NOAPI_NOINIT_NOERR -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL printf("called H5FD_s3comms_free_purl.\n"); #endif @@ -1866,7 +1875,7 @@ H5FD_s3comms_HMAC_SHA256(const unsigned char *key, size_t key_len, const char *m FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_HMAC_SHA256.\n"); #endif @@ -1953,7 +1962,7 @@ H5FD__s3comms_load_aws_creds_from_file(FILE *file, const char *profile_name, cha FUNC_ENTER_PACKAGE -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called load_aws_creds_from_file.\n"); #endif @@ -2070,7 +2079,7 @@ H5FD_s3comms_load_aws_profile(const char *profile_name, char *key_id_out, char * FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_load_aws_profile.\n"); #endif @@ -2152,7 +2161,7 @@ H5FD_s3comms_nlowercase(char *dest, const char *s, size_t len) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_nlowercase.\n"); #endif @@ -2212,7 +2221,7 @@ H5FD_s3comms_parse_url(const char *str, parsed_url_t **_purl) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL printf("called H5FD_s3comms_parse_url.\n"); #endif @@ -2419,21 +2428,21 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr unsigned int i = 0; int chars_written = 0; herr_t ret_value = SUCCEED; -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL unsigned char s[2] = {c, 0}; unsigned char hex[3] = {0, 0, 0}; #endif FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_percent_encode_char.\n"); #endif if (repr == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no destination `repr`."); -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL H5FD_s3comms_bytes_to_hex((char *)hex, s, 1, false); fprintf(stdout, " CHAR: \'%s\'\n", s); fprintf(stdout, " CHAR-HEX: \"%s\"\n", hex); @@ -2443,7 +2452,7 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr /* character represented in a single "byte" * and single percent-code */ -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, " SINGLE-BYTE\n"); #endif *repr_len = 3; @@ -2458,7 +2467,7 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr unsigned int k = 0; /* uint character representation */ unsigned int stack_size = 0; unsigned char stack[4] = {0, 0, 0, 0}; -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, " MULTI-BYTE\n"); #endif stack_size = 0; @@ -2478,7 +2487,7 @@ H5FD_s3comms_percent_encode_char(char *repr, const unsigned char c, size_t *repr * UTF-8 byte fields. */ -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, " STACK:\n {\n"); for (i = 0; i < stack_size; i++) { H5FD_s3comms_bytes_to_hex((char *)hex, (&stack[i]), 1, false); @@ -2571,7 +2580,7 @@ H5FD_s3comms_signing_key(unsigned char *md, const char *secret, const char *regi FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_signing_key.\n"); #endif @@ -2660,7 +2669,7 @@ H5FD_s3comms_tostringtosign(char *dest, const char *req, const char *now, const FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_tostringtosign.\n"); #endif @@ -2744,7 +2753,7 @@ H5FD_s3comms_trim(char *dest, char *s, size_t s_len, size_t *n_written) FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "called H5FD_s3comms_trim.\n"); #endif @@ -2831,7 +2840,7 @@ H5FD_s3comms_uriencode(char *dest, const char *s, size_t s_len, bool encode_slas FUNC_ENTER_NOAPI_NOINIT -#if S3COMMS_DEBUG +#if S3COMMS_DEBUG >= S3COMMS_DEBUG_TRACE_INTERNAL fprintf(stdout, "H5FD_s3comms_uriencode called.\n"); #endif diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 15accf76d33..9abc75ced56 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -28,7 +28,6 @@ #include "H5FDsec2.h" /* Sec2 file driver */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ /* The driver identification number, initialized at runtime */ @@ -327,7 +326,7 @@ H5FD__sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr } /* end if */ 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))) @@ -421,7 +420,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); @@ -665,7 +664,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, @@ -697,7 +696,7 @@ H5FD__sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " @@ -771,7 +770,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 @@ -803,7 +802,7 @@ H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN int myerrno = errno; time_t mytime = HDtime(NULL); - offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + offset = HDlseek(file->fd, 0, SEEK_CUR); HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, " @@ -888,7 +887,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 */ @@ -938,7 +937,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: @@ -972,7 +971,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: @@ -998,7 +997,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/H5FDsplitter.c b/src/H5FDsplitter.c index 56b2cdbf29f..a4a8eaacb69 100644 --- a/src/H5FDsplitter.c +++ b/src/H5FDsplitter.c @@ -335,7 +335,7 @@ H5Pget_fapl_splitter(hid_t fapl_id, H5FD_splitter_vfd_config_t *config /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, config); + H5TRACE2("e", "i*#", fapl_id, config); H5FD_SPLITTER_LOG_CALL(__func__); diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index b019add4009..fc581775867 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; @@ -1498,7 +1498,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/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..84e07215d53 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; @@ -777,7 +784,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 +858,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 +989,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 +1195,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 +1830,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/H5FDwindows.c b/src/H5FDwindows.c index e38a4d31b68..71078cdc95c 100644 --- a/src/H5FDwindows.c +++ b/src/H5FDwindows.c @@ -12,13 +12,9 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ #include "H5FDwindows.h" /* Windows file driver */ #include "H5FDsec2.h" /* Windows file driver */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ #ifdef H5_HAVE_WINDOWS diff --git a/src/H5FL.c b/src/H5FL.c index 5dd4ed38efe..3415996e430 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -984,10 +984,8 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block) #endif /* H5FL_TRACK */ /* Get the pointer to the native block info header in front of the native block to free */ - temp = (H5FL_blk_list_t *)(( - void *)((unsigned char *)block - - (sizeof(H5FL_blk_list_t) + - H5FL_TRACK_SIZE))); /*lint !e826 Pointer-to-pointer cast is appropriate here */ + temp = + (H5FL_blk_list_t *)((void *)((unsigned char *)block - (sizeof(H5FL_blk_list_t) + H5FL_TRACK_SIZE))); /* Save the block's size for later */ free_size = temp->size; @@ -1058,10 +1056,8 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size H5FL_TRACK_ H5FL_blk_list_t *temp; /* Temp. ptr to the new block node allocated */ /* Get the pointer to the chunk info header in front of the chunk to free */ - temp = (H5FL_blk_list_t *)(( - void *)((unsigned char *)block - - (sizeof(H5FL_blk_list_t) + - H5FL_TRACK_SIZE))); /*lint !e826 Pointer-to-pointer cast is appropriate here */ + temp = (H5FL_blk_list_t *)((void *)((unsigned char *)block - + (sizeof(H5FL_blk_list_t) + H5FL_TRACK_SIZE))); /* check if we are actually changing the size of the buffer */ if (new_size != temp->size) { @@ -1407,10 +1403,7 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj) #endif /* Get the pointer to the info header in front of the block to free */ - temp = (H5FL_arr_list_t *)(( - void *)((unsigned char *)obj - - (sizeof(H5FL_arr_list_t) + - H5FL_TRACK_SIZE))); /*lint !e826 Pointer-to-pointer cast is appropriate here */ + temp = (H5FL_arr_list_t *)((void *)((unsigned char *)obj - (sizeof(H5FL_arr_list_t) + H5FL_TRACK_SIZE))); /* Get the number of elements */ free_nelem = temp->nelem; @@ -1607,10 +1600,8 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void *obj, size_t new_elem H5FL_TRACK_PA assert((int)new_elem <= head->maxelem); /* Get the pointer to the info header in front of the block to free */ - temp = (H5FL_arr_list_t *)(( - void *)((unsigned char *)obj - - (sizeof(H5FL_arr_list_t) + - H5FL_TRACK_SIZE))); /*lint !e826 Pointer-to-pointer cast is appropriate here */ + temp = + (H5FL_arr_list_t *)((void *)((unsigned char *)obj - (sizeof(H5FL_arr_list_t) + H5FL_TRACK_SIZE))); /* Check if the size is really changing */ if (temp->nelem != new_elem) { 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 f5e9361c1eb..3fa31f00042 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -35,8 +35,8 @@ #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 */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ 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/H5Fdeprec.c b/src/H5Fdeprec.c index a3ae1d8958e..40e5ec3063d 100644 --- a/src/H5Fdeprec.c +++ b/src/H5Fdeprec.c @@ -36,7 +36,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Iprivate.h" /* IDs */ -#include "H5SMprivate.h" /* Shared object header messages */ #include "H5VLnative_private.h" /* Native VOL connector */ @@ -94,7 +93,7 @@ H5Fget_info1(hid_t obj_id, H5F_info1_t *finfo /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", obj_id, finfo); + H5TRACE2("e", "i*!", obj_id, finfo); /* Check args */ if (!finfo) 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 7b5aeb4c64f..360e78e7a62 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -27,9 +27,9 @@ #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 "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ @@ -1300,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; @@ -2825,11 +2826,11 @@ H5F__build_actual_name(const H5F_t *f, const H5P_genplist_t *fapl, const char *n /* Stat the filename we're resolving */ 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 */ 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/H5Fio.c b/src/H5Fio.c index b2c58353732..b0c24010e86 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -32,7 +32,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ #include "H5PBprivate.h" /* Page Buffer */ /****************/ diff --git a/src/H5Fmodule.h b/src/H5Fmodule.h index 17c27f4b79c..91489242164 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/H5Fmount.c b/src/H5Fmount.c index 47345f2d036..6f497468e3e 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -14,15 +14,11 @@ /* Packages needed by this file... */ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ -#include "H5VLprivate.h" /* Virtual Object Layer */ /* PRIVATE PROTOTYPES */ static void H5F__mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 7a535e90d7d..805029f3ca6 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -284,7 +284,7 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag) *------------------------------------------------------------------------- */ herr_t -H5F__get_mpi_atomicity(const H5F_t *file, hbool_t *flag) +H5F__get_mpi_atomicity(const H5F_t *file, bool *flag) { herr_t ret_value = SUCCEED; @@ -326,7 +326,7 @@ H5Fget_mpi_atomicity(hid_t file_id, bool *flag /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", file_id, flag); + H5TRACE2("e", "i*b", file_id, flag); /* Get the file object */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE))) diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 9dc35ea137b..815a26b77df 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -21,10 +21,10 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5ACprivate.h" /* Metadata cache */ -#include "H5CXprivate.h" /* API Contexts */ #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/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index e62cc474dfe..7161b8b2fd3 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -35,9 +35,7 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ /****************/ /* Local Macros */ diff --git a/src/H5G.c b/src/H5G.c index 384eeb2b034..7679da7d80a 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -591,7 +591,7 @@ H5Gget_info(hid_t loc_id, H5G_info_t *group_info /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", loc_id, group_info); + H5TRACE2("e", "i*GI", loc_id, group_info); /* Retrieve group information synchronously */ if (H5G__get_info_api_common(loc_id, group_info, NULL, NULL) < 0) @@ -620,7 +620,7 @@ H5Gget_info_async(const char *app_file, const char *app_func, unsigned app_line, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "*s*sIuixi", app_file, app_func, app_line, loc_id, group_info, es_id); + H5TRACE6("e", "*s*sIui*GIi", app_file, app_func, app_line, loc_id, group_info, es_id); /* Set up request token pointer for asynchronous operation */ if (H5ES_NONE != es_id) @@ -634,7 +634,7 @@ H5Gget_info_async(const char *app_file, const char *app_func, unsigned app_line, if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE6(__func__, "*s*sIuixi", app_file, app_func, app_line, loc_id, group_info, es_id)) < 0) + H5ARG_TRACE6(__func__, "*s*sIui*GIi", app_file, app_func, app_line, loc_id, group_info, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set"); @@ -699,7 +699,7 @@ H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *group_info /*out herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*sxi", loc_id, name, group_info, lapl_id); + H5TRACE4("e", "i*s*GIi", loc_id, name, group_info, lapl_id); /* Retrieve group information synchronously */ if (H5G__get_info_by_name_api_common(loc_id, name, group_info, lapl_id, NULL, NULL) < 0) @@ -728,7 +728,7 @@ H5Gget_info_by_name_async(const char *app_file, const char *app_func, unsigned a herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "*s*sIui*sxii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id); + H5TRACE8("e", "*s*sIui*s*GIii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id); /* Set up request token pointer for asynchronous operation */ if (H5ES_NONE != es_id) @@ -742,7 +742,7 @@ H5Gget_info_by_name_async(const char *app_file, const char *app_func, unsigned a if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE8(__func__, "*s*sIui*sxii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id)) < 0) + H5ARG_TRACE8(__func__, "*s*sIui*s*GIii", app_file, app_func, app_line, loc_id, name, group_info, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set"); @@ -809,7 +809,7 @@ H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5 herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, group_info, lapl_id); + H5TRACE7("e", "i*sIiIoh*GIi", loc_id, group_name, idx_type, order, n, group_info, lapl_id); /* Retrieve group information synchronously */ if (H5G__get_info_by_idx_api_common(loc_id, group_name, idx_type, order, n, group_info, lapl_id, NULL, @@ -840,8 +840,8 @@ H5Gget_info_by_idx_async(const char *app_file, const char *app_func, unsigned ap herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE11("e", "*s*sIui*sIiIohxii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, - group_info, lapl_id, es_id); + H5TRACE11("e", "*s*sIui*sIiIoh*GIii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, + n, group_info, lapl_id, es_id); /* Set up request token pointer for asynchronous operation */ if (H5ES_NONE != es_id) @@ -856,7 +856,7 @@ H5Gget_info_by_idx_async(const char *app_file, const char *app_func, unsigned ap if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE11(__func__, "*s*sIui*sIiIohxii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, group_info, lapl_id, es_id)) < 0) + H5ARG_TRACE11(__func__, "*s*sIui*sIiIoh*GIii", app_file, app_func, app_line, loc_id, group_name, idx_type, order, n, group_info, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "can't insert token into event set"); diff --git a/src/H5Gcache.c b/src/H5Gcache.c index f7ba49ad933..9e34e77c253 100644 --- a/src/H5Gcache.c +++ b/src/H5Gcache.c @@ -30,10 +30,9 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 8b9b5c8dc68..19493ace078 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -32,7 +32,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gpkg.h" /* Groups */ @@ -627,7 +626,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*szx", loc_id, name, size, buf); + H5TRACE4("e", "i*sz*s", loc_id, name, size, buf); /* Check arguments */ if (!name || !*name) @@ -748,7 +747,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf /*out*/ int ret_value; /* Return value */ FUNC_ENTER_API(-1) - H5TRACE4("Is", "i*szx", loc_id, name, bufsize, buf); + H5TRACE4("Is", "i*sz*s", loc_id, name, bufsize, buf); if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, -1, "no name specified"); @@ -884,7 +883,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", loc_id, num_objs); + H5TRACE2("e", "i*h", loc_id, num_objs); /* Check args */ id_type = H5I_get_type(loc_id); @@ -933,7 +932,7 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t * herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*sbx", loc_id, name, follow_link, statbuf); + H5TRACE4("e", "i*sb*Gs", loc_id, name, follow_link, statbuf); /* Check arguments */ if (!name || !*name) @@ -1148,7 +1147,7 @@ H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name /*out*/, size_t size ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Zs", "ihxz", loc_id, idx, name, size); + H5TRACE4("Zs", "ih*sz", loc_id, idx, name, size); /* Set up collective metadata if appropriate */ if (H5CX_set_loc(loc_id) < 0) diff --git a/src/H5Gent.c b/src/H5Gent.c index 0563ae15d4d..5b7c064ecfa 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -22,7 +22,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5HLprivate.h" /* Local Heaps */ #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/H5Glink.c b/src/H5Glink.c index fd4d5602798..b862947f195 100644 --- a/src/H5Glink.c +++ b/src/H5Glink.c @@ -35,7 +35,6 @@ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Ppublic.h" /* Property Lists */ #include "H5VLnative_private.h" /* Native VOL connector */ 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/H5Gname.c b/src/H5Gname.c index 1341a2cb8c2..38fea867511 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -32,7 +32,6 @@ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index e701922ab4e..2b73c2b5cd9 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -28,14 +28,13 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ -#include "H5Gpkg.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Lprivate.h" /* Links */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property Lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fprivate.h" /* File access */ +#include "H5Gpkg.h" /* Groups */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Lprivate.h" /* Links */ +#include "H5Pprivate.h" /* Property Lists */ /****************/ /* Local Macros */ @@ -218,7 +217,25 @@ H5G__obj_create_real(H5F_t *f, const H5O_ginfo_t *ginfo, const H5O_linfo_t *linf assert(link_size); /* Compute size of header to use for creation */ - hdr_size = linfo_size + ginfo_size + pline_size + (ginfo->est_num_entries * link_size); + + /* Basic header size */ + hdr_size = linfo_size + ginfo_size + pline_size; + + /* If this is likely to be a compact group, add space for the link + * messages, unless the size of the link messages is greater than + * the largest allowable object header message size, since the size + * of the link messages is the size of the NIL spacer message that + * would have to be written out to reserve enough space to hold the + * links if the group were left empty. + */ + bool compact = ginfo->est_num_entries <= ginfo->max_compact; + if (compact) { + + size_t size_of_links = ginfo->est_num_entries * link_size; + + if (size_of_links < H5O_MESG_MAX_SIZE) + hdr_size += size_of_links; + } } /* end if */ else hdr_size = (size_t)(4 + 2 * H5F_SIZEOF_ADDR(f)); 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 0686fa97ab7..0b524b7b4de 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -32,10 +32,9 @@ #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 "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index dbb46c1de6f..67f8e479e15 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -30,7 +30,6 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5Gpkg.h" /* Groups */ diff --git a/src/H5HF.c b/src/H5HF.c index 3484d45aa06..bbc5ce7e455 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -35,9 +35,8 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5FOprivate.h" /* File objects */ +#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/H5HFcache.c b/src/H5HFcache.c index ad8e4d24227..823e2dea28e 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -31,11 +31,10 @@ #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 */ -#include "H5VMprivate.h" /* Vectors and arrays */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 14fab84a04b..d9a6c19bf19 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -31,7 +31,6 @@ /***********/ #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 */ #include "H5VMprivate.h" /* Vectors and arrays */ 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/H5HFman.c b/src/H5HFman.c index b15960aff62..edbb48e059f 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -31,9 +31,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5HFpkg.h" /* Fractal heaps */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 8b279994ca8..2a61ad43a2a 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -25,9 +25,9 @@ /***********/ #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 */ -#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ 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 125d45141a4..f885ecf973a 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -31,8 +31,8 @@ #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/H5HGdbg.c b/src/H5HGdbg.c index 0f100e49a09..8f33052421b 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -27,7 +27,6 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5HGpkg.h" /* Global heaps */ -#include "H5Iprivate.h" /* ID Functions */ /****************/ /* Local Macros */ diff --git a/src/H5HL.c b/src/H5HL.c index bdf46d6ce37..680ef0a15db 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -648,15 +648,8 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of assert(last_fl->offset == H5HL_ALIGN(last_fl->offset)); assert(last_fl->size == H5HL_ALIGN(last_fl->size)); - if (last_fl->size < H5HL_SIZEOF_FREE(f)) { -#ifdef H5HL_DEBUG - if (H5DEBUG(HL) && last_fl->size) { - fprintf(H5DEBUG(HL), "H5HL: lost %lu bytes at line %d\n", (unsigned long)(last_fl->size), - __LINE__); - } -#endif + if (last_fl->size < H5HL_SIZEOF_FREE(f)) last_fl = H5HL__remove_free(heap, last_fl); - } } else { /* Create a new free list element large enough that we can @@ -675,21 +668,9 @@ H5HL_insert(H5F_t *f, H5HL_t *heap, size_t buf_size, const void *buf, size_t *of if (heap->freelist) heap->freelist->prev = fl; heap->freelist = fl; -#ifdef H5HL_DEBUG - } - else if (H5DEBUG(HL) && need_more > need_size) { - fprintf(H5DEBUG(HL), "H5HL_insert: lost %lu bytes at line %d\n", - (unsigned long)(need_more - need_size), __LINE__); -#endif } } -#ifdef H5HL_DEBUG - if (H5DEBUG(HL)) { - fprintf(H5DEBUG(HL), "H5HL: resize mem buf from %lu to %lu bytes\n", - (unsigned long)(old_dblk_size), (unsigned long)(old_dblk_size + need_more)); - } -#endif if (NULL == (heap->dblk_image = H5FL_BLK_REALLOC(lheap_chunk, heap->dblk_image, heap->dblk_size))) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "memory allocation failed"); @@ -822,14 +803,8 @@ H5HL_remove(H5F_t *f, H5HL_t *heap, size_t offset, size_t size) * hold the free list data. If not, the freed chunk is forever * lost. */ - if (size < H5HL_SIZEOF_FREE(f)) { -#ifdef H5HL_DEBUG - if (H5DEBUG(HL)) { - fprintf(H5DEBUG(HL), "H5HL: lost %lu bytes\n", (unsigned long)size); - } -#endif + if (size < H5HL_SIZEOF_FREE(f)) HGOTO_DONE(SUCCEED); - } /* Add an entry to the free list */ if (NULL == (fl = H5FL_MALLOC(H5HL_free_t))) diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 5d6959d4867..243d7653a86 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -14,7 +14,7 @@ * * Created: H5HLprivate.h * - * Purpose: Private declarations for the H5HL (local heap) package. + * Purpose: Private declarations for the H5HL (local heap) package * *------------------------------------------------------------------------- */ @@ -26,14 +26,6 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Fprivate.h" /* File access */ -/* - * Feature: Define H5HL_DEBUG on the compiler command line if you want to - * enable diagnostic messages from this layer. - */ -#ifdef NDEBUG -#undef H5HL_DEBUG -#endif - #define H5HL_ALIGN(X) ((((unsigned)X) + 7) & (unsigned)(~0x07)) /* align on 8-byte boundary */ #define H5HL_SIZEOF_FREE(F) \ diff --git a/src/H5I.c b/src/H5I.c index 97e679ce660..a5d3b39f130 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -908,7 +908,7 @@ H5Iget_name(hid_t id, char *name /*out*/, size_t size) ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "ixz", id, name, size); + H5TRACE3("Zs", "i*sz", id, name, size); /* Get the object pointer */ if (NULL == (vol_obj = H5VL_vol_object(id))) diff --git a/src/H5Iint.c b/src/H5Iint.c index 1c5321461cc..fe3b90c2454 100644 --- a/src/H5Iint.c +++ b/src/H5Iint.c @@ -373,15 +373,6 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) /* Discard the future object */ if ((info->discard_cb)(info->u.object) < 0) { if (udata->force) { -#ifdef H5I_DEBUG - if (H5DEBUG(I)) { - fprintf(H5DEBUG(I), - "H5I: discard type=%d obj=%p " - "failure ignored\n", - (int)udata->type_info->cls->type, info->u.c_object); - } -#endif /* H5I_DEBUG */ - /* Indicate node should be removed from list */ mark = true; } @@ -396,15 +387,6 @@ H5I__mark_node(void *_info, void H5_ATTR_UNUSED *key, void *_udata) if (udata->type_info->cls->free_func && (udata->type_info->cls->free_func)(info->u.object, H5_REQUEST_NULL) < 0) { if (udata->force) { -#ifdef H5I_DEBUG - if (H5DEBUG(I)) { - fprintf(H5DEBUG(I), - "H5I: free type=%d obj=%p " - "failure ignored\n", - (int)udata->type_info->cls->type, info->u.c_object); - } -#endif /* H5I_DEBUG */ - /* Indicate node should be removed from list */ mark = true; } diff --git a/src/H5L.c b/src/H5L.c index 78cf20d4784..49fe1ac4fd7 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -1042,7 +1042,7 @@ H5Lget_val(hid_t loc_id, const char *name, void *buf /*out*/, size_t size, hid_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*sxzi", loc_id, name, buf, size, lapl_id); + H5TRACE5("e", "i*s*xzi", loc_id, name, buf, size, lapl_id); /* Check arguments */ if (!name || !*name) @@ -1100,7 +1100,7 @@ H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, buf, size, lapl_id); + H5TRACE8("e", "i*sIiIoh*xzi", loc_id, group_name, idx_type, order, n, buf, size, lapl_id); /* Check arguments */ if (!group_name || !*group_name) @@ -1272,7 +1272,7 @@ H5Lget_info2(hid_t loc_id, const char *name, H5L_info2_t *linfo /*out*/, hid_t l herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id); + H5TRACE4("e", "i*s*!i", loc_id, name, linfo, lapl_id); /* Check arguments */ if (!name || !*name) @@ -1325,7 +1325,7 @@ H5Lget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id); + H5TRACE7("e", "i*sIiIoh*!i", loc_id, group_name, idx_type, order, n, linfo, lapl_id); /* Check arguments */ if (!group_name || !*group_name) @@ -1515,7 +1515,7 @@ H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5 ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE8("Zs", "i*sIiIohxzi", loc_id, group_name, idx_type, order, n, name, size, lapl_id); + H5TRACE8("Zs", "i*sIiIoh*szi", loc_id, group_name, idx_type, order, n, name, size, lapl_id); /* Check arguments */ if (!group_name || !*group_name) diff --git a/src/H5Ldeprec.c b/src/H5Ldeprec.c index 40734e1979c..f057538130c 100644 --- a/src/H5Ldeprec.c +++ b/src/H5Ldeprec.c @@ -311,7 +311,7 @@ H5Lget_info1(hid_t loc_id, const char *name, H5L_info1_t *linfo /*out*/, hid_t l herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*sxi", loc_id, name, linfo, lapl_id); + H5TRACE4("e", "i*s*!i", loc_id, name, linfo, lapl_id); /* Check arguments */ if (!name || !*name) @@ -396,7 +396,7 @@ H5Lget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, linfo, lapl_id); + H5TRACE7("e", "i*sIiIoh*!i", loc_id, group_name, idx_type, order, n, linfo, lapl_id); /* Check arguments */ if (!group_name || !*group_name) diff --git a/src/H5Lexternal.c b/src/H5Lexternal.c index 56c3117f081..89484ea1134 100644 --- a/src/H5Lexternal.c +++ b/src/H5Lexternal.c @@ -21,8 +21,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5Gpkg.h" /* Groups */ diff --git a/src/H5M.c b/src/H5M.c index f59e02fa3ee..49842494852 100644 --- a/src/H5M.c +++ b/src/H5M.c @@ -881,7 +881,7 @@ H5Mget_count(hid_t map_id, hsize_t *count /*out*/, hid_t dxpl_id) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5I_INVALID_HID) - H5TRACE3("e", "ixi", map_id, count, dxpl_id); + H5TRACE3("e", "i*hi", map_id, count, dxpl_id); /* Check args */ if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(map_id, H5I_MAP))) diff --git a/src/H5MF.c b/src/H5MF.c index c8df9e475b0..2de3e7ad197 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -34,7 +34,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* File access */ #include "H5FSpkg.h" /* File free space */ -#include "H5Iprivate.h" /* IDs */ #include "H5MFpkg.h" /* File memory management */ #include "H5VMprivate.h" /* Vectors and arrays */ 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/H5O.c b/src/H5O.c index 9087cbecd41..706a8ec4a36 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -32,7 +32,6 @@ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5ESprivate.h" /* Event Sets */ -#include "H5Fprivate.h" /* File access */ #include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5Opkg.h" /* Object headers */ @@ -1079,7 +1078,7 @@ H5Oget_info3(hid_t loc_id, H5O_info2_t *oinfo /*out*/, unsigned fields) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixIu", loc_id, oinfo, fields); + H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -1171,7 +1170,7 @@ H5Oget_info_by_name3(hid_t loc_id, const char *name, H5O_info2_t *oinfo /*out*/, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id); /* Retrieve object information synchronously */ if (H5O__get_info_by_name_api_common(loc_id, name, oinfo, fields, lapl_id, NULL, NULL) < 0) @@ -1201,7 +1200,7 @@ H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned a herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE9("e", "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, + H5TRACE9("e", "*s*sIui*s*!Iuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id); /* Set up request token pointer for asynchronous operation */ @@ -1216,7 +1215,7 @@ H5Oget_info_by_name_async(const char *app_file, const char *app_func, unsigned a if (NULL != token) /* clang-format off */ if (H5ES_insert(es_id, vol_obj->connector, token, - H5ARG_TRACE9(__func__, "*s*sIui*sxIuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id)) < 0) + H5ARG_TRACE9(__func__, "*s*sIui*s*!Iuii", app_file, app_func, app_line, loc_id, name, oinfo, fields, lapl_id, es_id)) < 0) /* clang-format on */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert token into event set"); @@ -1245,7 +1244,7 @@ H5Oget_info_by_idx3(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); + H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -1308,7 +1307,7 @@ H5Oget_native_info(hid_t loc_id, H5O_native_info_t *oinfo /*out*/, unsigned fiel herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixIu", loc_id, oinfo, fields); + H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -1359,7 +1358,7 @@ H5Oget_native_info_by_name(hid_t loc_id, const char *name, H5O_native_info_t *oi herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -1422,7 +1421,7 @@ H5Oget_native_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); + H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -1602,7 +1601,7 @@ H5Oget_comment(hid_t obj_id, char *comment /*out*/, size_t bufsize) ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "ixz", obj_id, comment, bufsize); + H5TRACE3("Zs", "i*sz", obj_id, comment, bufsize); /* Get the object */ if (NULL == (vol_obj = H5VL_vol_object(obj_id))) @@ -1655,7 +1654,7 @@ H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment /*out*/, si ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE5("Zs", "i*sxzi", loc_id, name, comment, bufsize, lapl_id); + H5TRACE5("Zs", "i*s*szi", loc_id, name, comment, bufsize, lapl_id); /* Check args */ if (!name || !*name) @@ -2150,14 +2149,14 @@ H5Oenable_mdc_flushes(hid_t object_id) /*------------------------------------------------------------------------- * Function: H5O__are_mdc_flushes_disabled * - * Purpose: Private version of cork status getter. + * Purpose: Private version of cork status getter * * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t -H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, hbool_t *are_disabled) +H5O__are_mdc_flushes_disabled(const H5O_loc_t *oloc, bool *are_disabled) { herr_t ret_value = SUCCEED; @@ -2196,7 +2195,7 @@ H5Oare_mdc_flushes_disabled(hid_t object_id, bool *are_disabled) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*!", object_id, are_disabled); + H5TRACE2("e", "i*b", object_id, are_disabled); /* Sanity check */ if (!are_disabled) 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/H5Ocache.c b/src/H5Ocache.c index 31763f91f04..53a7d0a7cfe 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -31,10 +31,8 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ 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/H5Ocont.c b/src/H5Ocont.c index 6894eca2118..621095a1986 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -27,7 +27,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5MFprivate.h" /* File memory management */ #include "H5Opkg.h" /* Object headers */ /* PRIVATE PROTOTYPES */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index e4b6dd5461d..f2f307e82db 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -30,18 +30,16 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Aprivate.h" /* Attributes */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ -#include "H5HGprivate.h" /* Global Heaps */ #include "H5FOprivate.h" /* File objects */ #include "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ -#include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5SLprivate.h" /* Skip Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Ocopy_ref.c b/src/H5Ocopy_ref.c index 667c0254a5d..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,10 +65,9 @@ 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, hid_t tid_src, 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); +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); /*********************/ /* Package Variables */ @@ -285,17 +285,14 @@ 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, hid_t tid_src, 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) +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) { H5T_t *dt_mem = NULL; /* Memory datatype */ H5T_t *dt_dst = NULL; /* Destination datatype */ - hid_t tid_mem = H5I_INVALID_HID; /* Datatype ID for memory datatype */ - hid_t tid_dst = H5I_INVALID_HID; /* Datatype ID for memory datatype */ H5T_path_t *tpath_src_mem = NULL, *tpath_mem_dst = NULL; /* Datatype conversion paths */ size_t i; /* Local index variable */ - bool reg_tid_src = (tid_src == H5I_INVALID_HID); hid_t dst_loc_id = H5I_INVALID_HID; void *conv_buf = NULL; /* Buffer for converting data */ size_t conv_buf_size = 0; /* Buffer size */ @@ -308,17 +305,9 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt FUNC_ENTER_PACKAGE - /* Create datatype ID for src datatype. */ - if ((tid_src == H5I_INVALID_HID) && (tid_src = H5I_register(H5I_DATATYPE, dt_src, false)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register source file datatype"); - /* create a memory copy of the reference datatype */ if (NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy"); - if ((tid_mem = H5I_register(H5I_DATATYPE, dt_mem, false)) < 0) { - (void)H5T_close_real(dt_mem); - HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register memory datatype"); - } /* end if */ /* create reference datatype at the destination file */ if (NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT))) @@ -327,10 +316,6 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt (void)H5T_close_real(dt_dst); HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "cannot mark datatype on disk"); } /* end if */ - if ((tid_dst = H5I_register(H5I_DATATYPE, dt_dst, false)) < 0) { - (void)H5T_close_real(dt_dst); - HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register destination file datatype"); - } /* end if */ /* Set up the conversion functions */ if (NULL == (tpath_src_mem = H5T_path_find(dt_src, dt_mem))) @@ -346,7 +331,7 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt H5MM_memcpy(conv_buf, buf_src, nbytes_src); /* Convert from source file to memory */ - if (H5T_convert(tpath_src_mem, tid_src, tid_mem, ref_count, (size_t)0, (size_t)0, conv_buf, NULL) < 0) + if (H5T_convert(tpath_src_mem, dt_src, dt_mem, ref_count, (size_t)0, (size_t)0, conv_buf, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Retrieve loc ID */ @@ -392,24 +377,21 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); /* Convert from memory to destination file */ - if (H5T_convert(tpath_mem_dst, tid_mem, tid_dst, ref_count, (size_t)0, (size_t)0, conv_buf, NULL) < 0) + if (H5T_convert(tpath_mem_dst, dt_mem, dt_dst, ref_count, (size_t)0, (size_t)0, conv_buf, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); H5MM_memcpy(buf_dst, conv_buf, nbytes_src); /* Reclaim space from reference data */ - if (H5T_reclaim(tid_mem, buf_space, reclaim_buf) < 0) + if (H5T_reclaim(dt_mem, buf_space, reclaim_buf) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "unable to reclaim reference data"); done: if (buf_space && (H5S_close(buf_space) < 0)) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "Can't close dataspace"); - /* Don't decrement ID, we want to keep underlying datatype */ - if (reg_tid_src && (tid_src > 0) && (NULL == H5I_remove(tid_src))) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if ((tid_mem > 0) && H5I_dec_ref(tid_mem) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); - if ((tid_dst > 0) && H5I_dec_ref(tid_dst) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "Can't decrement temporary datatype ID"); + HDONE_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "can't close dataspace"); + if (dt_mem && (H5T_close(dt_mem) < 0)) + HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + if (dt_dst && (H5T_close(dt_dst) < 0)) + HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); if (reclaim_buf) reclaim_buf = H5FL_BLK_FREE(type_conv, reclaim_buf); if (conv_buf) @@ -430,8 +412,8 @@ H5O__copy_expand_ref_object2(H5O_loc_t *src_oloc, hid_t tid_src, const H5T_t *dt *------------------------------------------------------------------------- */ herr_t -H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_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_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 */ H5O_loc_t src_oloc; /* Temporary object location for source object */ @@ -479,8 +461,8 @@ H5O_copy_expand_ref(H5F_t *file_src, hid_t tid_src, const H5T_t *dt_src, void *b case H5R_DATASET_REGION2: case H5R_ATTR: case H5R_OBJECT2: - if (H5O__copy_expand_ref_object2(&src_oloc, tid_src, dt_src, buf_src, nbytes_src, &dst_oloc, - &dst_root_loc, buf_dst, ref_count, cpy_info) < 0) + if (H5O__copy_expand_ref_object2(&src_oloc, dt_src, buf_src, nbytes_src, &dst_oloc, &dst_root_loc, + buf_dst, ref_count, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "unable to expand reference"); break; case H5R_BADTYPE: diff --git a/src/H5Odbg.c b/src/H5Odbg.c index bc880bbe62f..dfc8e878d8f 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -32,7 +32,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ -#include "H5Ppublic.h" /* Property Lists */ /****************/ /* Local Macros */ diff --git a/src/H5Odeprec.c b/src/H5Odeprec.c index 3de58185675..3dd01f4029d 100644 --- a/src/H5Odeprec.c +++ b/src/H5Odeprec.c @@ -405,7 +405,7 @@ H5Oget_info1(hid_t loc_id, H5O_info1_t *oinfo /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", loc_id, oinfo); + H5TRACE2("e", "i*!", loc_id, oinfo); /* Check args */ if (!oinfo) @@ -455,7 +455,7 @@ H5Oget_info_by_name1(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*sxi", loc_id, name, oinfo, lapl_id); + H5TRACE4("e", "i*s*!i", loc_id, name, oinfo, lapl_id); /* Check args */ if (!name) @@ -517,7 +517,7 @@ H5Oget_info_by_idx1(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "i*sIiIohxi", loc_id, group_name, idx_type, order, n, oinfo, lapl_id); + H5TRACE7("e", "i*sIiIoh*!i", loc_id, group_name, idx_type, order, n, oinfo, lapl_id); /* Check args */ if (!group_name || !*group_name) @@ -582,7 +582,7 @@ H5Oget_info2(hid_t loc_id, H5O_info1_t *oinfo /*out*/, unsigned fields) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixIu", loc_id, oinfo, fields); + H5TRACE3("e", "i*!Iu", loc_id, oinfo, fields); /* Check args */ if (!oinfo) @@ -635,7 +635,7 @@ H5Oget_info_by_name2(hid_t loc_id, const char *name, H5O_info1_t *oinfo /*out*/, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*sxIui", loc_id, name, oinfo, fields, lapl_id); + H5TRACE5("e", "i*s*!Iui", loc_id, name, oinfo, fields, lapl_id); /* Check args */ if (!name) @@ -700,7 +700,7 @@ H5Oget_info_by_idx2(hid_t loc_id, const char *group_name, H5_index_t idx_type, H herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "i*sIiIohxIui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); + H5TRACE8("e", "i*sIiIoh*!Iui", loc_id, group_name, idx_type, order, n, oinfo, fields, lapl_id); /* Check args */ if (!group_name || !*group_name) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 620d6864b9d..05652df0fe2 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -18,7 +18,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Gprivate.h" /* Groups */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Tpkg.h" /* Datatypes */ diff --git a/src/H5Ofill.c b/src/H5Ofill.c index b29c30a79bd..1ffb4f6b310 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -21,7 +21,6 @@ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Pprivate.h" /* Property lists */ @@ -533,6 +532,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 *dst_type = NULL; + H5T_t *tmp_type = NULL; void *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -571,41 +572,31 @@ H5O__fill_copy(const void *_src, void *_dst) /* If necessary, convert fill value datatypes (which copies VL components, etc.) */ if (!H5T_path_noop(tpath)) { - hid_t dst_id, src_id; /* Source & destination datatypes for type conversion */ uint8_t *bkg_buf = NULL; /* Background conversion buffer */ size_t bkg_size; /* Size of background buffer */ - /* Wrap copies of types to convert */ - dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dst->type, H5T_COPY_TRANSIENT), false); - if (dst_id < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy/register datatype"); - src_id = H5I_register(H5I_DATATYPE, H5T_copy(src->type, H5T_COPY_ALL), false); - if (src_id < 0) { - H5I_dec_ref(dst_id); - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy/register datatype"); - } /* end if */ + 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)); - if (H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + if (H5T_path_bkg(tpath) && NULL == (bkg_buf = H5FL_BLK_CALLOC(type_conv, bkg_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - } /* end if */ /* Convert fill value */ - if (H5T_convert(tpath, src_id, dst_id, (size_t)1, (size_t)0, (size_t)0, dst->buf, bkg_buf) < - 0) { - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); + 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); HGOTO_ERROR(H5E_OHDR, H5E_CANTCONVERT, NULL, "datatype conversion failed"); } /* end if */ /* Release the background buffer */ - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); if (bkg_buf) bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); } /* end if */ @@ -618,6 +609,9 @@ H5O__fill_copy(const void *_src, void *_dst) ret_value = dst; done: + if (tmp_type && (H5T_close(tmp_type) < 0)) + HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEOBJ, NULL, "unable to close temporary datatype"); + if (!ret_value && dst) { if (dst->buf) H5MM_xfree(dst->buf); @@ -712,8 +706,7 @@ H5O__fill_old_size(const H5F_t H5_ATTR_UNUSED *f, const void *_fill) herr_t H5O_fill_reset_dyn(H5O_fill_t *fill) { - hid_t fill_type_id = -1; /* Datatype ID for fill value datatype when reclaiming VL fill values */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -721,23 +714,14 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) if (fill->buf) { if (fill->type && H5T_detect_class(fill->type, H5T_VLEN, false) > 0) { - H5T_t *fill_type; /* Copy of fill value datatype */ H5S_t *fill_space; /* Scalar dataspace for fill value element */ - /* Copy the fill value datatype and get an ID for it */ - if (NULL == (fill_type = H5T_copy(fill->type, H5T_COPY_TRANSIENT))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy fill value datatype"); - if ((fill_type_id = H5I_register(H5I_DATATYPE, fill_type, false)) < 0) { - (void)H5T_close_real(fill_type); - HGOTO_ERROR(H5E_OHDR, H5E_CANTREGISTER, FAIL, "unable to register fill value datatype"); - } /* end if */ - /* Create a scalar dataspace for the fill value element */ if (NULL == (fill_space = H5S_create(H5S_SCALAR))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create scalar dataspace"); /* Reclaim any variable length components of the fill value */ - if (H5T_reclaim(fill_type_id, fill_space, fill->buf) < 0) { + if (H5T_reclaim(fill->type, fill_space, fill->buf) < 0) { H5S_close(fill_space); HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "unable to reclaim variable-length fill value data"); } /* end if */ @@ -756,9 +740,6 @@ H5O_fill_reset_dyn(H5O_fill_t *fill) } /* end if */ done: - if (fill_type_id > 0 && H5I_dec_ref(fill_type_id) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for temp ID"); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_fill_reset_dyn() */ @@ -956,10 +937,9 @@ H5O__fill_debug(H5F_t H5_ATTR_UNUSED *f, const void *_fill, FILE *stream, int in herr_t 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 */ - hid_t src_id = -1, dst_id = -1; /* Datatype identifiers */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_path_t *tpath; /* Type conversion info */ + void *buf = NULL, *bkg = NULL; /* Conversion buffers */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -990,10 +970,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 ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill->type, H5T_COPY_ALL), false)) < 0 || - (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(dset_type, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy/register data type"); - /* * Datatype conversions are always done in place, so we need a buffer * that is large enough for both source and destination. @@ -1010,7 +986,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_id, dst_id, (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 */ @@ -1027,10 +1003,6 @@ H5O_fill_convert(H5O_fill_t *fill, H5T_t *dset_type, bool *fill_changed) } /* end if */ done: - if (src_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for temp ID"); - if (dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_OHDR, H5E_CANTDEC, FAIL, "unable to decrement ref count for temp ID"); if (bkg) H5MM_xfree(bkg); diff --git a/src/H5Oint.c b/src/H5Oint.c index 052987728bc..16fea4b3cd7 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 */ @@ -548,11 +549,6 @@ H5O_open(H5O_loc_t *loc) assert(loc); assert(loc->file); -#ifdef H5O_DEBUG - if (H5DEBUG(O)) - fprintf(H5DEBUG(O), "> %" PRIuHADDR "\n", loc->addr); -#endif - /* Turn off the variable for holding file or increment open-lock counters */ if (loc->holding_file) loc->holding_file = false; @@ -762,16 +758,6 @@ H5O_close(H5O_loc_t *loc, bool *file_closed /*out*/) /* Decrement open-lock counters */ H5F_DECR_NOPEN_OBJS(loc->file); -#ifdef H5O_DEBUG - if (H5DEBUG(O)) { - if (false == H5F_ID_EXISTS(loc->file) && 1 == H5F_NREFS(loc->file)) - fprintf(H5DEBUG(O), "< %" PRIuHADDR " auto %lu remaining\n", loc->addr, - (unsigned long)H5F_NOPEN_OBJS(loc->file)); - else - fprintf(H5DEBUG(O), "< %" PRIuHADDR "\n", loc->addr); - } -#endif - /* * If the file open object count has reached the number of open mount points * (each of which has a group open in the file) attempt to close the file. diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 75456d6e853..fc0f59ee60d 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -21,10 +21,8 @@ #include "H5Dpkg.h" /* Dataset functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5MFprivate.h" /* File space management */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ -#include "H5Pprivate.h" /* Property lists */ /* Local macros */ diff --git a/src/H5Olink.c b/src/H5Olink.c index 6657a500c16..431e1dd4965 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -19,14 +19,12 @@ *------------------------------------------------------------------------- */ -#define H5G_FRIEND /*suppress error about including H5Gpkg */ #define H5L_FRIEND /*suppress error about including H5Lpkg */ #include "H5Omodule.h" /* This source code file is part of the H5O module */ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ -#include "H5Gpkg.h" /* Groups */ #include "H5Iprivate.h" /* IDs */ #include "H5Lpkg.h" /* Links */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index bc4381b2dd5..7190e46a57f 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -29,7 +29,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Aprivate.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5Iprivate.h" /* IDs */ diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 864af930b49..cd7fba4c05f 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -19,7 +19,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ static void *H5O__mtime_new_decode(H5F_t *f, H5O_t *open_oh, unsigned mesg_flags, unsigned *ioflags, diff --git a/src/H5Opline.c b/src/H5Opline.c index fd347356e9d..6abe575e418 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -18,7 +18,6 @@ #define H5Z_FRIEND /*suppress error about including H5Zpkg */ #include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index cdf4d6c19c9..6f3d39d1e83 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -985,8 +985,8 @@ 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, hid_t tid_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); +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 */ H5_DLL herr_t H5O_debug_id(unsigned type_id, H5F_t *f, const void *mesg, FILE *stream, int indent, diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index cf68a761bed..1658fa719f9 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -17,8 +17,6 @@ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ -#include "H5Gprivate.h" /* Groups */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Spkg.h" /* Dataspaces */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index f53fae5119f..9c32caf426b 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -32,7 +32,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ -#include "H5Gprivate.h" /* Groups */ #include "H5HFprivate.h" /* Fractal heap */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ diff --git a/src/H5Otest.c b/src/H5Otest.c index 2c23f0cbf18..410baa7f603 100644 --- a/src/H5Otest.c +++ b/src/H5Otest.c @@ -30,7 +30,6 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ #include "H5Opkg.h" /* Object headers */ /****************/ diff --git a/src/H5P.c b/src/H5P.c index b9be5a250d0..fc361e8788e 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -758,7 +758,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size /*out*/) herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*sx", id, name, size); + H5TRACE3("e", "i*s*z", id, name, size); /* Check arguments. */ if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) @@ -963,7 +963,7 @@ H5Pget_nprops(hid_t id, size_t *nprops /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", id, nprops); + H5TRACE2("e", "i*z", id, nprops); /* Check arguments. */ if (H5I_GENPROP_LST != H5I_get_type(id) && H5I_GENPROP_CLS != H5I_get_type(id)) @@ -1263,7 +1263,7 @@ H5Pget(hid_t plist_id, const char *name, void *value /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*sx", plist_id, name, value); + H5TRACE3("e", "i*s*x", plist_id, name, value); /* Check arguments. */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) diff --git a/src/H5PB.c b/src/H5PB.c index c671489c74a..fc09cd56e96 100644 --- a/src/H5PB.c +++ b/src/H5PB.c @@ -33,7 +33,7 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fpkg.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ #include "H5PBpkg.h" /* File access */ #include "H5SLprivate.h" /* Skip List */ diff --git a/src/H5PL.c b/src/H5PL.c index d01b0f5abc3..218e413eced 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -109,7 +109,7 @@ H5PLget_loading_state(unsigned *plugin_control_mask /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("e", "x", plugin_control_mask); + H5TRACE1("e", "*Iu", plugin_control_mask); if (NULL == plugin_control_mask) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "plugin_control_mask parameter cannot be NULL"); diff --git a/src/H5PLint.c b/src/H5PLint.c index 23d07506d3e..6ee4603f63a 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -24,11 +24,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5PLpkg.h" /* Plugin */ -#include "H5Zprivate.h" /* Filter pipeline */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5PLpkg.h" /* Plugin */ +#include "H5Zprivate.h" /* Filter pipeline */ /****************/ /* Local Macros */ 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/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index 3538d7f5580..3878f36efaa 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -35,7 +35,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5MMprivate.h" /* Memory management */ #include "H5PLpkg.h" /* Plugin */ -#include "H5Zprivate.h" /* Filter pipeline */ /****************/ /* Local Macros */ diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c index 71c79635038..37386265085 100644 --- a/src/H5Pdapl.c +++ b/src/H5Pdapl.c @@ -810,7 +810,7 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots /*out*/, size_t *rdcc_nbyt herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ixxx", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); + H5TRACE4("e", "i*z*z*d", dapl_id, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(dapl_id, H5P_DATASET_ACCESS))) @@ -1108,7 +1108,7 @@ H5Pget_virtual_view(hid_t plist_id, H5D_vds_view_t *view /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, view); + H5TRACE2("e", "i*Dv", plist_id, view); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1251,7 +1251,7 @@ H5Pget_virtual_printf_gap(hid_t plist_id, hsize_t *gap_size /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, gap_size); + H5TRACE2("e", "i*h", plist_id, gap_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1353,7 +1353,7 @@ H5Pget_append_flush(hid_t plist_id, unsigned ndims, hsize_t boundary[], H5D_appe herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "iIu*hxx", plist_id, ndims, boundary, func, udata); + H5TRACE5("e", "iIu*h*DA**x", plist_id, ndims, boundary, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1436,7 +1436,7 @@ H5Pget_efile_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "ixz", plist_id, prefix, size); + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) @@ -1526,7 +1526,7 @@ H5Pget_virtual_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "ixz", plist_id, prefix, size); + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_ACCESS))) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index ae426ee3f9e..8f0ba04745d 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -30,7 +30,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5CXprivate.h" /* API Contexts */ #include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ @@ -1980,7 +1979,7 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[] /*out*/) int ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Is", "iIsx", plist_id, max_ndims, dim); + H5TRACE3("Is", "iIs*h", plist_id, max_ndims, dim); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) @@ -2203,7 +2202,7 @@ H5Pget_virtual_count(hid_t dcpl_id, size_t *count /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", dcpl_id, count); + H5TRACE2("e", "i*z", dcpl_id, count); if (count) { /* Get the plist structure */ @@ -2400,7 +2399,7 @@ H5Pget_virtual_filename(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size); + H5TRACE4("Zs", "iz*sz", dcpl_id, idx, name, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -2458,7 +2457,7 @@ H5Pget_virtual_dsetname(hid_t dcpl_id, size_t idx, char *name /*out*/, size_t si ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("Zs", "izxz", dcpl_id, idx, name, size); + H5TRACE4("Zs", "iz*sz", dcpl_id, idx, name, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(dcpl_id, H5P_DATASET_CREATE))) @@ -2554,7 +2553,7 @@ H5Pget_chunk_opts(hid_t plist_id, unsigned *options /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, options); + H5TRACE2("e", "i*Iu", plist_id, options); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) @@ -2723,7 +2722,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name /*out herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "iIuzxxx", plist_id, idx, name_size, name, offset, size); + H5TRACE6("e", "iIuz*s*o*h", plist_id, idx, name_size, name, offset, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_CREATE))) @@ -3042,8 +3041,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); /* Convert the fill value */ - if (H5T_convert(tpath, type_id, type_id, (size_t)1, (size_t)0, (size_t)0, fill.buf, bkg_buf) < - 0) { + if (H5T_convert(tpath, type, type, (size_t)1, (size_t)0, (size_t)0, 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"); @@ -3085,8 +3083,8 @@ H5P_get_fill_value(H5P_genplist_t *plist, const H5T_t *type, void *value /*out*/ H5T_path_t *tpath; /*type conversion info */ void *buf = NULL; /*conversion buffer */ void *bkg = NULL; /*conversion buffer */ - hid_t src_id = -1; /*source datatype id */ - hid_t dst_id = -1; /*destination datatype id */ + H5T_t *src_type = NULL; /*source datatype */ + H5T_t *tmp_type = NULL; /*temporary datatype */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3113,8 +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 ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill.type, H5T_COPY_TRANSIENT), false)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register 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,9 +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 ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(type, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "unable to copy/register datatype"); - if (H5T_convert(tpath, src_id, dst_id, (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)); @@ -3147,10 +3149,8 @@ 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_id >= 0 && H5I_dec_ref(src_id) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID"); - if (dst_id >= 0 && H5I_dec_ref(dst_id) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't decrement ref count of temp ID"); + 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) } /* end H5P_get_fill_value() */ @@ -3176,7 +3176,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iix", plist_id, type_id, value); + H5TRACE3("e", "ii*x", plist_id, type_id, value); /* Check arguments */ if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -3399,7 +3399,7 @@ H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, alloc_time); + H5TRACE2("e", "i*Da", plist_id, alloc_time); /* Get values */ if (alloc_time) { @@ -3481,7 +3481,7 @@ H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, fill_time); + H5TRACE2("e", "i*Df", plist_id, fill_time); /* Set values */ if (fill_time) { @@ -3527,7 +3527,7 @@ H5Pget_dset_no_attrs_hint(hid_t dcpl_id, hbool_t *minimize /*out*/) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", dcpl_id, minimize); + H5TRACE2("e", "i*b", dcpl_id, minimize); if (NULL == minimize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "receiving pointer cannot be NULL"); diff --git a/src/H5Pdeprec.c b/src/H5Pdeprec.c index 4374730d48e..6e55c72b691 100644 --- a/src/H5Pdeprec.c +++ b/src/H5Pdeprec.c @@ -449,7 +449,7 @@ H5Pget_version(hid_t plist_id, unsigned *super /*out*/, unsigned *freelist /*out herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ixxxx", plist_id, super, freelist, stab, shhdr); + H5TRACE5("e", "i*Iu*Iu*Iu*Iu", plist_id, super, freelist, stab, shhdr); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -605,7 +605,7 @@ H5Pget_file_space(hid_t plist_id, H5F_file_space_type_t *strategy /*out*/, hsize herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, strategy, threshold); + H5TRACE3("e", "i*Ft*h", plist_id, strategy, threshold); /* Get current file space info */ if (H5Pget_file_space_strategy(plist_id, &new_strategy, &new_persist, &new_threshold) < 0) diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 9adb2d60d3f..a2538810d38 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -29,11 +29,9 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Cache */ #include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FDprivate.h" /* File drivers */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ #include "H5VMprivate.h" /* Vector Functions */ @@ -1033,7 +1031,7 @@ H5Pget_data_transform(hid_t plist_id, char *expression /*out*/, size_t size) ssize_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "ixz", plist_id, expression, size); + H5TRACE3("Zs", "i*sz", plist_id, expression, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1129,7 +1127,7 @@ H5Pget_buffer(hid_t plist_id, void **tconv /*out*/, void **bkg /*out*/) size_t ret_value; /* Return value */ FUNC_ENTER_API(0) - H5TRACE3("z", "ixx", plist_id, tconv, bkg); + H5TRACE3("z", "i**x**x", plist_id, tconv, bkg); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1387,7 +1385,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op /*out*/, void **o herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, op, operate_data); + H5TRACE3("e", "i*TE**x", plist_id, op, operate_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1425,7 +1423,7 @@ H5Pget_btree_ratios(hid_t plist_id, double *left /*out*/, double *middle /*out*/ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ixxx", plist_id, left, middle, right); + H5TRACE4("e", "i*d*d*d", plist_id, left, middle, right); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1590,7 +1588,7 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func /*out*/, voi herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ixxxx", plist_id, alloc_func, alloc_info, free_func, free_info); + H5TRACE5("e", "i*Ma**x*Mf**x", plist_id, alloc_func, alloc_info, free_func, free_info); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1672,7 +1670,7 @@ H5Pget_hyper_vector_size(hid_t plist_id, size_t *vector_size /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, vector_size); + H5TRACE2("e", "i*z", plist_id, vector_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1904,7 +1902,7 @@ H5Pget_mpio_actual_chunk_opt_mode(hid_t plist_id, herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, actual_chunk_opt_mode); + H5TRACE2("e", "i*Do", plist_id, actual_chunk_opt_mode); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1936,7 +1934,7 @@ H5Pget_mpio_actual_io_mode(hid_t plist_id, H5D_mpio_actual_io_mode_t *actual_io_ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, actual_io_mode); + H5TRACE2("e", "i*Di", plist_id, actual_io_mode); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -1968,7 +1966,7 @@ H5Pget_mpio_no_collective_cause(hid_t plist_id, uint32_t *local_no_collective_ca herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, local_no_collective_cause, global_no_collective_cause); + H5TRACE3("e", "i*Iu*Iu", plist_id, local_no_collective_cause, global_no_collective_cause); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -2421,7 +2419,7 @@ H5Pget_selection_io(hid_t plist_id, H5D_selection_io_mode_t *selection_io_mode / herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, selection_io_mode); + H5TRACE2("e", "i*DC", plist_id, selection_io_mode); /* Check arguments */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -2452,7 +2450,7 @@ H5Pget_no_selection_io_cause(hid_t plist_id, uint32_t *no_selection_io_cause /*o herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, no_selection_io_cause); + H5TRACE2("e", "i*Iu", plist_id, no_selection_io_cause); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -2485,7 +2483,7 @@ H5Pget_actual_selection_io_mode(hid_t plist_id, uint32_t *actual_selection_io_mo herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, actual_selection_io_mode); + H5TRACE2("e", "i*Iu", plist_id, actual_selection_io_mode); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) @@ -2617,7 +2615,7 @@ H5Pget_modify_write_buf(hid_t plist_id, hbool_t *modify_write_buf /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, modify_write_buf); + H5TRACE2("e", "i*b", plist_id, modify_write_buf); /* Check arguments */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_DATASET_XFER))) diff --git a/src/H5Pencdec.c b/src/H5Pencdec.c index 77568c5deca..4d1d8187591 100644 --- a/src/H5Pencdec.c +++ b/src/H5Pencdec.c @@ -25,7 +25,6 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* Files */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 6c2ef477aeb..65c21408a3f 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1106,7 +1106,7 @@ H5Pget_alignment(hid_t fapl_id, hsize_t *threshold /*out*/, hsize_t *alignment / herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", fapl_id, threshold, alignment); + H5TRACE3("e", "i*h*h", fapl_id, threshold, alignment); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -2028,7 +2028,7 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, offset); + H5TRACE2("e", "i*h", fapl_id, offset); /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) @@ -2100,7 +2100,7 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, type); + H5TRACE2("e", "i*Mt", fapl_id, type); /* Get the plist structure */ if (H5P_DEFAULT == fapl_id) @@ -2189,7 +2189,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, size_t *rdcc_nslots /*out*/, size_ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "i*Isxxx", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); + H5TRACE5("e", "i*Is*z*z*d", plist_id, mdc_nelmts, rdcc_nslots, rdcc_nbytes, rdcc_w0); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2276,7 +2276,7 @@ H5Pget_mdc_image_config(hid_t plist_id, H5AC_cache_image_config_t *config /*out* herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, config); + H5TRACE2("e", "i*CC", plist_id, config); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2362,7 +2362,7 @@ H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, config); + H5TRACE2("e", "i*Cc", plist_id, config); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2446,7 +2446,7 @@ H5Pget_gc_references(hid_t plist_id, unsigned *gc_ref /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, gc_ref); + H5TRACE2("e", "i*Iu", plist_id, gc_ref); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2507,7 +2507,7 @@ H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, degree); + H5TRACE2("e", "i*Fd", plist_id, degree); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2577,7 +2577,7 @@ H5Pget_meta_block_size(hid_t plist_id, hsize_t *size /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, size); + H5TRACE2("e", "i*h", plist_id, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2650,7 +2650,7 @@ H5Pget_sieve_buf_size(hid_t plist_id, size_t *size /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, size); + H5TRACE2("e", "i*z", plist_id, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2722,7 +2722,7 @@ H5Pget_small_data_block_size(hid_t plist_id, hsize_t *size /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, size); + H5TRACE2("e", "i*h", plist_id, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2892,7 +2892,7 @@ H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low /*out*/, H5F_libver_t *hi herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, low, high); + H5TRACE3("e", "i*Fv*Fv", plist_id, low, high); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -2965,7 +2965,7 @@ H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, efc_size); + H5TRACE2("e", "i*Iu", plist_id, efc_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -3092,7 +3092,7 @@ H5Pget_file_image(hid_t fapl_id, void **buf /*out*/, size_t *buf_len /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", fapl_id, buf, buf_len); + H5TRACE3("e", "i**x*z", fapl_id, buf, buf_len); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -3245,7 +3245,7 @@ H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callback herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, callbacks); + H5TRACE2("e", "i*DI", fapl_id, callbacks); /* Get the plist structure */ if (NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) @@ -4439,7 +4439,7 @@ H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, attempts); + H5TRACE2("e", "i*Iu", plist_id, attempts); /* Get values */ if (attempts) { @@ -4521,7 +4521,7 @@ H5Pget_object_flush_cb(hid_t plist_id, H5F_flush_cb_t *func /*out*/, void **udat herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, func, udata); + H5TRACE3("e", "i*FF**x", plist_id, func, udata); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4604,7 +4604,7 @@ H5Pget_mdc_log_options(hid_t plist_id, hbool_t *is_enabled /*out*/, char *locati herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ixxxx", plist_id, is_enabled, location, location_size, start_on_access); + H5TRACE5("e", "i*b*s*z*b", plist_id, is_enabled, location, location_size, start_on_access); /* Get the property list structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -4902,7 +4902,7 @@ H5Pget_evict_on_close(hid_t fapl_id, hbool_t *evict_on_close /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", fapl_id, evict_on_close); + H5TRACE2("e", "i*b", fapl_id, evict_on_close); /* Compare the property list's class against the other class */ if (true != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) @@ -4983,7 +4983,7 @@ H5Pget_file_locking(hid_t fapl_id, hbool_t *use_file_locking /*out*/, hbool_t *i herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", fapl_id, use_file_locking, ignore_when_disabled); + H5TRACE3("e", "i*b*b", fapl_id, use_file_locking, ignore_when_disabled); /* Make sure this is a fapl */ if (H5P_DEFAULT == fapl_id) @@ -5143,7 +5143,7 @@ H5Pget_all_coll_metadata_ops(hid_t plist_id, hbool_t *is_collective /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, is_collective); + H5TRACE2("e", "i*b", plist_id, is_collective); /* Compare the property list's class against the other class */ /* (Dataset, group, attribute, and named datatype access property lists @@ -5226,7 +5226,7 @@ H5Pget_mpi_params(hid_t plist_id, MPI_Comm *comm /*out*/, MPI_Info *info /*out*/ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, comm, info); + H5TRACE3("e", "i*Mc*Mi", plist_id, comm, info); /* Make sure that the property list is a fapl */ if (true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) @@ -5670,7 +5670,7 @@ H5Pget_coll_metadata_write(hid_t plist_id, hbool_t *is_collective /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, is_collective); + H5TRACE2("e", "i*b", plist_id, is_collective); /* Compare the property list's class against the other class */ if (true != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) @@ -5752,7 +5752,7 @@ H5Pget_page_buffer_size(hid_t plist_id, size_t *buf_size /*out*/, unsigned *min_ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ixxx", plist_id, buf_size, min_meta_perc, min_raw_perc); + H5TRACE4("e", "i*z*Iu*Iu", plist_id, buf_size, min_meta_perc, min_raw_perc); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) @@ -5899,7 +5899,7 @@ H5Pget_vol_id(hid_t plist_id, hid_t *vol_id /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, vol_id); + H5TRACE2("e", "i*i", plist_id, vol_id); if (H5P_DEFAULT == plist_id) plist_id = H5P_FILE_ACCESS_DEFAULT; @@ -5948,7 +5948,7 @@ H5Pget_vol_info(hid_t plist_id, void **vol_info /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, vol_info); + H5TRACE2("e", "i**x", plist_id, vol_info); /* Get property list for ID */ if (NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST))) diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index b15e2c9a699..c622b26b600 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -361,7 +361,7 @@ H5Pget_userblock(hid_t plist_id, hsize_t *size /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, size); + H5TRACE2("e", "i*h", plist_id, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -447,7 +447,7 @@ H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr /*out*/, size_t *sizeof_size /* herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, sizeof_addr, sizeof_size); + H5TRACE3("e", "i*z*z", plist_id, sizeof_addr, sizeof_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -548,7 +548,7 @@ H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out*/, unsigned *lk /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, ik, lk); + H5TRACE3("e", "i*Iu*Iu", plist_id, ik, lk); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -632,7 +632,7 @@ H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, ik); + H5TRACE2("e", "i*Iu", plist_id, ik); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -790,7 +790,7 @@ H5Pget_shared_mesg_nindexes(hid_t plist_id, unsigned *nindexes /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, nindexes); + H5TRACE2("e", "i*Iu", plist_id, nindexes); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -887,7 +887,7 @@ H5Pget_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned *mesg_type herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iIuxx", plist_id, index_num, mesg_type_flags, min_mesg_size); + H5TRACE4("e", "iIu*Iu*Iu", plist_id, index_num, mesg_type_flags, min_mesg_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -1160,7 +1160,7 @@ H5Pget_shared_mesg_phase_change(hid_t plist_id, unsigned *max_list /*out*/, unsi herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, max_list, min_btree); + H5TRACE3("e", "i*Iu*Iu", plist_id, max_list, min_btree); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -1242,7 +1242,7 @@ H5Pget_file_space_strategy(hid_t plist_id, H5F_fspace_strategy_t *strategy /*out herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ixxx", plist_id, strategy, persist, threshold); + H5TRACE4("e", "i*Ff*b*h", plist_id, strategy, persist, threshold); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) @@ -1382,7 +1382,7 @@ H5Pget_file_space_page_size(hid_t plist_id, hsize_t *fsp_size /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, fsp_size); + H5TRACE2("e", "i*h", plist_id, fsp_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_CREATE))) diff --git a/src/H5Pfmpl.c b/src/H5Pfmpl.c index ff6a3a3a1b2..97856c5a525 100644 --- a/src/H5Pfmpl.c +++ b/src/H5Pfmpl.c @@ -31,7 +31,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ -#include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ /****************/ diff --git a/src/H5Pgcpl.c b/src/H5Pgcpl.c index 364955be901..4ea0448356c 100644 --- a/src/H5Pgcpl.c +++ b/src/H5Pgcpl.c @@ -31,7 +31,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ -#include "H5Iprivate.h" /* IDs */ #include "H5Oprivate.h" /* Object headers */ #include "H5Ppkg.h" /* Property lists */ @@ -187,7 +186,7 @@ H5Pget_local_heap_size_hint(hid_t plist_id, size_t *size_hint /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, size_hint); + H5TRACE2("e", "i*z", plist_id, size_hint); if (size_hint) { H5P_genplist_t *plist; /* Property list pointer */ @@ -282,7 +281,7 @@ H5Pget_link_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, max_compact, min_dense); + H5TRACE3("e", "i*Iu*Iu", plist_id, max_compact, min_dense); /* Get values */ if (max_compact || min_dense) { @@ -380,7 +379,7 @@ H5Pget_est_link_info(hid_t plist_id, unsigned *est_num_entries /*out*/, unsigned herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, est_num_entries, est_name_len); + H5TRACE3("e", "i*Iu*Iu", plist_id, est_num_entries, est_name_len); /* Get values */ if (est_num_entries || est_name_len) { @@ -464,7 +463,7 @@ H5Pget_link_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, crt_order_flags); + H5TRACE2("e", "i*Iu", plist_id, crt_order_flags); /* Get values */ if (crt_order_flags) { diff --git a/src/H5Pint.c b/src/H5Pint.c index f6dbb2706c1..8f9f5125847 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -23,16 +23,13 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#ifdef H5_HAVE_PARALLEL -#include "H5ACprivate.h" /* Metadata cache */ -#endif /* H5_HAVE_PARALLEL */ +#include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free lists */ #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/H5Plapl.c b/src/H5Plapl.c index 1057fffa616..6eb2b7326a3 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -893,7 +893,7 @@ H5Pget_nlinks(hid_t plist_id, size_t *nlinks /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, nlinks); + H5TRACE2("e", "i*z", plist_id, nlinks); if (!nlinks) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer passed in"); @@ -964,7 +964,7 @@ H5Pget_elink_prefix(hid_t plist_id, char *prefix /*out*/, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Zs", "ixz", plist_id, prefix, size); + H5TRACE3("Zs", "i*sz", plist_id, prefix, size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_ACCESS))) @@ -1109,7 +1109,7 @@ H5Pget_elink_acc_flags(hid_t lapl_id, unsigned *flags /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", lapl_id, flags); + H5TRACE2("e", "i*Iu", lapl_id, flags); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) @@ -1184,7 +1184,7 @@ H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func /*out*/, void **op_dat herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", lapl_id, func, op_data); + H5TRACE3("e", "i*Lt**x", lapl_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(lapl_id, H5P_LINK_ACCESS))) diff --git a/src/H5Plcpl.c b/src/H5Plcpl.c index 536172e1616..b720b105949 100644 --- a/src/H5Plcpl.c +++ b/src/H5Plcpl.c @@ -30,7 +30,6 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ #include "H5Lprivate.h" /* Links */ #include "H5Ppkg.h" /* Property lists */ @@ -172,7 +171,7 @@ H5Pget_create_intermediate_group(hid_t plist_id, unsigned *crt_intmd_group /*out herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, crt_intmd_group); + H5TRACE2("e", "i*Iu", plist_id, crt_intmd_group); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_LINK_CREATE))) diff --git a/src/H5Pmapl.c b/src/H5Pmapl.c index 351bc73ec0b..8824f051f2c 100644 --- a/src/H5Pmapl.c +++ b/src/H5Pmapl.c @@ -29,7 +29,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Mprivate.h" /* Maps */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ /****************/ @@ -187,7 +186,7 @@ H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size /*out*/, size_ herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", mapl_id, key_prefetch_size, key_alloc_size); + H5TRACE3("e", "i*z*z", mapl_id, key_prefetch_size, key_alloc_size); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(mapl_id, H5P_MAP_ACCESS))) diff --git a/src/H5Pmcpl.c b/src/H5Pmcpl.c index f2cc29a8bb1..367edb3f8b7 100644 --- a/src/H5Pmcpl.c +++ b/src/H5Pmcpl.c @@ -31,7 +31,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Mprivate.h" /* Maps */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ /****************/ diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index ca70e1a6204..d293e84f08a 100644 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -31,11 +31,9 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Opkg.h" /* Object headers */ #include "H5Ppkg.h" /* Property lists */ -#include "H5PLprivate.h" /* Dynamic plugin */ #include "H5VMprivate.h" /* Vector Functions */ #include "H5Zprivate.h" /* Filter pipeline */ @@ -246,7 +244,7 @@ H5Pget_attr_phase_change(hid_t plist_id, unsigned *max_compact /*out*/, unsigned herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, max_compact, min_dense); + H5TRACE3("e", "i*Iu*Iu", plist_id, max_compact, min_dense); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_CREATE))) @@ -330,7 +328,7 @@ H5Pget_attr_creation_order(hid_t plist_id, unsigned *crt_order_flags /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, crt_order_flags); + H5TRACE2("e", "i*Iu", plist_id, crt_order_flags); /* Get values */ if (crt_order_flags) { @@ -427,7 +425,7 @@ H5Pget_obj_track_times(hid_t plist_id, hbool_t *track_times /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, track_times); + H5TRACE2("e", "i*b", plist_id, track_times); /* Get values */ if (track_times) { @@ -756,7 +754,7 @@ H5Pget_nfilters(hid_t plist_id) *------------------------------------------------------------------------- */ H5Z_filter_t -H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t *cd_nelmts /*in_out*/, +H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t *cd_nelmts /*in,out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/, unsigned *filter_config /*out*/) { @@ -766,7 +764,8 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t H5Z_filter_t ret_value; /* return value */ FUNC_ENTER_API(H5Z_FILTER_ERROR) - H5TRACE8("Zf", "iIux*zxzxx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name, filter_config); + H5TRACE8("Zf", "iIu*Iu*z*Iuz*s*Iu", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name, + filter_config); /* Check args */ if (cd_nelmts || cd_values) { @@ -837,7 +836,7 @@ H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t */ herr_t H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags /*out*/, - size_t *cd_nelmts /*in_out*/, unsigned cd_values[] /*out*/, size_t namelen, + size_t *cd_nelmts /*in,out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/, unsigned *filter_config) { H5O_pline_t pline; /* Filter pipeline */ @@ -883,14 +882,15 @@ H5P_get_filter_by_id(H5P_genplist_t *plist, H5Z_filter_t id, unsigned int *flags */ herr_t H5Pget_filter_by_id2(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/, - size_t *cd_nelmts /*in_out*/, unsigned cd_values[] /*out*/, size_t namelen, + size_t *cd_nelmts /*in,out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/, unsigned *filter_config /*out*/) { H5P_genplist_t *plist; /* Property list */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE8("e", "iZfx*zxzxx", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, filter_config); + H5TRACE8("e", "iZf*Iu*z*Iuz*s*Iu", plist_id, id, flags, cd_nelmts, cd_values, namelen, name, + filter_config); /* Check args */ if (id < 0 || id > H5Z_FILTER_MAX) @@ -1139,7 +1139,7 @@ H5Pset_fletcher32(hid_t plist_id) *------------------------------------------------------------------------- */ herr_t -H5P__get_filter(const H5Z_filter_info_t *filter, unsigned int *flags /*out*/, size_t *cd_nelmts /*in_out*/, +H5P__get_filter(const H5Z_filter_info_t *filter, unsigned int *flags /*out*/, size_t *cd_nelmts /*in,out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/, unsigned *filter_config /*out*/) { @@ -1656,7 +1656,7 @@ H5P__ocrt_pipeline_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_UNUSED *------------------------------------------------------------------------- */ H5Z_filter_t -H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t *cd_nelmts /*in_out*/, +H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t *cd_nelmts /*in,out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/) { H5O_pline_t pline; /* Filter pipeline */ @@ -1665,7 +1665,7 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t H5Z_filter_t ret_value; /* return value */ FUNC_ENTER_API(H5Z_FILTER_ERROR) - H5TRACE7("Zf", "iIux*zxzx", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name); + H5TRACE7("Zf", "iIu*Iu*z*Iuz*s", plist_id, idx, flags, cd_nelmts, cd_values, namelen, name); /* Check args */ if (cd_nelmts || cd_values) { @@ -1735,14 +1735,14 @@ H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags /*out*/, size_t */ herr_t H5Pget_filter_by_id1(hid_t plist_id, H5Z_filter_t id, unsigned int *flags /*out*/, - size_t *cd_nelmts /*in_out*/, unsigned cd_values[] /*out*/, size_t namelen, + size_t *cd_nelmts /*in,out*/, unsigned cd_values[] /*out*/, size_t namelen, char name[] /*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "iZfx*zxzx", plist_id, id, flags, cd_nelmts, cd_values, namelen, name); + H5TRACE7("e", "iZf*Iu*z*Iuz*s", plist_id, id, flags, cd_nelmts, cd_values, namelen, name); /* Check args */ if (id < 0 || id > H5Z_FILTER_MAX) diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index 869e36304d2..8a723378574 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -31,7 +31,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Ppkg.h" /* Property lists */ @@ -646,7 +645,7 @@ H5Pget_copy_object(hid_t plist_id, unsigned *cpy_option /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, cpy_option); + H5TRACE2("e", "i*Iu", plist_id, cpy_option); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) @@ -839,7 +838,7 @@ H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func /*out*/, void * herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", plist_id, func, op_data); + H5TRACE3("e", "i*Os**x", plist_id, func, op_data); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) diff --git a/src/H5Pstrcpl.c b/src/H5Pstrcpl.c index 86c3754844f..58cfa4c6645 100644 --- a/src/H5Pstrcpl.c +++ b/src/H5Pstrcpl.c @@ -31,7 +31,6 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ -#include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ /****************/ @@ -175,7 +174,7 @@ H5Pget_char_encoding(hid_t plist_id, H5T_cset_t *encoding /*out*/) herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "ix", plist_id, encoding); + H5TRACE2("e", "i*Tc", plist_id, encoding); /* Get the plist structure */ if (NULL == (plist = H5P_object_verify(plist_id, H5P_STRING_CREATE))) diff --git a/src/H5Ptest.c b/src/H5Ptest.c index 5d2446c5d39..f52a3702100 100644 --- a/src/H5Ptest.c +++ b/src/H5Ptest.c @@ -22,7 +22,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5Ppkg.h" /* Property lists */ -#include "H5Dprivate.h" /* Dataset */ /* Local variables */ diff --git a/src/H5R.c b/src/H5R.c index 8f0717460e2..3a91b926a17 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -28,7 +28,6 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5ESprivate.h" /* Event Sets */ #include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Rpkg.h" /* References */ #include "H5Sprivate.h" /* Dataspaces */ #include "H5VLprivate.h" /* Virtual Object Layer */ @@ -980,7 +979,7 @@ H5Rget_obj_type3(H5R_ref_t *ref_ptr, hid_t rapl_id, H5O_type_t *obj_type /*out*/ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "*Rrix", ref_ptr, rapl_id, obj_type); + H5TRACE3("e", "*Rri*Ot", ref_ptr, rapl_id, obj_type); /* Check args */ if (ref_ptr == NULL) @@ -1039,7 +1038,7 @@ H5Rget_file_name(const H5R_ref_t *ref_ptr, char *buf /*out*/, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "*Rrxz", ref_ptr, buf, size); + H5TRACE3("Zs", "*Rr*sz", ref_ptr, buf, size); /* Check args */ if (ref_ptr == NULL) @@ -1105,7 +1104,7 @@ H5Rget_obj_name(H5R_ref_t *ref_ptr, hid_t rapl_id, char *buf /*out*/, size_t siz ssize_t ret_value = 0; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE4("Zs", "*Rrixz", ref_ptr, rapl_id, buf, size); + H5TRACE4("Zs", "*Rri*sz", ref_ptr, rapl_id, buf, size); /* Check args */ if (ref_ptr == NULL) @@ -1167,7 +1166,7 @@ H5Rget_attr_name(const H5R_ref_t *ref_ptr, char *buf /*out*/, size_t size) ssize_t ret_value; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE3("Zs", "*Rrxz", ref_ptr, buf, size); + H5TRACE3("Zs", "*Rr*sz", ref_ptr, buf, size); /* Check args */ if (ref_ptr == NULL) 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/H5Rdeprec.c b/src/H5Rdeprec.c index 1d12ebae25a..90869cf3ab1 100644 --- a/src/H5Rdeprec.c +++ b/src/H5Rdeprec.c @@ -36,7 +36,6 @@ /* Private headers needed by this file */ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5Gprivate.h" /* Groups */ @@ -528,7 +527,7 @@ H5Rget_obj_type2(hid_t id, H5R_type_t ref_type, const void *ref, H5O_type_t *obj herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "iRt*xx", id, ref_type, ref, obj_type); + H5TRACE4("e", "iRt*x*Ot", id, ref_type, ref, obj_type); /* Check args */ if (buf == NULL) @@ -766,7 +765,7 @@ H5Rget_name(hid_t id, H5R_type_t ref_type, const void *ref, char *name /*out*/, ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_API((-1)) - H5TRACE5("Zs", "iRt*xxz", id, ref_type, ref, name, size); + H5TRACE5("Zs", "iRt*x*sz", id, ref_type, ref, name, size); /* Check args */ if (buf == NULL) diff --git a/src/H5Rint.c b/src/H5Rint.c index 6a84f1cb726..4606a57d3f7 100644 --- a/src/H5Rint.c +++ b/src/H5Rint.c @@ -20,18 +20,14 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ -#include "H5Gprivate.h" /* Groups */ #include "H5HGprivate.h" /* Global Heaps */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Rpkg.h" /* References */ #include "H5Sprivate.h" /* Dataspaces */ -#include "H5Tprivate.h" /* Datatypes */ #include "H5VLnative_private.h" /* Native VOL connector */ diff --git a/src/H5S.c b/src/H5S.c index 9bfe6f59dbf..1345e0d5634 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -876,7 +876,7 @@ H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[] /*out*/, hsize_t maxdim int ret_value = -1; FUNC_ENTER_API((-1)) - H5TRACE3("Is", "ixx", space_id, dims, maxdims); + H5TRACE3("Is", "i*h*h", space_id, dims, maxdims); /* Check args */ if (NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c index d021a482cb0..6165d664f38 100644 --- a/src/H5SMbtree2.c +++ b/src/H5SMbtree2.c @@ -22,7 +22,7 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Opkg.h" /* Object Headers */ #include "H5SMpkg.h" /* Shared object header messages */ diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 029e402bad3..77f1eef222e 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -31,10 +31,8 @@ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ #include "H5FLprivate.h" /* Free Lists */ -#include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ #include "H5SMpkg.h" /* Shared object header messages */ -#include "H5WBprivate.h" /* Wrapped Buffers */ /****************/ /* Local Macros */ diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 64f5c76937f..439954a1db3 100644 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -29,6 +29,7 @@ #include "H5ACprivate.h" /* Metadata Cache */ #include "H5B2private.h" /* B-trees */ #include "H5HFprivate.h" /* Fractal heaps */ +#include "H5FLprivate.h" /* Free Lists */ /****************************/ /* Package Macros */ diff --git a/src/H5SMtest.c b/src/H5SMtest.c index f306b892079..bde1d1d5e9c 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -24,7 +24,6 @@ #include "H5ACprivate.h" /* Metadata cache */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* File access */ -#include "H5FLprivate.h" /* Free Lists */ #include "H5SMpkg.h" /* Shared object header messages */ /****************/ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index ebfb4ef647c..291742e37cb 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -4820,7 +4820,7 @@ H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numbloc herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ihhx", spaceid, startblock, numblocks, buf); + H5TRACE4("e", "ihh*[a2]h", spaceid, startblock, numblocks, buf); /* Check args */ if (buf == NULL) @@ -12430,7 +12430,7 @@ H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[] /*out*/, hsize_t stride[ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE5("e", "ixxxx", spaceid, start, stride, count, block); + H5TRACE5("e", "i*h*h*h*h", spaceid, start, stride, count, block); /* Check args */ if (NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 46e6c338427..96b20400ac5 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -645,10 +645,7 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, if (sel_iter->u.hyp.iter_rank != 0 && sel_iter->u.hyp.iter_rank < space->extent.rank) { /* Flattened selection */ rank = sel_iter->u.hyp.iter_rank; -#ifdef H5S_DEBUG - if (H5DEBUG(S)) - fprintf(H5DEBUG(S), "%s: Flattened selection\n", __func__); -#endif + for (u = 0; u < rank; ++u) { H5_CHECK_OVERFLOW(diminfo[u].start, hsize_t, hssize_t); d[u].start = (hssize_t)diminfo[u].start + sel_iter->u.hyp.sel_off[u]; @@ -657,32 +654,16 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, d[u].count = diminfo[u].count; d[u].xtent = sel_iter->u.hyp.size[u]; -#ifdef H5S_DEBUG - if (H5DEBUG(S)) { - fprintf(H5DEBUG(S), - "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE - " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE, - __func__, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent); - if (u == 0) - fprintf(H5DEBUG(S), " rank=%u\n", rank); - else - fprintf(H5DEBUG(S), "\n"); - } -#endif - /* Sanity check */ assert(d[u].block > 0); assert(d[u].count > 0); assert(d[u].xtent > 0); - } /* end for */ - } /* end if */ + } + } else { /* Non-flattened selection */ rank = space->extent.rank; -#ifdef H5S_DEBUG - if (H5DEBUG(S)) - fprintf(H5DEBUG(S), "%s: Non-flattened selection\n", __func__); -#endif + for (u = 0; u < rank; ++u) { H5_CHECK_OVERFLOW(diminfo[u].start, hsize_t, hssize_t); d[u].start = (hssize_t)diminfo[u].start + space->select.offset[u]; @@ -691,25 +672,12 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, d[u].count = diminfo[u].count; d[u].xtent = space->extent.size[u]; -#ifdef H5S_DEBUG - if (H5DEBUG(S)) { - fprintf(H5DEBUG(S), - "%s: start=%" PRIdHSIZE " stride=%" PRIuHSIZE " count=%" PRIuHSIZE - " block=%" PRIuHSIZE " xtent=%" PRIuHSIZE, - __func__, d[u].start, d[u].strid, d[u].count, d[u].block, d[u].xtent); - if (u == 0) - fprintf(H5DEBUG(S), " rank=%u\n", rank); - else - fprintf(H5DEBUG(S), "\n"); - } -#endif - /* Sanity check */ assert(d[u].block > 0); assert(d[u].count > 0); assert(d[u].xtent > 0); - } /* end for */ - } /* end else */ + } + } /********************************************************************** Compute array "offset[rank]" which gives the offsets for a multi- @@ -717,22 +685,11 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, **********************************************************************/ offset[rank - 1] = 1; max_xtent[rank - 1] = d[rank - 1].xtent; -#ifdef H5S_DEBUG - if (H5DEBUG(S)) { - i = ((int)rank) - 1; - fprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], i, - max_xtent[i]); - } -#endif + for (i = ((int)rank) - 2; i >= 0; --i) { offset[i] = offset[i + 1] * d[i + 1].xtent; max_xtent[i] = max_xtent[i + 1] * d[i].xtent; -#ifdef H5S_DEBUG - if (H5DEBUG(S)) - fprintf(H5DEBUG(S), " offset[%2d]=%" PRIuHSIZE "; max_xtent[%2d]=%" PRIuHSIZE "\n", i, offset[i], - i, max_xtent[i]); -#endif - } /* end for */ + } /* Create a type covering the selected hyperslab. * Multidimensional dataspaces are stored in row-major order. @@ -740,16 +697,9 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, * fastest-changing (i.e., inner) dimension * to the slowest (outer). */ -/******************************************************* - * Construct contig type for inner contig dims: - *******************************************************/ -#ifdef H5S_DEBUG - if (H5DEBUG(S)) { - fprintf(H5DEBUG(S), "%s: Making contig type %zu MPI_BYTEs\n", __func__, elmt_size); - for (i = ((int)rank) - 1; i >= 0; --i) - fprintf(H5DEBUG(S), "d[%d].xtent=%" PRIuHSIZE "\n", i, d[i].xtent); - } -#endif + /******************************************************* + * Construct contig type for inner contig dims: + *******************************************************/ /* LARGE_DATATYPE:: * Check if the number of elements to form the inner type fits into a 32 bit integer. @@ -773,19 +723,7 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, * from the inside out: *******************************************************/ for (i = ((int)rank) - 1; i >= 0; --i) { -#ifdef H5S_DEBUG - if (H5DEBUG(S)) - fprintf(H5DEBUG(S), - "%s: Dimension i=%d \n" - "start=%" PRIdHSIZE " count=%" PRIuHSIZE " block=%" PRIuHSIZE " stride=%" PRIuHSIZE - ", xtent=%" PRIuHSIZE " max_xtent=%" PRIuHSIZE "\n", - __func__, i, d[i].start, d[i].count, d[i].block, d[i].strid, d[i].xtent, max_xtent[i]); -#endif - -#ifdef H5S_DEBUG - if (H5DEBUG(S)) - fprintf(H5DEBUG(S), "%s: i=%d Making vector-type \n", __func__, i); -#endif + /**************************************** * Build vector type of the selection. ****************************************/ @@ -919,11 +857,6 @@ H5S__mpio_reg_hyper_type(H5S_t *space, size_t elmt_size, MPI_Datatype *new_type, sel_iter = H5FL_FREE(H5S_sel_iter_t, sel_iter); } -#ifdef H5S_DEBUG - if (H5DEBUG(S)) - fprintf(H5DEBUG(S), "Leave %s, count=%d is_derived_type=%s\n", __func__, *count, - (*is_derived_type) ? "TRUE" : "FALSE"); -#endif FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__mpio_reg_hyper_type() */ diff --git a/src/H5Snone.c b/src/H5Snone.c index c4fdd4c670d..9e1ac8a8bef 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -23,11 +23,10 @@ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* ID Functions */ -#include "H5Spkg.h" /* Dataspace functions */ -#include "H5VMprivate.h" /* Vector functions */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* ID Functions */ +#include "H5Spkg.h" /* Dataspace functions */ /****************/ /* 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/H5Spoint.c b/src/H5Spoint.c index 8897d8ce136..0e07869ea25 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -1624,7 +1624,7 @@ H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoint herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "ihhx", spaceid, startpoint, numpoints, buf); + H5TRACE4("e", "ihh*[a2]h", spaceid, startpoint, numpoints, buf); /* Check args */ if (NULL == buf) 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 13440cd64f5..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) @@ -596,7 +595,7 @@ H5Sget_select_bounds(hid_t spaceid, hsize_t start[] /*out*/, hsize_t end[] /*out herr_t ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "ixx", spaceid, start, end); + H5TRACE3("e", "i*h*h", spaceid, start, end); /* Check args */ if (start == NULL || end == NULL) @@ -2901,7 +2900,7 @@ H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxelmts, size herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE7("e", "izzxxxx", sel_iter_id, maxseq, maxelmts, nseq, nelmts, off, len); + H5TRACE7("e", "izz*z*z*h*z", sel_iter_id, maxseq, maxelmts, nseq, nelmts, off, len); /* Check args */ if (NULL == (sel_iter = (H5S_sel_iter_t *)H5I_object_verify(sel_iter_id, H5I_SPACE_SEL_ITER))) 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 d6655668d65..91d9b42d95b 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) \ { \ @@ -350,12 +374,13 @@ static H5T_path_t *H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const H5T_conv_func_t *conv); static bool H5T_path_match(H5T_path_t *path, H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5VL_object_t *owned_vol_obj, H5T_conv_t func); -static bool H5T__detect_vlen_ref(const H5T_t *dt); -static H5T_t *H5T__initiate_copy(const H5T_t *old_dt); -static H5T_t *H5T__copy_transient(H5T_t *old_dt); -static H5T_t *H5T__copy_all(H5T_t *old_dt); -static herr_t H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo, - bool set_memory_type, H5T_copy_func_t copyfn); +static bool H5T_path_match_find_type_with_volobj(const H5T_t *datatype, const H5VL_object_t *owned_vol_obj); +static bool H5T__detect_vlen_ref(const H5T_t *dt); +static H5T_t *H5T__initiate_copy(const H5T_t *old_dt); +static H5T_t *H5T__copy_transient(H5T_t *old_dt); +static H5T_t *H5T__copy_all(H5T_t *old_dt); +static herr_t H5T__complete_copy(H5T_t *new_dt, const H5T_t *old_dt, H5T_shared_t *reopened_fo, + bool set_memory_type, H5T_copy_func_t copyfn); /*****************************/ /* Library Private Variables */ @@ -374,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 @@ -497,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; @@ -532,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; @@ -683,6 +721,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() */ @@ -736,6 +817,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) @@ -777,6 +861,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))) @@ -821,6 +909,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) @@ -1060,6 +1154,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 |= @@ -1218,6 +1328,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 |= @@ -1226,6 +1340,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 |= @@ -1234,6 +1352,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 |= @@ -1242,23 +1364,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 |= @@ -1267,6 +1405,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 |= @@ -1277,6 +1419,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 |= @@ -1287,6 +1433,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 |= @@ -1295,6 +1445,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 |= @@ -1303,6 +1457,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 |= @@ -1311,6 +1469,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 |= @@ -1319,23 +1481,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 |= @@ -1344,6 +1522,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 |= @@ -1354,6 +1536,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 |= @@ -1364,6 +1550,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 @@ -1482,8 +1672,8 @@ H5T_top_term_package(void) H5T__print_stats(path, &nprint /*in,out*/); path->cdata.command = H5T_CONV_FREE; if (path->conv.is_app) { - if ((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, - (size_t)0, (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + if ((path->conv.u.app_func)(H5I_INVALID_HID, H5I_INVALID_HID, &(path->cdata), 0, 0, 0, + NULL, NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { fprintf(H5DEBUG(T), @@ -1497,8 +1687,7 @@ H5T_top_term_package(void) } /* end if */ } /* end if */ else { - if ((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, - (size_t)0, (size_t)0, NULL, NULL) < 0) { + if ((path->conv.u.lib_func)(NULL, NULL, &(path->cdata), NULL, 0, 0, 0, NULL, NULL) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { fprintf(H5DEBUG(T), @@ -1545,99 +1734,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 */ @@ -2441,12 +2633,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 * @@ -2455,13 +2647,16 @@ H5T__register_int(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T static herr_t H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_conv_func_t *conv) { - hid_t tmp_sid = -1, tmp_did = -1; /*temporary data type IDs */ - H5T_path_t *old_path = NULL; /*existing conversion path */ - H5T_path_t *new_path = NULL; /*new conversion path */ - H5T_cdata_t cdata; /*temporary conversion data */ - int nprint = 0; /*number of paths shut down */ - int i; /*counter */ - herr_t ret_value = SUCCEED; /*return value */ + H5T_path_t *old_path = NULL; /*existing conversion path */ + H5T_path_t *new_path = NULL; /*new conversion path */ + H5T_cdata_t cdata; /*temporary conversion data */ + H5T_t *tmp_stype = NULL; /*temporary source datatype */ + H5T_t *tmp_dtype = NULL; /*temporary destination datatype */ + hid_t tmp_sid = H5I_INVALID_HID; /*temporary datatype ID */ + hid_t tmp_did = H5I_INVALID_HID; /*temporary datatype ID */ + int nprint = 0; /*number of paths shut down */ + int i; /*counter */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_PACKAGE @@ -2491,6 +2686,17 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con } /* end if */ } /* end if */ else { + H5T_conv_ctx_t tmp_ctx = {0}; + + /* + * Get the datatype conversion exception callback structure. + * Note that we have to first check if an API context has been + * pushed, since we could have arrived here during library + * initialization of the H5T package. + */ + if (!conv->is_app && H5CX_pushed() && (H5CX_get_dt_conv_cb(&tmp_ctx.u.init.cb_struct) < 0)) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); + /* Add function to end of soft list */ if ((size_t)H5T_g.nsoft >= H5T_g.asoft) { size_t na = MAX(32, 2 * H5T_g.asoft); @@ -2522,28 +2728,39 @@ 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 ((tmp_sid = H5I_register(H5I_DATATYPE, H5T_copy(old_path->src, H5T_COPY_ALL), false)) < 0 || - (tmp_did = H5I_register(H5I_DATATYPE, H5T_copy(old_path->dst, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, - "unable to register data types for conv query"); memset(&cdata, 0, sizeof cdata); cdata.command = H5T_CONV_INIT; if (conv->is_app) { - if ((conv->u.app_func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, NULL, - H5CX_get_dxpl()) < 0) { - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); - tmp_sid = tmp_did = -1; - H5E_clear_stack(NULL); + 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"); + if ((tmp_did = H5I_register(H5I_DATATYPE, tmp_dtype, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "unable to register ID for destination datatype"); + + if ((conv->u.app_func)(tmp_sid, tmp_did, &cdata, 0, 0, 0, NULL, NULL, H5CX_get_dxpl()) < 0) { + if (H5I_dec_ref(tmp_sid) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, + "unable to decrement reference count on temporary ID"); + if (H5I_dec_ref(tmp_did) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, + "unable to decrement reference count on temporary ID"); + tmp_sid = tmp_did = H5I_INVALID_HID; + tmp_stype = tmp_dtype = NULL; + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "unable to clear current error stack"); continue; } /* end if */ } /* end if */ - else if ((conv->u.lib_func)(tmp_sid, tmp_did, &cdata, (size_t)0, (size_t)0, (size_t)0, NULL, - NULL) < 0) { - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); - tmp_sid = tmp_did = -1; - H5E_clear_stack(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; } /* end if */ @@ -2567,8 +2784,8 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con H5T__print_stats(old_path, &nprint); old_path->cdata.command = H5T_CONV_FREE; if (old_path->conv.is_app) { - if ((old_path->conv.u.app_func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + if ((old_path->conv.u.app_func)(tmp_sid, tmp_did, &(old_path->cdata), 0, 0, 0, NULL, NULL, + H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), @@ -2578,8 +2795,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_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, - (size_t)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), @@ -2588,34 +2805,61 @@ H5T__register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_con (size_t)old_path->conv.u.lib_func, old_path->name); #endif } /* end if */ - (void)H5T_close_real(old_path->src); - (void)H5T_close_real(old_path->dst); + + if (H5T_close_real(old_path->src) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close datatype"); + if (H5T_close_real(old_path->dst) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close datatype"); + old_path = H5FL_FREE(H5T_path_t, old_path); /* Release temporary atoms */ - H5I_dec_ref(tmp_sid); - H5I_dec_ref(tmp_did); - tmp_sid = tmp_did = -1; + if (tmp_sid >= 0) { + if (H5I_dec_ref(tmp_sid) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + tmp_sid = H5I_INVALID_HID; + 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; + } /* We don't care about any failures during the freeing process */ - H5E_clear_stack(NULL); + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "unable to clear current error stack"); } /* end for */ } /* end else */ done: if (ret_value < 0) { if (new_path) { - if (new_path->src) - (void)H5T_close_real(new_path->src); - if (new_path->dst) - (void)H5T_close_real(new_path->dst); + if (new_path->src && (H5T_close_real(new_path->src) < 0)) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close datatype"); + if (new_path->dst && (H5T_close_real(new_path->dst) < 0)) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close datatype"); new_path = H5FL_FREE(H5T_path_t, new_path); } /* end if */ - if (tmp_sid >= 0) - H5I_dec_ref(tmp_sid); - if (tmp_did >= 0) - H5I_dec_ref(tmp_did); - } /* end if */ + } /* end if */ + + if (tmp_sid >= 0) { + if (H5I_dec_ref(tmp_sid) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + } + else if (tmp_stype) { + if (H5T_close(tmp_stype) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + } + if (tmp_did >= 0) { + if (H5I_dec_ref(tmp_did) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + } + else if (tmp_dtype) { + if (H5T_close(tmp_dtype) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__register() */ @@ -2757,8 +3001,8 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5VL_o H5T__print_stats(path, &nprint); path->cdata.command = H5T_CONV_FREE; if (path->conv.is_app) { - if ((path->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + if ((path->conv.u.app_func)(H5I_INVALID_HID, H5I_INVALID_HID, &(path->cdata), 0, 0, 0, NULL, + NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), @@ -2768,8 +3012,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5VL_o #endif } /* end if */ } /* end if */ - else if ((path->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL) < 0) { + else if ((path->conv.u.lib_func)(NULL, NULL, &(path->cdata), NULL, 0, 0, 0, NULL, NULL) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), @@ -2846,7 +3089,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata /*out*/) H5T_conv_t ret_value; /* Return value */ FUNC_ENTER_API(NULL) - H5TRACE3("TC", "iix", src_id, dst_id, pcdata); + H5TRACE3("TC", "ii**!", src_id, dst_id, pcdata); /* Check args */ if (NULL == (src = (H5T_t *)H5I_object_verify(src_id, H5I_DATATYPE)) || @@ -2951,7 +3194,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, void *backgroun if (NULL == (tpath = H5T_path_find(src, dst))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to convert between src and dst data types"); - if (H5T_convert(tpath, src_id, dst_id, nelmts, (size_t)0, (size_t)0, buf, background) < 0) + if (H5T_convert(tpath, src, dst, nelmts, 0, 0, buf, background) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); done: @@ -2973,15 +3216,18 @@ 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) { - 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); /* Check args */ - if (H5I_DATATYPE != H5I_get_type(type_id) || buf == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid argument"); + if (buf == NULL) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "'buf' pointer is NULL"); + 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"); if (!(H5S_has_extent(space))) @@ -2997,7 +3243,7 @@ H5Treclaim(hid_t type_id, hid_t space_id, hid_t dxpl_id, void *buf) H5CX_set_dxpl(dxpl_id); /* Call internal routine */ - ret_value = H5T_reclaim(type_id, space, buf); + ret_value = H5T_reclaim(type, space, buf); done: FUNC_LEAVE_API(ret_value) @@ -3912,14 +4158,16 @@ H5T__free(H5T_t *dt) /* Don't free locked datatypes */ if (H5T_STATE_IMMUTABLE == dt->shared->state) - HGOTO_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to close immutable datatype"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close immutable datatype"); /* Close the datatype */ switch (dt->shared->type) { case H5T_COMPOUND: for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { dt->shared->u.compnd.memb[i].name = (char *)H5MM_xfree(dt->shared->u.compnd.memb[i].name); - (void)H5T_close_real(dt->shared->u.compnd.memb[i].type); + if (H5T_close_real(dt->shared->u.compnd.memb[i].type) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, + "unable to close datatype for compound member"); } dt->shared->u.compnd.memb = (H5T_cmemb_t *)H5MM_xfree(dt->shared->u.compnd.memb); dt->shared->u.compnd.nmembs = 0; @@ -4207,7 +4455,8 @@ H5T__set_size(H5T_t *dt, size_t size) /* Get a copy of unsigned char type as the base/parent type */ if (NULL == (base = (H5T_t *)H5I_object(H5T_NATIVE_UCHAR))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid base datatype"); - dt->shared->parent = H5T_copy(base, H5T_COPY_ALL); + if (NULL == (dt->shared->parent = H5T_copy(base, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy base datatype"); /* change this datatype into a VL string */ dt->shared->type = H5T_VLEN; @@ -4809,11 +5058,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. @@ -4852,17 +5101,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. @@ -4875,16 +5124,20 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst) static H5T_path_t * H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_conv_func_t *conv) { - int lt, rt; /* left and right edges */ - int md; /* middle */ - int cmp; /* comparison result */ - int old_npaths; /* Previous number of paths in table */ - H5T_path_t *table = NULL; /* path existing in the table */ - H5T_path_t *path = NULL; /* new path */ - hid_t src_id = -1, dst_id = -1; /* src and dst type identifiers */ - int i; /* counter */ - int nprint = 0; /* lines of output printed */ - H5T_path_t *ret_value = NULL; /* Return value */ + H5T_conv_ctx_t tmp_ctx = {0}; /* temporary conversion context object */ + int lt, rt; /* left and right edges */ + int md; /* middle */ + int cmp; /* comparison result */ + int old_npaths; /* Previous number of paths in table */ + H5T_path_t *table = NULL; /* path existing in the table */ + H5T_path_t *path = NULL; /* new path */ + H5T_t *tmp_stype = NULL; /* temporary source datatype */ + H5T_t *tmp_dtype = NULL; /* temporary destination datatype */ + hid_t src_id = H5I_INVALID_HID; /* source datatype identifier */ + hid_t dst_id = H5I_INVALID_HID; /* destination datatype identifier */ + int i; /* counter */ + int nprint = 0; /* lines of output printed */ + H5T_path_t *ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE @@ -4894,6 +5147,15 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co assert(dst); assert(dst->shared); + /* + * Get the datatype conversion exception callback structure. + * Note that we have to first check if an API context has been + * pushed, since we could have arrived here during library + * initialization of the H5T package. + */ + if (H5CX_pushed() && (H5CX_get_dt_conv_cb(&tmp_ctx.u.init.cb_struct) < 0)) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, NULL, "unable to get conversion exception callback"); + /* * Make sure the first entry in the table is the no-op conversion path. */ @@ -4909,14 +5171,15 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co H5T_g.path[0]->conv.is_app = false; H5T_g.path[0]->conv.u.lib_func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if (H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, - NULL, NULL) < 0) { + if (H5T__conv_noop(NULL, NULL, &(H5T_g.path[0]->cdata), &tmp_ctx, 0, 0, 0, NULL, NULL) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); #endif - H5E_clear_stack(NULL); /*ignore the error*/ - } /* end if */ + /* Ignore any errors from the conversion function */ + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, NULL, "unable to clear current error stack"); + } /* end if */ H5T_g.path[0]->is_noop = true; H5T_g.npaths = 1; } /* end if */ @@ -4992,28 +5255,46 @@ 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 && (src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, - "unable to register source conversion type for query"); - if (path->dst && (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, - "unable to register destination conversion type for query"); + path->cdata.command = H5T_CONV_INIT; if (conv->is_app) { - if ((conv->u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, - NULL, H5CX_get_dxpl()) < 0) + /* 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"); + if (tmp_dtype && ((dst_id = H5I_register(H5I_DATATYPE, tmp_dtype, false)) < 0)) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, + "unable to register ID for destination datatype"); + + 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)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, (size_t)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) - H5I_dec_ref(src_id); - if (dst_id >= 0) - H5I_dec_ref(dst_id); - src_id = dst_id = -1; - path->conv = *conv; - path->is_hard = true; + + if (src_id >= 0) { + if (H5I_dec_ref(src_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, NULL, "can't decrement reference on temporary ID"); + src_id = H5I_INVALID_HID; + 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; + } + + path->conv = *conv; + path->is_hard = true; } /* end if */ /* @@ -5028,25 +5309,44 @@ 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; - if ((src_id = H5I_register(H5I_DATATYPE, H5T_copy(path->src, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, - "unable to register src conversion type for query"); - if ((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(path->dst, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, - "unable to register dst conversion type for query"); + path->cdata.command = H5T_CONV_INIT; if (H5T_g.soft[i].conv.is_app) { - if ((H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + /* 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"); + if ((dst_id = H5I_register(H5I_DATATYPE, tmp_dtype, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, NULL, + "unable to register ID for destination datatype"); + + if ((H5T_g.soft[i].conv.u.app_func)(src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, NULL, + H5CX_get_dxpl()) < 0) { memset(&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear_stack(NULL); /*ignore the error*/ + /*ignore the error*/ + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, NULL, "unable to clear current error stack"); path_init_error = true; } /* end if */ } /* end if */ - else if ((H5T_g.soft[i].conv.u.lib_func)(src_id, dst_id, &(path->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL) < 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)); - H5E_clear_stack(NULL); /*ignore the error*/ + /*ignore the error*/ + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, NULL, "unable to clear current error stack"); path_init_error = true; } /* end if */ @@ -5057,9 +5357,19 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co path->conv = H5T_g.soft[i].conv; path->is_hard = false; } /* end else */ - H5I_dec_ref(src_id); - H5I_dec_ref(dst_id); - src_id = dst_id = -1; + + if (src_id >= 0) { + if (H5I_dec_ref(src_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDEC, NULL, "can't decrement reference on temporary ID"); + src_id = H5I_INVALID_HID; + 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; + } } /* end for */ if (!path->conv.u.app_func) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no appropriate function for conversion path"); @@ -5093,29 +5403,32 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co H5T__print_stats(table, &nprint /*in,out*/); table->cdata.command = H5T_CONV_FREE; if (table->conv.is_app) { - if ((table->conv.u.app_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL, H5CX_get_dxpl()) < 0) { + if ((table->conv.u.app_func)(H5I_INVALID_HID, H5I_INVALID_HID, &(table->cdata), 0, 0, 0, NULL, + NULL, H5CX_get_dxpl()) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), "H5T: conversion function 0x%016zx free failed for %s (ignored)\n", (size_t)path->conv.u.app_func, path->name); #endif - H5E_clear_stack(NULL); /*ignore the failure*/ - } /* end if */ - } /* end if */ - else if ((table->conv.u.lib_func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, - (size_t)0, NULL, NULL) < 0) { + /*ignore the failure*/ + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, NULL, "unable to clear current error stack"); + } /* end if */ + } /* end if */ + else if ((table->conv.u.lib_func)(NULL, NULL, &(table->cdata), NULL, 0, 0, 0, NULL, NULL) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) fprintf(H5DEBUG(T), "H5T: conversion function 0x%016zx free failed for %s (ignored)\n", (size_t)path->conv.u.lib_func, path->name); #endif - H5E_clear_stack(NULL); /*ignore the failure*/ - } /* end if */ - if (table->src) - (void)H5T_close_real(table->src); - if (table->dst) - (void)H5T_close_real(table->dst); + /*ignore the failure*/ + if (H5E_clear_stack(NULL) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, NULL, "unable to clear current error stack"); + } /* end if */ + if (table->src && (H5T_close_real(table->src) < 0)) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close datatype"); + if (table->dst && (H5T_close_real(table->dst) < 0)) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close datatype"); table = H5FL_FREE(H5T_path_t, table); table = path; H5T_g.path[md] = path; @@ -5139,29 +5452,34 @@ 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; done: if (!ret_value && path && path != table) { - if (path->src) - (void)H5T_close_real(path->src); - if (path->dst) - (void)H5T_close_real(path->dst); + if (path->src && (H5T_close_real(path->src) < 0)) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close datatype"); + if (path->dst && (H5T_close_real(path->dst) < 0)) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close datatype"); path = H5FL_FREE(H5T_path_t, path); } /* end if */ - if (src_id >= 0) - H5I_dec_ref(src_id); - if (dst_id >= 0) - H5I_dec_ref(dst_id); + + if (src_id >= 0) { + if (H5I_dec_ref(src_id) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, NULL, "can't decrement reference on temporary ID"); + } + else if (tmp_stype) { + if (H5T_close(tmp_stype) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); + } + if (dst_id >= 0) { + if (H5I_dec_ref(dst_id) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, NULL, "can't decrement reference on temporary ID"); + } + else if (tmp_dtype) { + if (H5T_close(tmp_dtype) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "can't close temporary datatype"); + } FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__path_find_real() */ @@ -5182,10 +5500,10 @@ H5T_path_match(H5T_path_t *path, H5T_pers_t pers, const char *name, H5T_t *src, { bool ret_value = true; - assert(path); - FUNC_ENTER_NOAPI_NOINIT_NOERR + assert(path); + if ( /* Check that the specified conversion function persistence matches */ ((H5T_PERS_SOFT == pers && path->is_hard) || (H5T_PERS_HARD == pers && !path->is_hard)) || @@ -5200,11 +5518,12 @@ H5T_path_match(H5T_path_t *path, H5T_pers_t pers, const char *name, H5T_t *src, (src && H5T_cmp(src, path->src, false)) || (dst && H5T_cmp(dst, path->dst, false)) || /* - * Check that the specified VOL object matches the VOL object - * in the conversion path + * Check that the specified VOL object pointer matches the `owned_vol_obj` + * field for either the source datatype or destination datatype in the + * conversion path */ - (owned_vol_obj && (owned_vol_obj != path->src->shared->owned_vol_obj) && - (owned_vol_obj != path->dst->shared->owned_vol_obj)) || + (owned_vol_obj && (H5T_path_match_find_type_with_volobj(path->src, owned_vol_obj) == false) && + (H5T_path_match_find_type_with_volobj(path->dst, owned_vol_obj) == false)) || /* Check that the specified conversion function matches */ (func && func != path->conv.u.app_func)) @@ -5213,6 +5532,70 @@ H5T_path_match(H5T_path_t *path, H5T_pers_t pers, const char *name, H5T_t *src, FUNC_LEAVE_NOAPI(ret_value) } /* H5T_path_match() */ +/*------------------------------------------------------------------------- + * Function: H5T_path_match_find_type_with_volobj + * + * Purpose: Helper function to determine whether a datatype is or + * contains a datatype that has a VOL object pointer matching + * the given VOL object pointer. + * + * Return: true/false (can't fail) + * + *------------------------------------------------------------------------- + */ +static bool +H5T_path_match_find_type_with_volobj(const H5T_t *datatype, const H5VL_object_t *owned_vol_obj) +{ + bool ret_value = false; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + assert(datatype); + assert(owned_vol_obj); + + ret_value = (datatype->shared->owned_vol_obj == owned_vol_obj); + if (!ret_value) { + switch (datatype->shared->type) { + case H5T_COMPOUND: + for (unsigned i = 0; i < datatype->shared->u.compnd.nmembs; i++) { + if (ret_value) + break; + ret_value = H5T_path_match_find_type_with_volobj(datatype->shared->u.compnd.memb[i].type, + owned_vol_obj); + } + break; + + case H5T_VLEN: + /* Should be an error if no parent, but simplify logic for a true/false return value */ + if (datatype->shared->parent) + ret_value = H5T_path_match_find_type_with_volobj(datatype->shared->parent, owned_vol_obj); + break; + + case H5T_ARRAY: + /* Should be an error if no parent, but simplify logic for a true/false return value */ + if (datatype->shared->parent) + ret_value = H5T_path_match_find_type_with_volobj(datatype->shared->parent, owned_vol_obj); + break; + + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: /* Should have been determined by above check */ + case H5T_ENUM: + case H5T_NO_CLASS: /* Error value, but simplify logic for a true/false return value */ + case H5T_NCLASSES: /* Error value, but simplify logic for a true/false return value */ + default: + ret_value = false; + break; + } + } + + FUNC_LEAVE_NOAPI(ret_value) +} + /*------------------------------------------------------------------------- * Function: H5T_path_noop * @@ -5336,13 +5719,16 @@ H5T__compiler_conv(H5T_t *src, H5T_t *dst) *------------------------------------------------------------------------- */ herr_t -H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, 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}; #ifdef H5T_DEBUG - H5_timer_t timer; /* Timer for conversion */ + H5_timer_t timer = {0}; /* Timer for conversion */ #endif - herr_t ret_value = SUCCEED; /* Return value */ + hid_t src_type_id = H5I_INVALID_HID; + hid_t dst_type_id = H5I_INVALID_HID; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -5354,16 +5740,42 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t } /* end if */ #endif - /* Call the appropriate conversion callback */ - tpath->cdata.command = H5T_CONV_CONV; - if (tpath->conv.is_app) { - if ((tpath->conv.u.app_func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, - bkg, H5CX_get_dxpl()) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); - } /* end if */ - else if ((tpath->conv.u.lib_func)(src_id, dst_id, &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, - bkg) < 0) + /* Get the datatype conversion exception callback structure from the API context */ + if (H5CX_get_dt_conv_cb(&conv_ctx.u.conv.cb_struct) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); + + /* + * If this is an application conversion function or an exception callback + * function was supplied, register IDs for the datatypes so we can pass + * those as appropriate. Also grab the DXPL if necessary so we can pass + * that to the app conversion function. + */ + if (tpath->conv.is_app || conv_ctx.u.conv.cb_struct.func) { + if ((src_type_id = H5I_register(H5I_DATATYPE, src_type, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register ID for source datatype"); + if ((dst_type_id = H5I_register(H5I_DATATYPE, dst_type, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "unable to register ID for destination datatype"); + + if (tpath->conv.is_app) + conv_ctx.u.conv.dxpl_id = H5CX_get_dxpl(); + } + conv_ctx.u.conv.src_type_id = src_type_id; + conv_ctx.u.conv.dst_type_id = dst_type_id; + + if (H5T_convert_with_ctx(tpath, src_type, dst_type, &conv_ctx, nelmts, buf_stride, bkg_stride, buf, bkg) < + 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); + +done: + /* Remove IDs, but don't decrement their reference counts, as they + * could have been registered for datatypes that weren't copied + */ + if ((src_type_id >= 0) && (NULL == H5I_remove(src_type_id))) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't decrement temporary datatype ID"); + if ((dst_type_id >= 0) && (NULL == H5I_remove(dst_type_id))) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't decrement temporary datatype ID"); + #ifdef H5T_DEBUG if (H5DEBUG(T)) { /* Stop timer */ @@ -5378,10 +5790,52 @@ H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id, size_t nelmts, size_t } /* end if */ #endif -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_convert() */ +/*------------------------------------------------------------------------- + * Function: H5T_convert_with_ctx + * + * Purpose: Helper routine for H5T_convert that accepts a pointer to a + * H5T_conv_ctx_t conversion context structure. Useful for + * conversion routines involving container datatypes, such as + * compounds, where the conversion context structure that was + * setup during the initial H5T_convert call can be reused. + * This avoids the expensive and unnecessary overhead of + * recreating this structure and possibly re-registering IDs for + * the source and destination datatypes for every single member + * of the container datatype and every single element being + * converted that consists of that container datatype. + * + * Return: Non-negative on success/Negative on failure + * + *------------------------------------------------------------------------- + */ +herr_t +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; + + FUNC_ENTER_NOAPI(FAIL) + + /* Call the appropriate conversion callback */ + tpath->cdata.command = H5T_CONV_CONV; + if (tpath->conv.is_app) { + if ((tpath->conv.u.app_func)(conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, + &(tpath->cdata), nelmts, buf_stride, bkg_stride, buf, bkg, + conv_ctx->u.conv.dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); + } /* end if */ + else if ((tpath->conv.u.lib_func)(src_type, dst_type, &(tpath->cdata), conv_ctx, nelmts, buf_stride, + bkg_stride, buf, bkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_convert_with_ctx() */ + /*------------------------------------------------------------------------- * Function: H5T_oloc * diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 423baf9d209..fefc57472d9 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -245,7 +245,7 @@ H5Tget_array_dims2(hid_t type_id, hsize_t dims[] /*out*/) int ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("Is", "ix", type_id, dims); + H5TRACE2("Is", "i*h", type_id, dims); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) @@ -364,7 +364,7 @@ H5Tget_array_dims1(hid_t type_id, hsize_t dims[] /*out*/, int H5_ATTR_UNUSED per int ret_value; /* return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("Is", "ixx", type_id, dims, perm); + H5TRACE3("Is", "i*h*Is", type_id, dims, perm); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) diff --git a/src/H5Tbit.c b/src/H5Tbit.c index dd852a6b3dd..c8300b85cde 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -19,7 +19,6 @@ #include "H5private.h" /*generic functions */ #include "H5Eprivate.h" /*error handling */ -#include "H5MMprivate.h" /* Memory management */ #include "H5Tpkg.h" /*data-type functions */ #include "H5WBprivate.h" /* Wrapped Buffers */ @@ -305,7 +304,8 @@ H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) case H5T_ORDER_NONE: case H5T_ORDER_MIXED: default: - HDabort(); + /* This function can't return errors */ + assert(0 && "unknown byte order"); } H5T__bit_copy(buf, offset, (uint8_t *)&val, (size_t)0, size); diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 70b0930fa90..5c4b4be9553 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -25,7 +25,6 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ #include "H5ESprivate.h" /* Event Sets */ diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index f877d5263ae..17ccc50ac7e 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -25,7 +25,6 @@ /* Headers */ /***********/ #include "H5private.h" /*generic functions */ -#include "H5CXprivate.h" /*API Contexts */ #include "H5Eprivate.h" /*error handling */ #include "H5Iprivate.h" /*ID functions */ #include "H5MMprivate.h" /*memory management */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 72debe8d200..422e3110497 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -30,7 +30,6 @@ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ #include "H5Tpkg.h" /* Datatypes */ /****************/ @@ -113,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 @@ -185,8 +192,9 @@ #define H5T_CONV_Xx_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ { \ if (*(S) > (ST)(D_MAX)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MAX); \ @@ -195,8 +203,9 @@ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ } \ else if (*(S) < (ST)(D_MIN)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MIN); \ @@ -222,8 +231,9 @@ #define H5T_CONV_Ux_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ { \ if (*(S) > (ST)(D_MAX)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MAX); \ @@ -252,8 +262,9 @@ #define H5T_CONV_sU_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ { \ if (*(S) < 0) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = 0; \ @@ -313,8 +324,9 @@ /* Called if overflow is possible */ #define H5T_CONV_uS_CORE_1(S, D, ST, DT, D_MIN, D_MAX) \ if (*(S) > (DT)(D_MAX)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MAX); \ @@ -375,8 +387,9 @@ #define H5T_CONV_Su_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ { \ if (*(S) < 0) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = 0; \ @@ -385,8 +398,9 @@ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ } \ else if (sizeof(ST) > sizeof(DT) && *(S) > (ST)(D_MAX)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MAX); \ @@ -429,8 +443,9 @@ { \ /* Assumes memory format of unsigned & signed integers is same */ \ if (*(S) < 0) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = 0; \ @@ -460,8 +475,9 @@ { \ /* Assumes memory format of unsigned & signed integers is same */ \ if (*(S) > (ST)(D_MAX)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MAX); \ @@ -499,8 +515,9 @@ #define H5T_CONV_Ff_CORE(STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ { \ if (*(S) > (ST)(D_MAX)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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); \ @@ -509,8 +526,9 @@ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ } \ else if (*(S) < (ST)(D_MIN)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, S, D, cb_struct.user_data); \ + 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); \ @@ -607,8 +625,9 @@ \ /* 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 = \ - (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, S, D, cb_struct.user_data); \ + 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)); \ @@ -643,8 +662,9 @@ #define H5T_CONV_Fx_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 = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MAX); \ @@ -653,8 +673,9 @@ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ } \ else if (*(S) < (ST)(D_MIN)) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, S, D, cb_struct.user_data); \ + 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) = (DT)(D_MIN); \ @@ -663,8 +684,9 @@ /* if(except_ret==H5T_CONV_HANDLED): Fall through, user handled it */ \ } \ else if (*(S) != (ST)((DT)(*(S)))) { \ - H5T_conv_ret_t except_ret = \ - (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, S, D, cb_struct.user_data); \ + H5T_conv_ret_t except_ret = (conv_ctx->u.conv.cb_struct.func)( \ + H5T_CONV_EXCEPT_TRUNCATE, 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)); \ @@ -690,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. @@ -709,28 +824,24 @@ FUNC_ENTER_PACKAGE \ \ { \ - size_t elmtno; /*element number */ \ - H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \ - void *src_buf; /*'raw' source buffer */ \ - void *dst_buf; /*'raw' destination buffer */ \ - ST *src, *s; /*source buffer */ \ - DT *dst, *d; /*destination buffer */ \ - H5T_t *st, *dt; /*datatype descriptors */ \ - ST src_aligned; /*source aligned type */ \ - DT dst_aligned; /*destination aligned type */ \ - bool s_mv, d_mv; /*move data to align it? */ \ - ssize_t s_stride, d_stride; /*src and dst strides */ \ - size_t safe; /*how many elements are safe to process in each pass */ \ - H5T_conv_cb_t cb_struct; /*conversion callback structure */ \ + size_t elmtno; /*element number */ \ + H5T_CONV_DECL_PREC(PREC) /*declare precision variables, or not */ \ + void *src_buf; /*'raw' source buffer */ \ + void *dst_buf; /*'raw' destination buffer */ \ + ST *src, *s; /*source buffer */ \ + DT *dst, *d; /*destination buffer */ \ + ST src_aligned; /*source aligned type */ \ + DT dst_aligned; /*destination aligned type */ \ + bool s_mv, d_mv; /*move data to align it? */ \ + ssize_t s_stride, d_stride; /*src and dst strides */ \ + size_t safe; /*how many elements are safe to process in each pass */ \ \ switch (cdata->command) { \ case H5T_CONV_INIT: \ /* Sanity check and initialize statistics */ \ cdata->need_bkg = H5T_BKG_NO; \ - if (NULL == (st = (H5T_t *)H5I_object(src_id)) || \ - NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \ - "unable to dereference datatype object ID"); \ + if (NULL == st || NULL == dt) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype"); \ if (st->shared->size != sizeof(ST) || dt->shared->size != sizeof(DT)) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "disagreement about datatype size"); \ CI_ALLOC_PRIV \ @@ -743,6 +854,12 @@ break; \ \ case H5T_CONV_CONV: \ + if (NULL == st || NULL == dt) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid datatype"); \ + if (NULL == conv_ctx) \ + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \ + "invalid datatype conversion context pointer"); \ + \ /* Initialize source & destination strides */ \ if (buf_stride) { \ assert(buf_stride >= sizeof(ST)); \ @@ -766,17 +883,6 @@ CI_INC_SRC(s_mv) \ CI_INC_DST(d_mv) \ \ - /* Get conversion exception callback property */ \ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) \ - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, \ - "unable to get conversion exception callback"); \ - \ - /* Get source and destination datatypes */ \ - if (NULL == (st = (H5T_t *)H5I_object(src_id)) || \ - NULL == (dt = (H5T_t *)H5I_object(dst_id))) \ - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \ - "unable to dereference datatype object ID"); \ - \ H5T_CONV_SET_PREC(PREC) /*init precision variables, or not */ \ \ /* The outer loop of the type conversion macro, controlling which */ \ @@ -950,7 +1056,7 @@ done: /* The outer wrapper for the type conversion loop, to check for an exception handling routine */ #define H5T_CONV_LOOP_OUTER(PRE_SALIGN_GUTS, PRE_DALIGN_GUTS, POST_SALIGN_GUTS, POST_DALIGN_GUTS, GUTS, \ STYPE, DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ - if (cb_struct.func) { \ + if (conv_ctx->u.conv.cb_struct.func) { \ H5T_CONV_LOOP(PRE_SALIGN_GUTS, PRE_DALIGN_GUTS, POST_SALIGN_GUTS, POST_DALIGN_GUTS, GUTS, STYPE, \ DTYPE, S, D, ST, DT, D_MIN, D_MAX) \ } \ @@ -1058,19 +1164,24 @@ done: /* Conversion data for H5T__conv_struct() */ typedef struct H5T_conv_struct_t { int *src2dst; /*mapping from src to dst member num */ - hid_t *src_memb_id; /*source member type ID's */ + H5T_t **src_memb; /*source member datatypes */ + H5T_t **dst_memb; /*destination member datatypes */ + hid_t *src_memb_id; /*source member type ID's */ hid_t *dst_memb_id; /*destination member type ID's */ H5T_path_t **memb_path; /*conversion path for each member */ H5T_subset_info_t subset_info; /*info related to compound subsets */ unsigned src_nmembs; /*needed by free function */ + bool need_ids; /*whether we need IDs for the datatypes */ } 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 { @@ -1124,9 +1235,10 @@ H5FL_BLK_DEFINE_STATIC(ref_seq); *------------------------------------------------------------------------- */ herr_t -H5T__conv_noop(hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, H5T_cdata_t *cdata, - 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) +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) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1166,12 +1278,11 @@ H5T__conv_noop(hid_t H5_ATTR_UNUSED src_id, hid_t H5_ATTR_UNUSED dst_id, H5T_cda *------------------------------------------------------------------------- */ herr_t -H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, +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; - H5T_t *src = NULL; - H5T_t *dst = NULL; size_t i; herr_t ret_value = SUCCEED; /* Return value */ @@ -1180,7 +1291,7 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt switch (cdata->command) { case H5T_CONV_INIT: /* Capability query */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); if (src->shared->size != dst->shared->size || 0 != src->shared->u.atomic.offset || 0 != dst->shared->u.atomic.offset) @@ -1232,7 +1343,7 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt case H5T_CONV_CONV: /* The conversion */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* Check for "no op" reference conversion */ @@ -1572,12 +1683,11 @@ H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, +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; - H5T_t *src = NULL; - H5T_t *dst = NULL; size_t i; size_t j, md; herr_t ret_value = SUCCEED; /* Return value */ @@ -1587,7 +1697,7 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s switch (cdata->command) { case H5T_CONV_INIT: /* Capability query */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); if (src->shared->size != dst->shared->size || 0 != src->shared->u.atomic.offset || 0 != dst->shared->u.atomic.offset || @@ -1633,7 +1743,7 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s case H5T_CONV_CONV: /* The conversion */ - if (NULL == (src = (H5T_t *)H5I_object(src_id))) + if (NULL == src) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); buf_stride = buf_stride ? buf_stride : src->shared->size; @@ -1665,31 +1775,30 @@ H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s *------------------------------------------------------------------------- */ herr_t -H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *_buf, void H5_ATTR_UNUSED *background) +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; - H5T_t *src = NULL, *dst = NULL; /*source and dest datatypes */ - ssize_t direction; /*direction of traversal */ - size_t elmtno; /*element number */ - size_t olap; /*num overlapping elements */ - size_t half_size; /*1/2 of total size for swapping*/ - uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/ - uint8_t dbuf[256] = {0}; /*temp destination buffer */ - size_t msb_pad_offset; /*offset for dest MSB padding */ + ssize_t direction; /*direction of traversal */ + size_t elmtno; /*element number */ + size_t olap; /*num overlapping elements */ + size_t half_size; /*1/2 of total size for swapping*/ + uint8_t *s, *sp, *d, *dp; /*source and dest traversal ptrs*/ + uint8_t dbuf[256] = {0}; /*temp destination buffer */ + size_t msb_pad_offset; /*offset for dest MSB padding */ size_t i; - uint8_t *src_rev = NULL; /*order-reversed source buffer */ - H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ - H5T_conv_ret_t except_ret; /*return of callback function */ - bool reverse; /*if reverse the order of destination */ - herr_t ret_value = SUCCEED; /* Return value */ + uint8_t *src_rev = NULL; /*order-reversed source buffer */ + H5T_conv_ret_t except_ret; /*return of callback function */ + bool reverse; /*if reverse the order of destination */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE switch (cdata->command) { case H5T_CONV_INIT: /* Capability query */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_ORDER_LE != src->shared->u.atomic.order && H5T_ORDER_BE != src->shared->u.atomic.order) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order"); @@ -1702,9 +1811,10 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz break; case H5T_CONV_CONV: - /* Get the datatypes */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); /* * Do we process the values from beginning to end or vice versa? Also, @@ -1733,10 +1843,6 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz direction = -1; } - /* Get conversion exception callback property */ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src->shared->size); @@ -1793,11 +1899,12 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ if (src->shared->u.atomic.prec > dst->shared->u.atomic.prec) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct.func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, - cb_struct.user_data); + 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, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); } /* end if */ if (except_ret == H5T_CONV_UNHANDLED) { @@ -1902,38 +2009,51 @@ H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /*------------------------------------------------------------------------- * Function: H5T__conv_struct_free * - * Purpose: Free the private data structure used by the compound - * conversion functions. + * Purpose: Free the private data structure used by the compound + * conversion functions. * - * Return: The result of H5MM_xfree(priv) (NULL) + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ -static H5T_conv_struct_t * +static herr_t H5T__conv_struct_free(H5T_conv_struct_t *priv) { - int *src2dst = priv->src2dst; - hid_t *src_memb_id = priv->src_memb_id, *dst_memb_id = priv->dst_memb_id; - unsigned i; + int *src2dst = priv->src2dst; + H5T_t **src_memb = priv->src_memb; + H5T_t **dst_memb = priv->dst_memb; + hid_t *src_memb_id = priv->src_memb_id; + hid_t *dst_memb_id = priv->dst_memb_id; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE_NOERR - for (i = 0; i < priv->src_nmembs; i++) + for (unsigned i = 0; i < priv->src_nmembs; i++) if (src2dst[i] >= 0) { - int H5_ATTR_NDEBUG_UNUSED status; - - status = H5I_dec_ref(src_memb_id[i]); - assert(status >= 0); - status = H5I_dec_ref(dst_memb_id[src2dst[i]]); - assert(status >= 0); + if (priv->need_ids) { + if (H5I_dec_ref(src_memb_id[i]) < 0) + ret_value = FAIL; /* set return value, but keep going */ + if (H5I_dec_ref(dst_memb_id[src2dst[i]]) < 0) + ret_value = FAIL; /* set return value, but keep going */ + } + else { + if (H5T_close(src_memb[i]) < 0) + ret_value = FAIL; /* set return value, but keep going */ + if (H5T_close(dst_memb[src2dst[i]]) < 0) + ret_value = FAIL; /* set return value, but keep going */ + } } /* end if */ H5MM_xfree(src2dst); + H5MM_xfree(src_memb); + H5MM_xfree(dst_memb); H5MM_xfree(src_memb_id); H5MM_xfree(dst_memb_id); + H5MM_xfree(priv->memb_path); + H5MM_xfree(priv); - FUNC_LEAVE_NOAPI((H5T_conv_struct_t *)H5MM_xfree(priv)) + FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__conv_struct_free() */ /*------------------------------------------------------------------------- @@ -1980,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) +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; @@ -1997,11 +2117,31 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) /* * Allocate private data structure and arrays. */ - if (NULL == (priv = (H5T_conv_struct_t *)(cdata->priv = H5MM_calloc(sizeof(H5T_conv_struct_t)))) || - NULL == (priv->src2dst = (int *)H5MM_malloc(src_nmembs * sizeof(int))) || - NULL == (priv->src_memb_id = (hid_t *)H5MM_malloc(src_nmembs * sizeof(hid_t))) || - NULL == (priv->dst_memb_id = (hid_t *)H5MM_malloc(dst_nmembs * sizeof(hid_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); + if (NULL == (priv = (H5T_conv_struct_t *)(cdata->priv = H5MM_calloc(sizeof(H5T_conv_struct_t))))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate private conversion data"); + if (NULL == (priv->src2dst = (int *)H5MM_malloc(src_nmembs * sizeof(int)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, + "couldn't allocate source to destination member mapping array"); + if (NULL == (priv->src_memb = (H5T_t **)H5MM_malloc(src_nmembs * sizeof(H5T_t *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, + "couldn't allocate source compound member datatype array"); + if (NULL == (priv->dst_memb = (H5T_t **)H5MM_malloc(dst_nmembs * sizeof(H5T_t *)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, + "couldn't allocate destination compound member datatype array"); + + priv->need_ids = (cdata->command == H5T_CONV_INIT && conv_ctx->u.init.cb_struct.func) || + (cdata->command == H5T_CONV_CONV && conv_ctx->u.conv.cb_struct.func); + + /* Only create IDs for compound member datatypes if we need to */ + if (priv->need_ids) { + if (NULL == (priv->src_memb_id = (hid_t *)H5MM_malloc(src_nmembs * sizeof(hid_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, + "couldn't allocate source compound member datatype ID array"); + if (NULL == (priv->dst_memb_id = (hid_t *)H5MM_malloc(dst_nmembs * sizeof(hid_t)))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, + "couldn't allocate destination compound member datatype ID array"); + } + src2dst = priv->src2dst; priv->src_nmembs = src_nmembs; @@ -2020,8 +2160,7 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * Build a mapping from source member number to destination member * number. If some source member is not a destination member then that * mapping element will be negative. Also create atoms for each - * source and destination member datatype so we can look up the - * member datatype conversion functions later. + * source and destination member datatype if necessary. */ for (i = 0; i < src_nmembs; i++) { src2dst[i] = -1; @@ -2032,18 +2171,32 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) } /* end if */ } /* end for */ if (src2dst[i] >= 0) { - hid_t tid; H5T_t *type; + hid_t tid; - type = H5T_copy(src->shared->u.compnd.memb[i].type, H5T_COPY_ALL); - tid = H5I_register(H5I_DATATYPE, type, false); - assert(tid >= 0); - priv->src_memb_id[i] = tid; + if (NULL == (type = H5T_copy(src->shared->u.compnd.memb[i].type, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, + "can't copy source compound member datatype"); + priv->src_memb[i] = type; - type = H5T_copy(dst->shared->u.compnd.memb[src2dst[i]].type, H5T_COPY_ALL); - tid = H5I_register(H5I_DATATYPE, type, false); - assert(tid >= 0); - priv->dst_memb_id[src2dst[i]] = tid; + if (priv->need_ids) { + if ((tid = H5I_register(H5I_DATATYPE, type, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "can't register ID for source compound member datatype"); + priv->src_memb_id[i] = tid; + } + + if (NULL == (type = H5T_copy(dst->shared->u.compnd.memb[src2dst[i]].type, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, + "can't copy destination compound member datatype"); + priv->dst_memb[src2dst[i]] = type; + + if (priv->need_ids) { + if ((tid = H5I_register(H5I_DATATYPE, type, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "can't register ID for source compound member datatype"); + priv->dst_memb_id[src2dst[i]] = tid; + } } /* end if */ } /* end for */ } /* end if */ @@ -2070,7 +2223,8 @@ H5T__conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) dst->shared->u.compnd.memb[src2dst[i]].type); if (NULL == (priv->memb_path[i] = tpath)) { - cdata->priv = H5T__conv_struct_free(priv); + H5T__conv_struct_free(priv); + cdata->priv = NULL; HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert member datatype"); } /* end if */ } /* end if */ @@ -2192,14 +2346,12 @@ H5T__conv_struct_subset(const H5T_cdata_t *cdata) *------------------------------------------------------------------------- */ herr_t -H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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 */ uint8_t *xbuf = buf, *xbkg = bkg; /*temp pointers into buf and bkg*/ - H5T_t *src = NULL; /*source datatype */ - H5T_t *dst = NULL; /*destination datatype */ int *src2dst = NULL; /*maps src member to dst member */ H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */ @@ -2207,10 +2359,10 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t src_delta; /*source stride */ ssize_t bkg_delta; /*background stride */ size_t elmtno; - unsigned u; /*counters */ - int i; /*counters */ - H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv); - herr_t ret_value = SUCCEED; /* Return value */ + unsigned u; /*counters */ + H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv); + H5T_conv_ctx_t tmp_conv_ctx = {0}; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2218,38 +2370,48 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, case H5T_CONV_INIT: /* * First, determine if this conversion function applies to the - * conversion path SRC_ID-->DST_ID. If not, return failure; + * conversion path SRC-->DST. If not, return failure; * otherwise initialize the `priv' field of `cdata' with information * that remains (almost) constant for this conversion path. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_COMPOUND != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype"); if (H5T_COMPOUND != dst->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype"); - if (H5T__conv_struct_init(src, dst, cdata) < 0) + if (H5T__conv_struct_init(src, dst, cdata, conv_ctx) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data"); break; - case H5T_CONV_FREE: + case H5T_CONV_FREE: { /* * Free the private conversion data. */ - cdata->priv = H5T__conv_struct_free(priv); + herr_t status = H5T__conv_struct_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: /* * Conversion. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); assert(priv); assert(bkg && cdata->need_bkg); - if (cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) + /* Initialize temporary conversion context */ + tmp_conv_ctx = *conv_ctx; + + if (cdata->recalc && H5T__conv_struct_init(src, dst, cdata, conv_ctx) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data"); /* @@ -2293,6 +2455,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * 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*/ @@ -2300,12 +2463,19 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_memb = dst->shared->u.compnd.memb + src2dst[u]; if (dst_memb->size <= src_memb->size) { - if (H5T_convert(priv->memb_path[u], priv->src_memb_id[u], - priv->dst_memb_id[src2dst[u]], (size_t)1, (size_t)0, - (size_t)0, /*no striding (packed array)*/ - xbuf + src_memb->offset, xbkg + dst_memb->offset) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, + if (priv->need_ids) { + /* Update IDs in conversion context */ + tmp_conv_ctx.u.conv.src_type_id = priv->src_memb_id[u]; + tmp_conv_ctx.u.conv.dst_type_id = priv->dst_memb_id[src2dst[u]]; + } + + if (H5T_convert_with_ctx(priv->memb_path[u], priv->src_memb[u], + priv->dst_memb[src2dst[u]], &tmp_conv_ctx, (size_t)1, + (size_t)0, (size_t)0, /*no striding (packed array)*/ + xbuf + src_memb->offset, xbkg + dst_memb->offset) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "unable to convert compound datatype member"); + memmove(xbuf + offset, xbuf + src_memb->offset, dst_memb->size); offset += dst_memb->size; } /* end if */ @@ -2314,6 +2484,7 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, 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 @@ -2322,26 +2493,35 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * 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 (i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + for (int i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if (src2dst[i] < 0) continue; /*subsetting*/ src_memb = src->shared->u.compnd.memb + i; dst_memb = dst->shared->u.compnd.memb + src2dst[i]; if (dst_memb->size > src_memb->size) { + if (priv->need_ids) { + /* Update IDs in conversion context */ + tmp_conv_ctx.u.conv.src_type_id = priv->src_memb_id[i]; + tmp_conv_ctx.u.conv.dst_type_id = priv->dst_memb_id[src2dst[i]]; + } + offset -= src_memb->size; - if (H5T_convert(priv->memb_path[i], priv->src_memb_id[i], - priv->dst_memb_id[src2dst[i]], (size_t)1, (size_t)0, - (size_t)0, /*no striding (packed array)*/ - xbuf + offset, xbkg + dst_memb->offset) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, + if (H5T_convert_with_ctx(priv->memb_path[i], priv->src_memb[i], + priv->dst_memb[src2dst[i]], &tmp_conv_ctx, (size_t)1, + (size_t)0, (size_t)0, /*no striding (packed array)*/ + xbuf + offset, xbkg + dst_memb->offset) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "unable to convert compound datatype member"); } /* end if */ else 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); /* @@ -2416,25 +2596,23 @@ H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, *------------------------------------------------------------------------- */ herr_t -H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t bkg_stride, void *_buf, void *_bkg) +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 */ uint8_t *bkg = (uint8_t *)_bkg; /*background pointer arithmetic */ uint8_t *xbuf = NULL; /*temporary pointer into `buf' */ uint8_t *xbkg = NULL; /*temporary pointer into `bkg' */ - H5T_t *src = NULL; /*source datatype */ - H5T_t *dst = NULL; /*destination datatype */ int *src2dst = NULL; /*maps src member to dst member */ H5T_cmemb_t *src_memb = NULL; /*source struct member descript.*/ H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */ size_t offset; /*byte offset wrt struct */ size_t elmtno; /*element counter */ size_t copy_size; /*size of element for copying */ - H5T_conv_struct_t *priv = NULL; /*private data */ - bool no_stride = false; /*flag to indicate no stride */ - unsigned u; /*counters */ - int i; /*counters */ + H5T_conv_struct_t *priv = NULL; /*private data */ + H5T_conv_ctx_t tmp_conv_ctx = {0}; /*temporary conversion context */ + bool no_stride = false; /*flag to indicate no stride */ + unsigned u; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -2443,11 +2621,11 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm case H5T_CONV_INIT: /* * First, determine if this conversion function applies to the - * conversion path SRC_ID-->DST_ID. If not, return failure; + * conversion path SRC-->DST. If not, return failure; * otherwise initialize the `priv' field of `cdata' with information * that remains (almost) constant for this conversion path. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_COMPOUND != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype"); @@ -2455,7 +2633,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_COMPOUND datatype"); /* Initialize data which is relatively constant */ - if (H5T__conv_struct_init(src, dst, cdata) < 0) + if (H5T__conv_struct_init(src, dst, cdata, conv_ctx) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data"); priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; @@ -2480,7 +2658,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm offset += src_memb->size; } /* end for */ H5_CHECK_OVERFLOW(src->shared->u.compnd.nmembs, size_t, int); - for (i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + for (int i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if (src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; @@ -2488,7 +2666,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm if (dst_memb->size > src_memb->size) { offset -= src_memb->size; if (dst_memb->size > src->shared->size - offset) { - cdata->priv = H5T__conv_struct_free(priv); + H5T__conv_struct_free(priv); + cdata->priv = NULL; HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "conversion is unsupported by this function"); } /* end if */ @@ -2497,22 +2676,32 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm } /* end if */ break; - case H5T_CONV_FREE: + case H5T_CONV_FREE: { /* * Free the private conversion data. */ - cdata->priv = H5T__conv_struct_free((H5T_conv_struct_t *)(cdata->priv)); + herr_t status = H5T__conv_struct_free((H5T_conv_struct_t *)(cdata->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: /* * Conversion. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); + + /* Initialize temporary conversion context */ + tmp_conv_ctx = *conv_ctx; /* Update cached data if necessary */ - if (cdata->recalc && H5T__conv_struct_init(src, dst, cdata) < 0) + if (cdata->recalc && H5T__conv_struct_init(src, dst, cdata, conv_ctx) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data"); priv = (H5T_conv_struct_t *)(cdata->priv); assert(priv); @@ -2566,6 +2755,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm * 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*/ @@ -2573,13 +2763,20 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm dst_memb = dst->shared->u.compnd.memb + src2dst[u]; if (dst_memb->size <= src_memb->size) { + if (priv->need_ids) { + /* Update IDs in conversion context */ + tmp_conv_ctx.u.conv.src_type_id = priv->src_memb_id[u]; + tmp_conv_ctx.u.conv.dst_type_id = priv->dst_memb_id[src2dst[u]]; + } + xbuf = buf + src_memb->offset; xbkg = bkg + dst_memb->offset; - if (H5T_convert(priv->memb_path[u], priv->src_memb_id[u], - priv->dst_memb_id[src2dst[u]], nelmts, buf_stride, bkg_stride, xbuf, - xbkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, + if (H5T_convert_with_ctx(priv->memb_path[u], priv->src_memb[u], + priv->dst_memb[src2dst[u]], &tmp_conv_ctx, nelmts, + buf_stride, bkg_stride, xbuf, xbkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "unable to convert compound datatype member"); + for (elmtno = 0; elmtno < nelmts; elmtno++) { memmove(xbkg, xbuf, dst_memb->size); xbuf += buf_stride; @@ -2594,6 +2791,7 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm 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 @@ -2601,21 +2799,28 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm * 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 (i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { + for (int i = (int)src->shared->u.compnd.nmembs - 1; i >= 0; --i) { if (src2dst[i] < 0) continue; src_memb = src->shared->u.compnd.memb + i; dst_memb = dst->shared->u.compnd.memb + src2dst[i]; if (dst_memb->size > src_memb->size) { + if (priv->need_ids) { + /* Update IDs in conversion context */ + tmp_conv_ctx.u.conv.src_type_id = priv->src_memb_id[i]; + tmp_conv_ctx.u.conv.dst_type_id = priv->dst_memb_id[src2dst[i]]; + } + offset -= src_memb->size; xbuf = buf + offset; xbkg = bkg + dst_memb->offset; - if (H5T_convert(priv->memb_path[i], priv->src_memb_id[i], - priv->dst_memb_id[src2dst[i]], nelmts, buf_stride, bkg_stride, xbuf, - xbkg) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, + if (H5T_convert_with_ctx(priv->memb_path[i], priv->src_memb[i], + priv->dst_memb[src2dst[i]], &tmp_conv_ctx, nelmts, + buf_stride, bkg_stride, xbuf, xbkg) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "unable to convert compound datatype member"); for (elmtno = 0; elmtno < nelmts; elmtno++) { memmove(xbkg, xbuf, dst_memb->size); @@ -2624,7 +2829,8 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm } /* 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; @@ -2646,6 +2852,37 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm 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 * @@ -2658,131 +2895,201 @@ H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ 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"); + + 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]; - 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)))); + 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) } @@ -2798,19 +3105,20 @@ H5T__conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) *------------------------------------------------------------------------- */ herr_t -H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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 */ - H5T_t *src = NULL, *dst = NULL; /*src and dst datatypes */ - 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_cb_t cb_struct; /*conversion callback structure */ - 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 @@ -2818,50 +3126,46 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si case H5T_CONV_INIT: /* * Determine if this conversion function applies to the conversion - * path SRC_ID->DST_ID. If not return failure; otherwise initialize + * path SRC->DST. If not return failure; otherwise initialize * the `priv' field of `cdata' with information about the underlying * integer conversion. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype"); 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 = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); if (H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_ENUM datatype"); 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. @@ -2871,36 +3175,32 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si 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; } - /* Get conversion exception callback property */ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - - 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)); @@ -2909,33 +3209,36 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si /*overflow*/ except_ret = H5T_CONV_UNHANDLED; /*If user's exception handler is present, use it*/ - if (cb_struct.func) - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, - cb_struct.user_data); + if (conv_ctx->u.conv.cb_struct.func) + 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) - 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) @@ -2946,12 +3249,13 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si if (lt >= rt) { except_ret = H5T_CONV_UNHANDLED; /*If user's exception handler is present, use it*/ - if (cb_struct.func) - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, - cb_struct.user_data); + if (conv_ctx->u.conv.cb_struct.func) + 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) - 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"); @@ -2959,11 +3263,11 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si 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; @@ -2992,13 +3296,12 @@ H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si *------------------------------------------------------------------------- */ herr_t -H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +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, *dst; /*src and dst datatypes */ H5T_t *src_parent; /*parent type for src */ - hid_t src_parent_id = -1; /*ID for parent of the source */ H5T_path_t *tpath; /* Conversion information */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3008,9 +3311,9 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne case H5T_CONV_INIT: /* * Determine if this conversion function applies to the conversion - * path SRC_ID->DST_ID. If not, return failure. + * path SRC->DST. If not, return failure. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_ENUM != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "source type is not a H5T_ENUM datatype"); @@ -3024,23 +3327,18 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne break; case H5T_CONV_CONV: - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src_parent = src->shared->parent; if (NULL == (tpath = H5T_path_find(src_parent, dst))) { - HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatype"); } else if (!H5T_path_noop(tpath)) { - if ((src_parent_id = H5I_register(H5I_DATATYPE, H5T_copy(src_parent, H5T_COPY_ALL), false)) < - 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, - "unable to register types for conversion"); - /* Convert the data */ - if (H5T_convert(tpath, src_parent_id, dst_id, 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; @@ -3051,13 +3349,70 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne } /* end switch */ done: - /* Release the temporary datatype IDs used */ - if (src_parent_id >= 0) - H5I_dec_ref(src_parent_id); - FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__conv_enum_numeric() */ +/*------------------------------------------------------------------------- + * Function: H5T__conv_vlen_nested_free + * + * Purpose: Recursively locates and frees any nested VLEN components of + * complex data types (including COMPOUND). + * + * Return: Non-negative on success/Negative on failure. + * + *------------------------------------------------------------------------- + */ +static herr_t +H5T__conv_vlen_nested_free(uint8_t *buf, H5T_t *dt) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + switch (dt->shared->type) { + case H5T_VLEN: + /* Pointer buf refers to VLEN data; free it (always reset tmp) */ + if ((*(dt->shared->u.vlen.cls->del))(dt->shared->u.vlen.file, buf) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't free nested vlen"); + break; + + case H5T_COMPOUND: + /* Pointer buf refers to COMPOUND data; recurse for each member. */ + for (unsigned i = 0; i < dt->shared->u.compnd.nmembs; ++i) + if (H5T__conv_vlen_nested_free(buf + dt->shared->u.compnd.memb[i].offset, + dt->shared->u.compnd.memb[i].type) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't free compound member"); + break; + + case H5T_ARRAY: + /* Pointer buf refers to ARRAY data; recurse for each element. */ + for (unsigned i = 0; i < dt->shared->u.array.nelem; ++i) + if (H5T__conv_vlen_nested_free(buf + i * dt->shared->parent->shared->size, + dt->shared->parent) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "can't free array data"); + break; + + case H5T_INTEGER: + case H5T_FLOAT: + case H5T_TIME: + case H5T_STRING: + case H5T_BITFIELD: + case H5T_OPAQUE: + case H5T_REFERENCE: + case H5T_ENUM: + /* These types cannot contain vl data */ + break; + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype class"); + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5T__conv_vlen_nested_free() */ + /*------------------------------------------------------------------------- * Function: H5T__conv_vlen * @@ -3080,32 +3435,36 @@ H5T__conv_enum_numeric(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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_path_t *tpath = NULL; /* Type conversion path */ - bool noop_conv = false; /* Flag to indicate a noop conversion */ - bool write_to_file = false; /* Flag to indicate writing to file */ - htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatype */ - size_t bg_seq_len = 0; /* The number of elements in the background sequence */ - hid_t tsrc_id = -1, tdst_id = -1; /*temporary type atoms */ - H5T_t *src = NULL; /*source datatype */ - H5T_t *dst = NULL; /*destination datatype */ - uint8_t *s = NULL; /*source buffer */ - uint8_t *d = NULL; /*destination buffer */ - uint8_t *b = NULL; /*background buffer */ - ssize_t s_stride, d_stride; /*src and dst strides */ - ssize_t b_stride; /*bkg stride */ - size_t safe; /*how many elements are safe to process in each pass */ - size_t src_base_size, dst_base_size; /*source & destination base size*/ - void *conv_buf = NULL; /*temporary conversion buffer */ - size_t conv_buf_size = 0; /*size of conversion buffer in bytes */ - void *tmp_buf = NULL; /*temporary background buffer */ - size_t tmp_buf_size = 0; /*size of temporary bkg buffer */ - bool nested = false; /*flag of nested VL case */ - size_t elmtno; /*element number counter */ - herr_t ret_value = SUCCEED; /* Return value */ +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 */ + H5T_path_t *tpath = NULL; /* Type conversion path */ + bool noop_conv = false; /* Flag to indicate a noop conversion */ + bool write_to_file = false; /* Flag to indicate writing to file */ + htri_t parent_is_vlen; /* Flag to indicate parent is vlen datatype */ + size_t bg_seq_len = 0; /* The number of elements in the background sequence */ + H5T_t *tsrc_cpy = NULL; /*temporary copy of source base datatype */ + H5T_t *tdst_cpy = NULL; /*temporary copy of destination base datatype */ + hid_t tsrc_id = H5I_INVALID_HID; /*temporary type atom */ + hid_t tdst_id = H5I_INVALID_HID; /*temporary type atom */ + uint8_t *s = NULL; /*source buffer */ + uint8_t *d = NULL; /*destination buffer */ + uint8_t *b = NULL; /*background buffer */ + ssize_t s_stride, d_stride; /*src and dst strides */ + ssize_t b_stride; /*bkg stride */ + size_t safe; /*how many elements are safe to process in each pass */ + size_t src_base_size; /*source base size*/ + size_t dst_base_size; /*destination base size*/ + void *conv_buf = NULL; /*temporary conversion buffer */ + size_t conv_buf_size = 0; /*size of conversion buffer in bytes */ + void *tmp_buf = NULL; /*temporary background buffer */ + size_t tmp_buf_size = 0; /*size of temporary bkg buffer */ + bool nested = false; /*flag of nested VL case */ + bool need_ids = false; /*whether we need IDs for the datatypes */ + size_t elmtno; /*element number counter */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3118,7 +3477,7 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si * information that remains (almost) constant for this * conversion path. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_VLEN != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_VLEN datatype"); @@ -3145,8 +3504,15 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si /* * Conversion. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); + + /* Initialize temporary conversion context */ + tmp_conv_ctx = *conv_ctx; + + need_ids = (conv_ctx->u.conv.cb_struct.func != NULL); /* Initialize source & destination strides */ if (buf_stride) { @@ -3179,26 +3545,34 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest datatypes"); else if (!H5T_path_noop(tpath)) { - H5T_t *tsrc_cpy = NULL, *tdst_cpy = NULL; - if (NULL == (tsrc_cpy = H5T_copy(src->shared->parent, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy src type for conversion"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, + "unable to copy src base type for conversion"); /* References need to know about the src file */ if (tsrc_cpy->shared->type == H5T_REFERENCE) if (H5T_set_loc(tsrc_cpy, src->shared->u.vlen.file, src->shared->u.vlen.loc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set datatype location"); if (NULL == (tdst_cpy = H5T_copy(dst->shared->parent, H5T_COPY_ALL))) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, "unable to copy dst type for conversion"); + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, + "unable to copy dst base type for conversion"); /* References need to know about the dst file */ if (tdst_cpy->shared->type == H5T_REFERENCE) if (H5T_set_loc(tdst_cpy, dst->shared->u.vlen.file, dst->shared->u.vlen.loc) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't set datatype location"); - if (((tsrc_id = H5I_register(H5I_DATATYPE, tsrc_cpy, false)) < 0) || - ((tdst_id = H5I_register(H5I_DATATYPE, tdst_cpy, false)) < 0)) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, - "unable to register types for conversion"); + if (need_ids) { + if ((tsrc_id = H5I_register(H5I_DATATYPE, tsrc_cpy, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "unable to register ID for source base datatype"); + if ((tdst_id = H5I_register(H5I_DATATYPE, tdst_cpy, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "unable to register ID for destination base datatype"); + } + + /* Update IDs in conversion context */ + tmp_conv_ctx.u.conv.src_type_id = tsrc_id; + tmp_conv_ctx.u.conv.dst_type_id = tdst_id; } /* end else-if */ else noop_conv = true; @@ -3374,9 +3748,12 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si } /* end if */ /* Convert VL sequence */ - if (H5T_convert(tpath, tsrc_id, tdst_id, seq_len, (size_t)0, (size_t)0, conv_buf, - tmp_buf) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + 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 */ @@ -3396,8 +3773,8 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si tmp = (uint8_t *)tmp_buf + seq_len * dst_base_size; for (u = seq_len; u < bg_seq_len; u++, tmp += dst_base_size) { - /* Delete sequence in destination location */ - if ((*(dst->shared->u.vlen.cls->del))(dst->shared->u.vlen.file, tmp) < 0) + /* Recursively free destination data */ + if (H5T__conv_vlen_nested_free(tmp, dst->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREMOVE, FAIL, "unable to remove heap object"); } /* end for */ @@ -3417,11 +3794,6 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si nelmts -= safe; } /* end while */ - /* Release the temporary datatype IDs used */ - if (tsrc_id >= 0) - H5I_dec_ref(tsrc_id); - if (tdst_id >= 0) - H5I_dec_ref(tdst_id); break; default: /* Some other command we don't know about yet.*/ @@ -3429,6 +3801,23 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si } /* end switch */ done: + if (tsrc_id >= 0) { + if (H5I_dec_ref(tsrc_id) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + } + else if (tsrc_cpy) { + if (H5T_close(tsrc_cpy) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + } + if (tdst_id >= 0) { + if (H5I_dec_ref(tdst_id) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + } + else if (tdst_cpy) { + if (H5T_close(tdst_cpy) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + } + /* If the conversion buffer doesn't need to be freed, reset its pointer */ if (write_to_file && noop_conv) conv_buf = NULL; @@ -3453,20 +3842,22 @@ H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, si *------------------------------------------------------------------------- */ herr_t -H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, +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_path_t *tpath; /* Type conversion path */ - hid_t tsrc_id = -1, tdst_id = -1; /*temporary type atoms */ - H5T_t *src = NULL; /*source datatype */ - H5T_t *dst = NULL; /*destination datatype */ - uint8_t *sp, *dp; /*source and dest traversal ptrs */ - ssize_t src_delta, dst_delta; /*source & destination stride */ - int direction; /*direction of traversal */ - size_t elmtno; /*element number counter */ - unsigned u; /* local index variable */ - void *bkg_buf = NULL; /*temporary background buffer */ - herr_t ret_value = SUCCEED; /* Return value */ + H5T_conv_ctx_t tmp_conv_ctx = {0}; /* Temporary conversion context */ + H5T_path_t *tpath; /* Type conversion path */ + H5T_t *tsrc_cpy = NULL; /*temporary copy of source base datatype */ + H5T_t *tdst_cpy = NULL; /*temporary copy of destination base datatype */ + hid_t tsrc_id = H5I_INVALID_HID; /*temporary type atom */ + hid_t tdst_id = H5I_INVALID_HID; /*temporary type atom */ + uint8_t *sp, *dp; /*source and dest traversal ptrs */ + ssize_t src_delta, dst_delta; /*source & destination stride */ + int direction; /*direction of traversal */ + bool need_ids = false; /*whether we need IDs for the datatypes */ + void *bkg_buf = NULL; /*temporary background buffer */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -3474,12 +3865,12 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s case H5T_CONV_INIT: /* * First, determine if this conversion function applies to the - * conversion path SRC_ID-->DST_ID. If not, return failure; + * conversion path SRC-->DST. If not, return failure; * otherwise initialize the `priv' field of `cdata' with * information that remains (almost) constant for this * conversion path. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); assert(H5T_ARRAY == src->shared->type); assert(H5T_ARRAY == dst->shared->type); @@ -3488,7 +3879,7 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s if (src->shared->u.array.ndims != dst->shared->u.array.ndims) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "array datatypes do not have the same number of dimensions"); - for (u = 0; u < src->shared->u.array.ndims; u++) + for (unsigned u = 0; u < src->shared->u.array.ndims; u++) if (src->shared->u.array.dim[u] != dst->shared->u.array.dim[u]) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "array datatypes do not have the same sizes of dimensions"); @@ -3506,8 +3897,15 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s /* * Conversion. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); + + /* Initialize temporary conversion context */ + tmp_conv_ctx = *conv_ctx; + + need_ids = (conv_ctx->u.conv.cb_struct.func != NULL); /* * Do we process the values from beginning to end or vice @@ -3539,12 +3937,26 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s "unable to convert between src and dest datatypes"); } else if (!H5T_path_noop(tpath)) { - if ((tsrc_id = H5I_register(H5I_DATATYPE, H5T_copy(src->shared->parent, H5T_COPY_ALL), - false)) < 0 || - (tdst_id = - H5I_register(H5I_DATATYPE, H5T_copy(dst->shared->parent, H5T_COPY_ALL), false)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, - "unable to register types for conversion"); + if (NULL == (tsrc_cpy = H5T_copy(src->shared->parent, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, + "unable to copy src base type for conversion"); + + if (NULL == (tdst_cpy = H5T_copy(dst->shared->parent, H5T_COPY_ALL))) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOPY, FAIL, + "unable to copy dst base type for conversion"); + + if (need_ids) { + if ((tsrc_id = H5I_register(H5I_DATATYPE, tsrc_cpy, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "unable to register ID for source base datatype"); + if ((tdst_id = H5I_register(H5I_DATATYPE, tdst_cpy, false)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, + "unable to register ID for destination base datatype"); + } + + /* Update IDs in conversion context */ + tmp_conv_ctx.u.conv.src_type_id = tsrc_id; + tmp_conv_ctx.u.conv.dst_type_id = tdst_id; } /* Check if we need a background buffer for this conversion */ @@ -3559,25 +3971,22 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s } /* end if */ /* Perform the actual conversion */ - for (elmtno = 0; elmtno < nelmts; elmtno++) { + 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); /* Convert array */ - if (H5T_convert(tpath, tsrc_id, tdst_id, src->shared->u.array.nelem, (size_t)0, bkg_stride, - dp, bkg_buf) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed"); + if (H5T_convert_with_ctx(tpath, tsrc_cpy, tdst_cpy, &tmp_conv_ctx, src->shared->u.array.nelem, + (size_t)0, bkg_stride, dp, bkg_buf) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "datatype conversion failed"); /* Advance the source & destination pointers */ sp += src_delta; dp += dst_delta; } /* end for */ + tmp_conv_ctx.u.conv.recursive = false; - /* Release the temporary datatype IDs used */ - if (tsrc_id >= 0) - H5I_dec_ref(tsrc_id); - if (tdst_id >= 0) - H5I_dec_ref(tdst_id); break; default: /* Some other command we don't know about yet.*/ @@ -3585,6 +3994,23 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s } /* end switch */ done: + if (tsrc_id >= 0) { + if (H5I_dec_ref(tsrc_id) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + } + else if (tsrc_cpy) { + if (H5T_close(tsrc_cpy) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + } + if (tdst_id >= 0) { + if (H5I_dec_ref(tdst_id) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't decrement reference on temporary ID"); + } + else if (tdst_cpy) { + if (H5T_close(tdst_cpy) < 0) + HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close temporary datatype"); + } + /* Release the background buffer, if we have one */ if (bkg_buf) bkg_buf = H5FL_BLK_FREE(array_seq, bkg_buf); @@ -3603,14 +4029,13 @@ H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s *------------------------------------------------------------------------- */ herr_t -H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, +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) { - H5T_t *src = NULL; /* source datatype */ - H5T_t *dst = NULL; /* destination datatype */ - uint8_t *s = NULL; /* source buffer */ - uint8_t *d = NULL; /* destination buffer */ - uint8_t *b = NULL; /* background buffer */ + uint8_t *s = NULL; /* source buffer */ + uint8_t *d = NULL; /* destination buffer */ + uint8_t *b = NULL; /* background buffer */ ssize_t s_stride, d_stride; /* src and dst strides */ ssize_t b_stride; /* bkg stride */ size_t safe; /* how many elements are safe to process in each pass */ @@ -3625,12 +4050,12 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz case H5T_CONV_INIT: /* * First, determine if this conversion function applies to the - * conversion path SRC_ID-->DST_ID. If not, return failure; + * conversion path SRC-->DST. If not, return failure; * otherwise initialize the `priv' field of `cdata' with * information that remains (almost) constant for this * conversion path. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_REFERENCE != src->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "not a H5T_REFERENCE datatype"); @@ -3651,7 +4076,7 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* * Conversion. */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); assert(src->shared->u.atomic.u.r.cls); @@ -3815,11 +4240,10 @@ H5T__conv_ref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *------------------------------------------------------------------------- */ herr_t -H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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) { - H5T_t *src = NULL; /*source datatype */ - H5T_t *dst = NULL; /*destination datatype */ ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number */ @@ -3829,18 +4253,17 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz uint8_t *src_rev = NULL; /*order-reversed source buffer */ uint8_t dbuf[64] = {0}; /*temp destination buffer */ size_t first; - ssize_t sfirst; /*a signed version of `first' */ - size_t i; /*Local index variables */ - H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ - H5T_conv_ret_t except_ret; /*return of callback function */ - bool reverse; /*if reverse the order of destination */ - herr_t ret_value = SUCCEED; /* Return value */ + ssize_t sfirst; /*a signed version of `first' */ + size_t i; /*Local index variables */ + H5T_conv_ret_t except_ret; /*return of callback function */ + bool reverse; /*if reverse the order of destination */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE switch (cdata->command) { case H5T_CONV_INIT: - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); if (H5T_ORDER_LE != src->shared->u.atomic.order && H5T_ORDER_BE != src->shared->u.atomic.order) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order"); @@ -3855,9 +4278,10 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz break; case H5T_CONV_CONV: - /* Get the datatypes */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); /* * Do we process the values from beginning to end or vice versa? Also, @@ -3895,10 +4319,6 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src->shared->size); dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst->shared->size); - /* Get conversion exception callback property */ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src->shared->size); @@ -3978,11 +4398,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (first >= dst->shared->u.atomic.prec) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4011,11 +4434,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ if (first + 1 == src->shared->u.atomic.prec) { /*overflow - source is negative*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4036,11 +4462,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (first >= dst->shared->u.atomic.prec) { /*overflow - source is positive*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) @@ -4066,11 +4495,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ if (first + 1 >= dst->shared->u.atomic.prec) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4111,11 +4543,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz if (sfz >= 0 && fz + 1 >= dst->shared->u.atomic.prec) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4151,11 +4586,14 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz */ if (first + 1 >= dst->shared->u.atomic.prec) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ H5T__reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4250,12 +4688,11 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *------------------------------------------------------------------------- */ herr_t -H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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_t *src_p; /*source datatype */ - H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ ssize_t src_delta, dst_delta; /*source & destination stride */ @@ -4271,27 +4708,25 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - int64_t expo; /*exponent */ - hssize_t expo_max; /*maximum possible dst exponent */ - size_t msize = 0; /*useful size of mantissa in src*/ - size_t mpos; /*offset to useful mant is src */ - uint64_t sign; /*source sign bit value */ - size_t mrsh; /*amount to right shift mantissa*/ - bool carry = false; /*carry after rounding mantissa */ - size_t i; /*miscellaneous counters */ - size_t implied; /*destination implied bits */ - bool denormalized = false; /*is either source or destination denormalized?*/ - H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ - H5T_conv_ret_t except_ret; /*return of callback function */ - bool reverse; /*if reverse the order of destination */ - herr_t ret_value = SUCCEED; /*return value */ + int64_t expo; /*exponent */ + hssize_t expo_max; /*maximum possible dst exponent */ + size_t msize = 0; /*useful size of mantissa in src*/ + size_t mpos; /*offset to useful mant is src */ + uint64_t sign; /*source sign bit value */ + size_t mrsh; /*amount to right shift mantissa*/ + bool carry = false; /*carry after rounding mantissa */ + size_t i; /*miscellaneous counters */ + size_t implied; /*destination implied bits */ + bool denormalized = false; /*is either source or destination denormalized?*/ + H5T_conv_ret_t except_ret; /*return of callback function */ + bool reverse; /*if reverse the order of destination */ + herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_PACKAGE switch (cdata->command) { case H5T_CONV_INIT: - if (NULL == (src_p = (H5T_t *)H5I_object(src_id)) || - NULL == (dst_p = (H5T_t *)H5I_object(dst_id))) + if (NULL == src_p || NULL == dst_p) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -4310,10 +4745,11 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz break; case H5T_CONV_CONV: - /* Get the datatypes */ - if (NULL == (src_p = (H5T_t *)H5I_object(src_id)) || - NULL == (dst_p = (H5T_t *)H5I_object(dst_id))) + if (NULL == src_p || NULL == dst_p) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); + src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; expo_max = ((hssize_t)1 << dst.u.f.esize) - 1; @@ -4353,10 +4789,6 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz src_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : src_p->shared->size); dst_delta = (ssize_t)direction * (ssize_t)(buf_stride ? buf_stride : dst_p->shared->size); - /* Get conversion exception callback property */ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src_p->shared->size); @@ -4437,16 +4869,21 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* +Inf or -Inf */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); if (sign) - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, - d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_NINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); else - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, - d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_PINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4478,15 +4915,19 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ /* +Inf or -Inf */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); if (sign) - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, - cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_NINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); else - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, d, - cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_PINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4516,11 +4957,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* NaN */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NAN, src_id, dst_id, src_rev, d, - cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_NAN, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, + src_rev, d, conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4637,11 +5079,12 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * handler make sure the source buffer we hand it is in the * original byte order. */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, - cb_struct.user_data); + 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, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4727,12 +5170,15 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * calling the overflow handler make sure the source * buffer we hand it is in the original byte order. */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -4833,11 +5279,10 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *------------------------------------------------------------------------- */ herr_t -H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, +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) { - H5T_t *src = NULL; /*source datatype */ - H5T_t *dst = NULL; /*destination datatype */ ssize_t src_delta, dst_delta; /*source & destination stride */ int direction; /*direction of traversal */ size_t elmtno; /*element number */ @@ -4851,7 +5296,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz switch (cdata->command) { case H5T_CONV_INIT: - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); if (8 * src->shared->size != src->shared->u.atomic.prec || 8 * dst->shared->size != dst->shared->u.atomic.prec) @@ -4881,7 +5326,7 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz case H5T_CONV_CONV: /* Get the datatypes */ - if (NULL == (src = (H5T_t *)H5I_object(src_id)) || NULL == (dst = (H5T_t *)H5I_object(dst_id))) + if (NULL == src || NULL == dst) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); /* @@ -5076,8 +5521,9 @@ H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5094,8 +5540,9 @@ H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5112,8 +5559,9 @@ H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5130,8 +5578,9 @@ H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_sU(SCHAR, USHORT, signed char, unsigned short, -, -); } @@ -5148,8 +5597,9 @@ H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5166,8 +5616,9 @@ H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_uU(UCHAR, USHORT, unsigned char, unsigned short, -, -); } @@ -5184,8 +5635,9 @@ H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5202,8 +5654,9 @@ H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5220,8 +5673,9 @@ H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5238,8 +5692,9 @@ H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5256,8 +5711,9 @@ H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5274,8 +5730,9 @@ H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5292,8 +5749,9 @@ H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5310,8 +5768,9 @@ H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5328,8 +5787,9 @@ H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5346,8 +5806,9 @@ H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_sU(SCHAR, ULLONG, signed char, unsigned long long, -, -); } @@ -5364,8 +5825,9 @@ H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5382,8 +5844,9 @@ H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_uU(UCHAR, ULLONG, unsigned char, unsigned long long, -, -); } @@ -5400,8 +5863,9 @@ H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5418,8 +5882,9 @@ H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5436,8 +5901,9 @@ H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); } @@ -5454,8 +5920,9 @@ H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Uu(USHORT, UCHAR, unsigned short, unsigned char, -, UCHAR_MAX); } @@ -5472,8 +5939,9 @@ H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); } @@ -5490,8 +5958,9 @@ H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_us(USHORT, SHORT, unsigned short, short, -, SHRT_MAX); } @@ -5508,8 +5977,9 @@ H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5526,8 +5996,9 @@ H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5544,8 +6015,9 @@ H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5562,8 +6034,9 @@ H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5580,8 +6053,9 @@ H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5598,8 +6072,9 @@ H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5616,8 +6091,9 @@ H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5634,8 +6110,9 @@ H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_uU(USHORT, ULONG, unsigned short, unsigned long, -, -); } @@ -5652,8 +6129,9 @@ H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -5670,8 +6148,9 @@ H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_sU(SHORT, ULLONG, short, unsigned long long, -, -); } @@ -5688,8 +6167,9 @@ H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_uS(USHORT, LLONG, unsigned short, long long, -, LLONG_MAX); } @@ -5706,8 +6186,9 @@ H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_uU(USHORT, ULLONG, unsigned short, unsigned long long, -, -); } @@ -5724,8 +6205,9 @@ H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5742,8 +6224,9 @@ H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5760,8 +6243,9 @@ H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5778,8 +6262,9 @@ H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5796,8 +6281,9 @@ H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5814,8 +6300,9 @@ H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5832,8 +6319,9 @@ H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5850,8 +6338,9 @@ H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -5868,8 +6357,9 @@ H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5886,8 +6376,9 @@ H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5904,8 +6395,9 @@ H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5922,8 +6414,9 @@ H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5940,8 +6433,9 @@ H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -5958,8 +6452,9 @@ H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5976,8 +6471,9 @@ H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -5994,8 +6490,9 @@ H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -6012,8 +6509,9 @@ H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6030,8 +6528,9 @@ H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -6048,8 +6547,9 @@ H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6066,8 +6566,9 @@ H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6084,8 +6585,9 @@ H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6102,8 +6604,9 @@ H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6120,8 +6623,9 @@ H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6138,8 +6642,9 @@ H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6156,8 +6661,9 @@ H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6174,8 +6680,9 @@ H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Uu(ULONG, USHORT, unsigned long, unsigned short, -, USHRT_MAX); } @@ -6192,8 +6699,9 @@ H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6210,8 +6718,9 @@ H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6228,8 +6737,9 @@ H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6246,8 +6756,9 @@ H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6264,8 +6775,9 @@ H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -6282,8 +6794,9 @@ H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6300,8 +6813,9 @@ H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -6318,8 +6832,9 @@ H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -6336,8 +6851,9 @@ H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6354,8 +6870,9 @@ H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_uU(ULONG, ULLONG, unsigned long, unsigned long long, -, -); } @@ -6372,8 +6889,9 @@ H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6390,8 +6908,9 @@ H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6408,8 +6927,9 @@ H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Us(ULLONG, SCHAR, unsigned long long, signed char, -, SCHAR_MAX); } @@ -6426,8 +6946,9 @@ H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Uu(ULLONG, UCHAR, unsigned long long, unsigned char, -, UCHAR_MAX); } @@ -6444,8 +6965,9 @@ H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6462,8 +6984,9 @@ H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Su(LLONG, USHORT, long long, unsigned short, -, USHRT_MAX); } @@ -6480,8 +7003,9 @@ H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Us(ULLONG, SHORT, unsigned long long, short, -, SHRT_MAX); } @@ -6498,8 +7022,9 @@ H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Uu(ULLONG, USHORT, unsigned long long, unsigned short, -, USHRT_MAX); } @@ -6516,8 +7041,9 @@ H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6534,8 +7060,9 @@ H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6552,8 +7079,9 @@ H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6570,8 +7098,9 @@ H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6588,8 +7117,9 @@ H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); } @@ -6606,8 +7136,9 @@ H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6624,8 +7155,9 @@ H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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); } @@ -6642,8 +7174,9 @@ H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Uu(ULLONG, ULONG, unsigned long long, unsigned long, -, ULONG_MAX); } @@ -6660,8 +7193,9 @@ H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_su(LLONG, ULLONG, long long, unsigned long long, -, -); } @@ -6678,8 +7212,9 @@ H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_us(ULLONG, LLONG, unsigned long long, long long, -, LLONG_MAX); } @@ -6695,8 +7230,9 @@ H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_fF(FLOAT, DOUBLE, float, double, -, -); } @@ -6712,8 +7248,9 @@ H5T__conv_float_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_fF(FLOAT, LDOUBLE, float, long double, -, -); } @@ -6729,8 +7266,9 @@ H5T__conv_float_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Ff(DOUBLE, FLOAT, double, float, -FLT_MAX, FLT_MAX); } @@ -6746,8 +7284,9 @@ H5T__conv_double_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_fF(DOUBLE, LDOUBLE, double, long double, -, -); } @@ -6763,8 +7302,9 @@ H5T__conv_double_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Ff(LDOUBLE, FLOAT, long double, float, -FLT_MAX, FLT_MAX); } @@ -6780,8 +7320,9 @@ H5T__conv_ldouble_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_Ff(LDOUBLE, DOUBLE, long double, double, -DBL_MAX, DBL_MAX); } @@ -6797,8 +7338,9 @@ H5T__conv_ldouble_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -6814,8 +7356,9 @@ H5T__conv_schar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); } @@ -6831,8 +7374,9 @@ H5T__conv_schar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_schar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); } @@ -6848,8 +7392,9 @@ H5T__conv_schar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -6865,8 +7410,9 @@ H5T__conv_uchar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); } @@ -6882,8 +7428,9 @@ H5T__conv_uchar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_uchar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); } @@ -6899,8 +7446,9 @@ H5T__conv_uchar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -6916,8 +7464,9 @@ H5T__conv_short_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); } @@ -6933,8 +7482,9 @@ H5T__conv_short_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_short_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); } @@ -6950,8 +7500,9 @@ H5T__conv_short_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); } @@ -6967,8 +7518,9 @@ H5T__conv_ushort_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); } @@ -6984,8 +7536,9 @@ H5T__conv_ushort_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ushort_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); } @@ -7001,8 +7554,9 @@ H5T__conv_ushort_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -7018,8 +7572,9 @@ H5T__conv_int_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -7035,8 +7590,9 @@ H5T__conv_int_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_int_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -7052,8 +7608,9 @@ H5T__conv_int_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -7069,8 +7626,9 @@ H5T__conv_uint_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -7086,8 +7644,9 @@ H5T__conv_uint_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_uint_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); } @@ -7103,8 +7662,9 @@ H5T__conv_uint_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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, -, -); } @@ -7120,8 +7680,9 @@ H5T__conv_long_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -7137,8 +7698,9 @@ H5T__conv_long_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_long_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); } @@ -7154,8 +7716,9 @@ H5T__conv_long_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -7171,8 +7734,9 @@ H5T__conv_ulong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); } @@ -7188,8 +7752,9 @@ H5T__conv_ulong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ulong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); } @@ -7205,8 +7770,9 @@ H5T__conv_ulong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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, -, -); } @@ -7222,8 +7788,9 @@ H5T__conv_llong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(LLONG, DOUBLE, long long, double, -, -); } @@ -7240,8 +7807,9 @@ H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne */ #ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE herr_t -H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(LLONG, LDOUBLE, long long, long double, -, -); } @@ -7258,8 +7826,9 @@ H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(ULLONG, FLOAT, unsigned long long, float, -, -); } @@ -7275,8 +7844,9 @@ H5T__conv_ullong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(ULLONG, DOUBLE, unsigned long long, double, -, -); } @@ -7293,8 +7863,9 @@ H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n */ #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE herr_t -H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long long, long double, -, -); } @@ -7311,8 +7882,9 @@ H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); @@ -7330,8 +7902,9 @@ H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); @@ -7349,8 +7922,9 @@ H5T__conv_float_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -7368,8 +7942,9 @@ H5T__conv_double_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); @@ -7387,8 +7962,9 @@ H5T__conv_double_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -7406,8 +7982,9 @@ H5T__conv_ldouble_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); @@ -7425,8 +8002,9 @@ H5T__conv_ldouble_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); @@ -7444,8 +8022,9 @@ H5T__conv_float_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); @@ -7463,8 +8042,9 @@ H5T__conv_float_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); @@ -7482,8 +8062,9 @@ H5T__conv_double_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); @@ -7501,8 +8082,9 @@ H5T__conv_double_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); @@ -7520,8 +8102,9 @@ H5T__conv_ldouble_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); @@ -7539,8 +8122,9 @@ H5T__conv_ldouble_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); @@ -7558,8 +8142,9 @@ H5T__conv_float_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmt *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); @@ -7577,8 +8162,9 @@ H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); @@ -7596,8 +8182,9 @@ H5T__conv_double_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); @@ -7615,8 +8202,9 @@ H5T__conv_double_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); @@ -7634,8 +8222,9 @@ H5T__conv_ldouble_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); @@ -7653,8 +8242,9 @@ H5T__conv_ldouble_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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); @@ -7672,8 +8262,9 @@ H5T__conv_float_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelm *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); @@ -7691,8 +8282,9 @@ H5T__conv_float_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); @@ -7710,8 +8302,9 @@ H5T__conv_double_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); @@ -7729,8 +8322,9 @@ H5T__conv_double_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); @@ -7748,8 +8342,9 @@ H5T__conv_ldouble_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_ldouble_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); @@ -7767,8 +8362,9 @@ H5T__conv_ldouble_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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") H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); @@ -7786,8 +8382,9 @@ H5T__conv_float_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nel *------------------------------------------------------------------------- */ herr_t -H5T__conv_float_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); @@ -7805,8 +8402,9 @@ H5T__conv_float_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); @@ -7824,8 +8422,9 @@ H5T__conv_double_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t ne *------------------------------------------------------------------------- */ herr_t -H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); @@ -7844,8 +8443,9 @@ H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n */ #ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG herr_t -H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); @@ -7865,8 +8465,9 @@ H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t n */ #ifdef H5T_CONV_INTERNAL_LDOUBLE_ULLONG herr_t -H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, - size_t H5_ATTR_UNUSED bkg_stride, void *buf, void H5_ATTR_UNUSED *bkg) +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) { H5_GCC_CLANG_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); @@ -7874,6 +8475,255 @@ H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t } #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 * @@ -7886,12 +8736,11 @@ H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t *------------------------------------------------------------------------- */ herr_t -H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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_t *src_p; /*source datatype */ - H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ int direction; /*forward or backward traversal */ @@ -7905,25 +8754,24 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - hssize_t expo; /*source exponent */ - hssize_t sign; /*source sign bit value */ - 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' */ - H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ - 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 */ - herr_t ret_value = SUCCEED; /* Return value */ + hssize_t expo; /*source exponent */ + hssize_t sign; /*source sign bit value */ + uint8_t *int_buf = NULL; /*buffer for temporary value */ + size_t buf_size; /*buffer size for temporary value */ + size_t i; /*miscellaneous counters */ + 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 */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE switch (cdata->command) { case H5T_CONV_INIT: - if (NULL == (src_p = (H5T_t *)H5I_object(src_id)) || - NULL == (dst_p = (H5T_t *)H5I_object(dst_id))) + if (NULL == src_p || NULL == dst_p) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -7940,10 +8788,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz break; case H5T_CONV_CONV: - /* Get the datatypes */ - if (NULL == (src_p = (H5T_t *)H5I_object(src_id)) || - NULL == (dst_p = (H5T_t *)H5I_object(dst_id))) + if (NULL == src_p || NULL == dst_p) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); + src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -7976,12 +8825,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* 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); - - /* Get conversion exception callback property */ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); + 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); @@ -8064,13 +8912,16 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* +Infinity or -Infinity */ - if (sign) { /* -Infinity */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (sign) { /* -Infinity */ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, - d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_NINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -8086,13 +8937,16 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); } - else { /* +Infinity */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + else { /* +Infinity */ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, - d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_PINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -8120,13 +8974,16 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ /* +Infinity or -Infinity */ - if (sign) { /* -Infinity */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (sign) { /* -Infinity */ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, - cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_NINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -8142,13 +8999,16 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); } - else { /* +Infinity */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + else { /* +Infinity */ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PINF, src_id, dst_id, src_rev, d, - cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_PINF, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -8170,11 +9030,12 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T__bit_find(s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, false) < 0) { /* NaN */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NAN, src_id, dst_id, src_rev, d, - cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_NAN, conv_ctx->u.conv.src_type_id, conv_ctx->u.conv.dst_type_id, + src_rev, d, conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) { @@ -8233,36 +9094,47 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz 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); - /* - * If expo is less than mantissa size, the frantional value is dropped off - * during conversion. Set exception type to be "truncate" + /* 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) */ - if ((size_t)expo < src.u.f.msize && cb_struct.func) - truncated = true; + new_msb_pos = msb_pos_s + shift_val; + if (new_msb_pos == -1) + goto padding; /* - * What is the bit position for the most significant bit(MSB) of S - * which is set? This is checked before converted to negative - * integer. + * If expo is less than mantissa size, the fractional value is dropped off + * during conversion. Set exception type to be "truncate" */ - sfirst = H5T__bit_find(int_buf, (size_t)0, 8 * buf_size, H5T_BIT_MSB, true); - first = (size_t)sfirst; + if ((size_t)expo < src.u.f.msize && conv_ctx->u.conv.cb_struct.func) + truncated = true; - 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 @@ -8271,13 +9143,16 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz * zero(do nothing). If user's exception handler is set, call it and * let user handle it. */ - if (sign) { /*source is negative*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (sign) { /*source is negative*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, - d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); @@ -8289,14 +9164,17 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } } else { /*source is positive*/ - if (first >= dst.prec) { + if (new_msb_pos >= (ssize_t)dst.prec) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, - src_rev, d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) @@ -8310,19 +9188,23 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception"); } - else if (first < dst.prec) { - if (truncated && - cb_struct.func) { /*If user's exception handler is present, use it*/ + else { + if (truncated && conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, - src_rev, d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + 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; @@ -8336,20 +9218,22 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } else if (H5T_SGN_2 == dst.u.i.sign) { /*Destination is signed*/ if (sign) { /*source is negative*/ - if (first < dst.prec - 1) { - if (truncated && - cb_struct.func) { /*If user's exception handler is present, use it*/ + 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*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, - src_rev, d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } 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); @@ -8368,12 +9252,15 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* if underflows and no callback, do nothing except turn on * the sign bit because 0x80...00 is the biggest negative value. */ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, - src_rev, d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) @@ -8389,14 +9276,17 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz } } else { /*source is positive*/ - if (first >= dst.prec - 1) { + if (new_msb_pos >= (ssize_t)dst.prec - 1) { /*overflow*/ - if (cb_struct.func) { /*If user's exception handler is present, use it*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, - src_rev, d, cb_struct.user_data); + 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, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_UNHANDLED) @@ -8410,19 +9300,22 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz goto next; } } - else if (first < dst.prec - 1) { - if (truncated && - cb_struct.func) { /*If user's exception handler is present, use it*/ + 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*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, - src_rev, d, cb_struct.user_data); + except_ret = (conv_ctx->u.conv.cb_struct.func)( + H5T_CONV_EXCEPT_TRUNCATE, conv_ctx->u.conv.src_type_id, + conv_ctx->u.conv.dst_type_id, src_rev, d, + conv_ctx->u.conv.cb_struct.user_data); } 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, @@ -8509,12 +9402,11 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz *------------------------------------------------------------------------- */ herr_t -H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, 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_t *src_p; /*source datatype */ - H5T_t *dst_p; /*destination datatype */ H5T_atomic_t src; /*atomic source info */ H5T_atomic_t dst; /*atomic destination info */ int direction; /*forward or backward traversal */ @@ -8528,27 +9420,25 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ /* Conversion-related variables */ - hsize_t expo; /*destination exponent */ - hsize_t expo_max; /*maximal possible exponent value */ - size_t sign; /*source sign bit value */ - bool is_max_neg; /*source is maximal negative value*/ - bool do_round; /*whether there is roundup */ - 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' */ - H5T_conv_cb_t cb_struct = {NULL, NULL}; /*conversion callback structure */ - H5T_conv_ret_t except_ret; /*return of callback function */ - bool reverse; /*if reverse the order of destination */ - herr_t ret_value = SUCCEED; /* Return value */ + hsize_t expo; /*destination exponent */ + hsize_t expo_max; /*maximal possible exponent value */ + size_t sign; /*source sign bit value */ + bool is_max_neg; /*source is maximal negative value*/ + bool do_round; /*whether there is roundup */ + 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' */ + H5T_conv_ret_t except_ret; /*return of callback function */ + bool reverse; /*if reverse the order of destination */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE switch (cdata->command) { case H5T_CONV_INIT: - if (NULL == (src_p = (H5T_t *)H5I_object(src_id)) || - NULL == (dst_p = (H5T_t *)H5I_object(dst_id))) + if (NULL == src_p || NULL == dst_p) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -8565,10 +9455,11 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz break; case H5T_CONV_CONV: - /* Get the datatypes */ - if (NULL == (src_p = (H5T_t *)H5I_object(src_id)) || - NULL == (dst_p = (H5T_t *)H5I_object(dst_id))) + if (NULL == src_p || NULL == dst_p) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype"); + if (NULL == conv_ctx) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid datatype conversion context pointer"); + src = src_p->shared->u.atomic; dst = dst_p->shared->u.atomic; @@ -8601,13 +9492,9 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* 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); - /* Get conversion exception callback property */ - if (H5CX_get_dt_conv_cb(&cb_struct) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t *)H5MM_calloc(src_p->shared->size); @@ -8743,11 +9630,12 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* If the bit sequence is bigger than the mantissa part, there'll be some * precision loss. Let user's handler deal with the case if it's present */ - if (cb_struct.func) { + if (conv_ctx->u.conv.cb_struct.func) { H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, src_rev, d, - cb_struct.user_data); + 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, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); } if (except_ret == H5T_CONV_HANDLED) { @@ -8813,12 +9701,14 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz /* Check if the exponent is too big */ expo_max = (hsize_t)(pow(2.0, (double)dst.u.f.esize) - 1); - if (expo > expo_max) { /*overflows*/ - if (cb_struct.func) { /*user's exception handler. Reverse back source order*/ + if (expo > expo_max) { /*overflows*/ + if (conv_ctx->u.conv.cb_struct + .func) { /*user's exception handler. Reverse back source order*/ H5T__reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, - cb_struct.user_data); + 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, src_rev, d, conv_ctx->u.conv.cb_struct.user_data); if (except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, @@ -8828,7 +9718,8 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz 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; @@ -8973,9 +9864,8 @@ H5T__reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) *------------------------------------------------------------------------- */ herr_t -H5T_reclaim(hid_t type_id, H5S_t *space, void *buf) +H5T_reclaim(const H5T_t *type, H5S_t *space, void *buf) { - H5T_t *type; /* Datatype */ H5S_sel_iter_op_t dset_op; /* Operator for iteration */ H5T_vlen_alloc_info_t vl_alloc_info; /* VL allocation info */ herr_t ret_value = FAIL; /* Return value */ @@ -8983,13 +9873,10 @@ H5T_reclaim(hid_t type_id, H5S_t *space, void *buf) FUNC_ENTER_NOAPI_NOINIT /* Check args */ - assert(H5I_DATATYPE == H5I_get_type(type_id)); + assert(type); assert(space); assert(buf); - if (NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype"); - /* Get the allocation info */ if (H5CX_get_vlen_alloc_info(&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info"); diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 34e3687918e..d9f293071d9 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -32,10 +32,9 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ #include "H5CXprivate.h" /* API Contexts */ #include "H5Eprivate.h" /* Error handling */ -#include "H5FOprivate.h" /* File objects */ +#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 09407b12aee..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: @@ -222,7 +223,7 @@ H5Tget_member_value(hid_t type, unsigned membno, void *value /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "iIux", type, membno, value); + H5TRACE3("e", "iIu*x", type, membno, value); if (NULL == (dt = (H5T_t *)H5I_object_verify(type, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); @@ -289,7 +290,7 @@ H5Tenum_nameof(hid_t type, const void *value, char *name /*out*/, size_t size) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE4("e", "i*xxz", type, value, name, size); + H5TRACE4("e", "i*x*sz", type, value, name, size); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type, H5I_DATATYPE))) @@ -420,7 +421,7 @@ H5Tenum_valueof(hid_t type, const char *name, void *value /*out*/) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE3("e", "i*sx", type, name, value); + H5TRACE3("e", "i*s*x", type, name, value); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type, H5I_DATATYPE))) diff --git a/src/H5Tfields.c b/src/H5Tfields.c index dc839bac677..55289f6793b 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -177,7 +177,7 @@ H5T__get_member_name(H5T_t const *dt, unsigned membno) case H5T_NCLASSES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "operation not supported for type class"); - } /*lint !e788 All appropriate cases are covered */ + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -237,7 +237,7 @@ H5Tget_member_index(hid_t type_id, const char *name) case H5T_NCLASSES: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for this type"); - } /*lint !e788 All appropriate cases are covered */ + } done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index 9f7b4f718c5..c580e227b6a 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -47,7 +47,7 @@ H5Tget_fields(hid_t type_id, size_t *spos /*out*/, size_t *epos /*out*/, size_t herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE6("e", "ixxxxx", type_id, spos, epos, esize, mpos, msize); + H5TRACE6("e", "i*z*z*z*z*z", type_id, spos, epos, esize, mpos, msize); /* Check args */ if (NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) diff --git a/src/H5Tinit_float.c b/src/H5Tinit_float.c index 02bb3bad771..2642554b0f9 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 * 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 *