From ca0c0c3dc83acb7261e607cfee3b3ef04d167188 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 30 Sep 2020 09:28:21 -0500 Subject: Merge of clang-format changes from develop --- .clang-format | 62 + .github/CODEOWNERS | 42 + .github/workflows/clang-format-check.yml | 16 + .github/workflows/main.yml | 62 +- .github/workflows/pr-check.yml | 134 ++ CMakeLists.txt | 3 + MANIFEST | 7 + bin/format_source | 6 + bin/format_source_patch | 14 + c++/examples/CMakeLists.txt | 14 + c++/src/CMakeLists.txt | 11 + c++/test/CMakeLists.txt | 9 +- config/sanitizer/formatting.cmake | 144 ++ config/sanitizer/tools.cmake | 11 +- examples/CMakeLists.txt | 14 + examples/h5_dtransform.c | 52 +- fortran/src/CMakeLists.txt | 23 + fortran/src/H5Pf.c | 92 +- fortran/test/CMakeLists.txt | 15 +- hl/CMakeLists.txt | 6 +- hl/c++/examples/CMakeLists.txt | 7 + hl/c++/src/CMakeLists.txt | 13 +- hl/c++/test/CMakeLists.txt | 7 + hl/examples/CMakeLists.txt | 7 + hl/examples/pal_rgb.h | 515 +++--- hl/fortran/src/CMakeLists.txt | 15 +- hl/src/CMakeLists.txt | 19 + hl/src/H5LT.c | 150 +- hl/test/CMakeLists.txt | 28 + hl/test/pal_rgb.h | 521 +++--- hl/tools/gif2h5/CMakeLists.txt | 29 + hl/tools/h5watch/CMakeLists.txt | 32 + java/src/jni/CMakeLists.txt | 8 + java/src/jni/h5Constants.c | 13 +- java/src/jni/h5util.c | 2 +- release_docs/RELEASE.txt | 9 +- src/CMakeLists.txt | 66 +- src/H5ACprivate.h | 126 +- src/H5C.c | 1997 ++++++++++++----------- src/H5Cpkg.h | 1800 ++++++++++----------- src/H5Cprivate.h | 1888 +++++++++++----------- src/H5Dint.c | 3 + src/H5FDcore.c | 10 +- src/H5FDfamily.c | 550 +++---- src/H5FDmulti.c | 1167 +++++++------- src/H5FDprivate.h | 30 +- src/H5Fprivate.h | 50 +- src/H5Gpkg.h | 46 +- src/H5Gprivate.h | 24 +- src/H5Lprivate.h | 19 +- src/H5Lpublic.h | 14 +- src/H5MFpkg.h | 13 +- src/H5PLint.c | 4 +- src/H5PLplugin_cache.c | 4 +- src/H5Tconv.c | 174 +- src/H5Tnative.c | 76 +- src/H5VMprivate.h | 88 +- src/H5detect.c | 66 +- src/H5public.h | 13 +- src/H5system.c | 4 +- test/CMakeLists.txt | 145 +- test/CMakeTests.cmake | 7 + test/big.c | 206 +-- test/cache.c | 41 +- test/error_test.c | 4 +- test/external.c | 8 +- test/external_env.c | 3 - test/fheap.c | 2420 ++++++++++++++-------------- test/file_image.c | 6 +- test/h5test.c | 8 +- test/ntypes.c | 31 +- test/tvlstr.c | 9 +- test/vfd.c | 12 +- testpar/CMakeLists.txt | 18 +- testpar/testphdf5.h | 5 +- tools/lib/CMakeLists.txt | 13 + tools/libtest/CMakeLists.txt | 7 + tools/src/h5copy/CMakeLists.txt | 11 + tools/src/h5diff/CMakeLists.txt | 13 + tools/src/h5diff/h5diff_common.c | 8 +- tools/src/h5dump/CMakeLists.txt | 23 +- tools/src/h5format_convert/CMakeLists.txt | 11 + tools/src/h5import/CMakeLists.txt | 15 +- tools/src/h5jam/CMakeLists.txt | 13 + tools/src/h5ls/CMakeLists.txt | 11 + tools/src/h5repack/CMakeLists.txt | 12 + tools/src/h5stat/CMakeLists.txt | 11 + tools/src/misc/CMakeLists.txt | 17 + tools/test/h5copy/CMakeLists.txt | 15 + tools/test/h5diff/CMakeLists.txt | 14 + tools/test/h5dump/CMakeLists.txt | 14 + tools/test/h5format_convert/CMakeLists.txt | 14 + tools/test/h5import/CMakeLists.txt | 7 + tools/test/h5jam/CMakeLists.txt | 15 + tools/test/h5ls/CMakeLists.txt | 8 + tools/test/h5repack/CMakeLists.txt | 16 + tools/test/h5stat/CMakeLists.txt | 7 + tools/test/misc/CMakeLists.txt | 28 + tools/test/misc/vds/CMakeLists.txt | 11 +- tools/test/perform/CMakeLists.txt | 109 +- tools/test/perform/sio_engine.c | 4 +- utils/mirror_vfd/CMakeLists.txt | 18 +- 102 files changed, 7578 insertions(+), 6134 deletions(-) create mode 100644 .clang-format create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/clang-format-check.yml create mode 100644 .github/workflows/pr-check.yml create mode 100755 bin/format_source create mode 100755 bin/format_source_patch create mode 100644 config/sanitizer/formatting.cmake diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..36f326d --- /dev/null +++ b/.clang-format @@ -0,0 +1,62 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AlignConsecutiveMacros: true +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: true +AlwaysBreakAfterReturnType: AllDefinitions +BraceWrapping: + AfterFunction: true + BeforeCatch: true + BeforeElse: true +BreakBeforeBraces: Stroustrup +BreakAfterJavaFieldAnnotations: true +BreakStringLiterals: true +ColumnLimit: 110 +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 3 + SortPriority: 0 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 4 + SortPriority: 0 + - Regex: '.*' + Priority: 0 + SortPriority: 0 + - Regex: '^H5*.*' + Priority: 1 + SortPriority: 0 + - Regex: 'private.*' + Priority: 2 + SortPriority: 0 +IncludeIsMainRegex: '(public)?$' +IndentCaseLabels: true +IndentGotoLabels: false +IndentWidth: 4 +ObjCBlockIndentWidth: 4 +ReflowComments: true +SortIncludes: false +StatementMacros: + - FUNC_ENTER_API + - FUNC_LEAVE_API + - FUNC_ENTER_NOAPI_NOINIT_NOERR + - FUNC_LEAVE_NOAPI + - H5_BEGIN_TAG + - HGOTO_DONE_TAG + - H5_END_TAG + - HSYS_DONE_ERROR + - HSYS_GOTO_ERROR + - HDONE_ERROR + - HERROR + - H5_LEAVE + - H5E_PRINTF + - H5E_THROW + - HGOTO_DONE + - HGOTO_ERROR + - HMPI_ERROR + - HMPI_DONE_ERROR + - HMPI_GOTO_ERROR + - H5_GCC_DIAG_OFF + - H5_GCC_DIAG_ON +... + diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..31b194f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,42 @@ +# Lines starting with '#' are comments. +# Each line is a file pattern followed by one or more owners. + +# These owners will be the default owners for everything in the repo. +* @lrknox + +# Order is important. The last matching pattern has the most precedence. +# So if a pull request only touches javascript files, only these owners +# will be requested to review. +*.cmake @byrnHDF +CMakeLists.txt @byrnHDF +CMakeTests.* @byrnHDF + +/bin/ @lrknox @derobins @byrnHDF + +/c++/ bmribler@hdfgroup.org + +/config/ @lrknox @derobins @byrnHDF + +/doc/ @gnuoyd mainzer@hdfgroup.org + +/examples/ @lrknox @derobins bljones@hdfgroup.org + +/fortran/ @brtnfld @epourmal + +/hl/ bmribler@hdfgroup.org + +/java/ @jhendersonHDF @byrnHDF + +/m4/ @lrknox @derobins + +/release_docs/ @lrknox bljones@hdfgroup.org @byrnHDF + +/src/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup mainzer@hdfgroup.org + +/test/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup mainzer@hdfgroup.org + +/testpar/ @jhendersonHDF @rawarren mainzer@hdfgroup.org + +/tools/ @byrnHDF + +/utils/ @lrknox @byrnHDF diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml new file mode 100644 index 0000000..5b5222b --- /dev/null +++ b/.github/workflows/clang-format-check.yml @@ -0,0 +1,16 @@ +name: clang-format Check +on: [push, pull_request] +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Run clang-format style check for C programs. + uses: DoozyX/clang-format-lint-action@v0.8 + with: + source: '.' + extensions: 'c,h,cpp' + clangFormatVersion: 10 + style: file + exclude: './config ./hl/src/H5LTanalyze.c' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60e21c7..355e2e6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,8 +4,6 @@ name: hdf5 dev CI on: push: branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] - pull_request: - branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -14,7 +12,7 @@ jobs: strategy: # fail-fast: false matrix: - name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "macOS Latest Clang"] + name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC"] include: - name: "Windows Latest MSVC" artifact: "Windows-MSVC.tar.xz" @@ -27,16 +25,47 @@ jobs: artifact: "Linux.tar.xz" os: ubuntu-latest build_type: "Release" + cpp: ON fortran: OFF + parallel: OFF toolchain: "config/toolchain/GCC.cmake" generator: "-G Ninja" - name: "macOS Latest Clang" artifact: "macOS.tar.xz" os: macos-latest build_type: "Release" + cpp: ON fortran: OFF + parallel: OFF toolchain: "config/toolchain/clang.cmake" generator: "-G Ninja" + - name: "Ubuntu Debug GCC" + artifact: "LinuxDBG.tar.xz" + os: ubuntu-latest + build_type: "Debug" + cpp: ON + fortran: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "Ubuntu Autotools GCC" + artifact: "Linux.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: enable + fortran: enable + parallel: disable + toolchain: "" + generator: "autogen" +# - name: "Ubuntu Parallel GCC" +# artifact: "LinuxPar.tar.xz" +# os: ubuntu-latest +# build_type: "Release" +# cpp: OFF +# fortran: OFF +# parallel: ON +# toolchain: "config/toolchain/GCC.cmake" +# generator: "-G Ninja" name: ${{ matrix.name }} # The type of runner that the job will run on @@ -47,6 +76,9 @@ jobs: - name: Install Dependencies (Linux) run: sudo apt-get install ninja-build if: matrix.os == 'ubuntu-latest' + - name: Install Autotools Dependencies (Linux) + run: sudo apt-get install automake autoconf libtool libtool-bin + if: matrix.generator == 'autogen' - name: Install Dependencies (Windows) run: choco install ninja if: matrix.os == 'windows-latest' @@ -64,17 +96,39 @@ jobs: - name: Get Sources uses: actions/checkout@v2 + - name: Autotools Configure + if: matrix.generator == 'autogen' + run: | + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --enable-java + shell: bash + - name: Configure + if: matrix.generator != 'autogen' run: | mkdir "${{ runner.workspace }}/build" cd "${{ runner.workspace }}/build" - cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE + cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} -DHDF5_BUILD_CPP_LIB:BOOL=${{ matrix.cpp }} -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE shell: bash + - name: Autotools Build + if: matrix.generator == 'autogen' + run: make + working-directory: ${{ runner.workspace }}/build + - name: Build + if: matrix.generator != 'autogen' run: cmake --build . --config ${{ matrix.build_type }} working-directory: ${{ runner.workspace }}/build + - name: Autotools Test + if: matrix.generator == 'autogen' + run: make check + working-directory: ${{ runner.workspace }}/build + - name: Test + if: matrix.generator != 'autogen' run: ctest --build . -C ${{ matrix.build_type }} -V working-directory: ${{ runner.workspace }}/build diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml new file mode 100644 index 0000000..e3b9d9b --- /dev/null +++ b/.github/workflows/pr-check.yml @@ -0,0 +1,134 @@ +name: hdf5 dev CI + +# Controls when the action will run. Triggers the workflow on push or pull request +on: + pull_request: + branches: [ develop, hdf5_1_12, hdf5_1_10, hdf5_1_8 ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + strategy: +# fail-fast: false + matrix: + name: ["Windows Latest MSVC", "Ubuntu Latest GCC", "Ubuntu Debug GCC", "macOS Latest Clang", "Ubuntu Autotools GCC"] + include: + - name: "Windows Latest MSVC" + artifact: "Windows-MSVC.tar.xz" + os: windows-latest + build_type: "Release" + toolchain: "" + fortran: OFF + generator: "-G \"Visual Studio 16 2019\" -A x64" + - name: "Ubuntu Latest GCC" + artifact: "Linux.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: ON + fortran: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "macOS Latest Clang" + artifact: "macOS.tar.xz" + os: macos-latest + build_type: "Release" + cpp: ON + fortran: OFF + parallel: OFF + toolchain: "config/toolchain/clang.cmake" + generator: "-G Ninja" + - name: "Ubuntu Debug GCC" + artifact: "LinuxDBG.tar.xz" + os: ubuntu-latest + build_type: "Debug" + cpp: ON + fortran: OFF + parallel: OFF + toolchain: "config/toolchain/GCC.cmake" + generator: "-G Ninja" + - name: "Ubuntu Autotools GCC" + artifact: "Linux.tar.xz" + os: ubuntu-latest + build_type: "Release" + cpp: enable + fortran: enable + parallel: disable + toolchain: "" + generator: "autogen" +# - name: "Ubuntu Parallel GCC" +# artifact: "LinuxPar.tar.xz" +# os: ubuntu-latest +# build_type: "Release" +# cpp: OFF +# fortran: OFF +# parallel: ON +# toolchain: "config/toolchain/GCC.cmake" +# generator: "-G Ninja" + + name: ${{ matrix.name }} + # The type of runner that the job will run on + runs-on: ${{ matrix.os }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Install Dependencies (Linux) + run: sudo apt-get install ninja-build + if: matrix.os == 'ubuntu-latest' + - name: Install Autotools Dependencies (Linux) + run: sudo apt-get install automake autoconf libtool libtool-bin + if: matrix.generator == 'autogen' + - name: Install Dependencies (Windows) + run: choco install ninja + if: matrix.os == 'windows-latest' + - name: Install Dependencies (macOS) + run: brew install ninja + if: matrix.os == 'macos-latest' + - name: Set environment for MSVC (Windows) + if: matrix.os == 'windows-latest' + run: | + # Set these env vars so cmake picks the correct compiler + echo "::set-env name=CXX::cl.exe" + echo "::set-env name=CC::cl.exe" + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Get Sources + uses: actions/checkout@v2 + + - name: Autotools Configure + if: matrix.generator == 'autogen' + run: | + sh ./autogen.sh + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + $GITHUB_WORKSPACE/configure --enable-shared --${{ matrix.parallel }}-parallel --${{ matrix.cpp }}-cxx --${{ matrix.fortran }}-fortran --enable-java + shell: bash + + - name: Configure + if: matrix.generator != 'autogen' + run: | + mkdir "${{ runner.workspace }}/build" + cd "${{ runner.workspace }}/build" + cmake ${{ matrix.generator }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${{ matrix.toolchain }} -DBUILD_SHARED_LIBS=ON -DHDF5_ENABLE_ALL_WARNINGS=ON -DHDF5_ENABLE_PARALLEL:BOOL=${{ matrix.parallel }} -DHDF5_BUILD_CPP_LIB:BOOL=${{ matrix.cpp }} -DHDF5_BUILD_FORTRAN=${{ matrix.fortran }} -DHDF5_BUILD_JAVA=ON $GITHUB_WORKSPACE + shell: bash + + - name: Autotools Build + if: matrix.generator == 'autogen' + run: make + working-directory: ${{ runner.workspace }}/build + + - name: Build + if: matrix.generator != 'autogen' + run: cmake --build . --config ${{ matrix.build_type }} + working-directory: ${{ runner.workspace }}/build + + - name: Autotools Test + if: matrix.generator == 'autogen' + run: make check + working-directory: ${{ runner.workspace }}/build + + - name: Test + if: matrix.generator != 'autogen' + run: ctest --build . -C ${{ matrix.build_type }} -V + working-directory: ${{ runner.workspace }}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index 029449d..1e50a06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -497,6 +497,9 @@ endif () if (HDF5_ENABLE_SANITIZERS) include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake) endif () +if (HDF5_ENABLE_FORMATTERS) + include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake) +endif () #----------------------------------------------------------------------------- # Option to use code coverage diff --git a/MANIFEST b/MANIFEST index 920f123..b456f46 100644 --- a/MANIFEST +++ b/MANIFEST @@ -33,7 +33,11 @@ ./autogen.sh ./configure.ac +./.clang-format +./.github/CODEOWNERS _DO_NOT_DISTRIBUTE_ +./.github/workflows/clang-format-check.yml _DO_NOT_DISTRIBUTE_ ./.github/workflows/main.yml _DO_NOT_DISTRIBUTE_ +./.github/workflows/pr-check.yml _DO_NOT_DISTRIBUTE_ ./m4/aclocal_cxx.m4 ./m4/aclocal_fc.m4 @@ -71,6 +75,8 @@ ./bin/deploy ./bin/distdep ./bin/errors _DO_NOT_DISTRIBUTE_ +./bin/format_source +./bin/format_source_patch ./bin/genparser ./bin/gcov_script _DO_NOT_DISTRIBUTE_ ./bin/h5cc.in @@ -3527,6 +3533,7 @@ # CMake-specific Sanitizer Scripts ./config/sanitizer/code-coverage.cmake +./config/sanitizer/formatting.cmake ./config/sanitizer/sanitizers.cmake ./config/sanitizer/tools.cmake ./config/sanitizer/LICENSE diff --git a/bin/format_source b/bin/format_source new file mode 100755 index 0000000..b0b695c --- /dev/null +++ b/bin/format_source @@ -0,0 +1,6 @@ +#!/bin/bash +find . -type d \( -path ./config \) -prune \ + -o -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp \ + | xargs clang-format -style=file -i -fallback-style=none + +exit 0 \ No newline at end of file diff --git a/bin/format_source_patch b/bin/format_source_patch new file mode 100755 index 0000000..4c531ea --- /dev/null +++ b/bin/format_source_patch @@ -0,0 +1,14 @@ +#!/bin/bash +find . -type d \( -path ./config \) -prune \ + -o -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp \ + | xargs clang-format -style=file -i -fallback-style=none + +git diff > clang_format.patch + +# Delete if 0 size +if [ ! -s clang_format.patch ] +then + rm clang_format.patch +fi + +exit 0 \ No newline at end of file diff --git a/c++/examples/CMakeLists.txt b/c++/examples/CMakeLists.txt index 890d22d..b56014f 100644 --- a/c++/examples/CMakeLists.txt +++ b/c++/examples/CMakeLists.txt @@ -48,6 +48,13 @@ foreach (example ${examples}) endif () endif () set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example}) + endif () endforeach () foreach (example ${tutr_examples}) @@ -66,6 +73,13 @@ foreach (example ${tutr_examples}) endif () endif () set_target_properties (cpp_ex_${example} PROPERTIES FOLDER examples/cpp) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_CPP_EXAMPLES_${example}_FORMAT cpp_ex_${example}) + endif () endforeach () if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index 058f457..0b4473f 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -129,6 +129,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIB_TARGET}) + else () + clang_format (HDF5_CPP_SRC_FORMAT ${HDF5_CPP_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt index ca2295e..b911424 100644 --- a/c++/test/CMakeLists.txt +++ b/c++/test/CMakeLists.txt @@ -37,7 +37,7 @@ set (CPP_TEST_SOURCES set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_CPP_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ) +add_executable (cpp_testhdf5 ${CPP_TEST_SOURCES} ${HDF5_CPP_TEST_SOURCE_DIR}/h5cpputil.h) target_include_directories (cpp_testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(cpp_testhdf5 PRIVATE "${HDF5_CMAKE_CXX_FLAGS}") target_compile_definitions(cpp_testhdf5 @@ -57,6 +57,13 @@ else () endif () set_target_properties (cpp_testhdf5 PROPERTIES FOLDER test/cpp) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_CPP_TEST_cpp_testhdf5_FORMAT cpp_testhdf5) +endif () + if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/config/sanitizer/formatting.cmake b/config/sanitizer/formatting.cmake new file mode 100644 index 0000000..677a69a --- /dev/null +++ b/config/sanitizer/formatting.cmake @@ -0,0 +1,144 @@ +# +# Copyright (C) 2019 by George Cave - gcave@stablecoder.ca +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# +# clang-format +# +find_program(CLANG_FORMAT_EXE "clang-format") +mark_as_advanced(FORCE CLANG_FORMAT_EXE) +if(CLANG_FORMAT_EXE) + message(STATUS "clang-format found: ${CLANG_FORMAT_EXE}") +else() + message(STATUS "clang-format not found!") +endif() + +# Generates a 'format' target using a custom name, files, and include +# directories all being parameters. +# +# Do note that in order for sources to be inherited properly, the source paths +# must be reachable from where the macro is called, or otherwise require a full +# path for proper inheritance. +# +# ~~~ +# Required: +# TARGET_NAME - The name of the target to create. +# +# Optional: ARGN - The list of targets OR files to format. Relative and absolute +# paths are accepted. +# ~~~ +function(clang_format TARGET_NAME) + if(CLANG_FORMAT_EXE) + set(FORMAT_FILES) + # Check through the ARGN's, determine existent files + foreach(item IN LISTS ARGN) + if(TARGET ${item}) + # If the item is a target, then we'll attempt to grab the associated + # source files from it. + get_target_property(_TARGET_TYPE ${item} TYPE) + if(NOT + _TARGET_TYPE + STREQUAL + "INTERFACE_LIBRARY") + get_property( + _TEMP + TARGET ${item} + PROPERTY SOURCES) + foreach(iter IN LISTS _TEMP) + if(EXISTS ${iter}) + set(FORMAT_FILES ${FORMAT_FILES} ${iter}) + endif() + endforeach() + endif() + elseif(EXISTS ${item}) + # Check if it's a full file path + set(FORMAT_FILES ${FORMAT_FILES} ${item}) + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + # Check if it's based on the current source dir + set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${item}) + endif() + endforeach() + + # Make the target + if(FORMAT_FILES) + if(TARGET ${TARGET_NAME}) + message( + ERROR + "Cannot create clang-format target '${TARGET_NAME}', already exists.") + else() + add_custom_target(${TARGET_NAME} COMMAND ${CLANG_FORMAT_EXE} -i -style=file ${FORMAT_FILES}) + + if(NOT TARGET format) + add_custom_target(format) + endif() + + add_dependencies(format ${TARGET_NAME}) + endif() + endif() + + endif() +endfunction() + +# +# cmake-format +# +find_program(CMAKE_FORMAT_EXE "cmake-format") +mark_as_advanced(FORCE CMAKE_FORMAT_EXE) +if(CMAKE_FORMAT_EXE) + message(STATUS "cmake-format found: ${CMAKE_FORMAT_EXE}") +else() + message(STATUS "cmake-format not found!") +endif() + +# When called, this function will call 'cmake-format' program on all listed +# files (if both the program and the files exist and are found) +# ~~~ +# Required: +# TARGET_NAME - The name of the target to create. +# +# Optional: +# ARGN - Any arguments passed in will be considered as 'files' to perform the +# formatting on. Any items that are not files will be ignored. Both relative and +# absolute paths are accepted. +# ~~~ +function(cmake_format TARGET_NAME) + if(CMAKE_FORMAT_EXE) + set(FORMAT_FILES) + # Determine files that exist + foreach(iter IN LISTS ARGN) + if(EXISTS ${iter}) + set(FORMAT_FILES ${FORMAT_FILES} ${iter}) + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${iter}) + set(FORMAT_FILES ${FORMAT_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${iter}) + endif() + endforeach() + + # Generate target + if(FORMAT_FILES) + if(TARGET ${TARGET_NAME}) + message( + ERROR + "Cannot create cmake-format target '${TARGET_NAME}', already exists.") + else() + add_custom_target(${TARGET_NAME} COMMAND ${CMAKE_FORMAT_EXE} -i + ${FORMAT_FILES}) + + if(NOT TARGET cmake-format) + add_custom_target(cmake-format) + endif() + add_dependencies(cmake-format ${TARGET_NAME}) + endif() + endif() + endif() +endfunction() diff --git a/config/sanitizer/tools.cmake b/config/sanitizer/tools.cmake index a44022f..2f73cce 100644 --- a/config/sanitizer/tools.cmake +++ b/config/sanitizer/tools.cmake @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 by George Cave - gcave@stablecoder.ca +# Copyright (C) 2018-2020 by George Cave - gcave@stablecoder.ca # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of @@ -29,7 +29,7 @@ endmacro() # used as the options set. macro(include_what_you_use) if(IWYU AND IWYU_EXE) - set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${IWYU_EXE};${IWYU_STRING}") + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXE} ${ARGN}) endif() endmacro() @@ -37,11 +37,12 @@ endmacro() # options set. macro(cppcheck) if(CPPCHECK AND CPPCHECK_EXE) - set(CMAKE_CXX_CPPCHECK "${CPPCHECK_EXE};${CPPCHECK_STRING}") + set(CMAKE_CXX_CPPCHECK ${CPPCHECK_EXE} ${ARGN}) endif() endmacro() find_program(CLANG_TIDY_EXE NAMES "clang-tidy") +mark_as_advanced(FORCE CLANG_TIDY_EXE) if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") if(NOT CLANG_TIDY) @@ -63,6 +64,7 @@ else() endif() find_program(IWYU_EXE NAMES "include-what-you-use") +mark_as_advanced(FORCE IWYU_EXE) if(IWYU_EXE) message(STATUS "include-what-you-use found: ${IWYU_EXE}") if(NOT IWYU) @@ -85,6 +87,7 @@ else() endif() find_program(CPPCHECK_EXE NAMES "cppcheck") +mark_as_advanced(FORCE CPPCHECK_EXE) if(CPPCHECK_EXE) message(STATUS "cppcheck found: ${CPPCHECK_EXE}") if(CPPECHECK) @@ -108,4 +111,4 @@ else() set(CMAKE_CXX_CPPCHECK "" CACHE STRING "" FORCE) # delete it -endif() +endif() \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index bc9a445..5cc3244 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -51,6 +51,13 @@ foreach (example ${examples}) target_link_libraries (${example} PRIVATE ${HDF5_LIBSH_TARGET}) endif () set_target_properties (${example} PROPERTIES FOLDER examples) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_EXAMPLES_${example}_FORMAT ${example}) + endif () endforeach () if (H5_HAVE_PARALLEL) @@ -64,6 +71,13 @@ if (H5_HAVE_PARALLEL) target_link_libraries (ph5example PRIVATE ${HDF5_LIBSH_TARGET} ${MPI_C_LIBRARIES}) endif () set_target_properties (ph5example PROPERTIES FOLDER examples) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_EXAMPLES_ph5example_FORMAT ph5example) + endif () endif () if (BUILD_TESTING AND HDF5_TEST_EXAMPLES) diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c index 0b718ad..99cc48e 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -36,29 +36,31 @@ #define ROWS 12 #define COLS 18 +/* clang-format off */ const float windchillF[ROWS][COLS] = - { {36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0 }, - {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0 } , - {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0 }, - {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0 }, - {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0 }, - {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0 }, - {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0 }, - {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0 }, - {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0 }, + { {36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0}, + {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0}, + {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0}, + {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0}, + {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0}, + {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0}, + {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0}, + {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0}, + {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0}, {26.0, 19.0, 12.0, 4.0, -3.0, -10.0, -17.0, -24.0, -31.0, -38.0, -45.0, -52.0, -60.0, -67.0, -74.0, -81.0, -88.0, -95.0}, {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0}, {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0} }; - -#define PRINT(array) \ -{ \ - for(i=0; i US ASCII - * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + * H5T_CSET_ASCII_F -> US ASCII + * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * OUTPUTS * NONE * @@ -4350,8 +4356,8 @@ h5pset_char_encoding_c(hid_t_f *plist_id, int_f *encoding) * OUTPUTS * * encoding - Encoding character set: - * H5T_CSET_ASCII_F -> US ASCII - * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding + * H5T_CSET_ASCII_F -> US ASCII + * H5T_CSET_UTF8_F -> UTF-8 Unicode encoding * * RETURNS * 0 on success, -1 on failure @@ -4479,7 +4485,7 @@ h5pget_copy_object_c(hid_t_f *ocp_plist_id, int_f *copy_options) * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4541,7 +4547,7 @@ done: * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4590,7 +4596,7 @@ done: * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4632,7 +4638,7 @@ h5pget_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4677,7 +4683,7 @@ h5pget_est_link_info_c(hid_t_f *gcpl_id, int_f *est_num_entries, int_f *est_name * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4717,7 +4723,7 @@ h5pset_local_heap_size_hint_c(hid_t_f *gcpl_id, size_t_f *size_hint) * RETURNS * * Success: 0 - * Failure: -1 + * Failure: -1 * * AUTHOR * M. Scot Breitenfeld @@ -4787,7 +4793,7 @@ h5pset_link_phase_change_c(hid_t_f *gcpl_id, int_f *max_compact, int_f *min_dens * * INPUTS * - * fapl_id - File access property list identifier + * fapl_id - File access property list identifier * alignment - Required memory alignment boundary * block_size - File system block size * cbuf_size - Copy buffer size @@ -4833,7 +4839,7 @@ h5pset_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *a * * INPUTS * - * fapl_id - File access property list identifier + * fapl_id - File access property list identifier * OUTPUTS * * alignment - Required memory alignment boundary @@ -4885,9 +4891,9 @@ h5pget_fapl_direct_c(hid_t_f H5_ATTR_UNUSED *fapl_id, size_t_f H5_ATTR_UNUSED *a * Calls H5Pset_attr_phase_change * * INPUTS - * ocpl_id - Object (dataset or group) creation property list identifier - * max_compact - Maximum number of attributes to be stored in compact storage - * min_dense - Minimum number of attributes to be stored in dense storage + * ocpl_id - Object (dataset or group) creation property list identifier + * max_compact - Maximum number of attributes to be stored in compact storage + * min_dense - Minimum number of attributes to be stored in dense storage * OUTPUTS * * RETURNS @@ -5067,7 +5073,7 @@ h5pget_nlinks_c(hid_t_f *lapl_id, size_t_f *nlinks) * * INPUTS * - * lcpl_id - Link creation property list identifier + * lcpl_id - Link creation property list identifier * crt_intermed_group - Specifying whether to create intermediate groups upon * the creation of an object * RETURNS @@ -5103,7 +5109,8 @@ h5pget_create_inter_group_c(hid_t_f *lcpl_id, int_f *crt_intermed_group) * Name: h5pset_chunk_cache_c * Purpose: Calls H5Pset_chunk_cache * - * Inputs: dapl_id - Link creation property list identifier + * Inputs: + * dapl_id - Link creation property list identifier * rdcc_nslots - * rdcc_nbytes - * rdcc_w0 - @@ -5133,7 +5140,8 @@ h5pset_chunk_cache_c(hid_t_f *dapl_id, size_t_f *rdcc_nslots, size_t_f *rdcc_nby * Name: h5pget_chunk_cache_c * Purpose: Calls H5Pget_chunk_cache * - * Inputs: dapl_id - Link creation property list identifier + * Inputs: + * dapl_id - Link creation property list identifier * Outputs: * rdcc_nslots - * rdcc_nbytes - diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index 1dcb4ec..355220f 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -42,7 +42,7 @@ endif () # Add Test Lib #----------------------------------------------------------------------------- if (NOT BUILD_SHARED_LIBS) - add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c) + add_library (${HDF5_F90_C_TEST_LIB_TARGET} STATIC t.c t.h) set_source_files_properties (t.c PROPERTIES LANGUAGE C) target_include_directories (${HDF5_F90_C_TEST_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/static;$<$:${MPI_C_INCLUDE_DIRS}>" @@ -60,7 +60,7 @@ if (NOT BUILD_SHARED_LIBS) LINKER_LANGUAGE C ) else () - add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c) + add_library (${HDF5_F90_C_TEST_LIBSH_TARGET} SHARED t.c t.h) target_include_directories (${HDF5_F90_C_TEST_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR};${HDF5_F90_BINARY_DIR}/shared;$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" @@ -79,6 +79,17 @@ else () ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT BUILD_SHARED_LIBS) + clang_format (HDF5_FORTRAN_TESTS_FORMAT ${HDF5_F90_C_TEST_LIB_TARGET}) + else () + clang_format (HDF5_FORTRAN_TESTS_FORMAT ${HDF5_F90_C_TEST_LIBSH_TARGET}) + endif () +endif () + if (NOT BUILD_SHARED_LIBS) add_custom_command ( OUTPUT ${HDF5_FORTRAN_TESTS_BINARY_DIR}/static/tf_gen.F90 diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index 70c458d..083c60e 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -18,8 +18,6 @@ if (HDF5_BUILD_EXAMPLES) endif () #-- Build the Unit testing if requested -if (NOT HDF5_EXTERNALLY_CONFIGURED) - if (BUILD_TESTING AND HDF5_TEST_SERIAL) - add_subdirectory (test) - endif () +if (BUILD_TESTING AND HDF5_TEST_SERIAL) + add_subdirectory (test) endif () diff --git a/hl/c++/examples/CMakeLists.txt b/hl/c++/examples/CMakeLists.txt index 22c9973..037bf8f 100644 --- a/hl/c++/examples/CMakeLists.txt +++ b/hl/c++/examples/CMakeLists.txt @@ -23,6 +23,13 @@ else () endif () set_target_properties (ptExampleFL PROPERTIES FOLDER examples/hl/cpp) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_CPP_EXAMPLES_FORMAT ptExampleFL) +endif () + if (BUILD_TESTING AND HDF5_TEST_CPP AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index fbabc86..e4678fd 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -9,7 +9,7 @@ set (HDF5_HL_CPP_SOURCES ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.cpp) set (HDF5_HL_CPP_HDRS ${HDF5_HL_CPP_SRC_SOURCE_DIR}/H5PacketTable.h) if (NOT ONLY_SHARED_LIBS) - add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES}) + add_library (${HDF5_HL_CPP_LIB_TARGET} STATIC ${HDF5_HL_CPP_SOURCES} ${HDF5_HL_CPP_HDRS}) target_include_directories (${HDF5_HL_CPP_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>" @@ -40,6 +40,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIB_TARGET}) + else () + clang_format (HDF5_HL_CPP_SRC_FORMAT ${HDF5_HL_CPP_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( diff --git a/hl/c++/test/CMakeLists.txt b/hl/c++/test/CMakeLists.txt index 5c224a8..246a670 100644 --- a/hl/c++/test/CMakeLists.txt +++ b/hl/c++/test/CMakeLists.txt @@ -25,6 +25,13 @@ else () endif () set_target_properties (hl_ptableTest PROPERTIES FOLDER test/hl/cpp) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_CPP_TEST_FORMAT hl_ptableTest) +endif () + if (HDF5_TEST_CPP AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/hl/examples/CMakeLists.txt b/hl/examples/CMakeLists.txt index 1707ae9..9bce861 100644 --- a/hl/examples/CMakeLists.txt +++ b/hl/examples/CMakeLists.txt @@ -37,6 +37,13 @@ foreach (example ${examples}) target_link_libraries (hl_ex_${example} PRIVATE ${HDF5_HL_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) endif () set_target_properties (hl_ex_${example} PROPERTIES FOLDER examples/hl) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_EXAMPLES_${example}_FORMAT hl_ex_${example}) + endif () endforeach () if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) diff --git a/hl/examples/pal_rgb.h b/hl/examples/pal_rgb.h index f3905b3..488ee42 100644 --- a/hl/examples/pal_rgb.h +++ b/hl/examples/pal_rgb.h @@ -11,263 +11,266 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -const unsigned char pal_rgb[256*3] = {255,255,255, -0,0,131, -0,0,135, -0,0,139, -0,0,143, -0,0,147, -0,0,151, -0,0,155, -0,0,159, -0,0,163, -0,0,167, -0,0,171, -0,0,175, -0,0,179, -0,0,183, -0,0,187, -0,0,191, -0,0,195, -0,0,199, -0,0,203, -0,0,207, -0,0,211, -0,0,215, -0,0,219, -0,0,223, -0,0,227, -0,0,231, -0,0,235, -0,0,239, -0,0,243, -0,0,247, -0,0,251, -0,0,255, -0,0,255, -0,3,255, -0,7,255, -0,11,255, -0,15,255, -0,19,255, -0,23,255, -0,27,255, -0,31,255, -0,35,255, -0,39,255, -0,43,255, -0,47,255, -0,51,255, -0,55,255, -0,59,255, -0,63,255, -0,67,255, -0,71,255, -0,75,255, -0,79,255, -0,83,255, -0,87,255, -0,91,255, -0,95,255, -0,99,255, -0,103,255, -0,107,255, -0,111,255, -0,115,255, -0,119,255, -0,123,255, -0,127,255, -0,131,255, -0,135,255, -0,139,255, -0,143,255, -0,147,255, -0,151,255, -0,155,255, -0,159,255, -0,163,255, -0,167,255, -0,171,255, -0,175,255, -0,179,255, -0,183,255, -0,187,255, -0,191,255, -0,195,255, -0,199,255, -0,203,255, -0,207,255, -0,211,255, -0,215,255, -0,219,255, -0,223,255, -0,227,255, -0,231,255, -0,235,255, -0,239,255, -0,243,255, -0,247,255, -0,251,255, -0,255,255, -0,255,255, -3,255,251, -7,255,247, -11,255,243, -15,255,239, -19,255,235, -23,255,231, -27,255,227, -31,255,223, -35,255,219, -39,255,215, -43,255,211, -47,255,207, -51,255,203, -55,255,199, -59,255,195, -63,255,191, -67,255,187, -71,255,183, -75,255,179, -79,255,175, -83,255,171, -87,255,167, -91,255,163, -95,255,159, -99,255,155, -103,255,151, -107,255,147, -111,255,143, -115,255,139, -119,255,135, -123,255,131, -127,255,127, -131,255,123, -135,255,119, -139,255,115, -143,255,111, -147,255,107, -151,255,103, -155,255,99, -159,255,95, -163,255,91, -167,255,87, -171,255,83, -175,255,79, -179,255,75, -183,255,71, -187,255,67, -191,255,63, -195,255,59, -199,255,55, -203,255,51, -207,255,47, -211,255,43, -215,255,39, -219,255,35, -223,255,31, -227,255,27, -231,255,23, -235,255,19, -239,255,15, -243,255,11, -247,255,7, -251,255,3, -255,255,0, -255,251,0, -255,247,0, -255,243,0, -255,239,0, -255,235,0, -255,231,0, -255,227,0, -255,223,0, -255,219,0, -255,215,0, -255,211,0, -255,207,0, -255,203,0, -255,199,0, -255,195,0, -255,191,0, -255,187,0, -255,183,0, -255,179,0, -255,175,0, -255,171,0, -255,167,0, -255,163,0, -255,159,0, -255,155,0, -255,151,0, -255,147,0, -255,143,0, -255,139,0, -255,135,0, -255,131,0, -255,127,0, -255,123,0, -255,119,0, -255,115,0, -255,111,0, -255,107,0, -255,103,0, -255,99,0, -255,95,0, -255,91,0, -255,87,0, -255,83,0, -255,79,0, -255,75,0, -255,71,0, -255,67,0, -255,63,0, -255,59,0, -255,55,0, -255,51,0, -255,47,0, -255,43,0, -255,39,0, -255,35,0, -255,31,0, -255,27,0, -255,23,0, -255,19,0, -255,15,0, -255,11,0, -255,7,0, -255,3,0, -255,0,0, -250,0,0, -246,0,0, -241,0,0, -237,0,0, -233,0,0, -228,0,0, -224,0,0, -219,0,0, -215,0,0, -211,0,0, -206,0,0, -202,0,0, -197,0,0, -193,0,0, -189,0,0, -184,0,0, -180,0,0, -175,0,0, -171,0,0, -167,0,0, -162,0,0, -158,0,0, -153,0,0, -149,0,0, -145,0,0, -140,0,0, -136,0,0, -131,0,0, -127,0,0 +/* clang-format off */ +const unsigned char pal_rgb[256*3] = { + 255,255,255, + 0,0,131, + 0,0,135, + 0,0,139, + 0,0,143, + 0,0,147, + 0,0,151, + 0,0,155, + 0,0,159, + 0,0,163, + 0,0,167, + 0,0,171, + 0,0,175, + 0,0,179, + 0,0,183, + 0,0,187, + 0,0,191, + 0,0,195, + 0,0,199, + 0,0,203, + 0,0,207, + 0,0,211, + 0,0,215, + 0,0,219, + 0,0,223, + 0,0,227, + 0,0,231, + 0,0,235, + 0,0,239, + 0,0,243, + 0,0,247, + 0,0,251, + 0,0,255, + 0,0,255, + 0,3,255, + 0,7,255, + 0,11,255, + 0,15,255, + 0,19,255, + 0,23,255, + 0,27,255, + 0,31,255, + 0,35,255, + 0,39,255, + 0,43,255, + 0,47,255, + 0,51,255, + 0,55,255, + 0,59,255, + 0,63,255, + 0,67,255, + 0,71,255, + 0,75,255, + 0,79,255, + 0,83,255, + 0,87,255, + 0,91,255, + 0,95,255, + 0,99,255, + 0,103,255, + 0,107,255, + 0,111,255, + 0,115,255, + 0,119,255, + 0,123,255, + 0,127,255, + 0,131,255, + 0,135,255, + 0,139,255, + 0,143,255, + 0,147,255, + 0,151,255, + 0,155,255, + 0,159,255, + 0,163,255, + 0,167,255, + 0,171,255, + 0,175,255, + 0,179,255, + 0,183,255, + 0,187,255, + 0,191,255, + 0,195,255, + 0,199,255, + 0,203,255, + 0,207,255, + 0,211,255, + 0,215,255, + 0,219,255, + 0,223,255, + 0,227,255, + 0,231,255, + 0,235,255, + 0,239,255, + 0,243,255, + 0,247,255, + 0,251,255, + 0,255,255, + 0,255,255, + 3,255,251, + 7,255,247, + 11,255,243, + 15,255,239, + 19,255,235, + 23,255,231, + 27,255,227, + 31,255,223, + 35,255,219, + 39,255,215, + 43,255,211, + 47,255,207, + 51,255,203, + 55,255,199, + 59,255,195, + 63,255,191, + 67,255,187, + 71,255,183, + 75,255,179, + 79,255,175, + 83,255,171, + 87,255,167, + 91,255,163, + 95,255,159, + 99,255,155, + 103,255,151, + 107,255,147, + 111,255,143, + 115,255,139, + 119,255,135, + 123,255,131, + 127,255,127, + 131,255,123, + 135,255,119, + 139,255,115, + 143,255,111, + 147,255,107, + 151,255,103, + 155,255,99, + 159,255,95, + 163,255,91, + 167,255,87, + 171,255,83, + 175,255,79, + 179,255,75, + 183,255,71, + 187,255,67, + 191,255,63, + 195,255,59, + 199,255,55, + 203,255,51, + 207,255,47, + 211,255,43, + 215,255,39, + 219,255,35, + 223,255,31, + 227,255,27, + 231,255,23, + 235,255,19, + 239,255,15, + 243,255,11, + 247,255,7, + 251,255,3, + 255,255,0, + 255,251,0, + 255,247,0, + 255,243,0, + 255,239,0, + 255,235,0, + 255,231,0, + 255,227,0, + 255,223,0, + 255,219,0, + 255,215,0, + 255,211,0, + 255,207,0, + 255,203,0, + 255,199,0, + 255,195,0, + 255,191,0, + 255,187,0, + 255,183,0, + 255,179,0, + 255,175,0, + 255,171,0, + 255,167,0, + 255,163,0, + 255,159,0, + 255,155,0, + 255,151,0, + 255,147,0, + 255,143,0, + 255,139,0, + 255,135,0, + 255,131,0, + 255,127,0, + 255,123,0, + 255,119,0, + 255,115,0, + 255,111,0, + 255,107,0, + 255,103,0, + 255,99,0, + 255,95,0, + 255,91,0, + 255,87,0, + 255,83,0, + 255,79,0, + 255,75,0, + 255,71,0, + 255,67,0, + 255,63,0, + 255,59,0, + 255,55,0, + 255,51,0, + 255,47,0, + 255,43,0, + 255,39,0, + 255,35,0, + 255,31,0, + 255,27,0, + 255,23,0, + 255,19,0, + 255,15,0, + 255,11,0, + 255,7,0, + 255,3,0, + 255,0,0, + 250,0,0, + 246,0,0, + 241,0,0, + 237,0,0, + 233,0,0, + 228,0,0, + 224,0,0, + 219,0,0, + 215,0,0, + 211,0,0, + 206,0,0, + 202,0,0, + 197,0,0, + 193,0,0, + 189,0,0, + 184,0,0, + 180,0,0, + 175,0,0, + 171,0,0, + 167,0,0, + 162,0,0, + 158,0,0, + 153,0,0, + 149,0,0, + 145,0,0, + 140,0,0, + 136,0,0, + 131,0,0, + 127,0,0 }; +/* clang-format on */ diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index d682d5f..789d2fa 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -15,7 +15,7 @@ endif () # Generate the H5LT and H5TB REAL APIs #----------------------------------------------------------------------------- -add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90 ) +add_executable (H5HL_buildiface ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5HL_buildiface.F90) target_include_directories (H5HL_buildiface PRIVATE "${HDF5_BINARY_DIR};${HDF5_F90_BINARY_DIR}") if (WIN32 AND MSVC) if (BUILD_SHARED_LIBS) @@ -54,7 +54,7 @@ set (HDF5_HL_F90_C_SOURCES ) set_source_files_properties (${HDF5_HL_F90_C_SOURCES} PROPERTIES LANGUAGE C) -set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) +set (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5IMcc.h) if (NOT ONLY_SHARED_LIBS) add_library (${HDF5_HL_F90_C_LIB_TARGET} STATIC ${HDF5_HL_F90_C_SOURCES} ${HDF5_HL_F90_HEADERS}) @@ -93,6 +93,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIB_TARGET}) + else () + clang_format (HDF5_HL_F90_C_SRC_FORMAT ${HDF5_HL_F90_C_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Fortran Modules #----------------------------------------------------------------------------- set (HDF5_HL_F90_F_BASE_SOURCES diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index c4ddf19..e73c470 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -30,6 +30,14 @@ set (HL_HEADERS set (HL_PRIVATE_HEADERS ${HDF5_HL_SRC_SOURCE_DIR}/H5LTparse.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5DSprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5IMprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5PTprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5HLprivate2.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LTprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5PTprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5TBprivate.h + ${HDF5_HL_SRC_SOURCE_DIR}/H5LDprivate.h ) if (NOT ONLY_SHARED_LIBS) @@ -64,6 +72,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIB_TARGET}) + else () + clang_format (HDF5_HL_SRC_FORMAT ${HDF5_HL_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- install ( diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 55b1b9e..999ed88 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -58,17 +58,17 @@ size_t indent = 0; /* Data structure to pass application data to callbacks. */ typedef struct { - void *app_image_ptr; /* Pointer to application buffer */ - size_t app_image_size; /* Size of application buffer */ - void *fapl_image_ptr; /* Pointer to FAPL buffer */ - size_t fapl_image_size; /* Size of FAPL buffer */ - int fapl_ref_count; /* Reference counter for FAPL buffer */ - void *vfd_image_ptr; /* Pointer to VFD buffer */ - size_t vfd_image_size; /* Size of VFD buffer */ - int vfd_ref_count; /* Reference counter for VFD buffer */ - unsigned flags; /* Flags indicate how the file image will */ + void *app_image_ptr; /* Pointer to application buffer */ + size_t app_image_size; /* Size of application buffer */ + void *fapl_image_ptr; /* Pointer to FAPL buffer */ + size_t fapl_image_size; /* Size of FAPL buffer */ + int fapl_ref_count; /* Reference counter for FAPL buffer */ + void *vfd_image_ptr; /* Pointer to VFD buffer */ + size_t vfd_image_size; /* Size of VFD buffer */ + int vfd_ref_count; /* Reference counter for VFD buffer */ + unsigned flags; /* Flags indicate how the file image will */ /* be open */ - int ref_count; /* Reference counter on udata struct */ + int ref_count; /* Reference counter on udata struct */ } H5LT_file_image_ud_t; /* callbacks prototypes for file image ops */ @@ -81,7 +81,7 @@ static herr_t udata_free(void *udata); /* Definition of callbacks for file image operations. */ - + /*------------------------------------------------------------------------- * Function: image_malloc * @@ -127,9 +127,9 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) udata->fapl_image_size = udata->app_image_size; return_value = udata->fapl_image_ptr; udata->fapl_ref_count++; - break; + break; - case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: if (udata->fapl_image_ptr == NULL) goto out; if (udata->fapl_image_size != size) @@ -139,7 +139,7 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) return_value = udata->fapl_image_ptr; udata->fapl_ref_count++; - break; + break; case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET: goto out; @@ -160,16 +160,16 @@ image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) goto out; udata->vfd_image_ptr = udata->fapl_image_ptr; - udata->vfd_image_size = size; + udata->vfd_image_size = size; udata->vfd_ref_count++; return_value = udata->vfd_image_ptr; break; - /* added unused labels to shut the compiler up */ - case H5FD_FILE_IMAGE_OP_NO_OP: - case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: - case H5FD_FILE_IMAGE_OP_FILE_RESIZE: - case H5FD_FILE_IMAGE_OP_FILE_CLOSE: + /* added unused labels to shut the compiler up */ + case H5FD_FILE_IMAGE_OP_NO_OP: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: + case H5FD_FILE_IMAGE_OP_FILE_RESIZE: + case H5FD_FILE_IMAGE_OP_FILE_CLOSE: default: goto out; } /* end switch */ @@ -180,7 +180,7 @@ out: return NULL; } /* end image_malloc() */ - + /*------------------------------------------------------------------------- * Function: image_memcpy * @@ -251,11 +251,11 @@ image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file goto out; break; - /* added unused labels to shut the compiler up */ - case H5FD_FILE_IMAGE_OP_NO_OP: - case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: - case H5FD_FILE_IMAGE_OP_FILE_RESIZE: - case H5FD_FILE_IMAGE_OP_FILE_CLOSE: + /* added unused labels to shut the compiler up */ + case H5FD_FILE_IMAGE_OP_NO_OP: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: + case H5FD_FILE_IMAGE_OP_FILE_RESIZE: + case H5FD_FILE_IMAGE_OP_FILE_CLOSE: default: goto out; } /* end switch */ @@ -266,7 +266,7 @@ out: return NULL; } /* end image_memcpy() */ - + /*------------------------------------------------------------------------- * Function: image_realloc * @@ -351,7 +351,7 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) switch(file_image_op) { case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: - if (udata->fapl_image_ptr != ptr) + if (udata->fapl_image_ptr != ptr) goto out; if (udata->fapl_ref_count == 0) goto out; @@ -386,14 +386,14 @@ image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) } /* end if */ break; - /* added unused labels to keep the compiler quite */ - case H5FD_FILE_IMAGE_OP_NO_OP: - case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: - case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: - case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET: - case H5FD_FILE_IMAGE_OP_FILE_OPEN: - case H5FD_FILE_IMAGE_OP_FILE_RESIZE: - default: + /* added unused labels to keep the compiler quite */ + case H5FD_FILE_IMAGE_OP_NO_OP: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET: + case H5FD_FILE_IMAGE_OP_FILE_OPEN: + case H5FD_FILE_IMAGE_OP_FILE_RESIZE: + default: goto out; } /* end switch */ @@ -403,7 +403,7 @@ out: return(FAIL); } /* end image_free() */ - + /*------------------------------------------------------------------------- * Function: udata_copy * @@ -843,7 +843,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5LTopen_file_image * @@ -859,9 +859,9 @@ out: */ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) { - hid_t fapl=-1, file_id=-1; /* HDF5 identifiers */ + hid_t fapl=-1, file_id=-1; /* HDF5 identifiers */ unsigned file_open_flags; /* Flags for image open */ - char file_name[64]; /* Filename buffer */ + char file_name[64]; /* Filename buffer */ size_t alloc_incr; /* Buffer allocation increment */ size_t min_incr = 65536; /* Minimum buffer increment */ double buf_prcnt = 0.1f; /* Percentage of buffer size to set @@ -898,7 +898,7 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) /* Set callbacks for file image ops ONLY if the file image is NOT copied */ if (flags & H5LT_FILE_IMAGE_DONT_COPY) { - H5LT_file_image_ud_t *udata; /* Pointer to udata structure */ + H5LT_file_image_ud_t *udata; /* Pointer to udata structure */ /* Allocate buffer to communicate user data to callbacks */ if (NULL == (udata = (H5LT_file_image_ud_t *)HDmalloc(sizeof(H5LT_file_image_ud_t)))) @@ -1407,13 +1407,13 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d * modify the op_data buffer (i.e.: dset_name) during the traversal, and the * library never modifies that buffer. */ -H5_GCC_DIAG_OFF(cast-qual) +H5_GCC_DIAG_OFF("cast-qual") herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) { return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, 0, find_dataset, (void *)dset_name); } -H5_GCC_DIAG_ON(cast-qual) +H5_GCC_DIAG_ON("cast-qual") /*------------------------------------------------------------------------- * @@ -2038,13 +2038,13 @@ herr_t H5LTfind_attribute( hid_t loc_id, const char* attr_name ) * modify the op_data buffer (i.e.: attr_name) during the traversal, and the * library never modifies that buffer. */ -H5_GCC_DIAG_OFF(cast-qual) +H5_GCC_DIAG_OFF("cast-qual") herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) { return H5Aiterate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, find_attr, (void *)attr_name); } -H5_GCC_DIAG_ON(cast-qual) +H5_GCC_DIAG_ON("cast-qual") /*------------------------------------------------------------------------- @@ -2297,13 +2297,13 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str * extend past the allocated buffer; if it does then truncate the string */ if(size_str < *len - 1) { - if( size_str + size_str_to_add < *len - 1) { - HDstrncat(buf, str_to_add, size_str_to_add); - } else { - HDstrncat(buf, str_to_add, (*len - 1) - size_str); - } + if( size_str + size_str_to_add < *len - 1) { + HDstrncat(buf, str_to_add, size_str_to_add); + } else { + HDstrncat(buf, str_to_add, (*len - 1) - size_str); + } } else { - buf[*len-1] = '\0'; /* buffer is full, null terminate */ + buf[*len-1] = '\0'; /* buffer is full, null terminate */ } } @@ -3062,15 +3062,15 @@ next: HDsnprintf(dt_str, *slen, "H5T_NO_CLASS"); break; case H5T_REFERENCE: - if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) { - HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }"); - } - else { - HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }"); - } - break; + if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) { + HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }"); + } + else { + HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }"); + } + break; case H5T_NCLASSES: - break; + break; default: HDsnprintf(dt_str, *slen, "unknown data type"); } @@ -3626,7 +3626,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5LT_set_attribute_string * @@ -3746,12 +3746,12 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) if(HDstrncmp(path, ".", path_length) == 0) { if(check_object_valid) { obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT); - ret_value = obj_exists; - goto done; + ret_value = obj_exists; + goto done; } else { - ret_value = TRUE; /* Since the object is the identifier itself, - * we can only check if loc_id is a valid type */ - goto done; + ret_value = TRUE; /* Since the object is the identifier itself, + * we can only check if loc_id is a valid type */ + goto done; } } @@ -3775,20 +3775,20 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) obj_exists = FALSE; if((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) { - ret_value = FAIL; - goto done; + ret_value = FAIL; + goto done; } /* If target link does not exist then no reason to * continue checking the path */ if(link_exists != TRUE) { - ret_value = FALSE; - goto done; + ret_value = FALSE; + goto done; } /* Determine if link resolves to an actual object */ if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { - ret_value = FAIL; + ret_value = FAIL; goto done; } @@ -3812,11 +3812,11 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) ret_value = link_exists; /* Determine if link resolves to an actual object for check_object_valid TRUE */ if(check_object_valid == TRUE && link_exists == TRUE) { - if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { - ret_value = FAIL; - } else { - ret_value = obj_exists; - } + if((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { + ret_value = FAIL; + } else { + ret_value = obj_exists; + } } } diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 6349bb3..2fc0c87 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -37,6 +37,13 @@ macro (HL_ADD_EXE hl_name) ) endif () set_target_properties (hl_${hl_name} PROPERTIES FOLDER test/hl) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_${hl_name}_FORMAT hl_${hl_name}) + endif () endmacro () HL_ADD_EXE (test_lite) @@ -69,6 +76,13 @@ else () endif () set_target_properties (hl_test_packet PROPERTIES FOLDER test/hl) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_test_packet_FORMAT hl_test_packet) +endif () + # -------------------------------------------------------------------- # This executable is used to generate test files for the test_ds test. # It should only be run during development when new test files are needed @@ -85,6 +99,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) ) set_target_properties (hl_gen_test_ds PROPERTIES FOLDER test/hl/gen) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_gen_test_ds_FORMAT hl_gen_test_ds) + endif () + add_executable (hl_gen_test_ld gen_test_ld.c) target_compile_options(hl_gen_test_ld PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (hl_gen_test_ld PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -95,6 +116,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) ${HDF5_LIB_TARGET} ) set_target_properties (hl_gen_test_ld PROPERTIES FOLDER test/hl/gen) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TEST_hl_gen_test_ld_FORMAT hl_gen_test_ld) + endif () endif () if (HDF5_TEST_SERIAL) diff --git a/hl/test/pal_rgb.h b/hl/test/pal_rgb.h index 4b22bea..488ee42 100644 --- a/hl/test/pal_rgb.h +++ b/hl/test/pal_rgb.h @@ -11,261 +11,270 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -const unsigned char pal_rgb[256*3] = {255,255,255, -0,0,131, -0,0,135, -0,0,139, -0,0,143, -0,0,147, -0,0,151, -0,0,155, -0,0,159, -0,0,163, -0,0,167, -0,0,171, -0,0,175, -0,0,179, -0,0,183, -0,0,187, -0,0,191, -0,0,195, -0,0,199, -0,0,203, -0,0,207, -0,0,211, -0,0,215, -0,0,219, -0,0,223, -0,0,227, -0,0,231, -0,0,235, -0,0,239, -0,0,243, -0,0,247, -0,0,251, -0,0,255, -0,0,255, -0,3,255, -0,7,255, -0,11,255, -0,15,255, -0,19,255, -0,23,255, -0,27,255, -0,31,255, -0,35,255, -0,39,255, -0,43,255, -0,47,255, -0,51,255, -0,55,255, -0,59,255, -0,63,255, -0,67,255, -0,71,255, -0,75,255, -0,79,255, -0,83,255, -0,87,255, -0,91,255, -0,95,255, -0,99,255, -0,103,255, -0,107,255, -0,111,255, -0,115,255, -0,119,255, -0,123,255, -0,127,255, -0,131,255, -0,135,255, -0,139,255, -0,143,255, -0,147,255, -0,151,255, -0,155,255, -0,159,255, -0,163,255, -0,167,255, -0,171,255, -0,175,255, -0,179,255, -0,183,255, -0,187,255, -0,191,255, -0,195,255, -0,199,255, -0,203,255, -0,207,255, -0,211,255, -0,215,255, -0,219,255, -0,223,255, -0,227,255, -0,231,255, -0,235,255, -0,239,255, -0,243,255, -0,247,255, -0,251,255, -0,255,255, -0,255,255, -3,255,251, -7,255,247, -11,255,243, -15,255,239, -19,255,235, -23,255,231, -27,255,227, -31,255,223, -35,255,219, -39,255,215, -43,255,211, -47,255,207, -51,255,203, -55,255,199, -59,255,195, -63,255,191, -67,255,187, -71,255,183, -75,255,179, -79,255,175, -83,255,171, -87,255,167, -91,255,163, -95,255,159, -99,255,155, -103,255,151, -107,255,147, -111,255,143, -115,255,139, -119,255,135, -123,255,131, -127,255,127, -131,255,123, -135,255,119, -139,255,115, -143,255,111, -147,255,107, -151,255,103, -155,255,99, -159,255,95, -163,255,91, -167,255,87, -171,255,83, -175,255,79, -179,255,75, -183,255,71, -187,255,67, -191,255,63, -195,255,59, -199,255,55, -203,255,51, -207,255,47, -211,255,43, -215,255,39, -219,255,35, -223,255,31, -227,255,27, -231,255,23, -235,255,19, -239,255,15, -243,255,11, -247,255,7, -251,255,3, -255,255,0, -255,251,0, -255,247,0, -255,243,0, -255,239,0, -255,235,0, -255,231,0, -255,227,0, -255,223,0, -255,219,0, -255,215,0, -255,211,0, -255,207,0, -255,203,0, -255,199,0, -255,195,0, -255,191,0, -255,187,0, -255,183,0, -255,179,0, -255,175,0, -255,171,0, -255,167,0, -255,163,0, -255,159,0, -255,155,0, -255,151,0, -255,147,0, -255,143,0, -255,139,0, -255,135,0, -255,131,0, -255,127,0, -255,123,0, -255,119,0, -255,115,0, -255,111,0, -255,107,0, -255,103,0, -255,99,0, -255,95,0, -255,91,0, -255,87,0, -255,83,0, -255,79,0, -255,75,0, -255,71,0, -255,67,0, -255,63,0, -255,59,0, -255,55,0, -255,51,0, -255,47,0, -255,43,0, -255,39,0, -255,35,0, -255,31,0, -255,27,0, -255,23,0, -255,19,0, -255,15,0, -255,11,0, -255,7,0, -255,3,0, -255,0,0, -250,0,0, -246,0,0, -241,0,0, -237,0,0, -233,0,0, -228,0,0, -224,0,0, -219,0,0, -215,0,0, -211,0,0, -206,0,0, -202,0,0, -197,0,0, -193,0,0, -189,0,0, -184,0,0, -180,0,0, -175,0,0, -171,0,0, -167,0,0, -162,0,0, -158,0,0, -153,0,0, -149,0,0, -145,0,0, -140,0,0, -136,0,0, -131,0,0, -127,0,0 +/* clang-format off */ +const unsigned char pal_rgb[256*3] = { + 255,255,255, + 0,0,131, + 0,0,135, + 0,0,139, + 0,0,143, + 0,0,147, + 0,0,151, + 0,0,155, + 0,0,159, + 0,0,163, + 0,0,167, + 0,0,171, + 0,0,175, + 0,0,179, + 0,0,183, + 0,0,187, + 0,0,191, + 0,0,195, + 0,0,199, + 0,0,203, + 0,0,207, + 0,0,211, + 0,0,215, + 0,0,219, + 0,0,223, + 0,0,227, + 0,0,231, + 0,0,235, + 0,0,239, + 0,0,243, + 0,0,247, + 0,0,251, + 0,0,255, + 0,0,255, + 0,3,255, + 0,7,255, + 0,11,255, + 0,15,255, + 0,19,255, + 0,23,255, + 0,27,255, + 0,31,255, + 0,35,255, + 0,39,255, + 0,43,255, + 0,47,255, + 0,51,255, + 0,55,255, + 0,59,255, + 0,63,255, + 0,67,255, + 0,71,255, + 0,75,255, + 0,79,255, + 0,83,255, + 0,87,255, + 0,91,255, + 0,95,255, + 0,99,255, + 0,103,255, + 0,107,255, + 0,111,255, + 0,115,255, + 0,119,255, + 0,123,255, + 0,127,255, + 0,131,255, + 0,135,255, + 0,139,255, + 0,143,255, + 0,147,255, + 0,151,255, + 0,155,255, + 0,159,255, + 0,163,255, + 0,167,255, + 0,171,255, + 0,175,255, + 0,179,255, + 0,183,255, + 0,187,255, + 0,191,255, + 0,195,255, + 0,199,255, + 0,203,255, + 0,207,255, + 0,211,255, + 0,215,255, + 0,219,255, + 0,223,255, + 0,227,255, + 0,231,255, + 0,235,255, + 0,239,255, + 0,243,255, + 0,247,255, + 0,251,255, + 0,255,255, + 0,255,255, + 3,255,251, + 7,255,247, + 11,255,243, + 15,255,239, + 19,255,235, + 23,255,231, + 27,255,227, + 31,255,223, + 35,255,219, + 39,255,215, + 43,255,211, + 47,255,207, + 51,255,203, + 55,255,199, + 59,255,195, + 63,255,191, + 67,255,187, + 71,255,183, + 75,255,179, + 79,255,175, + 83,255,171, + 87,255,167, + 91,255,163, + 95,255,159, + 99,255,155, + 103,255,151, + 107,255,147, + 111,255,143, + 115,255,139, + 119,255,135, + 123,255,131, + 127,255,127, + 131,255,123, + 135,255,119, + 139,255,115, + 143,255,111, + 147,255,107, + 151,255,103, + 155,255,99, + 159,255,95, + 163,255,91, + 167,255,87, + 171,255,83, + 175,255,79, + 179,255,75, + 183,255,71, + 187,255,67, + 191,255,63, + 195,255,59, + 199,255,55, + 203,255,51, + 207,255,47, + 211,255,43, + 215,255,39, + 219,255,35, + 223,255,31, + 227,255,27, + 231,255,23, + 235,255,19, + 239,255,15, + 243,255,11, + 247,255,7, + 251,255,3, + 255,255,0, + 255,251,0, + 255,247,0, + 255,243,0, + 255,239,0, + 255,235,0, + 255,231,0, + 255,227,0, + 255,223,0, + 255,219,0, + 255,215,0, + 255,211,0, + 255,207,0, + 255,203,0, + 255,199,0, + 255,195,0, + 255,191,0, + 255,187,0, + 255,183,0, + 255,179,0, + 255,175,0, + 255,171,0, + 255,167,0, + 255,163,0, + 255,159,0, + 255,155,0, + 255,151,0, + 255,147,0, + 255,143,0, + 255,139,0, + 255,135,0, + 255,131,0, + 255,127,0, + 255,123,0, + 255,119,0, + 255,115,0, + 255,111,0, + 255,107,0, + 255,103,0, + 255,99,0, + 255,95,0, + 255,91,0, + 255,87,0, + 255,83,0, + 255,79,0, + 255,75,0, + 255,71,0, + 255,67,0, + 255,63,0, + 255,59,0, + 255,55,0, + 255,51,0, + 255,47,0, + 255,43,0, + 255,39,0, + 255,35,0, + 255,31,0, + 255,27,0, + 255,23,0, + 255,19,0, + 255,15,0, + 255,11,0, + 255,7,0, + 255,3,0, + 255,0,0, + 250,0,0, + 246,0,0, + 241,0,0, + 237,0,0, + 233,0,0, + 228,0,0, + 224,0,0, + 219,0,0, + 215,0,0, + 211,0,0, + 206,0,0, + 202,0,0, + 197,0,0, + 193,0,0, + 189,0,0, + 184,0,0, + 180,0,0, + 175,0,0, + 171,0,0, + 167,0,0, + 162,0,0, + 158,0,0, + 153,0,0, + 149,0,0, + 145,0,0, + 140,0,0, + 136,0,0, + 131,0,0, + 127,0,0 }; +/* clang-format on */ + + + + + + diff --git a/hl/tools/gif2h5/CMakeLists.txt b/hl/tools/gif2h5/CMakeLists.txt index 0b895a3..e165b54 100644 --- a/hl/tools/gif2h5/CMakeLists.txt +++ b/hl/tools/gif2h5/CMakeLists.txt @@ -40,6 +40,17 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5) + else () + clang_format (HDF5_HL_TOOLS_GIF2H5_FORMAT gif2h5-shared) + endif () +endif () + #-- Add h52gif program set (hdf2gif_SOURCES ${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/hdf2gif.c @@ -71,6 +82,17 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif) + else () + clang_format (HDF5_HL_TOOLS_H52GIF_FORMAT h52gif-shared) + endif () +endif () + if (BUILD_TESTING AND HDF5_TEST_SERIAL) # -------------------------------------------------------------------- # This executable can generate the actual test files - Currently not @@ -84,6 +106,13 @@ if (BUILD_TESTING AND HDF5_TEST_SERIAL) target_link_libraries (hl_h52gifgentest PRIVATE ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (hl_h52gifgentest PROPERTIES FOLDER generator/tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_hl_h52gifgentest_FORMAT hl_h52gifgentest) + endif () + # add_test (NAME hl_h52gifgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index c5ad976..7e04329 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5watch-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch) + else () + clang_format (HDF5_HL_TOOLS_H5WATCH_FORMAT h5watch-shared) + endif () +endif () + if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) #-- Add swmr_check_compat_vfd program set (hl_swmr_check_compat_vfd_SOURCES @@ -45,6 +56,13 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) endif () set_target_properties (hl_swmr_check_compat_vfd PROPERTIES FOLDER tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_hl_swmr_check_compat_vfd_FORMAT hl_swmr_check_compat_vfd) + endif () + #-- Add extend_dset program set (extend_dset_SOURCES ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/extend_dset.c @@ -61,6 +79,13 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) endif () set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_extend_dset_FORMAT extend_dset) + endif () + add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) target_compile_options(h5watchgentest PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (h5watchgentest PRIVATE "${HDF5_HL_SRC_DIR}/src;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -73,6 +98,13 @@ if (BUILD_TESTING AND HDF5_TEST_SWMR AND HDF5_TEST_SERIAL) endif () set_target_properties (h5watchgentest PROPERTIES FOLDER generator/tools/hl) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_HL_TOOLS_H5WATCH_h5watchgentest_FORMAT h5watchgentest) + endif () + if (HDF5_TEST_TOOLS) include (CMakeTests.cmake) endif () diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index a5b2d96..ae9e789 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -44,6 +44,7 @@ set (HDF5_JAVA_JNI_CHDRS ${HDF5_JAVA_JNI_SOURCE_DIR}/h5fImp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5gImp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5iImp.h + ${HDF5_JAVA_JNI_SOURCE_DIR}/h5Imp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5jni.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5lImp.h ${HDF5_JAVA_JNI_SOURCE_DIR}/h5oImp.h @@ -85,6 +86,13 @@ SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED "JAVA") #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_JNI_SRC_FORMAT ${HDF5_JAVA_JNI_LIB_TARGET}) +endif () + +#----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- if (HDF5_EXPORTED_TARGETS) diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index f9b0cfd..dc8a13d 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -26,9 +26,8 @@ extern "C" { #include #include "h5jni.h" -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC diagnostic ignored "-Wunused-parameter" +H5_GCC_DIAG_OFF("missing-prototypes") +H5_GCC_DIAG_OFF("unused-parameter") JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; } @@ -353,8 +352,7 @@ JNIEXPORT jlong JNICALL Java_hdf_hdf5lib_HDF5Constants_H5E_1WRITEERROR(JNIEnv *env, jclass cls) { return H5E_WRITEERROR; } /* Java does not have unsigned native types */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" +H5_GCC_DIAG_OFF("sign-conversion") JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1CREAT(JNIEnv *env, jclass cls) { return H5F_ACC_CREAT; } JNIEXPORT jint JNICALL @@ -371,7 +369,7 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1READ(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_READ; } JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1ACC_1SWMR_1WRITE(JNIEnv *env, jclass cls) { return H5F_ACC_SWMR_WRITE; } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON("sign-conversion") JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5F_1CLOSE_1DEFAULT(JNIEnv *env, jclass cls) { return H5F_CLOSE_DEFAULT; } @@ -1337,7 +1335,8 @@ Java_hdf_hdf5lib_HDF5Constants_H5Z_1SCALEOFFSET_1USER_1NPARMS(JNIEnv *env, jclas JNIEXPORT jint JNICALL Java_hdf_hdf5lib_HDF5Constants_H5Z_1FILTER_1ALL(JNIEnv *env, jclass cls) { return H5Z_FILTER_ALL; } -#pragma GCC diagnostic pop +H5_GCC_DIAG_ON("missing-prototypes") +H5_GCC_DIAG_ON("unused-parameter") #ifdef __cplusplus } /* end extern "C" */ diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index e8bfab2..c45873a 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -716,7 +716,7 @@ h5str_sprintf if (NULL == (this_str = (char *) HDmalloc(27))) H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_sprintf: failed to allocate string buffer"); - if (HDsprintf(this_str, "%Lf", tmp_ldouble) < 0) + if (HDsprintf(this_str, "%Lg", tmp_ldouble) < 0) H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure"); break; diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 03196b2..d5a28ea 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -47,7 +47,14 @@ New Features Configuration: ------------- - - + - Added CMake option to format source files + + HDF5_ENABLE_FORMATTERS option will enable creation of targets using the + pattern - HDF5_*_SRC_FORMAT - where * corresponds to the source folder + or tool folder. All sources can be formatted by executing the format target; + make format + + (ADB - 2020/09/24) Library: -------- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5e1d037..f60d39b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -664,6 +664,42 @@ set (H5Z_HDRS ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SOURCES}" ) +set (H5_MODULE_HEADERS + ${HDF5_SRC_DIR}/H5Amodule.h + ${HDF5_SRC_DIR}/H5ACmodule.h + ${HDF5_SRC_DIR}/H5Bmodule.h + ${HDF5_SRC_DIR}/H5B2module.h + ${HDF5_SRC_DIR}/H5Cmodule.h + ${HDF5_SRC_DIR}/H5CXmodule.h + ${HDF5_SRC_DIR}/H5Dmodule.h + ${HDF5_SRC_DIR}/H5Emodule.h + ${HDF5_SRC_DIR}/H5EAmodule.h + ${HDF5_SRC_DIR}/H5Fmodule.h + ${HDF5_SRC_DIR}/H5FAmodule.h + ${HDF5_SRC_DIR}/H5FDdrvr_module.h + ${HDF5_SRC_DIR}/H5FDmodule.h + ${HDF5_SRC_DIR}/H5FLmodule.h + ${HDF5_SRC_DIR}/H5FSmodule.h + ${HDF5_SRC_DIR}/H5Gmodule.h + ${HDF5_SRC_DIR}/H5HFmodule.h + ${HDF5_SRC_DIR}/H5HGmodule.h + ${HDF5_SRC_DIR}/H5HLmodule.h + ${HDF5_SRC_DIR}/H5Imodule.h + ${HDF5_SRC_DIR}/H5Lmodule.h + ${HDF5_SRC_DIR}/H5MFmodule.h + ${HDF5_SRC_DIR}/H5MPmodule.h + ${HDF5_SRC_DIR}/H5Omodule.h + ${HDF5_SRC_DIR}/H5Pmodule.h + ${HDF5_SRC_DIR}/H5PBmodule.h + ${HDF5_SRC_DIR}/H5PLmodule.h + ${HDF5_SRC_DIR}/H5Rmodule.h + ${HDF5_SRC_DIR}/H5Smodule.h + ${HDF5_SRC_DIR}/H5SLmodule.h + ${HDF5_SRC_DIR}/H5SMmodule.h + ${HDF5_SRC_DIR}/H5Tmodule.h + ${HDF5_SRC_DIR}/H5Zmodule.h +) + set (common_SRCS ${H5_SOURCES} ${H5A_SOURCES} @@ -816,6 +852,7 @@ set (H5_PRIVATE_HEADERS ${HDF5_SRC_DIR}/H5Lpkg.h ${HDF5_SRC_DIR}/H5Lprivate.h + ${HDF5_SRC_DIR}/H5MFpkg.h ${HDF5_SRC_DIR}/H5MFprivate.h ${HDF5_SRC_DIR}/H5MMprivate.h @@ -1031,6 +1068,13 @@ else () endif () endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_SRC_DETECT_FORMAT ${HDF5_SRC_DIR}/H5detect.c) +endif () + add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c) target_include_directories (H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS}) @@ -1040,6 +1084,13 @@ target_link_libraries (H5make_libsettings PRIVATE $<$:"-O0"> ) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_SRC_LIBSETTINGS_FORMAT H5make_libsettings) +endif () + add_custom_command ( OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c ${HDF5_BINARY_DIR}/gen_SRCS.stamp2 @@ -1076,7 +1127,7 @@ if (NOT ONLY_SHARED_LIBS) set (gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c ${HDF5_BINARY_DIR}/H5lib_settings.c) add_custom_target (gen_${HDF5_LIB_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp2) - add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} ${gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" INTERFACE "$/include>;$" @@ -1112,7 +1163,7 @@ if (BUILD_SHARED_LIBS) set (shared_gen_SRCS ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c ${HDF5_BINARY_DIR}/shared/H5lib_settings.c) add_custom_target (gen_${HDF5_LIBSH_TARGET} ALL DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1 ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp2) - add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS}) + add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS}) target_include_directories (${HDF5_LIBSH_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>" PUBLIC "$<$:${HDFS_INCLUDE_DIR}>" @@ -1143,6 +1194,17 @@ if (BUILD_SHARED_LIBS) endif () #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_SRC_FORMAT ${HDF5_LIB_TARGET}) + else () + clang_format (HDF5_SRC_FORMAT ${HDF5_LIBSH_TARGET}) + endif () +endif () + +#----------------------------------------------------------------------------- # Add file(s) to CMake Install #----------------------------------------------------------------------------- if (NOT HDF5_INSTALL_NO_DEVELOPMENT) diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 575c791..99f3979 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -13,12 +13,12 @@ /*------------------------------------------------------------------------- * - * Created: H5ACprivate.h - * Jul 9 1997 - * Robb Matzke + * Created: H5ACprivate.h + * Jul 9 1997 + * Robb Matzke * - * Purpose: Constants and typedefs available to the rest of the - * library. + * Purpose: Constants and typedefs available to the rest of the + * library. * *------------------------------------------------------------------------- */ @@ -26,14 +26,14 @@ #ifndef _H5ACprivate_H #define _H5ACprivate_H -#include "H5ACpublic.h" /*public prototypes */ +#include "H5ACpublic.h" /*public prototypes */ /* Pivate headers needed by this header */ -#include "H5private.h" /* Generic Functions */ -#include "H5Cprivate.h" /* Cache */ -#include "H5Fprivate.h" /* File access */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5SLprivate.h" /* Skip lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Cprivate.h" /* Cache */ +#include "H5Fprivate.h" /* File access */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5SLprivate.h" /* Skip lists */ /* Global metadata tag values */ #define H5AC__INVALID_TAG (haddr_t)0 @@ -75,7 +75,7 @@ typedef enum { H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock) */ H5AC_EPOCH_MARKER_ID, /* (27) epoch marker - always internal to cache */ H5AC_PROXY_ENTRY_ID, /* (28) cache entry proxy */ - H5AC_PREFETCHED_ENTRY_ID, /* (29) prefetched entry - always internal to cache */ + H5AC_PREFETCHED_ENTRY_ID, /* (29) prefetched entry - always internal to cache */ H5AC_NTYPES /* Number of types, must be last */ } H5AC_type_t; @@ -90,29 +90,29 @@ typedef enum { * * NOTE: test/cache plays games with the f->shared->cache, and thus * setting H5AC_DUMP_STATS_ON_CLOSE will generate constant, - * irrelevant data when run with that test program. See - * comments on setup_cache() / takedown_cache() in test/cache_common.c. + * irrelevant data when run with that test program. See + * comments on setup_cache() / takedown_cache() in test/cache_common.c. * for details. * - * If you need to dump stats at file close in test/cache.c, - * use the dump_stats parameter to takedown_cache(), or call - * H5C_stats() directly. - * JRM -- 4/12/15 + * If you need to dump stats at file close in test/cache.c, + * use the dump_stats parameter to takedown_cache(), or call + * H5C_stats() directly. + * JRM -- 4/12/15 * * Added the H5AC_DUMP_IMAGE_STATS_ON_CLOSE #define, which works much * the same way as H5AC_DUMP_STATS_ON_CLOSE. However, the set of stats * displayed is much smaller, and directed purely at the cache image feature. * - * JRM -- 11/1/15 + * JRM -- 11/1/15 */ #if H5C_COLLECT_CACHE_STATS -#define H5AC_DUMP_STATS_ON_CLOSE 0 +#define H5AC_DUMP_STATS_ON_CLOSE 0 #define H5AC_DUMP_IMAGE_STATS_ON_CLOSE 0 #else /* H5C_COLLECT_CACHE_STATS */ -#define H5AC_DUMP_STATS_ON_CLOSE 0 +#define H5AC_DUMP_STATS_ON_CLOSE 0 #define H5AC_DUMP_IMAGE_STATS_ON_CLOSE 0 #endif /* H5C_COLLECT_CACHE_STATS */ @@ -121,8 +121,8 @@ typedef enum { * At present, these are the same as those given in H5Cprivate.h. */ -#define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE -#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE +#define H5AC__DEFAULT_MAX_CACHE_SIZE H5C__DEFAULT_MAX_CACHE_SIZE +#define H5AC__DEFAULT_MIN_CLEAN_SIZE H5C__DEFAULT_MIN_CLEAN_SIZE /* Check if we are sanity checking tagging */ #if H5C_DO_TAGGING_SANITY_CHECKS @@ -132,18 +132,18 @@ typedef enum { #endif /* - * Class methods pertaining to caching. Each type of cached object will + * Class methods pertaining to caching. Each type of cached object will * have a constant variable with permanent life-span that describes how * to cache the object. */ -#define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG -#define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG +#define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG +#define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG /* Cork actions: cork/uncork/get cork status of an object */ -#define H5AC__SET_CORK H5C__SET_CORK -#define H5AC__UNCORK H5C__UNCORK -#define H5AC__GET_CORKED H5C__GET_CORKED +#define H5AC__SET_CORK H5C__SET_CORK +#define H5AC__UNCORK H5C__UNCORK +#define H5AC__GET_CORKED H5C__GET_CORKED /* Aliases for the "ring" type and values */ typedef H5C_ring_t H5AC_ring_t; @@ -159,7 +159,7 @@ typedef H5C_ring_t H5AC_ring_t; typedef H5C_notify_action_t H5AC_notify_action_t; #define H5AC_NOTIFY_ACTION_AFTER_INSERT H5C_NOTIFY_ACTION_AFTER_INSERT #define H5AC_NOTIFY_ACTION_AFTER_LOAD H5C_NOTIFY_ACTION_AFTER_LOAD -#define H5AC_NOTIFY_ACTION_AFTER_FLUSH H5C_NOTIFY_ACTION_AFTER_FLUSH +#define H5AC_NOTIFY_ACTION_AFTER_FLUSH H5C_NOTIFY_ACTION_AFTER_FLUSH #define H5AC_NOTIFY_ACTION_BEFORE_EVICT H5C_NOTIFY_ACTION_BEFORE_EVICT #define H5AC_NOTIFY_ACTION_ENTRY_DIRTIED H5C_NOTIFY_ACTION_ENTRY_DIRTIED #define H5AC_NOTIFY_ACTION_ENTRY_CLEANED H5C_NOTIFY_ACTION_ENTRY_CLEANED @@ -168,36 +168,36 @@ typedef H5C_notify_action_t H5AC_notify_action_t; #define H5AC_NOTIFY_ACTION_CHILD_UNSERIALIZED H5C_NOTIFY_ACTION_CHILD_UNSERIALIZED #define H5AC_NOTIFY_ACTION_CHILD_SERIALIZED H5C_NOTIFY_ACTION_CHILD_SERIALIZED -#define H5AC__CLASS_NO_FLAGS_SET H5C__CLASS_NO_FLAGS_SET +#define H5AC__CLASS_NO_FLAGS_SET H5C__CLASS_NO_FLAGS_SET #define H5AC__CLASS_SPECULATIVE_LOAD_FLAG H5C__CLASS_SPECULATIVE_LOAD_FLAG /* The following flags should only appear in test code */ #define H5AC__CLASS_SKIP_READS H5C__CLASS_SKIP_READS #define H5AC__CLASS_SKIP_WRITES H5C__CLASS_SKIP_WRITES -typedef H5C_get_initial_load_size_func_t H5AC_get_initial_load_size_func_t; -typedef H5C_get_final_load_size_func_t H5AC_get_final_load_size_func_t; -typedef H5C_verify_chksum_func_t H5AC_verify_chksum_func_t; -typedef H5C_deserialize_func_t H5AC_deserialize_func_t; -typedef H5C_image_len_func_t H5AC_image_len_func_t; +typedef H5C_get_initial_load_size_func_t H5AC_get_initial_load_size_func_t; +typedef H5C_get_final_load_size_func_t H5AC_get_final_load_size_func_t; +typedef H5C_verify_chksum_func_t H5AC_verify_chksum_func_t; +typedef H5C_deserialize_func_t H5AC_deserialize_func_t; +typedef H5C_image_len_func_t H5AC_image_len_func_t; #define H5AC__SERIALIZE_NO_FLAGS_SET H5C__SERIALIZE_NO_FLAGS_SET #define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG #define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG -typedef H5C_pre_serialize_func_t H5AC_pre_serialize_func_t; -typedef H5C_serialize_func_t H5AC_serialize_func_t; -typedef H5C_notify_func_t H5AC_notify_func_t; -typedef H5C_free_icr_func_t H5AC_free_icr_func_t; -typedef H5C_get_fsf_size_t H5AC_get_fsf_size_t; +typedef H5C_pre_serialize_func_t H5AC_pre_serialize_func_t; +typedef H5C_serialize_func_t H5AC_serialize_func_t; +typedef H5C_notify_func_t H5AC_notify_func_t; +typedef H5C_free_icr_func_t H5AC_free_icr_func_t; +typedef H5C_get_fsf_size_t H5AC_get_fsf_size_t; -typedef H5C_class_t H5AC_class_t; +typedef H5C_class_t H5AC_class_t; /* Cache entry info */ -typedef H5C_cache_entry_t H5AC_info_t; +typedef H5C_cache_entry_t H5AC_info_t; /* Typedef for metadata cache (defined in H5Cpkg.h) */ -typedef H5C_t H5AC_t; +typedef H5C_t H5AC_t; /* Metadata cache proxy entry type */ typedef struct H5AC_proxy_entry_t { @@ -223,6 +223,7 @@ typedef struct H5AC_proxy_entry_t { #define H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED +/* clang-format off */ #ifdef H5_HAVE_PARALLEL #define H5AC__DEFAULT_CACHE_CONFIG \ { \ @@ -255,9 +256,9 @@ typedef struct H5AC_proxy_entry_t { /* int epochs_before_eviction = */ 3, \ /* hbool_t apply_empty_reserve = */ TRUE, \ /* double empty_reserve = */ 0.1f, \ - /* size_t dirty_bytes_threshold = */ (256 * 1024), \ - /* int metadata_write_strategy = */ \ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ + /* size_t dirty_bytes_threshold = */ (256 * 1024), \ + /* int metadata_write_strategy = */ \ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ } #else /* H5_HAVE_PARALLEL */ #define H5AC__DEFAULT_CACHE_CONFIG \ @@ -291,9 +292,9 @@ typedef struct H5AC_proxy_entry_t { /* int epochs_before_eviction = */ 3, \ /* hbool_t apply_empty_reserve = */ TRUE, \ /* double empty_reserve = */ 0.1f, \ - /* size_t dirty_bytes_threshold = */ (256 * 1024), \ - /* int metadata_write_strategy = */ \ - H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ + /* size_t dirty_bytes_threshold = */ (256 * 1024), \ + /* int metadata_write_strategy = */ \ + H5AC__DEFAULT_METADATA_WRITE_STRATEGY \ } #endif /* H5_HAVE_PARALLEL */ @@ -304,6 +305,7 @@ typedef struct H5AC_proxy_entry_t { /* hbool_t save_resize_status = */ FALSE, \ /* int32_t entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE \ } +/* clang-format on */ /* * Library prototypes. */ @@ -313,21 +315,21 @@ typedef struct H5AC_proxy_entry_t { * the equivalent flags from H5Cprivate.h. */ -#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET -#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG -#define H5AC__DELETED_FLAG H5C__DELETED_FLAG -#define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG -#define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG -#define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG -#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG -#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG +#define H5AC__NO_FLAGS_SET H5C__NO_FLAGS_SET +#define H5AC__SET_FLUSH_MARKER_FLAG H5C__SET_FLUSH_MARKER_FLAG +#define H5AC__DELETED_FLAG H5C__DELETED_FLAG +#define H5AC__DIRTIED_FLAG H5C__DIRTIED_FLAG +#define H5AC__PIN_ENTRY_FLAG H5C__PIN_ENTRY_FLAG +#define H5AC__UNPIN_ENTRY_FLAG H5C__UNPIN_ENTRY_FLAG +#define H5AC__FLUSH_INVALIDATE_FLAG H5C__FLUSH_INVALIDATE_FLAG +#define H5AC__FLUSH_CLEAR_ONLY_FLAG H5C__FLUSH_CLEAR_ONLY_FLAG #define H5AC__FLUSH_MARKED_ENTRIES_FLAG H5C__FLUSH_MARKED_ENTRIES_FLAG #define H5AC__FLUSH_IGNORE_PROTECTED_FLAG H5C__FLUSH_IGNORE_PROTECTED_FLAG -#define H5AC__READ_ONLY_FLAG H5C__READ_ONLY_FLAG -#define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG +#define H5AC__READ_ONLY_FLAG H5C__READ_ONLY_FLAG +#define H5AC__FREE_FILE_SPACE_FLAG H5C__FREE_FILE_SPACE_FLAG #define H5AC__TAKE_OWNERSHIP_FLAG H5C__TAKE_OWNERSHIP_FLAG -#define H5AC__FLUSH_LAST_FLAG H5C__FLUSH_LAST_FLAG -#define H5AC__FLUSH_COLLECTIVELY_FLAG H5C__FLUSH_COLLECTIVELY_FLAG +#define H5AC__FLUSH_LAST_FLAG H5C__FLUSH_LAST_FLAG +#define H5AC__FLUSH_COLLECTIVELY_FLAG H5C__FLUSH_COLLECTIVELY_FLAG /* #defines of flags used to report entry status in the diff --git a/src/H5C.c b/src/H5C.c index 20182da..8bfcf67d 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -19,52 +19,52 @@ * * Purpose: Functions in this file implement a generic cache for * things which exist on disk, and which may be - * unambiguously referenced by their disk addresses. + * unambiguously referenced by their disk addresses. * * The code in this module was initially written in - * support of a complete re-write of the metadata cache - * in H5AC.c However, other uses for the cache code - * suggested themselves, and thus this file was created - * in an attempt to support re-use. + * support of a complete re-write of the metadata cache + * in H5AC.c However, other uses for the cache code + * suggested themselves, and thus this file was created + * in an attempt to support re-use. * - * For a detailed overview of the cache, please see the - * header comment for H5C_t in H5Cpkg.h. + * For a detailed overview of the cache, please see the + * header comment for H5C_t in H5Cpkg.h. * *------------------------------------------------------------------------- */ /************************************************************************** * - * To Do: + * To Do: * - * Code Changes: + * Code Changes: * - * - Remove extra functionality in H5C__flush_single_entry()? + * - Remove extra functionality in H5C__flush_single_entry()? * - * - Change protect/unprotect to lock/unlock. + * - Change protect/unprotect to lock/unlock. * - * - Flush entries in increasing address order in - * H5C__make_space_in_cache(). + * - Flush entries in increasing address order in + * H5C__make_space_in_cache(). * - * - Also in H5C__make_space_in_cache(), use high and low water marks - * to reduce the number of I/O calls. + * - Also in H5C__make_space_in_cache(), use high and low water marks + * to reduce the number of I/O calls. * - * - When flushing, attempt to combine contiguous entries to reduce - * I/O overhead. Can't do this just yet as some entries are not - * contiguous. Do this in parallel only or in serial as well? + * - When flushing, attempt to combine contiguous entries to reduce + * I/O overhead. Can't do this just yet as some entries are not + * contiguous. Do this in parallel only or in serial as well? * - * - Create MPI type for dirty objects when flushing in parallel. + * - Create MPI type for dirty objects when flushing in parallel. * - * - Now that TBBT routines aren't used, fix nodes in memory to + * - Now that TBBT routines aren't used, fix nodes in memory to * point directly to the skip list node from the LRU list, eliminating * skip list lookups when evicting objects from the cache. * - * Tests: + * Tests: * - * - Trim execution time. (This is no longer a major issue with the - * shift from the TBBT to a hash table for indexing.) + * - Trim execution time. (This is no longer a major issue with the + * shift from the TBBT to a hash table for indexing.) * - * - Add random tests. + * - Add random tests. * **************************************************************************/ @@ -73,22 +73,22 @@ /****************/ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ -#define H5F_FRIEND /* suppress error about including H5Fpkg */ +#define H5F_FRIEND /* suppress error about including H5Fpkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Cpkg.h" /* Cache */ -#include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Fpkg.h" /* Files */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MFprivate.h" /* File memory management */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5private.h" /* Generic Functions */ +#include "H5Cpkg.h" /* Cache */ +#include "H5CXprivate.h" /* API Contexts */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Fpkg.h" /* Files */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MFprivate.h" /* File memory management */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ /****************/ @@ -211,21 +211,21 @@ H5FL_DEFINE_STATIC(H5C_t); H5FL_BLK_DEFINE_STATIC(parent); - + /*------------------------------------------------------------------------- * Function: H5C_create * * Purpose: Allocate, initialize, and return the address of a new - * instance of H5C_t. + * instance of H5C_t. * - * In general, the max_cache_size parameter must be positive, - * and the min_clean_size parameter must lie in the closed - * interval [0, max_cache_size]. + * In general, the max_cache_size parameter must be positive, + * and the min_clean_size parameter must lie in the closed + * interval [0, max_cache_size]. * - * The check_write_permitted parameter must either be NULL, - * or point to a function of type H5C_write_permitted_func_t. - * If it is NULL, the cache will use the write_permitted - * flag to determine whether writes are permitted. + * The check_write_permitted parameter must either be NULL, + * or point to a function of type H5C_write_permitted_func_t. + * If it is NULL, the cache will use the write_permitted + * flag to determine whether writes are permitted. * * Return: Success: Pointer to the new instance. * @@ -301,24 +301,24 @@ H5FL_BLK_DEFINE_STATIC(parent); * * JRM -- 4/20/20 * Added initialization for the slist_enabled field. Recall - * that the slist is used to flush metadata cache entries - * in (roughly) increasing address order. While this is + * that the slist is used to flush metadata cache entries + * in (roughly) increasing address order. While this is * needed at flush and close, it is not used elsewhere. - * The slist_enabled field exists to allow us to construct + * The slist_enabled field exists to allow us to construct * the slist when needed, and leave it empty otherwise -- thus * avoiding the overhead of maintaining it. - * + * * JRM -- 4/29/20 - * + * *------------------------------------------------------------------------- */ H5C_t * -H5C_create(size_t max_cache_size, - size_t min_clean_size, - int max_type_id, +H5C_create(size_t max_cache_size, + size_t min_clean_size, + int max_type_id, const H5C_class_t * const * class_table_ptr, H5C_write_permitted_func_t check_write_permitted, - hbool_t write_permitted, + hbool_t write_permitted, H5C_log_flush_func_t log_flush, void * aux_ptr) { @@ -342,7 +342,7 @@ H5C_create(size_t max_cache_size, } /* end for */ if(NULL == (cache_ptr = H5FL_CALLOC(H5C_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if(NULL == (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list") @@ -354,34 +354,34 @@ H5C_create(size_t max_cache_size, * the fields. */ - cache_ptr->magic = H5C__H5C_T_MAGIC; + cache_ptr->magic = H5C__H5C_T_MAGIC; - cache_ptr->flush_in_progress = FALSE; + cache_ptr->flush_in_progress = FALSE; if(NULL == (cache_ptr->log_info = (H5C_log_info_t *)H5MM_calloc(sizeof(H5C_log_info_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed") - cache_ptr->aux_ptr = aux_ptr; + cache_ptr->aux_ptr = aux_ptr; - cache_ptr->max_type_id = max_type_id; + cache_ptr->max_type_id = max_type_id; - cache_ptr->class_table_ptr = class_table_ptr; + cache_ptr->class_table_ptr = class_table_ptr; - cache_ptr->max_cache_size = max_cache_size; - cache_ptr->min_clean_size = min_clean_size; + cache_ptr->max_cache_size = max_cache_size; + cache_ptr->min_clean_size = min_clean_size; - cache_ptr->check_write_permitted = check_write_permitted; - cache_ptr->write_permitted = write_permitted; + cache_ptr->check_write_permitted = check_write_permitted; + cache_ptr->write_permitted = write_permitted; - cache_ptr->log_flush = log_flush; + cache_ptr->log_flush = log_flush; - cache_ptr->evictions_enabled = TRUE; - cache_ptr->close_warning_received = FALSE; + cache_ptr->evictions_enabled = TRUE; + cache_ptr->close_warning_received = FALSE; - cache_ptr->index_len = 0; - cache_ptr->index_size = (size_t)0; - cache_ptr->clean_index_size = (size_t)0; - cache_ptr->dirty_index_size = (size_t)0; + cache_ptr->index_len = 0; + cache_ptr->index_size = (size_t)0; + cache_ptr->clean_index_size = (size_t)0; + cache_ptr->dirty_index_size = (size_t)0; for(i = 0; i < H5C_RING_NTYPES; i++) { cache_ptr->index_ring_len[i] = 0; @@ -411,98 +411,98 @@ H5C_create(size_t max_cache_size, cache_ptr->slist_len = 0; cache_ptr->slist_size = (size_t)0; - /* slist_ring_len, slist_ring_size, and + /* slist_ring_len, slist_ring_size, and * slist_ptr initializaed above. */ #if H5C_DO_SANITY_CHECKS - cache_ptr->slist_len_increase = 0; - cache_ptr->slist_size_increase = 0; + cache_ptr->slist_len_increase = 0; + cache_ptr->slist_size_increase = 0; #endif /* H5C_DO_SANITY_CHECKS */ - cache_ptr->entries_removed_counter = 0; - cache_ptr->last_entry_removed_ptr = NULL; + cache_ptr->entries_removed_counter = 0; + cache_ptr->last_entry_removed_ptr = NULL; cache_ptr->entry_watched_for_removal = NULL; - cache_ptr->pl_len = 0; - cache_ptr->pl_size = (size_t)0; - cache_ptr->pl_head_ptr = NULL; - cache_ptr->pl_tail_ptr = NULL; + cache_ptr->pl_len = 0; + cache_ptr->pl_size = (size_t)0; + cache_ptr->pl_head_ptr = NULL; + cache_ptr->pl_tail_ptr = NULL; - cache_ptr->pel_len = 0; - cache_ptr->pel_size = (size_t)0; - cache_ptr->pel_head_ptr = NULL; - cache_ptr->pel_tail_ptr = NULL; + cache_ptr->pel_len = 0; + cache_ptr->pel_size = (size_t)0; + cache_ptr->pel_head_ptr = NULL; + cache_ptr->pel_tail_ptr = NULL; - cache_ptr->LRU_list_len = 0; - cache_ptr->LRU_list_size = (size_t)0; - cache_ptr->LRU_head_ptr = NULL; - cache_ptr->LRU_tail_ptr = NULL; + cache_ptr->LRU_list_len = 0; + cache_ptr->LRU_list_size = (size_t)0; + cache_ptr->LRU_head_ptr = NULL; + cache_ptr->LRU_tail_ptr = NULL; #ifdef H5_HAVE_PARALLEL - cache_ptr->coll_list_len = 0; - cache_ptr->coll_list_size = (size_t)0; - cache_ptr->coll_head_ptr = NULL; - cache_ptr->coll_tail_ptr = NULL; - cache_ptr->coll_write_list = NULL; + cache_ptr->coll_list_len = 0; + cache_ptr->coll_list_size = (size_t)0; + cache_ptr->coll_head_ptr = NULL; + cache_ptr->coll_tail_ptr = NULL; + cache_ptr->coll_write_list = NULL; #endif /* H5_HAVE_PARALLEL */ #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS - cache_ptr->cLRU_list_len = 0; - cache_ptr->cLRU_list_size = (size_t)0; - cache_ptr->cLRU_head_ptr = NULL; - cache_ptr->cLRU_tail_ptr = NULL; - - cache_ptr->dLRU_list_len = 0; - cache_ptr->dLRU_list_size = (size_t)0; - cache_ptr->dLRU_head_ptr = NULL; - cache_ptr->dLRU_tail_ptr = NULL; + cache_ptr->cLRU_list_len = 0; + cache_ptr->cLRU_list_size = (size_t)0; + cache_ptr->cLRU_head_ptr = NULL; + cache_ptr->cLRU_tail_ptr = NULL; + + cache_ptr->dLRU_list_len = 0; + cache_ptr->dLRU_list_size = (size_t)0; + cache_ptr->dLRU_head_ptr = NULL; + cache_ptr->dLRU_tail_ptr = NULL; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - cache_ptr->size_increase_possible = FALSE; + cache_ptr->size_increase_possible = FALSE; cache_ptr->flash_size_increase_possible = FALSE; cache_ptr->flash_size_increase_threshold = 0; - cache_ptr->size_decrease_possible = FALSE; - cache_ptr->resize_enabled = FALSE; - cache_ptr->cache_full = FALSE; - cache_ptr->size_decreased = FALSE; - cache_ptr->resize_in_progress = FALSE; - cache_ptr->msic_in_progress = FALSE; - - (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER; - (cache_ptr->resize_ctl).rpt_fcn = NULL; - (cache_ptr->resize_ctl).set_initial_size = FALSE; - (cache_ptr->resize_ctl).initial_size = H5C__DEF_AR_INIT_SIZE; - (cache_ptr->resize_ctl).min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC; - (cache_ptr->resize_ctl).max_size = H5C__DEF_AR_MAX_SIZE; - (cache_ptr->resize_ctl).min_size = H5C__DEF_AR_MIN_SIZE; - (cache_ptr->resize_ctl).epoch_length = H5C__DEF_AR_EPOCH_LENGTH; - - (cache_ptr->resize_ctl).incr_mode = H5C_incr__off; - (cache_ptr->resize_ctl).lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD; - (cache_ptr->resize_ctl).increment = H5C__DEF_AR_INCREMENT; - (cache_ptr->resize_ctl).apply_max_increment = TRUE; - (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; + cache_ptr->size_decrease_possible = FALSE; + cache_ptr->resize_enabled = FALSE; + cache_ptr->cache_full = FALSE; + cache_ptr->size_decreased = FALSE; + cache_ptr->resize_in_progress = FALSE; + cache_ptr->msic_in_progress = FALSE; + + (cache_ptr->resize_ctl).version = H5C__CURR_AUTO_SIZE_CTL_VER; + (cache_ptr->resize_ctl).rpt_fcn = NULL; + (cache_ptr->resize_ctl).set_initial_size = FALSE; + (cache_ptr->resize_ctl).initial_size = H5C__DEF_AR_INIT_SIZE; + (cache_ptr->resize_ctl).min_clean_fraction = H5C__DEF_AR_MIN_CLEAN_FRAC; + (cache_ptr->resize_ctl).max_size = H5C__DEF_AR_MAX_SIZE; + (cache_ptr->resize_ctl).min_size = H5C__DEF_AR_MIN_SIZE; + (cache_ptr->resize_ctl).epoch_length = H5C__DEF_AR_EPOCH_LENGTH; + + (cache_ptr->resize_ctl).incr_mode = H5C_incr__off; + (cache_ptr->resize_ctl).lower_hr_threshold = H5C__DEF_AR_LOWER_THRESHHOLD; + (cache_ptr->resize_ctl).increment = H5C__DEF_AR_INCREMENT; + (cache_ptr->resize_ctl).apply_max_increment = TRUE; + (cache_ptr->resize_ctl).max_increment = H5C__DEF_AR_MAX_INCREMENT; (cache_ptr->resize_ctl).flash_incr_mode = H5C_flash_incr__off; (cache_ptr->resize_ctl).flash_multiple = 1.0f; (cache_ptr->resize_ctl).flash_threshold = 0.25f; - (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; - (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; - (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT; - (cache_ptr->resize_ctl).apply_max_decrement = TRUE; - (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT; + (cache_ptr->resize_ctl).decr_mode = H5C_decr__off; + (cache_ptr->resize_ctl).upper_hr_threshold = H5C__DEF_AR_UPPER_THRESHHOLD; + (cache_ptr->resize_ctl).decrement = H5C__DEF_AR_DECREMENT; + (cache_ptr->resize_ctl).apply_max_decrement = TRUE; + (cache_ptr->resize_ctl).max_decrement = H5C__DEF_AR_MAX_DECREMENT; (cache_ptr->resize_ctl).epochs_before_eviction = H5C__DEF_AR_EPCHS_B4_EVICT; (cache_ptr->resize_ctl).apply_empty_reserve = TRUE; - (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; + (cache_ptr->resize_ctl).empty_reserve = H5C__DEF_AR_EMPTY_RESERVE; - cache_ptr->epoch_markers_active = 0; + cache_ptr->epoch_markers_active = 0; /* no need to initialize the ring buffer itself */ - cache_ptr->epoch_marker_ringbuf_first = 1; - cache_ptr->epoch_marker_ringbuf_last = 0; - cache_ptr->epoch_marker_ringbuf_size = 0; + cache_ptr->epoch_marker_ringbuf_first = 1; + cache_ptr->epoch_marker_ringbuf_last = 0; + cache_ptr->epoch_marker_ringbuf_size = 0; /* Initialize all epoch marker entries' fields to zero/FALSE/NULL */ HDmemset(cache_ptr->epoch_markers, 0, sizeof(cache_ptr->epoch_markers)); @@ -510,10 +510,10 @@ H5C_create(size_t max_cache_size, /* Set non-zero/FALSE/NULL fields for epoch markers */ for ( i = 0; i < H5C__MAX_EPOCH_MARKERS; i++ ) { - ((cache_ptr->epoch_markers)[i]).magic = - H5C__H5C_CACHE_ENTRY_T_MAGIC; - ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; - ((cache_ptr->epoch_markers)[i]).type = H5AC_EPOCH_MARKER; + ((cache_ptr->epoch_markers)[i]).magic = + H5C__H5C_CACHE_ENTRY_T_MAGIC; + ((cache_ptr->epoch_markers)[i]).addr = (haddr_t)i; + ((cache_ptr->epoch_markers)[i]).type = H5AC_EPOCH_MARKER; } /* Initialize cache image generation on file close related fields. @@ -527,25 +527,25 @@ H5C_create(size_t max_cache_size, cache_ptr->image_ctl.flags = H5C_CI__ALL_FLAGS; cache_ptr->serialization_in_progress= FALSE; - cache_ptr->load_image = FALSE; + cache_ptr->load_image = FALSE; cache_ptr->image_loaded = FALSE; - cache_ptr->delete_image = FALSE; - cache_ptr->image_addr = HADDR_UNDEF; - cache_ptr->image_len = 0; - cache_ptr->image_data_len = 0; + cache_ptr->delete_image = FALSE; + cache_ptr->image_addr = HADDR_UNDEF; + cache_ptr->image_len = 0; + cache_ptr->image_data_len = 0; - cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; - cache_ptr->entries_relocated_counter = 0; - cache_ptr->entry_fd_height_change_counter = 0; + cache_ptr->entries_loaded_counter = 0; + cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_relocated_counter = 0; + cache_ptr->entry_fd_height_change_counter = 0; - cache_ptr->num_entries_in_image = 0; - cache_ptr->image_entries = NULL; - cache_ptr->image_buffer = NULL; + cache_ptr->num_entries_in_image = 0; + cache_ptr->image_entries = NULL; + cache_ptr->image_buffer = NULL; /* initialize free space manager related fields: */ - cache_ptr->rdfsm_settled = FALSE; - cache_ptr->mdfsm_settled = FALSE; + cache_ptr->rdfsm_settled = FALSE; + cache_ptr->mdfsm_settled = FALSE; if(H5C_reset_cache_hit_rate_stats(cache_ptr) < 0) /* this should be impossible... */ @@ -553,7 +553,7 @@ H5C_create(size_t max_cache_size, H5C_stats__reset(cache_ptr); - cache_ptr->prefix[0] = '\0'; /* empty string */ + cache_ptr->prefix[0] = '\0'; /* empty string */ #ifndef NDEBUG cache_ptr->get_entry_ptr_from_addr_counter = 0; @@ -582,19 +582,19 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_create() */ - + /*------------------------------------------------------------------------- * Function: H5C_def_auto_resize_rpt_fcn * * Purpose: Print results of a automatic cache resize. * - * This function should only be used where HDprintf() behaves - * well -- i.e. not on Windows. + * This function should only be used where HDprintf() behaves + * well -- i.e. not on Windows. * * Return: void * * Programmer: John Mainzer - * 10/27/04 + * 10/27/04 * *------------------------------------------------------------------------- */ @@ -634,7 +634,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, (cache_ptr->resize_ctl).lower_hr_threshold); HDfprintf(stdout, - "%s cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%scache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -708,7 +708,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, } HDfprintf(stdout, - "%s cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n", + "%s cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n", cache_ptr->prefix, old_max_cache_size, old_min_clean_size, @@ -722,7 +722,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold); HDfprintf(stdout, - "%s cache already at maximum size so no change.\n", + "%s cache already at maximum size so no change.\n", cache_ptr->prefix); break; @@ -730,7 +730,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDfprintf(stdout, "%sAuto cache resize -- hit rate (%lf) -- can't decrease.\n", cache_ptr->prefix, hit_rate); - HDfprintf(stdout, "%s cache already at minimum size.\n", + HDfprintf(stdout, "%s cache already at minimum size.\n", cache_ptr->prefix); break; @@ -754,7 +754,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, cache_ptr->prefix, hit_rate, (cache_ptr->resize_ctl).lower_hr_threshold); HDfprintf(stdout, - "%s cache not full so no increase in size.\n", + "%s cache not full so no increase in size.\n", cache_ptr->prefix); break; @@ -768,7 +768,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, } /* H5C_def_auto_resize_rpt_fcn() */ - + /*------------------------------------------------------------------------- * Function: H5C_free_tag_list_cb * @@ -777,7 +777,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi - * January 2014 + * January 2014 * *------------------------------------------------------------------------- */ @@ -796,14 +796,14 @@ H5C_free_tag_list_cb(void *_item, void H5_ATTR_UNUSED *key, void H5_ATTR_UNUSED FUNC_LEAVE_NOAPI(0) } /* H5C_free_tag_list_cb() */ - + /*------------------------------------------------------------------------- * * Function: H5C_prep_for_file_close * * Purpose: This function should be called just prior to the cache - * flushes at file close. There should be no protected - * entries in the cache at this point. + * flushes at file close. There should be no protected + * entries in the cache at this point. * * Return: Non-negative on success/Negative on failure * @@ -817,7 +817,7 @@ H5C_prep_for_file_close(H5F_t *f) { H5C_t * cache_ptr; hbool_t image_generated = FALSE; /* Whether a cache image was generated */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -891,7 +891,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_prep_for_file_close() */ - + /*------------------------------------------------------------------------- * Function: H5C_dest * @@ -900,24 +900,24 @@ done: * This function fails if any object are protected since the * resulting file might not be consistent. * - * Note that *cache_ptr has been freed upon successful return. + * Note that *cache_ptr has been freed upon successful return. * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer - * 6/2/04 + * 6/2/04 * * Modifications: * * JRM -- 5/15/20 * - * Updated the function to enable the slist prior to the - * call to H5C__flush_invalidate_cache(). + * Updated the function to enable the slist prior to the + * call to H5C__flush_invalidate_cache(). * * Arguably, it shouldn't be necessary to re-enable the - * slist after the call to H5C__flush_invalidate_cache(), as + * slist after the call to H5C__flush_invalidate_cache(), as * the metadata cache should be discarded. However, in the - * test code, we make multiple calls to H5C_dest(). Thus + * test code, we make multiple calls to H5C_dest(). Thus * we re-enable the slist on failure if it and the cache * still exist. * @@ -960,7 +960,7 @@ H5C_dest(H5F_t * f) "Can't generate metadata cache image") } - /* Question: Is it possible for cache_ptr->slist be non-null at this + /* Question: Is it possible for cache_ptr->slist be non-null at this * point? If no, shouldn't this if statement be an assert? */ if ( cache_ptr->slist_ptr != NULL ) { @@ -991,7 +991,7 @@ H5C_dest(H5F_t * f) if ( cache_ptr->get_entry_ptr_from_addr_counter > 0 ) { - HDfprintf(stdout, + HDfprintf(stdout, "*** %ld calls to H5C_get_entry_ptr_from_add(). ***\n", cache_ptr->get_entry_ptr_from_addr_counter); } @@ -1018,7 +1018,7 @@ done: } /* H5C_dest() */ - + /*------------------------------------------------------------------------- * Function: H5C_evict * @@ -1027,15 +1027,15 @@ done: * Return: Non-negative on success/Negative on failure * * Programmer: Vailin Choi - * Dec 2013 + * Dec 2013 * * Modifications: * * JRM -- 5/5/20 * * Added code to enable the skip list prior to the call - * to H5C__flush_invalidate_cache(), and disable it - * afterwards. + * to H5C__flush_invalidate_cache(), and disable it + * afterwards. * *------------------------------------------------------------------------- */ @@ -1057,7 +1057,7 @@ H5C_evict(H5F_t * f) /* Flush and invalidate all cache entries except the pinned entries */ if ( H5C__flush_invalidate_cache(f, H5C__EVICT_ALLOW_LAST_PINS_FLAG) < 0 ) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to evict entries in the cache") /* Disable the slist, @@ -1070,13 +1070,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_evict() */ - + /*------------------------------------------------------------------------- * Function: H5C_expunge_entry * * Purpose: Use this function to tell the cache to expunge an entry - * from the cache without writing it to disk even if it is - * dirty. The entry may not be either pinned or protected. + * from the cache without writing it to disk even if it is + * dirty. The entry may not be either pinned or protected. * * Return: Non-negative on success/Negative on failure * @@ -1088,10 +1088,10 @@ done: herr_t H5C_expunge_entry(H5F_t *f, const H5C_class_t *type, haddr_t addr, unsigned flags) { - H5C_t * cache_ptr; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_t * cache_ptr; + H5C_cache_entry_t * entry_ptr = NULL; unsigned flush_flags = (H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG); - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1146,51 +1146,51 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_expunge_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C_flush_cache * - * Purpose: Flush (and possibly destroy) the entries contained in the - * specified cache. + * Purpose: Flush (and possibly destroy) the entries contained in the + * specified cache. * - * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the - * function returns failure. + * If the cache contains protected entries, the function will + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the + * function returns failure. * * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. + * a request to flush all items and something was protected. * * Programmer: John Mainzer - * 6/2/04 + * 6/2/04 * - * Changes: Modified function to test for slist chamges in - * pre_serialize and serialize callbacks, and re-start - * scans through the slist when such changes occur. + * Changes: Modified function to test for slist chamges in + * pre_serialize and serialize callbacks, and re-start + * scans through the slist when such changes occur. * - * This has been a potential problem for some time, - * and there has been code in this function to deal - * with elements of this issue. However the shift - * to the V3 cache in combination with the activities - * of some of the cache clients (in particular the - * free space manager and the fractal heap) have - * made this re-work necessary. + * This has been a potential problem for some time, + * and there has been code in this function to deal + * with elements of this issue. However the shift + * to the V3 cache in combination with the activities + * of some of the cache clients (in particular the + * free space manager and the fractal heap) have + * made this re-work necessary. * - * JRM -- 12/13/14 + * JRM -- 12/13/14 * - * Modified function to support rings. Basic idea is that - * every entry in the cache is assigned to a ring. Entries - * in the outermost ring are flushed first, followed by - * those in the next outermost ring, and so on until the - * innermost ring is flushed. See header comment on - * H5C_ring_t in H5Cprivate.h for a more detailed - * discussion. + * Modified function to support rings. Basic idea is that + * every entry in the cache is assigned to a ring. Entries + * in the outermost ring are flushed first, followed by + * those in the next outermost ring, and so on until the + * innermost ring is flushed. See header comment on + * H5C_ring_t in H5Cprivate.h for a more detailed + * discussion. * - * JRM -- 8/30/15 + * JRM -- 8/30/15 * - * Modified function to call the free space manager - * settling functions. - * JRM -- 6/9/16 + * Modified function to call the free space manager + * settling functions. + * JRM -- 6/9/16 * *------------------------------------------------------------------------- */ @@ -1198,19 +1198,19 @@ herr_t H5C_flush_cache(H5F_t *f, unsigned flags) { #if H5C_DO_SANITY_CHECKS - int i; - uint32_t index_len = 0; - size_t index_size = (size_t)0; - size_t clean_index_size = (size_t)0; - size_t dirty_index_size = (size_t)0; - size_t slist_size = (size_t)0; - uint32_t slist_len = 0; + int i; + uint32_t index_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; + uint32_t slist_len = 0; #endif /* H5C_DO_SANITY_CHECKS */ - H5C_ring_t ring; + H5C_ring_t ring; H5C_t * cache_ptr; hbool_t destroy; - hbool_t ignore_protected; - herr_t ret_value = SUCCEED; + hbool_t ignore_protected; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -1235,7 +1235,7 @@ H5C_flush_cache(H5F_t *f, unsigned flags) clean_index_size += cache_ptr->clean_index_ring_size[i]; dirty_index_size += cache_ptr->dirty_index_ring_size[i]; - slist_len += cache_ptr->slist_ring_len[i]; + slist_len += cache_ptr->slist_ring_len[i]; slist_size += cache_ptr->slist_ring_size[i]; } /* end for */ @@ -1266,45 +1266,45 @@ H5C_flush_cache(H5F_t *f, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate failed") } /* end if */ else { - /* flush each ring, starting from the outermost ring and + /* flush each ring, starting from the outermost ring and * working inward. */ ring = H5C_RING_USER; - while(ring < H5C_RING_NTYPES) { + while(ring < H5C_RING_NTYPES) { /* Only call the free space manager settle routines when close * warning has been received. */ - if(cache_ptr->close_warning_received) { - switch(ring) { - case H5C_RING_USER: - break; + if(cache_ptr->close_warning_received) { + switch(ring) { + case H5C_RING_USER: + break; - case H5C_RING_RDFSM: + case H5C_RING_RDFSM: /* Settle raw data FSM */ - if(!cache_ptr->rdfsm_settled) - if(H5MF_settle_raw_data_fsm(f, &cache_ptr->rdfsm_settled) < 0) + if(!cache_ptr->rdfsm_settled) + if(H5MF_settle_raw_data_fsm(f, &cache_ptr->rdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "RD FSM settle failed") - break; + break; - case H5C_RING_MDFSM: + case H5C_RING_MDFSM: /* Settle metadata FSM */ - if(!cache_ptr->mdfsm_settled) - if(H5MF_settle_meta_data_fsm(f, &cache_ptr->mdfsm_settled) < 0) + if(!cache_ptr->mdfsm_settled) + if(H5MF_settle_meta_data_fsm(f, &cache_ptr->mdfsm_settled) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "MD FSM settle failed") - break; + break; - case H5C_RING_SBE: - case H5C_RING_SB: - break; + case H5C_RING_SBE: + case H5C_RING_SB: + break; - default: + default: HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Unknown ring?!?!") - break; - } /* end switch */ + break; + } /* end switch */ } /* end if */ - if(H5C__flush_ring(f, ring, flags) < 0) + if(H5C__flush_ring(f, ring, flags) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush ring failed") ring++; } /* end while */ @@ -1316,28 +1316,28 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_flush_cache() */ - + /*------------------------------------------------------------------------- * Function: H5C_flush_to_min_clean * - * Purpose: Flush dirty entries until the caches min clean size is - * attained. + * Purpose: Flush dirty entries until the caches min clean size is + * attained. * - * This function is used in the implementation of the - * metadata cache in PHDF5. To avoid "messages from the - * future", the cache on process 0 can't be allowed to - * flush entries until the other processes have reached - * the same point in the calculation. If this constraint - * is not met, it is possible that the other processes will - * read metadata generated at a future point in the - * computation. + * This function is used in the implementation of the + * metadata cache in PHDF5. To avoid "messages from the + * future", the cache on process 0 can't be allowed to + * flush entries until the other processes have reached + * the same point in the calculation. If this constraint + * is not met, it is possible that the other processes will + * read metadata generated at a future point in the + * computation. * * * Return: Non-negative on success/Negative on failure or if - * write is not permitted. + * write is not permitted. * * Programmer: John Mainzer - * 9/16/05 + * 9/16/05 * *------------------------------------------------------------------------- */ @@ -1345,8 +1345,8 @@ herr_t H5C_flush_to_min_clean(H5F_t * f) { H5C_t * cache_ptr; - hbool_t write_permitted; - herr_t ret_value = SUCCEED; + hbool_t write_permitted; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -1375,7 +1375,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_flush_to_min_clean() */ - + /*------------------------------------------------------------------------- * Function: H5C_insert_entry * @@ -1383,36 +1383,36 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * Observe that this function cannot occasion a read. + * Observe that this function cannot occasion a read. * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer - * 6/2/04 + * 6/2/04 * *------------------------------------------------------------------------- */ herr_t H5C_insert_entry(H5F_t * f, const H5C_class_t * type, - haddr_t addr, - void * thing, + haddr_t addr, + void * thing, unsigned int flags) { H5C_t *cache_ptr; H5AC_ring_t ring = H5C_RING_UNDEFINED; - hbool_t insert_pinned; + hbool_t insert_pinned; hbool_t flush_last; #ifdef H5_HAVE_PARALLEL hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ #endif /* H5_HAVE_PARALLEL */ hbool_t set_flush_marker; - hbool_t write_permitted = TRUE; - size_t empty_space; + hbool_t write_permitted = TRUE; + size_t empty_space; H5C_cache_entry_t *entry_ptr = NULL; H5C_cache_entry_t *test_entry_ptr; - hbool_t entry_tagged = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t entry_tagged = FALSE; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1527,20 +1527,20 @@ H5C_insert_entry(H5F_t * f, #endif /* H5_HAVE_PARALLEL */ /* initialize cache image related fields */ - entry_ptr->include_in_image = FALSE; - entry_ptr->lru_rank = 0; - entry_ptr->image_dirty = FALSE; - entry_ptr->fd_parent_count = 0; - entry_ptr->fd_parent_addrs = NULL; - entry_ptr->fd_child_count = 0; - entry_ptr->fd_dirty_child_count = 0; - entry_ptr->image_fd_height = 0; - entry_ptr->prefetched = FALSE; - entry_ptr->prefetch_type_id = 0; - entry_ptr->age = 0; + entry_ptr->include_in_image = FALSE; + entry_ptr->lru_rank = 0; + entry_ptr->image_dirty = FALSE; + entry_ptr->fd_parent_count = 0; + entry_ptr->fd_parent_addrs = NULL; + entry_ptr->fd_child_count = 0; + entry_ptr->fd_dirty_child_count = 0; + entry_ptr->image_fd_height = 0; + entry_ptr->prefetched = FALSE; + entry_ptr->prefetch_type_id = 0; + entry_ptr->age = 0; entry_ptr->prefetched_dirty = FALSE; #ifndef NDEBUG /* debugging field */ - entry_ptr->serialization_count = 0; + entry_ptr->serialization_count = 0; #endif /* NDEBUG */ entry_ptr->tl_next = NULL; @@ -1566,11 +1566,11 @@ H5C_insert_entry(H5F_t * f, if(cache_ptr->evictions_enabled && (((cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size) - || - (((empty_space + cache_ptr->clean_index_size) < cache_ptr->min_clean_size)))) { + || + (((empty_space + cache_ptr->clean_index_size) < cache_ptr->min_clean_size)))) { size_t space_needed; - if(empty_space <= entry_ptr->size) + if(empty_space <= entry_ptr->size) cache_ptr->cache_full = TRUE; if(cache_ptr->check_write_permitted != NULL) { @@ -1668,31 +1668,31 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_insert_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C_mark_entry_dirty * - * Purpose: Mark a pinned or protected entry as dirty. The target entry - * MUST be either pinned or protected, and MAY be both. + * Purpose: Mark a pinned or protected entry as dirty. The target entry + * MUST be either pinned or protected, and MAY be both. * - * In the protected case, this call is the functional - * equivalent of setting the H5C__DIRTIED_FLAG on an unprotect - * call. + * In the protected case, this call is the functional + * equivalent of setting the H5C__DIRTIED_FLAG on an unprotect + * call. * - * In the pinned but not protected case, if the entry is not - * already dirty, the function places function marks the entry - * dirty and places it on the skip list. + * In the pinned but not protected case, if the entry is not + * already dirty, the function places function marks the entry + * dirty and places it on the skip list. * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer * 5/15/06 * - * JRM -- 11/5/08 - * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY() to - * update the new clean_index_size and dirty_index_size - * fields of H5C_t in the case that the entry was clean - * prior to this call, and is pinned and not protected. + * JRM -- 11/5/08 + * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY() to + * update the new clean_index_size and dirty_index_size + * fields of H5C_t in the case that the entry was clean + * prior to this call, and is pinned and not protected. * *------------------------------------------------------------------------- */ @@ -1713,7 +1713,7 @@ H5C_mark_entry_dirty(void *thing) HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); if ( entry_ptr->is_protected ) { - HDassert( ! ((entry_ptr)->is_read_only) ); + HDassert( ! ((entry_ptr)->is_read_only) ); /* set the dirtied flag */ entry_ptr->dirtied = TRUE; @@ -1728,18 +1728,18 @@ H5C_mark_entry_dirty(void *thing) }/* end if */ } /* end if */ else if ( entry_ptr->is_pinned ) { - hbool_t was_clean; /* Whether the entry was previously clean */ - hbool_t image_was_up_to_date; + hbool_t was_clean; /* Whether the entry was previously clean */ + hbool_t image_was_up_to_date; /* Remember previous dirty status */ - was_clean = !entry_ptr->is_dirty; + was_clean = !entry_ptr->is_dirty; /* Check if image is up to date */ image_was_up_to_date = entry_ptr->image_up_to_date; /* Mark the entry as dirty if it isn't already */ entry_ptr->is_dirty = TRUE; - entry_ptr->image_up_to_date = FALSE; + entry_ptr->image_up_to_date = FALSE; /* Modify cache data structures */ if(was_clean) @@ -1776,15 +1776,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_mark_entry_dirty() */ - + /*------------------------------------------------------------------------- * Function: H5C_mark_entry_clean * - * Purpose: Mark a pinned entry as clean. The target entry MUST be pinned. + * Purpose: Mark a pinned entry as clean. The target entry MUST be pinned. * - * If the entry is not - * already clean, the function places function marks the entry - * clean and removes it from the skip list. + * If the entry is not + * already clean, the function places function marks the entry + * clean and removes it from the skip list. * * Return: Non-negative on success/Negative on failure * @@ -1813,7 +1813,7 @@ H5C_mark_entry_clean(void *_thing) if(entry_ptr->is_protected) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKCLEAN, FAIL, "entry is protected") else if(entry_ptr->is_pinned) { - hbool_t was_dirty; /* Whether the entry was previously dirty */ + hbool_t was_dirty; /* Whether the entry was previously dirty */ /* Remember previous dirty status */ was_dirty = entry_ptr->is_dirty; @@ -1855,12 +1855,12 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_mark_entry_clean() */ - + /*------------------------------------------------------------------------- * Function: H5C_mark_entry_unserialized * - * Purpose: Mark a pinned or protected entry as unserialized. The target - * entry MUST be either pinned or protected, and MAY be both. + * Purpose: Mark a pinned or protected entry as unserialized. The target + * entry MUST be either pinned or protected, and MAY be both. * * Return: Non-negative on success/Negative on failure * @@ -1886,7 +1886,7 @@ H5C_mark_entry_unserialized(void *thing) /* Reset image_up_to_date */ if(entry->image_up_to_date) { - entry->image_up_to_date = FALSE; + entry->image_up_to_date = FALSE; if(entry->flush_dep_nparents > 0) if(H5C__mark_flush_dep_unserialized(entry) < 0) @@ -1900,12 +1900,12 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_mark_entry_unserialized() */ - + /*------------------------------------------------------------------------- * Function: H5C_mark_entry_serialized * - * Purpose: Mark a pinned entry as serialized. The target entry MUST be - * pinned. + * Purpose: Mark a pinned entry as serialized. The target entry MUST be + * pinned. * * Return: Non-negative on success/Negative on failure * @@ -1932,7 +1932,7 @@ H5C_mark_entry_serialized(void *_thing) else if(entry->is_pinned) { /* Check for entry changing status and do notifications, etc. */ if(!entry->image_up_to_date) { - /* Set the image_up_to_date flag */ + /* Set the image_up_to_date flag */ entry->image_up_to_date = TRUE; /* Propagate the serialize up the flush dependency chain, if appropriate */ @@ -1948,7 +1948,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_mark_entry_serialized() */ - + /*------------------------------------------------------------------------- * * Function: H5C_move_entry @@ -1964,14 +1964,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_move_entry(H5C_t * cache_ptr, +H5C_move_entry(H5C_t * cache_ptr, const H5C_class_t * type, - haddr_t old_addr, - haddr_t new_addr) + haddr_t old_addr, + haddr_t new_addr) { - H5C_cache_entry_t * entry_ptr = NULL; - H5C_cache_entry_t * test_entry_ptr = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * test_entry_ptr = NULL; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2041,15 +2041,15 @@ H5C_move_entry(H5C_t * cache_ptr, entry_ptr->addr = new_addr; if(!entry_ptr->destroy_in_progress) { - hbool_t was_dirty; /* Whether the entry was previously dirty */ + hbool_t was_dirty; /* Whether the entry was previously dirty */ /* Remember previous dirty status */ was_dirty = entry_ptr->is_dirty; /* Mark the entry as dirty if it isn't already */ - entry_ptr->is_dirty = TRUE; + entry_ptr->is_dirty = TRUE; - /* This shouldn't be needed, but it keeps the test code happy */ + /* This shouldn't be needed, but it keeps the test code happy */ if(entry_ptr->image_up_to_date) { entry_ptr->image_up_to_date = FALSE; if(entry_ptr->flush_dep_nparents > 0) @@ -2062,7 +2062,7 @@ H5C_move_entry(H5C_t * cache_ptr, H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) /* Skip some actions if we're in the middle of flushing the entry */ - if(!entry_ptr->flush_in_progress) { + if(!entry_ptr->flush_in_progress) { /* Update the replacement policy for the entry */ H5C__UPDATE_RP_FOR_MOVE(cache_ptr, entry_ptr, was_dirty, FAIL) @@ -2096,15 +2096,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_move_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C_resize_entry * - * Purpose: Resize a pinned or protected entry. + * Purpose: Resize a pinned or protected entry. * - * Resizing an entry dirties it, so if the entry is not - * already dirty, the function places the entry on the - * skip list. + * Resizing an entry dirties it, so if the entry is not + * already dirty, the function places the entry on the + * skip list. * * Return: Non-negative on success/Negative on failure * @@ -2143,7 +2143,7 @@ H5C_resize_entry(void *thing, size_t new_size) /* update for change in entry size if necessary */ if ( entry_ptr->size != new_size ) { - hbool_t was_clean; + hbool_t was_clean; /* make note of whether the entry was clean to begin with */ was_clean = !entry_ptr->is_dirty; @@ -2167,7 +2167,7 @@ H5C_resize_entry(void *thing, size_t new_size) if ( cache_ptr->flash_size_increase_possible ) { if ( new_size > entry_ptr->size ) { - size_t size_increase; + size_t size_increase; size_increase = new_size - entry_ptr->size; @@ -2199,18 +2199,18 @@ H5C_resize_entry(void *thing, size_t new_size) #endif /* H5_HAVE_PARALLEL */ /* update statistics just before changing the entry size */ - H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size); + H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size); /* update the hash table */ - H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ + H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \ new_size, entry_ptr, was_clean); /* if the entry is in the skip list, update that too */ if(entry_ptr->in_slist) - H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_size); + H5C__UPDATE_SLIST_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, new_size); - /* finally, update the entry size proper */ - entry_ptr->size = new_size; + /* finally, update the entry size proper */ + entry_ptr->size = new_size; if(!entry_ptr->in_slist) H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) @@ -2244,19 +2244,19 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_resize_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C_pin_protected_entry() * - * Purpose: Pin a protected cache entry. The entry must be protected - * at the time of call, and must be unpinned. + * Purpose: Pin a protected cache entry. The entry must be protected + * at the time of call, and must be unpinned. * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer * 4/26/06 * - * Changes: Added extreme sanity checks on entry and exit. + * Changes: Added extreme sanity checks on entry and exit. * JRM -- 4/26/14 * *------------------------------------------------------------------------- @@ -2304,21 +2304,21 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_pin_protected_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C_protect * * Purpose: If the target entry is not in the cache, load it. If - * necessary, attempt to evict one or more entries to keep - * the cache within its maximum size. + * necessary, attempt to evict one or more entries to keep + * the cache within its maximum size. * - * Mark the target entry as protected, and return its address - * to the caller. The caller must call H5C_unprotect() when - * finished with the entry. + * Mark the target entry as protected, and return its address + * to the caller. The caller must call H5C_unprotect() when + * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to - * H5C_protect. Any attempt to do so will result in a failure. + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to + * H5C_protect. Any attempt to do so will result in a failure. * * Return: Success: Ptr to the desired entry * Failure: NULL @@ -2328,27 +2328,27 @@ done: *------------------------------------------------------------------------- */ void * -H5C_protect(H5F_t * f, +H5C_protect(H5F_t * f, const H5C_class_t * type, - haddr_t addr, + haddr_t addr, void * udata, - unsigned flags) + unsigned flags) { - H5C_t * cache_ptr; + H5C_t * cache_ptr; H5AC_ring_t ring = H5C_RING_UNDEFINED; - hbool_t hit; - hbool_t have_write_permitted = FALSE; - hbool_t read_only = FALSE; + hbool_t hit; + hbool_t have_write_permitted = FALSE; + hbool_t read_only = FALSE; hbool_t flush_last; #ifdef H5_HAVE_PARALLEL hbool_t coll_access = FALSE; /* whether access to the cache entry is done collectively */ #endif /* H5_HAVE_PARALLEL */ - hbool_t write_permitted; + hbool_t write_permitted; hbool_t was_loaded = FALSE; /* Whether the entry was loaded as a result of the protect */ - size_t empty_space; - void * thing; - H5C_cache_entry_t * entry_ptr; - void * ret_value = NULL; /* Return value */ + size_t empty_space; + void * thing; + H5C_cache_entry_t * entry_ptr; + void * ret_value = NULL; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -2534,16 +2534,16 @@ H5C_protect(H5F_t * f, */ if ( ( cache_ptr->evictions_enabled ) && ( ( (cache_ptr->index_size + entry_ptr->size) > - cache_ptr->max_cache_size) - || - ( ( empty_space + cache_ptr->clean_index_size ) < - cache_ptr->min_clean_size ) - ) + cache_ptr->max_cache_size) + || + ( ( empty_space + cache_ptr->clean_index_size ) < + cache_ptr->min_clean_size ) + ) ) { size_t space_needed; - if(empty_space <= entry_ptr->size) + if(empty_space <= entry_ptr->size) cache_ptr->cache_full = TRUE; if(cache_ptr->check_write_permitted != NULL) { @@ -2604,7 +2604,7 @@ H5C_protect(H5F_t * f, * ******************************************* * * Set the flush_last field - * of the newly loaded entry before inserting it into the + * of the newly loaded entry before inserting it into the * index. Must do this, as the index tracked the number of * entries with the flush_last field set, but assumes that * the field will not change after insertion into the index. @@ -2637,24 +2637,24 @@ H5C_protect(H5F_t * f, HDassert(entry_ptr->type == type); if(entry_ptr->is_protected) { - if(read_only && entry_ptr->is_read_only) { - HDassert(entry_ptr->ro_ref_count > 0); - (entry_ptr->ro_ref_count)++; - } /* end if */ + if(read_only && entry_ptr->is_read_only) { + HDassert(entry_ptr->ro_ref_count > 0); + (entry_ptr->ro_ref_count)++; + } /* end if */ else HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Target already protected & not read only?!?") } /* end if */ else { - H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL) + H5C__UPDATE_RP_FOR_PROTECT(cache_ptr, entry_ptr, NULL) - entry_ptr->is_protected = TRUE; + entry_ptr->is_protected = TRUE; - if ( read_only ) { - entry_ptr->is_read_only = TRUE; - entry_ptr->ro_ref_count = 1; - } /* end if */ + if ( read_only ) { + entry_ptr->is_read_only = TRUE; + entry_ptr->ro_ref_count = 1; + } /* end if */ - entry_ptr->dirtied = FALSE; + entry_ptr->dirtied = FALSE; } /* end else */ H5C__UPDATE_CACHE_HIT_RATE_STATS(cache_ptr, hit) @@ -2698,10 +2698,10 @@ H5C_protect(H5F_t * f, /* check to see if the cache is now oversized due to the cache * size reduction. If it is, try to evict enough entries to * bring the cache size down to the current maximum cache size. - * - * Also, if the min_clean_size requirement is not met, we - * should also call H5C__make_space_in_cache() to bring us - * into complience. + * + * Also, if the min_clean_size requirement is not met, we + * should also call H5C__make_space_in_cache() to bring us + * into complience. */ if(cache_ptr->index_size >= cache_ptr->max_cache_size) @@ -2710,11 +2710,11 @@ H5C_protect(H5F_t * f, empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; if ( ( cache_ptr->index_size > cache_ptr->max_cache_size ) - || - ( ( empty_space + cache_ptr->clean_index_size ) < - cache_ptr->min_clean_size) ) { + || + ( ( empty_space + cache_ptr->clean_index_size ) < + cache_ptr->min_clean_size) ) { - if(cache_ptr->index_size > cache_ptr->max_cache_size) + if(cache_ptr->index_size > cache_ptr->max_cache_size) cache_ptr->cache_full = TRUE; if(H5C__make_space_in_cache(f, (size_t)0, write_permitted) < 0 ) @@ -2756,7 +2756,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_protect() */ - + /*------------------------------------------------------------------------- * * Function: H5C_reset_cache_hit_rate_stats() @@ -2772,37 +2772,37 @@ done: herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") - cache_ptr->cache_hits = 0; - cache_ptr->cache_accesses = 0; + cache_ptr->cache_hits = 0; + cache_ptr->cache_accesses = 0; done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_reset_cache_hit_rate_stats() */ - + /*------------------------------------------------------------------------- * Function: H5C_set_cache_auto_resize_config * - * Purpose: Set the cache automatic resize configuration to the - * provided values if they are in range, and fail if they - * are not. + * Purpose: Set the cache automatic resize configuration to the + * provided values if they are in range, and fail if they + * are not. * - * If the new configuration enables automatic cache resizing, - * coerce the cache max size and min clean size into agreement - * with the new policy and re-set the full cache hit rate - * stats. + * If the new configuration enables automatic cache resizing, + * coerce the cache max size and min clean size into agreement + * with the new policy and re-set the full cache hit rate + * stats. * * Return: SUCCEED on success, and FAIL on failure. * * Programmer: John Mainzer - * 10/8/04 + * 10/8/04 * *------------------------------------------------------------------------- */ @@ -2812,7 +2812,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, { size_t new_max_cache_size; size_t new_min_clean_size; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -2896,7 +2896,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, if(config_ptr->max_size == config_ptr->min_size) { cache_ptr->size_increase_possible = FALSE; - cache_ptr->flash_size_increase_possible = FALSE; + cache_ptr->flash_size_increase_possible = FALSE; cache_ptr->size_decrease_possible = FALSE; } /* end if */ @@ -2931,7 +2931,7 @@ H5C_set_cache_auto_resize_config(H5C_t *cache_ptr, /* since new_min_clean_size is of type size_t, we have * - * ( 0 <= new_min_clean_size ) + * ( 0 <= new_min_clean_size ) * * by definition. */ @@ -2991,7 +2991,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_set_cache_auto_resize_config() */ - + /*------------------------------------------------------------------------- * Function: H5C_set_evictions_enabled() * @@ -3023,7 +3023,7 @@ H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled) */ if((evictions_enabled != TRUE) && ((cache_ptr->resize_ctl.incr_mode != H5C_incr__off) || - (cache_ptr->resize_ctl.decr_mode != H5C_decr__off))) + (cache_ptr->resize_ctl.decr_mode != H5C_decr__off))) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't disable evictions when auto resize enabled") cache_ptr->evictions_enabled = evictions_enabled; @@ -3032,27 +3032,27 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_set_evictions_enabled() */ - + /*------------------------------------------------------------------------- * * Function: H5C_set_slist_enabled() * * Purpose: Enable or disable the slist as directed. * - * The slist (skip list) is an address ordered list of - * dirty entries in the metadata cache. However, this + * The slist (skip list) is an address ordered list of + * dirty entries in the metadata cache. However, this * list is only needed during flush and close, where we - * use it to write entries in more or less increasing - * address order. + * use it to write entries in more or less increasing + * address order. * * This function sets up and enables further operations - * on the slist, or disable the slist. This in turn - * allows us to avoid the overhead of maintaining the + * on the slist, or disable the slist. This in turn + * allows us to avoid the overhead of maintaining the * slist when it is not needed. * * - * If the slist_enabled parameter is TRUE, the function - * + * If the slist_enabled parameter is TRUE, the function + * * 1) Verifies that the slist is empty. * * 2) Scans the index list, and inserts all dirty entries @@ -3060,7 +3060,7 @@ done: * * 3) Sets cache_ptr->slist_enabled = TRUE. * - * Note that the clear_slist parameter is ignored if + * Note that the clear_slist parameter is ignored if * the slist_enabed parameter is TRUE. * * @@ -3074,7 +3074,7 @@ done: * Thus shutdown proceeds as follows: * * 1) Test to see if the slist is empty. If it is, proceed - * to step 3. + * to step 3. * * 2) Test to see if the clear_slist parameter is TRUE. * @@ -3083,7 +3083,7 @@ done: * If it isn't, throw an error. * * 3) set cache_ptr->slist_enabled = FALSE. - * + * * Return: SUCCEED on success, and FAIL on failure. * * Programmer: John Mainzer @@ -3096,7 +3096,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, +H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, hbool_t clear_slist) { H5C_cache_entry_t * entry_ptr; @@ -3126,14 +3126,14 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, } - /* set cache_ptr->slist_enabled to TRUE so that the slist + /* set cache_ptr->slist_enabled to TRUE so that the slist * mainenance macros will be enabled. */ cache_ptr->slist_enabled = TRUE; /* scan the index list and insert all dirty entries in the slist */ - entry_ptr = cache_ptr->il_head; + entry_ptr = cache_ptr->il_head; while ( entry_ptr != NULL ) { @@ -3147,10 +3147,10 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, entry_ptr = entry_ptr->il_next; } - /* we don't maintain a dirty index len, so we can't do a cross + /* we don't maintain a dirty index len, so we can't do a cross * check against it. Note that there is no point in cross checking * against the dirty LRU size, as the dirty LRU may not be maintained, - * and in any case, there is no requirement that all dirty entries + * and in any case, there is no requirement that all dirty entries * will reside on the dirty LRU. */ HDassert( cache_ptr->dirty_index_size == cache_ptr->slist_size ); @@ -3181,7 +3181,7 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, node_ptr = H5SL_first(cache_ptr->slist_ptr); } } else { - + HDassert(FALSE); HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist not empty (2)?") } @@ -3198,27 +3198,27 @@ H5C_set_slist_enabled(H5C_t *cache_ptr, hbool_t slist_enabled, HDassert(cache_ptr->slist_enabled); #endif /* H5C__SLIST_OPT_ENABLED is FALSE */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_set_slist_enabled() */ - + /*------------------------------------------------------------------------- * Function: H5C_unpin_entry() * - * Purpose: Unpin a cache entry. The entry can be either protected or - * unprotected at the time of call, but must be pinned. + * Purpose: Unpin a cache entry. The entry can be either protected or + * unprotected at the time of call, but must be pinned. * * Return: Non-negative on success/Negative on failure * * Programmer: John Mainzer * 3/22/06 * - * Changes: Added extreme sanity checks on entry and exit. - * JRM -- 4/26/14 + * Changes: Added extreme sanity checks on entry and exit. + JRM -- 4/26/14 * *------------------------------------------------------------------------- */ @@ -3260,24 +3260,24 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_unpin_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C_unprotect * - * Purpose: Undo an H5C_protect() call -- specifically, mark the - * entry as unprotected, remove it from the protected list, - * and give it back to the replacement policy. + * Purpose: Undo an H5C_protect() call -- specifically, mark the + * entry as unprotected, remove it from the protected list, + * and give it back to the replacement policy. * - * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5C_protect() and the THING - * argument must be the value returned by that call to - * H5C_protect(). + * The TYPE and ADDR arguments must be the same as those in + * the corresponding call to H5C_protect() and the THING + * argument must be the value returned by that call to + * H5C_protect(). * * Return: Non-negative on success/Negative on failure * - * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to - * disk. + * If the deleted flag is TRUE, simply remove the target entry + * from the cache, clear it, and free it without writing it to + * disk. * * Return: Non-negative on success/Negative on failure * @@ -3356,28 +3356,28 @@ done: * * * JRM -- 5/8/20 - * Updated for the possibility that the slist will be + * Updated for the possibility that the slist will be * disabled. * *------------------------------------------------------------------------- */ herr_t -H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) +H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) { H5C_t * cache_ptr; - hbool_t deleted; - hbool_t dirtied; + hbool_t deleted; + hbool_t dirtied; hbool_t set_flush_marker; - hbool_t pin_entry; - hbool_t unpin_entry; - hbool_t free_file_space; - hbool_t take_ownership; - hbool_t was_clean; + hbool_t pin_entry; + hbool_t unpin_entry; + hbool_t free_file_space; + hbool_t take_ownership; + hbool_t was_clean; #ifdef H5_HAVE_PARALLEL - hbool_t clear_entry = FALSE; + hbool_t clear_entry = FALSE; #endif /* H5_HAVE_PARALLEL */ - H5C_cache_entry_t * entry_ptr; - H5C_cache_entry_t * test_entry_ptr; + H5C_cache_entry_t * entry_ptr; + H5C_cache_entry_t * test_entry_ptr; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -3539,19 +3539,19 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Update index for newly dirtied entry */ H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(cache_ptr, entry_ptr) - /* If the entry's type has a 'notify' callback send a - * 'entry dirtied' notice now that the entry is fully + /* If the entry's type has a 'notify' callback send a + * 'entry dirtied' notice now that the entry is fully * integrated into the cache. */ if ( ( entry_ptr->type->notify ) && - ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_DIRTIED, + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_DIRTIED, entry_ptr) < 0 ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ "can't notify client about entry dirty flag set") /* Propagate the flush dep dirty flag up the flush dependency chain - * if appropriate + * if appropriate */ if ( entry_ptr->flush_dep_nparents > 0 ) { @@ -3564,19 +3564,19 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* Check for newly clean entry */ else if ( ! was_clean && ! entry_ptr->is_dirty ) { - /* If the entry's type has a 'notify' callback send a - * 'entry cleaned' notice now that the entry is fully + /* If the entry's type has a 'notify' callback send a + * 'entry cleaned' notice now that the entry is fully * integrated into the cache. */ if ( ( entry_ptr->type->notify ) && - ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0 ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ "can't notify client about entry dirty flag cleared") /* Propagate the flush dep clean flag up the flush dependency chain - * if appropriate + * if appropriate */ if ( entry_ptr->flush_dep_nparents > 0 ) { @@ -3584,8 +3584,8 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \ "Can't propagate flush dep dirty flag") - - } + + } } /* end else-if */ /* Pin or unpin the entry as requested. */ @@ -3622,7 +3622,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) if ( !entry_ptr->in_slist ) { - /* this is a no-op if cache_ptr->slist_enabled is FALSE */ + /* this is a no-op if cache_ptr->slist_enabled is FALSE */ H5C__INSERT_ENTRY_IN_SLIST(cache_ptr, entry_ptr, FAIL) } } /* end if */ @@ -3685,7 +3685,7 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) /* verify that the target entry is in the cache. */ H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL) - if ( test_entry_ptr == NULL ) + if ( test_entry_ptr == NULL ) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ "entry not in hash table?!?") @@ -3695,8 +3695,8 @@ H5C_unprotect(H5F_t *f, haddr_t addr, void *thing, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ "hash table contains multiple entries for addr?!?") - if ( H5C__flush_single_entry(f, entry_ptr, - H5C__FLUSH_CLEAR_ONLY_FLAG | + if ( H5C__flush_single_entry(f, entry_ptr, + H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \ "Can't clear entry") @@ -3722,7 +3722,7 @@ done: } /* H5C_unprotect() */ - + /*------------------------------------------------------------------------- * * Function: H5C_unsettle_entry_ring @@ -3766,36 +3766,36 @@ H5C_unsettle_entry_ring(void *_entry) HDassert(cache->magic == H5C__H5C_T_MAGIC); switch(entry->ring) { - case H5C_RING_USER: + case H5C_RING_USER: /* Do nothing */ - break; - - case H5C_RING_RDFSM: - if(cache->rdfsm_settled) { - if(cache->flush_in_progress || cache->close_warning_received) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected rdfsm ring unsettle") - cache->rdfsm_settled = FALSE; - } /* end if */ - break; - - case H5C_RING_MDFSM: - if(cache->mdfsm_settled) { - if(cache->flush_in_progress || cache->close_warning_received) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected mdfsm ring unsettle") - cache->mdfsm_settled = FALSE; - } /* end if */ - break; - - default: - HDassert(FALSE); /* this should be un-reachable */ - break; + break; + + case H5C_RING_RDFSM: + if(cache->rdfsm_settled) { + if(cache->flush_in_progress || cache->close_warning_received) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected rdfsm ring unsettle") + cache->rdfsm_settled = FALSE; + } /* end if */ + break; + + case H5C_RING_MDFSM: + if(cache->mdfsm_settled) { + if(cache->flush_in_progress || cache->close_warning_received) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unexpected mdfsm ring unsettle") + cache->mdfsm_settled = FALSE; + } /* end if */ + break; + + default: + HDassert(FALSE); /* this should be un-reachable */ + break; } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_unsettle_entry_ring() */ - + /*------------------------------------------------------------------------- * Function: H5C_unsettle_ring() * @@ -3853,24 +3853,24 @@ H5C_unsettle_ring(H5F_t * f, H5C_ring_t ring) } /* end if */ break; - default: - HDassert(FALSE); /* this should be un-reachable */ - break; + default: + HDassert(FALSE); /* this should be un-reachable */ + break; } /* end switch */ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_unsettle_ring() */ - + /*------------------------------------------------------------------------- * Function: H5C_validate_resize_config() * - * Purpose: Run a sanity check on the specified sections of the - * provided instance of struct H5C_auto_size_ctl_t. + * Purpose: Run a sanity check on the specified sections of the + * provided instance of struct H5C_auto_size_ctl_t. * - * Do nothing and return SUCCEED if no errors are detected, - * and flag an error and return FAIL otherwise. + * Do nothing and return SUCCEED if no errors are detected, + * and flag an error and return FAIL otherwise. * * Return: Non-negative on success/Negative on failure * @@ -4022,15 +4022,15 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_validate_resize_config() */ - + /*------------------------------------------------------------------------- * Function: H5C_create_flush_dependency() * - * Purpose: Initiates a parent<->child entry flush dependency. The parent + * Purpose: Initiates a parent<->child entry flush dependency. The parent * entry must be pinned or protected at the time of call, and must * have all dependencies removed before the cache can shut down. * - * Note: Flush dependencies in the cache indicate that a child entry + * Note: Flush dependencies in the cache indicate that a child entry * must be flushed to the file before its parent. (This is * currently used to implement Single-Writer/Multiple-Reader (SWMR) * I/O access for data structures in the file). @@ -4049,7 +4049,7 @@ herr_t H5C_create_flush_dependency(void * parent_thing, void * child_thing) { H5C_t * cache_ptr; - H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent thing's entry */ + H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent thing's entry */ H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child thing's entry */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4166,11 +4166,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_create_flush_dependency() */ - + /*------------------------------------------------------------------------- * Function: H5C_destroy_flush_dependency() * - * Purpose: Terminates a parent<-> child entry flush dependency. The + * Purpose: Terminates a parent<-> child entry flush dependency. The * parent entry must be pinned. * * Return: Non-negative on success/Negative on failure @@ -4184,8 +4184,8 @@ herr_t H5C_destroy_flush_dependency(void *parent_thing, void * child_thing) { H5C_t * cache_ptr; - H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent entry */ - H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child entry */ + H5C_cache_entry_t * parent_entry = (H5C_cache_entry_t *)parent_thing; /* Ptr to parent entry */ + H5C_cache_entry_t * child_entry = (H5C_cache_entry_t *)child_thing; /* Ptr to child entry */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -4283,16 +4283,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_destroy_flush_dependency() */ - + /*************************************************************************/ /**************************** Private Functions: *************************/ /*************************************************************************/ - + /*------------------------------------------------------------------------- * Function: H5C__pin_entry_from_client() * - * Purpose: Internal routine to pin a cache entry from a client action. + * Purpose: Internal routine to pin a cache entry from a client action. * * Return: Non-negative on success/Negative on failure * @@ -4337,11 +4337,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__pin_entry_from_client() */ - + /*------------------------------------------------------------------------- * Function: H5C__unpin_entry_real() * - * Purpose: Internal routine to unpin a cache entry. + * Purpose: Internal routine to unpin a cache entry. * * Return: Non-negative on success/Negative on failure * @@ -4377,11 +4377,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__unpin_entry_real() */ - + /*------------------------------------------------------------------------- * Function: H5C__unpin_entry_from_client() * - * Purpose: Internal routine to unpin a cache entry from a client action. + * Purpose: Internal routine to unpin a cache entry from a client action. * * Return: Non-negative on success/Negative on failure * @@ -4422,18 +4422,18 @@ done: /*------------------------------------------------------------------------- * - * Function: H5C__auto_adjust_cache_size + * Function: H5C__auto_adjust_cache_size * - * Purpose: Obtain the current full cache hit rate, and compare it - * with the hit rate thresholds for modifying cache size. - * If one of the thresholds has been crossed, adjusts the - * size of the cache accordingly. + * Purpose: Obtain the current full cache hit rate, and compare it + * with the hit rate thresholds for modifying cache size. + * If one of the thresholds has been crossed, adjusts the + * size of the cache accordingly. * - * The function then resets the full cache hit rate - * statistics, and exits. + * The function then resets the full cache hit rate + * statistics, and exits. * * Return: Non-negative on success/Negative on failure or if there was - * an attempt to flush a protected item. + * an attempt to flush a protected item. * * * Programmer: John Mainzer, 10/7/04 @@ -4443,16 +4443,16 @@ done: static herr_t H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) { - H5C_t * cache_ptr = f->shared->cache; - hbool_t reentrant_call = FALSE; - hbool_t inserted_epoch_marker = FALSE; - size_t new_max_cache_size = 0; - size_t old_max_cache_size = 0; - size_t new_min_clean_size = 0; - size_t old_min_clean_size = 0; - double hit_rate; - enum H5C_resize_status status = in_spec; /* will change if needed */ - herr_t ret_value = SUCCEED; /* Return value */ + H5C_t * cache_ptr = f->shared->cache; + hbool_t reentrant_call = FALSE; + hbool_t inserted_epoch_marker = FALSE; + size_t new_max_cache_size = 0; + size_t old_max_cache_size = 0; + size_t new_min_clean_size = 0; + size_t old_min_clean_size = 0; + double hit_rate; + enum H5C_resize_status status = in_spec; /* will change if needed */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -4673,9 +4673,9 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) /* new_min_clean_size is of size_t, and thus must be non-negative. * Hence we have * - * ( 0 <= new_min_clean_size ). + * ( 0 <= new_min_clean_size ). * - * by definition. + * by definition. */ HDassert( new_min_clean_size <= new_max_cache_size ); HDassert( (cache_ptr->resize_ctl).min_size <= new_max_cache_size ); @@ -4693,8 +4693,8 @@ H5C__auto_adjust_cache_size(H5F_t *f, hbool_t write_permitted) cache_ptr->size_decreased = TRUE; } - /* update flash cache size increase fields as appropriate */ - if ( cache_ptr->flash_size_increase_possible ) { + /* update flash cache size increase fields as appropriate */ + if ( cache_ptr->flash_size_increase_possible ) { switch ( (cache_ptr->resize_ctl).flash_incr_mode ) { @@ -4742,17 +4742,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__auto_adjust_cache_size() */ - + /*------------------------------------------------------------------------- * * Function: H5C__autoadjust__ageout * * Purpose: Implement the ageout automatic cache size decrement - * algorithm. Note that while this code evicts aged out - * entries, the code does not change the maximum cache size. - * Instead, the function simply computes the new value (if - * any change is indicated) and reports this value in - * *new_max_cache_size_ptr. + * algorithm. Note that while this code evicts aged out + * entries, the code does not change the maximum cache size. + * Instead, the function simply computes the new value (if + * any change is indicated) and reports this value in + * *new_max_cache_size_ptr. * * Return: Non-negative on success/Negative on failure or if there was * an attempt to flush a protected item. @@ -4767,8 +4767,8 @@ H5C__autoadjust__ageout(H5F_t * f, double hit_rate, enum H5C_resize_status * sta size_t * new_max_cache_size_ptr, hbool_t write_permitted) { H5C_t * cache_ptr = f->shared->cache; - size_t test_size; - herr_t ret_value = SUCCEED; /* Return value */ + size_t test_size; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -4851,16 +4851,16 @@ done: } /* H5C__autoadjust__ageout() */ - + /*------------------------------------------------------------------------- * * Function: H5C__autoadjust__ageout__cycle_epoch_marker * * Purpose: Remove the oldest epoch marker from the LRU list, - * and reinsert it at the head of the LRU list. Also - * remove the epoch marker's index from the head of the - * ring buffer, and re-insert it at the tail of the ring - * buffer. + * and reinsert it at the head of the LRU list. Also + * remove the epoch marker's index from the head of the + * ring buffer, and re-insert it at the tail of the ring + * buffer. * * Return: SUCCEED on success/FAIL on failure. * @@ -4935,37 +4935,37 @@ done: } /* H5C__autoadjust__ageout__cycle_epoch_marker() */ - + /*------------------------------------------------------------------------- * * Function: H5C__autoadjust__ageout__evict_aged_out_entries * * Purpose: Evict clean entries in the cache that haven't - * been accessed for at least - * (cache_ptr->resize_ctl).epochs_before_eviction epochs, - * and flush dirty entries that haven't been accessed for - * that amount of time. + * been accessed for at least + * (cache_ptr->resize_ctl).epochs_before_eviction epochs, + * and flush dirty entries that haven't been accessed for + * that amount of time. * - * Depending on configuration, the function will either - * flush or evict all such entries, or all such entries it - * encounters until it has freed the maximum amount of space - * allowed under the maximum decrement. + * Depending on configuration, the function will either + * flush or evict all such entries, or all such entries it + * encounters until it has freed the maximum amount of space + * allowed under the maximum decrement. * - * If we are running in parallel mode, writes may not be - * permitted. If so, the function simply skips any dirty - * entries it may encounter. + * If we are running in parallel mode, writes may not be + * permitted. If so, the function simply skips any dirty + * entries it may encounter. * - * The function makes no attempt to maintain the minimum - * clean size, as there is no guarantee that the cache size - * will be changed. + * The function makes no attempt to maintain the minimum + * clean size, as there is no guarantee that the cache size + * will be changed. * - * If there is no cache size change, the minimum clean size - * constraint will be met through a combination of clean - * entries and free space in the cache. + * If there is no cache size change, the minimum clean size + * constraint will be met through a combination of clean + * entries and free space in the cache. * - * If there is a cache size reduction, the minimum clean size - * will be re-calculated, and will be enforced the next time - * we have to make space in the cache. + * If there is a cache size reduction, the minimum clean size + * will be re-calculated, and will be enforced the next time + * we have to make space in the cache. * * Observe that this function cannot occasion a read. * @@ -4978,10 +4978,10 @@ done: static herr_t H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitted) { - H5C_t * cache_ptr = f->shared->cache; - size_t eviction_size_limit; - size_t bytes_evicted = 0; - hbool_t prev_is_dirty = FALSE; + H5C_t * cache_ptr = f->shared->cache; + size_t eviction_size_limit; + size_t bytes_evicted = 0; + hbool_t prev_is_dirty = FALSE; hbool_t restart_scan; H5C_cache_entry_t * entry_ptr; H5C_cache_entry_t * next_ptr; @@ -5025,10 +5025,10 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte HDassert( ! (entry_ptr->is_read_only) ); HDassert( (entry_ptr->ro_ref_count) == 0 ); - next_ptr = entry_ptr->next; + next_ptr = entry_ptr->next; prev_ptr = entry_ptr->prev; - if(prev_ptr != NULL) + if(prev_ptr != NULL) prev_is_dirty = prev_ptr->is_dirty; if(entry_ptr->is_dirty ) { @@ -5073,23 +5073,23 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte if(prev_ptr != NULL) { if(skipping_entry) entry_ptr = prev_ptr; - else if(restart_scan || (prev_ptr->is_dirty != prev_is_dirty) + else if(restart_scan || (prev_ptr->is_dirty != prev_is_dirty) || (prev_ptr->next != next_ptr) || (prev_ptr->is_protected) || (prev_ptr->is_pinned)) { /* Something has happened to the LRU -- start over - * from the tail. + * from the tail. */ restart_scan = FALSE; entry_ptr = cache_ptr->LRU_tail_ptr; - H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) + H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) } /* end else-if */ else entry_ptr = prev_ptr; - } /* end if */ + } /* end if */ else - entry_ptr = NULL; + entry_ptr = NULL; } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, @@ -5137,10 +5137,10 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t *f, hbool_t write_permitte /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. - * - * Since all entries are clean, serialize() will not be called, - * and thus we needn't test to see if the LRU has been changed - * out from under us. + * + * Since all entries are clean, serialize() will not be called, + * and thus we needn't test to see if the LRU has been changed + * out from under us. */ entry_ptr = prev_ptr; } /* end while */ @@ -5153,14 +5153,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__autoadjust__ageout__evict_aged_out_entries() */ - + /*------------------------------------------------------------------------- * * Function: H5C__autoadjust__ageout__insert_new_marker * * Purpose: Find an unused marker cache entry, mark it as used, and - * insert it at the head of the LRU list. Also add the - * marker's index in the epoch_markers array. + * insert it at the head of the LRU list. Also add the + * marker's index in the epoch_markers array. * * Return: SUCCEED on success/FAIL on failure. * @@ -5224,13 +5224,13 @@ done: } /* H5C__autoadjust__ageout__insert_new_marker() */ - + /*------------------------------------------------------------------------- * * Function: H5C__autoadjust__ageout__remove_all_markers * * Purpose: Remove all epoch markers from the LRU list and mark them - * as inactive. + * as inactive. * * Return: SUCCEED on success/FAIL on failure. * @@ -5299,15 +5299,15 @@ done: } /* H5C__autoadjust__ageout__remove_all_markers() */ - + /*------------------------------------------------------------------------- * * Function: H5C__autoadjust__ageout__remove_excess_markers * * Purpose: Remove epoch markers from the end of the LRU list and - * mark them as inactive until the number of active markers - * equals the the current value of - * (cache_ptr->resize_ctl).epochs_before_eviction. + * mark them as inactive until the number of active markers + * equals the the current value of + * (cache_ptr->resize_ctl).epochs_before_eviction. * * Return: SUCCEED on success/FAIL on failure. * @@ -5318,9 +5318,9 @@ done: static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ - int i; - int ring_buf_index; + herr_t ret_value = SUCCEED; /* Return value */ + int i; + int ring_buf_index; FUNC_ENTER_NOAPI_NOINIT @@ -5377,7 +5377,7 @@ done: } /* H5C__autoadjust__ageout__remove_excess_markers() */ - + /*------------------------------------------------------------------------- * * Function: H5C__flash_increase_cache_size @@ -5439,7 +5439,7 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, HDassert( (cache_ptr->max_cache_size - cache_ptr->index_size) < space_needed ); space_needed -= cache_ptr->max_cache_size - - cache_ptr->index_size; + cache_ptr->index_size; } space_needed = (size_t)(((double)space_needed) * @@ -5495,9 +5495,9 @@ H5C__flash_increase_cache_size(H5C_t * cache_ptr, } /* note that we don't cycle the epoch markers. We can - * argue either way as to whether we should, but for now - * we don't. - */ + * argue either way as to whether we should, but for now + * we don't. + */ if ( (cache_ptr->resize_ctl).rpt_fcn != NULL ) { @@ -5529,37 +5529,36 @@ done: } /* H5C__flash_increase_cache_size() */ - + /*------------------------------------------------------------------------- - * * Function: H5C__flush_invalidate_cache * - * Purpose: Flush and destroy the entries contained in the target - * cache. + * Purpose: Flush and destroy the entries contained in the target + * cache. * - * If the cache contains protected entries, the function will - * fail, as protected entries cannot be either flushed or - * destroyed. However all unprotected entries should be - * flushed and destroyed before the function returns failure. + * If the cache contains protected entries, the function will + * fail, as protected entries cannot be either flushed or + * destroyed. However all unprotected entries should be + * flushed and destroyed before the function returns failure. * - * While pinned entries can usually be flushed, they cannot - * be destroyed. However, they should be unpinned when all - * the entries that reference them have been destroyed (thus - * reduding the pinned entry's reference count to 0, allowing - * it to be unpinned). + * While pinned entries can usually be flushed, they cannot + * be destroyed. However, they should be unpinned when all + * the entries that reference them have been destroyed (thus + * reduding the pinned entry's reference count to 0, allowing + * it to be unpinned). * - * If pinned entries are present, the function makes repeated - * passes through the cache, flushing all dirty entries - * (including the pinned dirty entries where permitted) and - * destroying all unpinned entries. This process is repeated - * until either the cache is empty, or the number of pinned - * entries stops decreasing on each pass. + * If pinned entries are present, the function makes repeated + * passes through the cache, flushing all dirty entries + * (including the pinned dirty entries where permitted) and + * destroying all unpinned entries. This process is repeated + * until either the cache is empty, or the number of pinned + * entries stops decreasing on each pass. * * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. + * a request to flush all items and something was protected. * * Programmer: John Mainzer - * 3/24/065 + * 3/24/065 * * Modifications: * @@ -5580,7 +5579,7 @@ done: * Note that this is a pretty bad scenario if it ever * happens. The code I have added should allow us to * handle the situation under all but the worst conditions, - * but one can argue that we should just scream and die if + * but one can argue that we should just scream and die if * we ever detect the condition. * * -- JRM 10/13/07 @@ -5589,15 +5588,15 @@ done: * * * Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. - * This flag is used to flush and evict all entries in + * This flag is used to flush and evict all entries in * the metadata cache that are not pinned -- typically, * everything other than the superblock. * * ??? -- ??/??/?? * - * Added sanity checks to verify that the skip list is - * enabled on entry. On the face of it, it would make - * sense to enable the slist on entry, and disable it + * Added sanity checks to verify that the skip list is + * enabled on entry. On the face of it, it would make + * sense to enable the slist on entry, and disable it * on exit, as this function is not called repeatedly. * However, since this function can be called from * H5C_flush_cache(), this would create cases in the test @@ -5611,9 +5610,9 @@ done: static herr_t H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) { - H5C_t * cache_ptr; - H5C_ring_t ring; - herr_t ret_value = SUCCEED; + H5C_t * cache_ptr; + H5C_ring_t ring; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -5627,13 +5626,13 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) #if H5C_DO_SANITY_CHECKS { - int32_t i; - uint32_t index_len = 0; - uint32_t slist_len = 0; - size_t index_size = (size_t)0; - size_t clean_index_size = (size_t)0; - size_t dirty_index_size = (size_t)0; - size_t slist_size = (size_t)0; + int32_t i; + uint32_t index_len = 0; + uint32_t slist_len = 0; + size_t index_size = (size_t)0; + size_t clean_index_size = (size_t)0; + size_t dirty_index_size = (size_t)0; + size_t slist_size = (size_t)0; HDassert(cache_ptr->index_ring_len[H5C_RING_UNDEFINED] == 0); HDassert(cache_ptr->index_ring_size[H5C_RING_UNDEFINED] == (size_t)0); @@ -5681,7 +5680,7 @@ H5C__flush_invalidate_cache(H5F_t *f, unsigned flags) if(H5C_flush_invalidate_ring(f, ring, flags) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "flush invalidate ring failed") ring++; @@ -5740,7 +5739,7 @@ done: } /* H5C__flush_invalidate_cache() */ - + /*------------------------------------------------------------------------- * Function: H5C_flush_invalidate_ring * @@ -5776,7 +5775,7 @@ done: * 9/1/15 * * Changes: Added support for the H5C__EVICT_ALLOW_LAST_PINS_FLAG. - * This flag is used to flush and evict all entries in + * This flag is used to flush and evict all entries in * the metadata cache that are not pinned -- typically, * everything other than the superblock. * @@ -5784,7 +5783,7 @@ done: * * A recent optimization turns off the slist unless a flush * is in progress. This should not effect this function, as - * it is only called during a flush. Added an assertion to + * it is only called during a flush. Added an assertion to * verify this. * * JRM -- 5/6/20 @@ -6008,7 +6007,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) */ if ( ( ( !entry_ptr->flush_me_last ) || ( ( entry_ptr->flush_me_last ) && - ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) + ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) ) && ( entry_ptr->flush_dep_nchildren == 0 ) && ( entry_ptr->ring == ring ) ) { @@ -6023,7 +6022,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) } /* end if */ else if ( entry_ptr->is_pinned ) { - if ( H5C__flush_single_entry(f, entry_ptr, + if ( H5C__flush_single_entry(f, entry_ptr, H5C__DURING_FLUSH_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -6046,13 +6045,13 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) } /* end else-if */ else { - if ( H5C__flush_single_entry(f, entry_ptr, - (cooked_flags | - H5C__DURING_FLUSH_FLAG | + if ( H5C__flush_single_entry(f, entry_ptr, + (cooked_flags | + H5C__DURING_FLUSH_FLAG | H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) ) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "dirty entry flush destroy failed") if ( cache_ptr->slist_changed ) { @@ -6084,12 +6083,12 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) if ( node_ptr == NULL ) { - HDassert(cache_ptr->slist_len == - (uint32_t)((int32_t)initial_slist_len + + HDassert(cache_ptr->slist_len == + (uint32_t)((int32_t)initial_slist_len + cache_ptr->slist_len_increase)); - HDassert(cache_ptr->slist_size == - (size_t)((ssize_t)initial_slist_size + + HDassert(cache_ptr->slist_size == + (size_t)((ssize_t)initial_slist_size + cache_ptr->slist_size_increase)); } /* end if */ #endif /* H5C_DO_SANITY_CHECKS */ @@ -6125,11 +6124,11 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert((next_entry_ptr == NULL) || (next_entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC)); - if ( ( ( ! entry_ptr->flush_me_last ) || - ( entry_ptr->flush_me_last && - ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) - ) && - ( entry_ptr->flush_dep_nchildren == 0 ) && + if ( ( ( ! entry_ptr->flush_me_last ) || + ( entry_ptr->flush_me_last && + ( cache_ptr->num_last_entries >= cache_ptr->slist_len ) ) + ) && + ( entry_ptr->flush_dep_nchildren == 0 ) && ( entry_ptr->ring == ring ) ) { if ( entry_ptr->is_protected ) { @@ -6175,10 +6174,10 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) */ cache_ptr->entry_watched_for_removal = next_entry_ptr; - if ( H5C__flush_single_entry(f, entry_ptr, - (cooked_flags | - H5C__DURING_FLUSH_FLAG | - H5C__FLUSH_INVALIDATE_FLAG | + if ( H5C__flush_single_entry(f, entry_ptr, + (cooked_flags | + H5C__DURING_FLUSH_FLAG | + H5C__FLUSH_INVALIDATE_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG)) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -6192,8 +6191,8 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) * if this results in the size of the pinned entry * failing to decline during the pass. */ - if ( ( ( NULL != next_entry_ptr ) && - ( NULL == cache_ptr->entry_watched_for_removal ) + if ( ( ( NULL != next_entry_ptr ) && + ( NULL == cache_ptr->entry_watched_for_removal ) ) || ( cache_ptr->entries_loaded_counter > 0 ) || ( cache_ptr->entries_inserted_counter > 0 ) || @@ -6245,7 +6244,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) /* Check if the number of pinned entries in the ring is positive, and * it is not declining. Scream and die if so. */ - if ( ( cur_ring_pel_len > 0 ) && + if ( ( cur_ring_pel_len > 0 ) && ( cur_ring_pel_len >= old_ring_pel_len ) ) { /* Don't error if allowed to have pinned entries remaining */ @@ -6262,7 +6261,7 @@ H5C_flush_invalidate_ring(H5F_t * f, H5C_ring_t ring, unsigned flags) HDassert(protected_entries == cache_ptr->pl_len); - if ( ( protected_entries > 0 ) && + if ( ( protected_entries > 0 ) && ( protected_entries == cache_ptr->index_len ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -6303,7 +6302,7 @@ done: } /* H5C_flush_invalidate_ring() */ - + /*------------------------------------------------------------------------- * * Function: H5C__flush_ring @@ -6329,7 +6328,7 @@ done: * * Changes: A recent optimization turns off the slist unless a flush * is in progress. This should not effect this function, as - * it is only called during a flush. Added an assertion to + * it is only called during a flush. Added an assertion to * verify this. * * JRM -- 5/6/20 @@ -6341,21 +6340,21 @@ static herr_t H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) { H5C_t * cache_ptr = f->shared->cache; - hbool_t flushed_entries_last_pass; - hbool_t flush_marked_entries; - hbool_t ignore_protected; - hbool_t tried_to_flush_protected_entry = FALSE; - hbool_t restart_slist_scan; - uint32_t protected_entries = 0; - H5SL_node_t * node_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; - H5C_cache_entry_t * next_entry_ptr = NULL; + hbool_t flushed_entries_last_pass; + hbool_t flush_marked_entries; + hbool_t ignore_protected; + hbool_t tried_to_flush_protected_entry = FALSE; + hbool_t restart_slist_scan; + uint32_t protected_entries = 0; + H5SL_node_t * node_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * next_entry_ptr = NULL; #if H5C_DO_SANITY_CHECKS - uint32_t initial_slist_len = 0; + uint32_t initial_slist_len = 0; size_t initial_slist_size = 0; #endif /* H5C_DO_SANITY_CHECKS */ int i; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -6372,7 +6371,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) ( H5C_validate_pinned_entry_list(cache_ptr ) < 0 ) || ( H5C_validate_lru_list(cache_ptr) < 0 ) ) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ @@ -6541,15 +6540,15 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) next_entry_ptr = NULL; } - if ( ( ! flush_marked_entries || entry_ptr->flush_marker ) && + if ( ( ! flush_marked_entries || entry_ptr->flush_marker ) && ( ( ! entry_ptr->flush_me_last ) || - ( ( entry_ptr->flush_me_last ) && + ( ( entry_ptr->flush_me_last ) && ( ( cache_ptr->num_last_entries >= cache_ptr->slist_len )|| ( flush_marked_entries && entry_ptr->flush_marker ) ) ) - ) && - ( ( entry_ptr->flush_dep_nchildren == 0 ) || - ( entry_ptr->flush_dep_ndirty_children == 0 ) ) && + ) && + ( ( entry_ptr->flush_dep_nchildren == 0 ) || + ( entry_ptr->flush_dep_ndirty_children == 0 ) ) && ( entry_ptr->ring == ring ) ) { HDassert(entry_ptr->flush_dep_nunser_children == 0); @@ -6566,7 +6565,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) } /* end if */ else { - if ( H5C__flush_single_entry(f, entry_ptr, + if ( H5C__flush_single_entry(f, entry_ptr, (flags | H5C__DURING_FLUSH_FLAG)) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -6605,7 +6604,7 @@ H5C__flush_ring(H5F_t *f, H5C_ring_t ring, unsigned flags) HDassert(protected_entries <= cache_ptr->pl_len); - if ( ( ( cache_ptr->pl_len > 0 ) && ( ! ignore_protected ) ) || + if ( ( ( cache_ptr->pl_len > 0 ) && ( ! ignore_protected ) ) || ( tried_to_flush_protected_entry ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -6626,7 +6625,7 @@ done: } /* H5C__flush_ring() */ - + /*------------------------------------------------------------------------- * * Function: H5C__flush_single_entry @@ -6709,10 +6708,10 @@ done: * * * JRM -- 5/8/20 - * Updated sanity checks for the possibility that the slist + * Updated sanity checks for the possibility that the slist * is disabled. * - * Also updated main comment to conform more closely with + * Also updated main comment to conform more closely with * the current state of the code. * *------------------------------------------------------------------------- @@ -6753,7 +6752,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) clear_only = ((flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); free_file_space = ((flags & H5C__FREE_FILE_SPACE_FLAG) != 0); take_ownership = ((flags & H5C__TAKE_OWNERSHIP_FLAG) != 0); - del_from_slist_on_destroy = + del_from_slist_on_destroy = ((flags & H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) != 0); during_flush = ((flags & H5C__DURING_FLUSH_FLAG) != 0); generate_image = ((flags & H5C__GENERATE_IMAGE_FLAG) != 0); @@ -6790,9 +6789,9 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * Set suppress_image_entry_writes to TRUE if indicated by the * image_ctl flags. */ - if ( ( cache_ptr->close_warning_received ) && - ( cache_ptr->image_ctl.generate_image ) && - ( cache_ptr->num_entries_in_image > 0 ) && + if ( ( cache_ptr->close_warning_received ) && + ( cache_ptr->image_ctl.generate_image ) && + ( cache_ptr->num_entries_in_image > 0 ) && ( cache_ptr->image_entries != NULL ) ) { /* Sanity checks */ @@ -6811,8 +6810,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* end if */ } /* end if */ - /* run initial sanity checks */ -#if H5C_DO_SANITY_CHECKS + /* run initial sanity checks */ +#if H5C_DO_SANITY_CHECKS if ( cache_ptr->slist_enabled ) { if ( entry_ptr->in_slist ) { @@ -6882,14 +6881,14 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) if ( NULL == entry_ptr->image_ptr ) { - if ( NULL == (entry_ptr->image_ptr = + if ( NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, \ "memory allocation failed for on disk image buffer") #if H5C_DO_MEMORY_SANITY_CHECKS - H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, + H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ @@ -6920,7 +6919,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(entry_ptr->is_dirty); #if H5C_DO_SANITY_CHECKS - if ( ( cache_ptr->check_write_permitted ) && + if ( ( cache_ptr->check_write_permitted ) && ( ! ( cache_ptr->write_permitted ) ) ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -6934,8 +6933,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * H5AC__CLASS_SKIP_WRITES is set in the entry's type. This * flag should only be used in test code */ - if ( ( ( ! suppress_image_entry_writes ) || - ( ! entry_ptr->include_in_image ) ) && + if ( ( ( ! suppress_image_entry_writes ) || + ( ! entry_ptr->include_in_image ) ) && ( ( (entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0 ) ) { H5FD_mem_t mem_type = H5FD_MEM_DEFAULT; @@ -6943,7 +6942,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) #ifdef H5_HAVE_PARALLEL if ( cache_ptr->coll_write_list ) { - if ( H5SL_insert(cache_ptr->coll_write_list, entry_ptr, + if ( H5SL_insert(cache_ptr->coll_write_list, entry_ptr, &entry_ptr->addr) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTINSERT, FAIL, \ @@ -6966,7 +6965,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) mem_type = entry_ptr->type->mem_type; } - if ( H5F_block_write(f, mem_type, entry_ptr->addr, + if ( H5F_block_write(f, mem_type, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -6982,7 +6981,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * just flushed the entry. */ if ( ( entry_ptr->type->notify ) && - ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_AFTER_FLUSH, entry_ptr) < 0 ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ @@ -7043,8 +7042,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) * to be removed from the cache, send a 'before eviction' notice while * the entry is still fully integrated in the cache. */ - if ( ( entry_ptr->type->notify ) && - ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, + if ( ( entry_ptr->type->notify ) && + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_BEFORE_EVICT, entry_ptr) < 0 ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ @@ -7127,19 +7126,19 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Check for entry changing status and do notifications, etc. */ if ( was_dirty ) { - /* If the entry's type has a 'notify' callback send a - * 'entry cleaned' notice now that the entry is fully + /* If the entry's type has a 'notify' callback send a + * 'entry cleaned' notice now that the entry is fully * integrated into the cache. */ if ( ( entry_ptr->type->notify ) && - ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, + ( (entry_ptr->type->notify)(H5C_NOTIFY_ACTION_ENTRY_CLEANED, entry_ptr) < 0 ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTNOTIFY, FAIL, \ "can't notify client about entry dirty flag cleared") - /* Propagate the clean flag up the flush dependency chain - * if appropriate + /* Propagate the clean flag up the flush dependency chain + * if appropriate */ if ( entry_ptr->flush_dep_ndirty_children != 0 ) { @@ -7160,7 +7159,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) entry_ptr->flush_in_progress = FALSE; /* capture the cache entry address for the log_flush call at the - * end before the entry_ptr gets freed + * end before the entry_ptr gets freed */ entry_addr = entry_ptr->addr; @@ -7242,7 +7241,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) } /* Release the space on disk */ - if ( H5MF_xfree(f, entry_ptr->type->mem_type, + if ( H5MF_xfree(f, entry_ptr->type->mem_type, entry_ptr->addr, fsf_size) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, \ @@ -7285,8 +7284,8 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) /* Reset dirty flag */ entry_ptr->is_dirty = FALSE; - /* If the entry's type has a 'notify' callback send a - * 'entry cleaned' notice now that the entry is fully + /* If the entry's type has a 'notify' callback send a + * 'entry cleaned' notice now that the entry is fully * integrated into the cache. */ if ( ( entry_ptr->type->notify ) && @@ -7335,10 +7334,10 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) HDassert(!destroy); HDassert(entry_ptr->image_ptr); - if ( ( f->shared->page_buf ) && + if ( ( f->shared->page_buf ) && ( f->shared->page_buf->page_size >= entry_ptr->size ) ) { - if ( H5PB_update_entry(f->shared->page_buf, entry_ptr->addr, + if ( H5PB_update_entry(f->shared->page_buf, entry_ptr->addr, entry_ptr->size, entry_ptr->image_ptr) > 0 ) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -7348,7 +7347,7 @@ H5C__flush_single_entry(H5F_t *f, H5C_cache_entry_t *entry_ptr, unsigned flags) if ( cache_ptr->log_flush ) { - if ( (cache_ptr->log_flush)(cache_ptr, entry_addr, + if ( (cache_ptr->log_flush)(cache_ptr, entry_addr, was_dirty, flags) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -7368,7 +7367,7 @@ done: } /* H5C__flush_single_entry() */ - + /*------------------------------------------------------------------------- * * Function: H5C__verify_len_eoa @@ -7395,8 +7394,8 @@ H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, size_t *len, hbool_t actual) { H5FD_mem_t cooked_type; /* Modified type, accounting for switching global heaps */ - haddr_t eoa; /* End-of-allocation in the file */ - herr_t ret_value = SUCCEED; /* Return value */ + haddr_t eoa; /* End-of-allocation in the file */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -7410,29 +7409,29 @@ H5C__verify_len_eoa(H5F_t *f, const H5C_class_t *type, haddr_t addr, /* Get the file's end-of-allocation value */ eoa = H5F_get_eoa(f, cooked_type); if(!H5F_addr_defined(eoa)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "invalid EOA address for file") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "invalid EOA address for file") /* Check for bad address in general */ if(H5F_addr_gt(addr, eoa)) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "address of object past end of allocation") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "address of object past end of allocation") /* Check if the amount of data to read will be past the EOA */ if(H5F_addr_gt((addr + *len), eoa)) { - if(actual) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "actual len exceeds EOA") - else - /* Trim down the length of the metadata */ - *len = (size_t)(eoa - addr); + if(actual) + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "actual len exceeds EOA") + else + /* Trim down the length of the metadata */ + *len = (size_t)(eoa - addr); } /* end if */ if(*len <= 0) - HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "len not positive after adjustment for EOA") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "len not positive after adjustment for EOA") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__verify_len_eoa() */ - + /*------------------------------------------------------------------------- * * Function: H5C_load_entry @@ -7671,7 +7670,7 @@ H5C_load_entry(H5F_t * f, * * In the following assert: * - * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); + * HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6 ) ); * * note that type ids 5 & 6 are associated with object headers in the * metadata cache. @@ -7691,7 +7690,7 @@ H5C_load_entry(H5F_t * f, entry->image_ptr = image; entry->image_up_to_date = !dirty; entry->type = type; - entry->is_dirty = dirty; + entry->is_dirty = dirty; entry->dirtied = FALSE; entry->is_protected = FALSE; entry->is_read_only = FALSE; @@ -7719,7 +7718,7 @@ H5C_load_entry(H5F_t * f, entry->ht_next = NULL; entry->ht_prev = NULL; entry->il_next = NULL; - entry->il_prev = NULL; + entry->il_prev = NULL; entry->next = NULL; entry->prev = NULL; @@ -7772,28 +7771,28 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_load_entry() */ - + /*------------------------------------------------------------------------- * * Function: H5C__make_space_in_cache * * Purpose: Attempt to evict cache entries until the index_size - * is at least needed_space below max_cache_size. + * is at least needed_space below max_cache_size. * - * In passing, also attempt to bring cLRU_list_size to a - * value greater than min_clean_size. + * In passing, also attempt to bring cLRU_list_size to a + * value greater than min_clean_size. * - * Depending on circumstances, both of these goals may - * be impossible, as in parallel mode, we must avoid generating - * a write as part of a read (to avoid deadlock in collective - * I/O), and in all cases, it is possible (though hopefully - * highly unlikely) that the protected list may exceed the - * maximum size of the cache. + * Depending on circumstances, both of these goals may + * be impossible, as in parallel mode, we must avoid generating + * a write as part of a read (to avoid deadlock in collective + * I/O), and in all cases, it is possible (though hopefully + * highly unlikely) that the protected list may exceed the + * maximum size of the cache. * - * Thus the function simply does its best, returning success - * unless an error is encountered. + * Thus the function simply does its best, returning success + * unless an error is encountered. * - * Observe that this function cannot occasion a read. + * Observe that this function cannot occasion a read. * * Return: Non-negative on success/Negative on failure. * @@ -7802,26 +7801,26 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) +H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) { - H5C_t * cache_ptr = f->shared->cache; + H5C_t * cache_ptr = f->shared->cache; #if H5C_COLLECT_CACHE_STATS int32_t clean_entries_skipped = 0; int32_t dirty_pf_entries_skipped = 0; int32_t total_entries_scanned = 0; #endif /* H5C_COLLECT_CACHE_STATS */ - uint32_t entries_examined = 0; - uint32_t initial_list_len; - size_t empty_space; + uint32_t entries_examined = 0; + uint32_t initial_list_len; + size_t empty_space; hbool_t reentrant_call = FALSE; - hbool_t prev_is_dirty = FALSE; + hbool_t prev_is_dirty = FALSE; hbool_t didnt_flush_entry = FALSE; - hbool_t restart_scan; - H5C_cache_entry_t * entry_ptr; - H5C_cache_entry_t * prev_ptr; - H5C_cache_entry_t * next_ptr; - uint32_t num_corked_entries = 0; - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t restart_scan; + H5C_cache_entry_t * entry_ptr; + H5C_cache_entry_t * prev_ptr; + H5C_cache_entry_t * next_ptr; + uint32_t num_corked_entries = 0; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -7848,47 +7847,47 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - if(cache_ptr->index_size >= cache_ptr->max_cache_size) - empty_space = 0; - else - empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; + if(cache_ptr->index_size >= cache_ptr->max_cache_size) + empty_space = 0; + else + empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; while ( ( ( (cache_ptr->index_size + space_needed) > cache_ptr->max_cache_size ) - || - ( - ( empty_space + cache_ptr->clean_index_size ) - < - ( cache_ptr->min_clean_size ) + || + ( + ( empty_space + cache_ptr->clean_index_size ) + < + ( cache_ptr->min_clean_size ) ) - ) + ) && ( entries_examined <= (2 * initial_list_len) ) && ( entry_ptr != NULL ) ) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert( !(entry_ptr->is_protected) ); HDassert( ! (entry_ptr->is_read_only) ); HDassert( (entry_ptr->ro_ref_count) == 0 ); - next_ptr = entry_ptr->next; + next_ptr = entry_ptr->next; prev_ptr = entry_ptr->prev; - if(prev_ptr != NULL) - prev_is_dirty = prev_ptr->is_dirty; + if(prev_ptr != NULL) + prev_is_dirty = prev_ptr->is_dirty; - if(entry_ptr->is_dirty && + if(entry_ptr->is_dirty && (entry_ptr->tag_info && entry_ptr->tag_info->corked)) { /* Skip "dirty" corked entries. */ - ++num_corked_entries; + ++num_corked_entries; didnt_flush_entry = TRUE; - } else if ( ( (entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID ) && + } else if ( ( (entry_ptr->type)->id != H5AC_EPOCH_MARKER_ID ) && ( ! entry_ptr->flush_in_progress ) && ( ! entry_ptr->prefetched_dirty ) ) { @@ -7905,7 +7904,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) } #endif /* H5C_COLLECT_CACHE_STATS */ - /* reset entries_removed_counter and + /* reset entries_removed_counter and * last_entry_removed_ptr prior to the call to * H5C__flush_single_entry() so that we can spot * unexpected removals of entries from the cache, @@ -7919,7 +7918,7 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) if(H5C__flush_single_entry(f, entry_ptr, H5C__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush entry") - if ( ( cache_ptr->entries_removed_counter > 1 ) || + if ( ( cache_ptr->entries_removed_counter > 1 ) || ( cache_ptr->last_entry_removed_ptr == prev_ptr ) ) restart_scan = TRUE; @@ -7961,63 +7960,63 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) #endif /* H5C_COLLECT_CACHE_STATS */ } - if ( prev_ptr != NULL ) { + if ( prev_ptr != NULL ) { - if ( didnt_flush_entry ) { + if ( didnt_flush_entry ) { - /* epoch markers don't get flushed, and we don't touch + /* epoch markers don't get flushed, and we don't touch * entries that are in the process of being flushed. * Hence no need for sanity checks, as we haven't * flushed anything. Thus just set entry_ptr to prev_ptr * and go on. - */ + */ entry_ptr = prev_ptr; - } else if ( ( restart_scan ) + } else if ( ( restart_scan ) || ( prev_ptr->is_dirty != prev_is_dirty ) - || - ( prev_ptr->next != next_ptr ) - || - ( prev_ptr->is_protected ) - || - ( prev_ptr->is_pinned ) ) { - - /* something has happened to the LRU -- start over - * from the tail. - */ + || + ( prev_ptr->next != next_ptr ) + || + ( prev_ptr->is_protected ) + || + ( prev_ptr->is_pinned ) ) { + + /* something has happened to the LRU -- start over + * from the tail. + */ restart_scan = FALSE; - entry_ptr = cache_ptr->LRU_tail_ptr; - H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) + entry_ptr = cache_ptr->LRU_tail_ptr; + H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) - } else { + } else { - entry_ptr = prev_ptr; + entry_ptr = prev_ptr; - } - } else { + } + } else { - entry_ptr = NULL; + entry_ptr = NULL; - } + } - entries_examined++; + entries_examined++; - if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { + if ( cache_ptr->index_size >= cache_ptr->max_cache_size ) { - empty_space = 0; + empty_space = 0; - } else { + } else { - empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; + empty_space = cache_ptr->max_cache_size - cache_ptr->index_size; - } + } - HDassert( cache_ptr->index_size == - (cache_ptr->clean_index_size + - cache_ptr->dirty_index_size) ); + HDassert( cache_ptr->index_size == + (cache_ptr->clean_index_size + + cache_ptr->dirty_index_size) ); - } + } #if H5C_COLLECT_CACHE_STATS cache_ptr->calls_to_msic++; @@ -8041,19 +8040,19 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) #endif /* H5C_COLLECT_CACHE_STATS */ - /* NEED: work on a better assert for corked entries */ - HDassert( ( entries_examined > (2 * initial_list_len) ) || - ( (cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) > - cache_ptr->max_cache_size ) || - ( ( cache_ptr->clean_index_size + empty_space ) - >= cache_ptr->min_clean_size ) || - ( ( num_corked_entries ))); + /* NEED: work on a better assert for corked entries */ + HDassert( ( entries_examined > (2 * initial_list_len) ) || + ( (cache_ptr->pl_size + cache_ptr->pel_size + cache_ptr->min_clean_size) > + cache_ptr->max_cache_size ) || + ( ( cache_ptr->clean_index_size + empty_space ) + >= cache_ptr->min_clean_size ) || + ( ( num_corked_entries ))); #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS HDassert( ( entries_examined > (2 * initial_list_len) ) || - ( cache_ptr->cLRU_list_size <= cache_ptr->clean_index_size ) ); + ( cache_ptr->cLRU_list_size <= cache_ptr->clean_index_size ) ); HDassert( ( entries_examined > (2 * initial_list_len) ) || - ( cache_ptr->dLRU_list_size <= cache_ptr->dirty_index_size ) ); + ( cache_ptr->dLRU_list_size <= cache_ptr->dirty_index_size ) ); #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -8093,14 +8092,14 @@ H5C__make_space_in_cache(H5F_t *f, size_t space_needed, hbool_t write_permitted) } /* end if */ - /* we are scanning the clean LRU, so the serialize function - * will not be called on any entry -- thus there is no - * concern about the list being modified out from under - * this function. - */ + /* we are scanning the clean LRU, so the serialize function + * will not be called on any entry -- thus there is no + * concern about the list being modified out from under + * this function. + */ entry_ptr = prev_ptr; - entries_examined++; + entries_examined++; } #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ } @@ -8115,16 +8114,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__make_space_in_cache() */ - + /*------------------------------------------------------------------------- * * Function: H5C_validate_lru_list * * Purpose: Debugging function that scans the LRU list for errors. * - * If an error is detected, the function generates a - * diagnostic and returns FAIL. If no error is detected, - * the function returns SUCCEED. + * If an error is detected, the function generates a + * diagnostic and returns FAIL. If no error is detected, + * the function returns SUCCEED. * * Return: FAIL if error is detected, SUCCEED otherwise. * @@ -8132,8 +8131,8 @@ done: * * Changes: * - * Added code to verify that the LRU contains no pinned - * entries. JRM -- 4/25/14 + * Added code to verify that the LRU contains no pinned + * entries. JRM -- 4/25/14 * *------------------------------------------------------------------------- */ @@ -8142,10 +8141,10 @@ done: static herr_t H5C_validate_lru_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -8243,7 +8242,7 @@ done: #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - + /*------------------------------------------------------------------------- * * Function: H5C_validate_pinned_entry_list @@ -8251,9 +8250,9 @@ done: * Purpose: Debugging function that scans the pinned entry list for * errors. * - * If an error is detected, the function generates a - * diagnostic and returns FAIL. If no error is detected, - * the function returns SUCCEED. + * If an error is detected, the function generates a + * diagnostic and returns FAIL. If no error is detected, + * the function returns SUCCEED. * * Return: FAIL if error is detected, SUCCEED otherwise. * @@ -8261,7 +8260,7 @@ done: * * Changes: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -8270,10 +8269,10 @@ done: static herr_t H5C_validate_pinned_entry_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -8375,7 +8374,7 @@ done: #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - + /*------------------------------------------------------------------------- * * Function: H5C_validate_protected_entry_list @@ -8383,9 +8382,9 @@ done: * Purpose: Debugging function that scans the protected entry list for * errors. * - * If an error is detected, the function generates a - * diagnostic and returns FAIL. If no error is detected, - * the function returns SUCCEED. + * If an error is detected, the function generates a + * diagnostic and returns FAIL. If no error is detected, + * the function returns SUCCEED. * * Return: FAIL if error is detected, SUCCEED otherwise. * @@ -8393,7 +8392,7 @@ done: * * Changes: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -8402,10 +8401,10 @@ done: static herr_t H5C_validate_protected_entry_list(H5C_t * cache_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ int32_t len = 0; size_t size = 0; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; FUNC_ENTER_NOAPI_NOINIT @@ -8500,23 +8499,23 @@ done: #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - + /*------------------------------------------------------------------------- * * Function: H5C_entry_in_skip_list * * Purpose: Debugging function that scans skip list to see if it - * is in present. We need this, as it is possible for - * an entry to be in the skip list twice. + * is in present. We need this, as it is possible for + * an entry to be in the skip list twice. * * Return: FALSE if the entry is not in the skip list, and TRUE - * if it is. + * if it is. * * Programmer: John Mainzer, 11/1/14 * * Changes: * - * None. + * None. * *------------------------------------------------------------------------- */ @@ -8527,7 +8526,7 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) { hbool_t in_slist = FALSE; H5SL_node_t * node_ptr = NULL; - H5C_cache_entry_t * entry_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); @@ -8539,19 +8538,19 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) { entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); - HDassert( entry_ptr ); - HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); + HDassert( entry_ptr ); + HDassert( entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC ); HDassert( entry_ptr->is_dirty ); HDassert( entry_ptr->in_slist ); if ( entry_ptr == target_ptr ) { - in_slist = TRUE; + in_slist = TRUE; - } else { + } else { - node_ptr = H5SL_next(node_ptr); - } + node_ptr = H5SL_next(node_ptr); + } } return(in_slist); @@ -8559,7 +8558,7 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) } /* H5C_entry_in_skip_list() */ #endif /* H5C_DO_SLIST_SANITY_CHECKS */ - + /*------------------------------------------------------------------------- * * Function: H5C__flush_marked_entries @@ -8571,11 +8570,11 @@ H5C_entry_in_skip_list(H5C_t * cache_ptr, H5C_cache_entry_t *target_ptr) * Programmer: Mike McGreevy * November 3, 2010 * - * Changes: Modified function to setup the slist before calling + * Changes: Modified function to setup the slist before calling * H%C_flush_cache(), and take it down afterwards. Note - * that the slist need not be empty after the call to - * H5C_flush_cache() since we are only flushing marked - * entries. Thus must set the clear_slist parameter + * that the slist need not be empty after the call to + * H5C_flush_cache() since we are only flushing marked + * entries. Thus must set the clear_slist parameter * of H5C_set_slist_enabled to TRUE. * * JRM -- 5/6/20 @@ -8601,13 +8600,13 @@ H5C__flush_marked_entries(H5F_t * f) /* Flush all marked entries */ - if ( H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | + if ( H5C_flush_cache(f, H5C__FLUSH_MARKED_ENTRIES_FLAG | H5C__FLUSH_IGNORE_PROTECTED_FLAG) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache") /* Disable the slist. Set the clear_slist parameter to TRUE - * since we called H5C_flush_cache() with the + * since we called H5C_flush_cache() with the * H5C__FLUSH_MARKED_ENTRIES_FLAG. */ if ( H5C_set_slist_enabled(f->shared->cache, FALSE, TRUE) < 0 ) @@ -8620,34 +8619,34 @@ done: } /* H5C__flush_marked_entries */ - + /*------------------------------------------------------------------------- * * Function: H5C_cork * * Purpose: To cork/uncork/get cork status of an object depending on "action": - * H5C__SET_CORK: - * To cork the object - * Return error if the object is already corked - * H5C__UNCORK: - * To uncork the obejct - * Return error if the object is not corked - * H5C__GET_CORKED: - * To retrieve the cork status of an object in - * the parameter "corked" + * H5C__SET_CORK: + * To cork the object + * Return error if the object is already corked + * H5C__UNCORK: + * To uncork the obejct + * Return error if the object is not corked + * H5C__GET_CORKED: + * To retrieve the cork status of an object in + * the parameter "corked" * * Return: Success: Non-negative * Failure: Negative * * Programmer: Vailin Choi - * January 2014 + * January 2014 * *------------------------------------------------------------------------- */ herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) { - H5C_tag_info_t *tag_info; /* Points to a tag info struct */ + H5C_tag_info_t *tag_info; /* Points to a tag info struct */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -8730,7 +8729,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_cork() */ - + /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_dirty() * @@ -8759,11 +8758,11 @@ H5C__mark_flush_dep_dirty(H5C_cache_entry_t * entry) /* Iterate over the parent entries, if any */ for(u = 0; u < entry->flush_dep_nparents; u++) { - /* Sanity check */ - HDassert(entry->flush_dep_parent[u]->flush_dep_ndirty_children < entry->flush_dep_parent[u]->flush_dep_nchildren); + /* Sanity check */ + HDassert(entry->flush_dep_parent[u]->flush_dep_ndirty_children < entry->flush_dep_parent[u]->flush_dep_nchildren); - /* Adjust the parent's number of dirty children */ - entry->flush_dep_parent[u]->flush_dep_ndirty_children++; + /* Adjust the parent's number of dirty children */ + entry->flush_dep_parent[u]->flush_dep_ndirty_children++; /* If the parent has a 'notify' callback, send a 'child entry dirtied' notice */ if(entry->flush_dep_parent[u]->type->notify && @@ -8775,7 +8774,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__mark_flush_dep_dirty() */ - + /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_clean() * @@ -8807,11 +8806,11 @@ H5C__mark_flush_dep_clean(H5C_cache_entry_t * entry) * dependency - QAK, 2017/08/12 */ for(i = ((int)entry->flush_dep_nparents) - 1; i >= 0; i--) { - /* Sanity check */ - HDassert(entry->flush_dep_parent[i]->flush_dep_ndirty_children > 0); + /* Sanity check */ + HDassert(entry->flush_dep_parent[i]->flush_dep_ndirty_children > 0); - /* Adjust the parent's number of dirty children */ - entry->flush_dep_parent[i]->flush_dep_ndirty_children--; + /* Adjust the parent's number of dirty children */ + entry->flush_dep_parent[i]->flush_dep_ndirty_children--; /* If the parent has a 'notify' callback, send a 'child entry cleaned' notice */ if(entry->flush_dep_parent[i]->type->notify && @@ -8823,13 +8822,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__mark_flush_dep_clean() */ - + /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_serialized() * * Purpose: Decrement the flush_dep_nunser_children fields of all the - * target entry's flush dependency parents in response to - * the target entry becoming serialized. + * target entry's flush dependency parents in response to + * the target entry becoming serialized. * * Return: Non-negative on success/Negative on failure * @@ -8854,7 +8853,7 @@ H5C__mark_flush_dep_serialized(H5C_cache_entry_t * entry_ptr) * dependency - QAK, 2017/08/12 */ for(i = ((int)entry_ptr->flush_dep_nparents) - 1; i >= 0; i--) { - /* Sanity checks */ + /* Sanity checks */ HDassert(entry_ptr->flush_dep_parent); HDassert(entry_ptr->flush_dep_parent[i]->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->flush_dep_parent[i]->flush_dep_nunser_children > 0); @@ -8872,7 +8871,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__mark_flush_dep_serialized() */ - + /*------------------------------------------------------------------------- * Function: H5C__mark_flush_dep_unserialized() * @@ -8919,7 +8918,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__mark_flush_dep_unserialized() */ - + #ifndef NDEBUG /*------------------------------------------------------------------------- * Function: H5C__assert_flush_dep_nocycle() @@ -8953,46 +8952,46 @@ H5C__assert_flush_dep_nocycle(const H5C_cache_entry_t * entry, /* Iterate over entry's parents (if any) */ for(u = 0; u < entry->flush_dep_nparents; u++) - H5C__assert_flush_dep_nocycle(entry->flush_dep_parent[u], base_entry); + H5C__assert_flush_dep_nocycle(entry->flush_dep_parent[u], base_entry); FUNC_LEAVE_NOAPI_VOID } /* H5C__assert_flush_dep_nocycle() */ #endif /* NDEBUG */ - + /*------------------------------------------------------------------------- * Function: H5C__serialize_cache * - * Purpose: Serialize (i.e. construct an on disk image) for all entries - * in the metadata cache including clean entries. + * Purpose: Serialize (i.e. construct an on disk image) for all entries + * in the metadata cache including clean entries. * - * Note that flush dependencies and "flush me last" flags - * must be observed in the serialization process. + * Note that flush dependencies and "flush me last" flags + * must be observed in the serialization process. * - * Note also that entries may be loaded, flushed, evicted, - * expunged, relocated, resized, or removed from the cache - * during this process, just as these actions may occur during - * a regular flush. + * Note also that entries may be loaded, flushed, evicted, + * expunged, relocated, resized, or removed from the cache + * during this process, just as these actions may occur during + * a regular flush. * - * However, we are given that the cache will contain no protected - * entries on entry to this routine (although entries may be - * briefly protected and then unprotected during the serialize - * process). + * However, we are given that the cache will contain no protected + * entries on entry to this routine (although entries may be + * briefly protected and then unprotected during the serialize + * process). * - * The objective of this routine is serialize all entries and - * to force all entries into their actual locations on disk. + * The objective of this routine is serialize all entries and + * to force all entries into their actual locations on disk. * - * The initial need for this routine is to settle all entries - * in the cache prior to construction of the metadata cache - * image so that the size of the cache image can be calculated. - * However, I gather that other uses for the routine are - * under consideration. + * The initial need for this routine is to settle all entries + * in the cache prior to construction of the metadata cache + * image so that the size of the cache image can be calculated. + * However, I gather that other uses for the routine are + * under consideration. * * Return: Non-negative on success/Negative on failure or if there was - * a request to flush all items and something was protected. + * a request to flush all items and something was protected. * * Programmer: John Mainzer - * 7/22/15 + * 7/22/15 * *------------------------------------------------------------------------- */ @@ -9068,9 +9067,9 @@ H5C__serialize_cache(H5F_t *f) scan_ptr = cache_ptr->il_head; while(scan_ptr != NULL) { - HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - scan_ptr->serialization_count = 0; - scan_ptr = scan_ptr->il_next; + HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + scan_ptr->serialization_count = 0; + scan_ptr = scan_ptr->il_next; } /* end while */ } /* end block */ #endif /* NDEBUG */ @@ -9089,7 +9088,7 @@ H5C__serialize_cache(H5F_t *f) */ ring = H5C_RING_USER; while(ring < H5C_RING_NTYPES) { - HDassert(cache_ptr->close_warning_received); + HDassert(cache_ptr->close_warning_received); switch(ring) { case H5C_RING_USER: break; @@ -9133,10 +9132,10 @@ H5C__serialize_cache(H5F_t *f) scan_ptr = cache_ptr->il_head; while(scan_ptr != NULL) { - HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(scan_ptr->serialization_count <= 1); + HDassert(scan_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(scan_ptr->serialization_count <= 1); - scan_ptr = scan_ptr->il_next; + scan_ptr = scan_ptr->il_next; } /* end while */ } /* end block */ #endif /* NDEBUG */ @@ -9146,7 +9145,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__serialize_cache() */ - + /*------------------------------------------------------------------------- * Function: H5C__serialize_ring * @@ -9157,16 +9156,16 @@ done: * If the cache contains protected entries in the specified * ring, the function will fail, as protected entries cannot * be serialized. However all unprotected entries in the - * target ring should be serialized before the function - * returns failure. + * target ring should be serialized before the function + * returns failure. * * If flush dependencies appear in the target ring, the * function makes repeated passes through the index list - * serializing entries in flush dependency order. + * serializing entries in flush dependency order. * - * All entries outside the H5C_RING_SBE are marked for - * inclusion in the cache image. Entries in H5C_RING_SBE - * and below are marked for exclusion from the image. + * All entries outside the H5C_RING_SBE are marked for + * inclusion in the cache image. Entries in H5C_RING_SBE + * and below are marked for exclusion from the image. * * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. @@ -9179,7 +9178,7 @@ done: static herr_t H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) { - hbool_t done = FALSE; + hbool_t done = FALSE; H5C_t * cache_ptr; H5C_cache_entry_t * entry_ptr; herr_t ret_value = SUCCEED; @@ -9278,45 +9277,45 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) * and serialize callbacks. */ cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_inserted_counter = 0; cache_ptr->entries_relocated_counter = 0; - done = TRUE; /* set to FALSE if any activity in inner loop */ - entry_ptr = cache_ptr->il_head; - while(entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + done = TRUE; /* set to FALSE if any activity in inner loop */ + entry_ptr = cache_ptr->il_head; + while(entry_ptr != NULL) { + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - /* Verify that either the entry is already serialized, or + /* Verify that either the entry is already serialized, or * that it is assigned to either the target or an inner * ring. */ HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); - /* Skip flush me last entries or inner ring entries */ - if(!entry_ptr->flush_me_last && entry_ptr->ring == ring) { + /* Skip flush me last entries or inner ring entries */ + if(!entry_ptr->flush_me_last && entry_ptr->ring == ring) { - /* if we encounter an unserialized entry in the current + /* if we encounter an unserialized entry in the current * ring that is not marked flush me last, we are not done. */ - if(!entry_ptr->image_up_to_date) - done = FALSE; + if(!entry_ptr->image_up_to_date) + done = FALSE; - /* Serialize the entry if its image is not up to date + /* Serialize the entry if its image is not up to date * and it has no unserialized flush dependency children. */ - if(!entry_ptr->image_up_to_date && entry_ptr->flush_dep_nunser_children == 0) { - HDassert(entry_ptr->serialization_count == 0); + if(!entry_ptr->image_up_to_date && entry_ptr->flush_dep_nunser_children == 0) { + HDassert(entry_ptr->serialization_count == 0); - /* Serialize the entry */ - if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") + /* Serialize the entry */ + if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") HDassert(entry_ptr->flush_dep_nunser_children == 0); - HDassert(entry_ptr->serialization_count == 0); + HDassert(entry_ptr->serialization_count == 0); #ifndef NDEBUG /* Increment serialization counter (to detect multiple serializations) */ - entry_ptr->serialization_count++; + entry_ptr->serialization_count++; #endif /* NDEBUG */ } /* end if */ } /* end if */ @@ -9332,7 +9331,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) /* Reset the counters */ cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_inserted_counter = 0; cache_ptr->entries_relocated_counter = 0; /* Restart scan */ @@ -9340,8 +9339,8 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) } /* end if */ else /* Advance to next entry */ - entry_ptr = entry_ptr->il_next; - } /* while ( entry_ptr != NULL ) */ + entry_ptr = entry_ptr->il_next; + } /* while ( entry_ptr != NULL ) */ } /* while ( ! done ) */ @@ -9350,7 +9349,7 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) * and serialize callbacks. */ cache_ptr->entries_loaded_counter = 0; - cache_ptr->entries_inserted_counter = 0; + cache_ptr->entries_inserted_counter = 0; cache_ptr->entries_relocated_counter = 0; /* At this point, all entries not marked "flush me last" and in @@ -9361,43 +9360,43 @@ H5C__serialize_ring(H5F_t *f, H5C_ring_t ring) */ entry_ptr = cache_ptr->il_head; while(entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(entry_ptr->ring > H5C_RING_UNDEFINED); + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(entry_ptr->ring > H5C_RING_UNDEFINED); HDassert(entry_ptr->ring < H5C_RING_NTYPES); HDassert((entry_ptr->ring >= ring) || (entry_ptr->image_up_to_date)); - if(entry_ptr->ring == ring) { - if(entry_ptr->flush_me_last) { - if(!entry_ptr->image_up_to_date) { - HDassert(entry_ptr->serialization_count == 0); + if(entry_ptr->ring == ring) { + if(entry_ptr->flush_me_last) { + if(!entry_ptr->image_up_to_date) { + HDassert(entry_ptr->serialization_count == 0); HDassert(entry_ptr->flush_dep_nunser_children == 0); - /* Serialize the entry */ - if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") + /* Serialize the entry */ + if(H5C__serialize_single_entry(f, cache_ptr, entry_ptr) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "entry serialization failed") /* Check for the cache changing */ if((cache_ptr->entries_loaded_counter > 0) || (cache_ptr->entries_inserted_counter > 0) || (cache_ptr->entries_relocated_counter > 0)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush_me_last entry serialization triggered restart") + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "flush_me_last entry serialization triggered restart") HDassert(entry_ptr->flush_dep_nunser_children == 0); - HDassert(entry_ptr->serialization_count == 0); + HDassert(entry_ptr->serialization_count == 0); #ifndef NDEBUG /* Increment serialization counter (to detect multiple serializations) */ - entry_ptr->serialization_count++; + entry_ptr->serialization_count++; #endif /* NDEBUG */ } /* end if */ } /* end if */ else { - HDassert(entry_ptr->image_up_to_date); - HDassert(entry_ptr->serialization_count <= 1); + HDassert(entry_ptr->image_up_to_date); + HDassert(entry_ptr->serialization_count <= 1); HDassert(entry_ptr->flush_dep_nunser_children == 0); } /* end else */ } /* if ( entry_ptr->ring == ring ) */ - entry_ptr = entry_ptr->il_next; + entry_ptr = entry_ptr->il_next; } /* while ( entry_ptr != NULL ) */ done: @@ -9405,12 +9404,12 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__serialize_ring() */ - + /*------------------------------------------------------------------------- * Function: H5C__serialize_single_entry * * Purpose: Serialize the cache entry pointed to by the entry_ptr - * parameter. + * parameter. * * Return: Non-negative on success/Negative on failure * @@ -9421,7 +9420,7 @@ done: static herr_t H5C__serialize_single_entry(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -9467,7 +9466,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__serialize_single_entry() */ - + /*------------------------------------------------------------------------- * Function: H5C__generate_image * @@ -9487,7 +9486,7 @@ done: * Programmer: Mohamad Chaarawi * 2/10/16 * - * Changes: Updated sanity checks for the possibility that the skip + * Changes: Updated sanity checks for the possibility that the skip * list is disabled. * JRM 5/16/20 * @@ -9521,8 +9520,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* Call client's pre-serialize callback, if there's one */ if ( ( entry_ptr->type->pre_serialize ) && ( (entry_ptr->type->pre_serialize)(f, (void *)entry_ptr, - entry_ptr->addr, entry_ptr->size, - &new_addr, &new_len, + entry_ptr->addr, entry_ptr->size, + &new_addr, &new_len, &serialize_flags) < 0 ) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -9532,7 +9531,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) if ( serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET ) { /* Check for unexpected flags from serialize callback */ - if ( serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | + if ( serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG | H5C__SERIALIZE_MOVED_FLAG) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ @@ -9572,7 +9571,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) #endif /* If required, resize the buffer and update the entry and the cache - * data structures + * data structures */ if ( serialize_flags & H5C__SERIALIZE_RESIZED_FLAG ) { @@ -9580,15 +9579,15 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) HDassert(new_len > 0); /* Allocate a new image buffer */ - if ( NULL == (entry_ptr->image_ptr = - H5MM_realloc(entry_ptr->image_ptr, + if ( NULL == (entry_ptr->image_ptr = + H5MM_realloc(entry_ptr->image_ptr, new_len + H5C_IMAGE_EXTRA_SPACE)) ) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, \ "memory allocation failed for on disk image buffer") #if H5C_DO_MEMORY_SANITY_CHECKS - H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + new_len, + H5MM_memcpy(((uint8_t *)entry_ptr->image_ptr) + new_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ @@ -9609,8 +9608,8 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) /* As we haven't updated the cache data structures for * for the flush or flush destroy yet, the entry should - * be in the slist if the slist is enabled. Since - * H5C__UPDATE_SLIST_FOR_SIZE_CHANGE() is a no-op if the + * be in the slist if the slist is enabled. Since + * H5C__UPDATE_SLIST_FOR_SIZE_CHANGE() is a no-op if the * slist is enabled, call it un-conditionally. */ HDassert(entry_ptr->is_dirty); @@ -9655,7 +9654,7 @@ H5C__generate_image(H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr) } /* end if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) */ /* Serialize object into buffer */ - if ( entry_ptr->type->serialize(f, entry_ptr->image_ptr, entry_ptr->size, + if ( entry_ptr->type->serialize(f, entry_ptr->image_ptr, entry_ptr->size, (void *)entry_ptr) < 0 ) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry") @@ -9687,13 +9686,13 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__generate_image */ - + /*------------------------------------------------------------------------- * * Function: H5C_remove_entry * * Purpose: Remove an entry from the cache. Must be not protected, pinned, - * dirty, involved in flush dependencies, etc. + * dirty, involved in flush dependencies, etc. * * Return: Non-negative on success/Negative on failure * @@ -9757,10 +9756,10 @@ H5C_remove_entry(void *_entry) /* Update the cache internal data structures as appropriate for a destroy. * Specifically: - * 1) Delete it from the index - * 2) Delete it from the collective read access list - * 3) Update the replacement policy for eviction - * 4) Remove it from the tag list for this object + * 1) Delete it from the index + * 2) Delete it from the collective read access list + * 3) Update the replacement policy for eviction + * 4) Remove it from the tag list for this object */ H5C__DELETE_FROM_INDEX(cache, entry, FAIL) diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 79ebd9e..54cca2e 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -17,15 +17,18 @@ * Purpose: This file contains declarations which are normally visible * only within the H5C package. * - * Source files outside the H5C package should include - * H5Cprivate.h instead. + * Source files outside the H5C package should include + * H5Cprivate.h instead. * - * The one exception to this rule is test/cache.c. The test - * code is easier to write if it can look at the cache's - * internal data structures. Indeed, this is the main - * reason why this file was created. + * The one exception to this rule is test/cache.c. The test + * code is easier to write if it can look at the cache's + * internal data structures. Indeed, this is the main + * reason why this file was created. */ +/* clang-format off */ +/* Maintain current format by disabling format for this file */ + #if !(defined H5C_FRIEND || defined H5C_MODULE) #error "Do not include this file outside the H5C package!" #endif @@ -50,7 +53,7 @@ /* Cache configuration settings */ #define H5C__HASH_TABLE_LEN (64 * 1024) /* must be a power of 2 */ -#define H5C__H5C_T_MAGIC 0x005CAC0E +#define H5C__H5C_T_MAGIC 0x005CAC0E /* Initial allocated size of the "flush_dep_parent" array */ @@ -81,7 +84,7 @@ * to the HGOTO_ERROR macro, which may not be appropriate in all cases. * If so, we will need versions of the insertion and deletion macros which * do not reference the sanity checking macros. - * JRM - 5/5/04 + * JRM - 5/5/04 * * Changes: * @@ -156,14 +159,14 @@ * sanity checking macros. These macro are used to update the size of * a DLL when one of its entries changes size. * - * JRM - 9/8/05 + * JRM - 9/8/05 * * - Added macros supporting the index list -- a doubly liked list of * all entries in the index. This list is necessary to reduce the * cost of visiting all entries in the cache, which was previously * done via a scan of the hash table. * - * JRM - 10/15/15 + * JRM - 10/15/15 * ****************************************************************************/ @@ -591,7 +594,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ H5C__IL_DLL_SC(head_ptr, tail_ptr, len, Size, fv) \ } /* H5C__IL_DLL_REMOVE() */ - + /*********************************************************************** * * Stats collection macros @@ -626,68 +629,68 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ (cache_ptr)->dirty_index_size; #define H5C__UPDATE_STATS_FOR_DIRTY_PIN(cache_ptr, entry_ptr) \ - (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; + (((cache_ptr)->dirty_pins)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) \ if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ - (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ + (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ - if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ - (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ - if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ - (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ + if ( (cache_ptr)->pel_len > (cache_ptr)->max_pel_len ) \ + (cache_ptr)->max_pel_len = (cache_ptr)->pel_len; \ + if ( (cache_ptr)->pel_size > (cache_ptr)->max_pel_size ) \ + (cache_ptr)->max_pel_size = (cache_ptr)->pel_size; #define H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr) \ - if ( cache_ptr->flush_in_progress ) \ + if ( cache_ptr->flush_in_progress ) \ ((cache_ptr)->cache_flush_moves[(entry_ptr)->type->id])++; \ if ( entry_ptr->flush_in_progress ) \ ((cache_ptr)->entry_flush_moves[(entry_ptr)->type->id])++; \ - (((cache_ptr)->moves)[(entry_ptr)->type->id])++; \ + (((cache_ptr)->moves)[(entry_ptr)->type->id])++; \ (cache_ptr)->entries_relocated_counter++; #define H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_size)\ - if ( cache_ptr->flush_in_progress ) \ + if ( cache_ptr->flush_in_progress ) \ ((cache_ptr)->cache_flush_size_changes[(entry_ptr)->type->id])++; \ if ( entry_ptr->flush_in_progress ) \ ((cache_ptr)->entry_flush_size_changes[(entry_ptr)->type->id])++; \ - if ( (entry_ptr)->size < (new_size) ) { \ - ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ + if ( (entry_ptr)->size < (new_size) ) { \ + ((cache_ptr)->size_increases[(entry_ptr)->type->id])++; \ H5C__UPDATE_MAX_INDEX_SIZE_STATS(cache_ptr) \ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; \ if ( (cache_ptr)->pl_size > (cache_ptr)->max_pl_size ) \ (cache_ptr)->max_pl_size = (cache_ptr)->pl_size; \ - } else if ( (entry_ptr)->size > (new_size) ) { \ - ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ - } + } else if ( (entry_ptr)->size > (new_size) ) { \ + ((cache_ptr)->size_decreases[(entry_ptr)->type->id])++; \ + } #define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) \ - (cache_ptr)->total_ht_insertions++; + (cache_ptr)->total_ht_insertions++; #define H5C__UPDATE_STATS_FOR_HT_DELETION(cache_ptr) \ - (cache_ptr)->total_ht_deletions++; + (cache_ptr)->total_ht_deletions++; #define H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, success, depth) \ - if ( success ) { \ - (cache_ptr)->successful_ht_searches++; \ - (cache_ptr)->total_successful_ht_search_depth += depth; \ - } else { \ - (cache_ptr)->failed_ht_searches++; \ - (cache_ptr)->total_failed_ht_search_depth += depth; \ - } + if ( success ) { \ + (cache_ptr)->successful_ht_searches++; \ + (cache_ptr)->total_successful_ht_search_depth += depth; \ + } else { \ + (cache_ptr)->failed_ht_searches++; \ + (cache_ptr)->total_failed_ht_search_depth += depth; \ + } #define H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) \ - ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; + ((cache_ptr)->unpins)[(entry_ptr)->type->id]++; #define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr) \ - ((cache_ptr)->slist_scan_restarts)++; + ((cache_ptr)->slist_scan_restarts)++; #define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) \ - ((cache_ptr)->LRU_scan_restarts)++; + ((cache_ptr)->LRU_scan_restarts)++; #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) \ - ((cache_ptr)->index_scan_restarts)++; + ((cache_ptr)->index_scan_restarts)++; #define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \ { \ @@ -953,7 +956,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #endif /* H5C_COLLECT_CACHE_STATS */ - + /*********************************************************************** * * Hash table access and manipulation macros: @@ -970,13 +973,13 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ * the clean_index_size and dirty_index_size fields of H5C_t. Also * added macros to allow us to track entry cleans and dirties. * - * JRM -- 11/5/08 + * JRM -- 11/5/08 * * - Updated existing index macros and sanity check macros to maintain * the index_ring_len, index_ring_size, clean_index_ring_size, and * dirty_index_ring_size fields of H5C_t. * - * JRM -- 9/1/15 + * JRM -- 9/1/15 * * - Updated existing index macros and sanity checks macros to * maintain an doubly linked list of all entries in the index. @@ -990,9 +993,9 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ /* H5C__HASH_TABLE_LEN is defined in H5Cpkg.h. It mut be a power of two. */ -#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3) +#define H5C__HASH_MASK ((size_t)(H5C__HASH_TABLE_LEN - 1) << 3) -#define H5C__HASH_FCN(x) (int)((unsigned)((x) & H5C__HASH_MASK) >> 3) +#define H5C__HASH_FCN(x) (int)((unsigned)((x) & H5C__HASH_MASK) >> 3) #if H5C_DO_SANITY_CHECKS @@ -1008,7 +1011,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( H5C__HASH_FCN((entry_ptr)->addr) >= H5C__HASH_TABLE_LEN ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ @@ -1031,7 +1034,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->magic != H5C__H5C_T_MAGIC ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] == 0 ) || \ @@ -1068,7 +1071,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (entry_ptr)->ht_prev != NULL ) ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ @@ -1099,7 +1102,7 @@ if ( ( (cache_ptr) == NULL ) || \ ( (entry_ptr)->ht_prev != NULL ) || \ ( (cache_ptr)->index_size != \ ((cache_ptr)->clean_index_size + \ - (cache_ptr)->dirty_index_size) ) || \ + (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ @@ -1158,7 +1161,7 @@ if ( ( (cache_ptr) == NULL ) || \ } #define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ + entry_ptr, was_clean) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len <= 0 ) || \ ( (cache_ptr)->index_size <= 0 ) || \ @@ -1172,9 +1175,9 @@ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( ( !( was_clean ) || \ - ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ - ( ( (was_clean) ) || \ - ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ + ( (cache_ptr)->clean_index_size < (old_size) ) ) && \ + ( ( (was_clean) ) || \ + ( (cache_ptr)->dirty_index_size < (old_size) ) ) ) || \ ( (entry_ptr) == NULL ) || \ ( (entry_ptr)->ring <= H5C_RING_UNDEFINED ) || \ ( (entry_ptr)->ring >= H5C_RING_NTYPES ) || \ @@ -1193,20 +1196,20 @@ if ( ( (cache_ptr) == NULL ) || \ } #define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) \ + entry_ptr) \ if ( ( (cache_ptr) == NULL ) || \ ( (cache_ptr)->index_len <= 0 ) || \ ( (cache_ptr)->index_size <= 0 ) || \ ( (new_size) > (cache_ptr)->index_size ) || \ ( (cache_ptr)->index_size != \ - ((cache_ptr)->clean_index_size + \ + ((cache_ptr)->clean_index_size + \ (cache_ptr)->dirty_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->clean_index_size) ) || \ ( (cache_ptr)->index_size < ((cache_ptr)->dirty_index_size) ) || \ ( ( !((entry_ptr)->is_dirty ) || \ - ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ - ( ( ((entry_ptr)->is_dirty) ) || \ - ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ + ( (cache_ptr)->dirty_index_size < (new_size) ) ) && \ + ( ( ((entry_ptr)->is_dirty) ) || \ + ( (cache_ptr)->clean_index_size < (new_size) ) ) ) || \ ( ( (cache_ptr)->index_len == 1 ) && \ ( (cache_ptr)->index_size != (new_size) ) ) || \ ( (cache_ptr)->index_ring_len[(entry_ptr)->ring] > \ @@ -1320,9 +1323,9 @@ if ( ( (cache_ptr)->index_size != \ #define H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) #define H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) #define H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) + entry_ptr, was_clean) #define H5C__POST_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr) + entry_ptr) #define H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr) #define H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr) @@ -1462,10 +1465,10 @@ if ( ( (cache_ptr)->index_size != \ H5C__PRE_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ (cache_ptr)->dirty_index_size -= (entry_ptr)->size; \ ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ - -= (entry_ptr)->size; \ + -= (entry_ptr)->size; \ (cache_ptr)->clean_index_size += (entry_ptr)->size; \ ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ - += (entry_ptr)->size; \ + += (entry_ptr)->size; \ H5C__POST_HT_UPDATE_FOR_ENTRY_CLEAN_SC(cache_ptr, entry_ptr); \ } @@ -1474,18 +1477,18 @@ if ( ( (cache_ptr)->index_size != \ H5C__PRE_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ (cache_ptr)->clean_index_size -= (entry_ptr)->size; \ ((cache_ptr)->clean_index_ring_size[entry_ptr->ring]) \ - -= (entry_ptr)->size; \ + -= (entry_ptr)->size; \ (cache_ptr)->dirty_index_size += (entry_ptr)->size; \ ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring]) \ - += (entry_ptr)->size; \ + += (entry_ptr)->size; \ H5C__POST_HT_UPDATE_FOR_ENTRY_DIRTY_SC(cache_ptr, entry_ptr); \ } #define H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ + entry_ptr, was_clean) \ { \ H5C__PRE_HT_ENTRY_SIZE_CHANGE_SC(cache_ptr, old_size, new_size, \ - entry_ptr, was_clean) \ + entry_ptr, was_clean) \ (cache_ptr)->index_size -= (old_size); \ (cache_ptr)->index_size += (new_size); \ ((cache_ptr)->index_ring_size[entry_ptr->ring]) -= (old_size); \ @@ -1494,14 +1497,14 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->clean_index_size -= (old_size); \ ((cache_ptr)->clean_index_ring_size[entry_ptr->ring])-= (old_size); \ } else { \ - (cache_ptr)->dirty_index_size -= (old_size); \ + (cache_ptr)->dirty_index_size -= (old_size); \ ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring])-= (old_size); \ } \ if((entry_ptr)->is_dirty) { \ (cache_ptr)->dirty_index_size += (new_size); \ ((cache_ptr)->dirty_index_ring_size[entry_ptr->ring])+= (new_size); \ } else { \ - (cache_ptr)->clean_index_size += (new_size); \ + (cache_ptr)->clean_index_size += (new_size); \ ((cache_ptr)->clean_index_ring_size[entry_ptr->ring])+= (new_size); \ } \ H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->il_len, \ @@ -1511,7 +1514,7 @@ if ( ( (cache_ptr)->index_size != \ entry_ptr) \ } - + /************************************************************************** * * Skip list insertion and deletion macros: @@ -1523,11 +1526,11 @@ if ( ( (cache_ptr)->index_size != \ /*------------------------------------------------------------------------- * - * Macro: H5C__INSERT_ENTRY_IN_SLIST + * Macro: H5C__INSERT_ENTRY_IN_SLIST * * Purpose: Insert the specified instance of H5C_cache_entry_t into - * the skip list in the specified instance of H5C_t. Update - * the associated length and size fields. + * the skip list in the specified instance of H5C_t. Update + * the associated length and size fields. * * Return: N/A * @@ -1535,66 +1538,66 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM -- 7/21/04 - * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar - * index fields. + * JRM -- 7/21/04 + * Updated function to set the in_tree flag when inserting + * an entry into the tree. Also modified the function to + * update the tree size and len fields instead of the similar + * index fields. * - * All of this is part of the modifications to support the - * hash table. + * All of this is part of the modifications to support the + * hash table. * - * JRM -- 7/27/04 - * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of - * wringing a little more speed out of the cache. + * JRM -- 7/27/04 + * Converted the function H5C_insert_entry_in_tree() into + * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of + * wringing a little more speed out of the cache. * - * Note that we don't bother to check if the entry is already - * in the tree -- if it is, H5SL_insert() will fail. + * Note that we don't bother to check if the entry is already + * in the tree -- if it is, H5SL_insert() will fail. * - * QAK -- 11/27/04 - * Switched over to using skip list routines. + * QAK -- 11/27/04 + * Switched over to using skip list routines. * - * JRM -- 6/27/06 - * Added fail_val parameter. + * JRM -- 6/27/06 + * Added fail_val parameter. * - * JRM -- 8/25/06 - * Added the H5C_DO_SANITY_CHECKS version of the macro. + * JRM -- 8/25/06 + * Added the H5C_DO_SANITY_CHECKS version of the macro. * - * This version maintains the slist_len_increase and - * slist_size_increase fields that are used in sanity - * checks in the flush routines. + * This version maintains the slist_len_increase and + * slist_size_increase fields that are used in sanity + * checks in the flush routines. * - * All this is needed as the fractal heap needs to be - * able to dirty, resize and/or move entries during the - * flush. + * All this is needed as the fractal heap needs to be + * able to dirty, resize and/or move entries during the + * flush. * - * JRM -- 12/13/14 - * Added code to set cache_ptr->slist_changed to TRUE - * when an entry is inserted in the slist. + * JRM -- 12/13/14 + * Added code to set cache_ptr->slist_changed to TRUE + * when an entry is inserted in the slist. * - * JRM -- 9/1/15 - * Added code to maintain the cache_ptr->slist_ring_len - * and cache_ptr->slist_ring_size arrays. + * JRM -- 9/1/15 + * Added code to maintain the cache_ptr->slist_ring_len + * and cache_ptr->slist_ring_size arrays. * * JRM -- 4/29/20 - * Reworked macro to support the slist_enabled field - * of H5C_t. If slist_enabled == TRUE, the macro + * Reworked macro to support the slist_enabled field + * of H5C_t. If slist_enabled == TRUE, the macro * functions as before. Otherwise, the macro is a no-op, * and the slist must be empty. * *------------------------------------------------------------------------- */ -/* NOTE: The H5C__INSERT_ENTRY_IN_SLIST() macro is set up so that - * - * H5C_DO_SANITY_CHECKS +/* NOTE: The H5C__INSERT_ENTRY_IN_SLIST() macro is set up so that + * + * H5C_DO_SANITY_CHECKS * - * and + * and * - * H5C_DO_SLIST_SANITY_CHECKS + * H5C_DO_SLIST_SANITY_CHECKS * - * can be selected independantly. This is easy to miss as the + * can be selected independantly. This is easy to miss as the * two #defines are easy to confuse. */ @@ -1701,7 +1704,7 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_DO_SANITY_CHECKS */ - + /*------------------------------------------------------------------------- * * Function: H5C__REMOVE_ENTRY_FROM_SLIST @@ -1736,8 +1739,8 @@ if ( ( (cache_ptr)->index_size != \ * when an entry is removed from the slist. * * JRM -- 4/29/20 - * Reworked macro to support the slist_enabled field - * of H5C_t. If slist_enabled == TRUE, the macro + * Reworked macro to support the slist_enabled field + * of H5C_t. If slist_enabled == TRUE, the macro * functions as before. Otherwise, the macro is a no-op, * and the slist must be empty. * @@ -1839,7 +1842,7 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_DO_SANITY_CHECKS */ - + /*------------------------------------------------------------------------- * * Function: H5C__UPDATE_SLIST_FOR_SIZE_CHANGE @@ -1873,8 +1876,8 @@ if ( ( (cache_ptr)->index_size != \ * and cache_ptr->slist_ring_size arrays. * * JRM -- 4/29/20 - * Reworked macro to support the slist_enabled field - * of H5C_t. If slist_enabled == TRUE, the macro + * Reworked macro to support the slist_enabled field + * of H5C_t. If slist_enabled == TRUE, the macro * functions as before. Otherwise, the macro is a no-op, * and the slist must be empty. * @@ -1969,7 +1972,7 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_DO_SANITY_CHECKS */ - + /************************************************************************** * * Replacement policy update macros: @@ -1981,18 +1984,18 @@ if ( ( (cache_ptr)->index_size != \ /*------------------------------------------------------------------------- * - * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS + * Macro: H5C__FAKE_RP_FOR_MOST_RECENT_ACCESS * * Purpose: For efficiency, we sometimes change the order of flushes -- - * but doing so can confuse the replacement policy. This - * macro exists to allow us to specify an entry as the - * most recently touched so we can repair any such - * confusion. + * but doing so can confuse the replacement policy. This + * macro exists to allow us to specify an entry as the + * most recently touched so we can repair any such + * confusion. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the macro + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2000,15 +2003,15 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM -- 3/20/06 - * Modified macro to ignore pinned entries. Pinned entries - * do not appear in the data structures maintained by the - * replacement policy code, and thus this macro has nothing - * to do if called for such an entry. + * JRM -- 3/20/06 + * Modified macro to ignore pinned entries. Pinned entries + * do not appear in the data structures maintained by the + * replacement policy code, and thus this macro has nothing + * to do if called for such an entry. * - * JRM -- 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM -- 3/28/07 + * Added sanity checks using the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -2030,16 +2033,16 @@ if ( ( (cache_ptr)->index_size != \ /* modified LRU specific code */ \ \ /* remove the entry from the LRU list, and re-insert it at the head.\ - */ \ + */ \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* Use the dirty flag to infer whether the entry is on the clean or \ @@ -2093,16 +2096,16 @@ if ( ( (cache_ptr)->index_size != \ /* modified LRU specific code */ \ \ /* remove the entry from the LRU list, and re-insert it at the head \ - */ \ + */ \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* End modified LRU specific code. */ \ @@ -2111,18 +2114,18 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_EVICTION + * Macro: H5C__UPDATE_RP_FOR_EVICTION * * Purpose: Update the replacement policy data structures for an - * eviction of the specified cache entry. + * eviction of the specified cache entry. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: Non-negative on success/Negative on failure. * @@ -2130,27 +2133,27 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_eviction() to the - * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze - * a bit more performance out of the cache. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_eviction() to the + * macro H5C__UPDATE_RP_FOR_EVICTION in an effort to squeeze + * a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * the pre-processor, I'll have to remove them. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause difficulties with + * the pre-processor, I'll have to remove them. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. * - * JRM - 3/20/06 - * Pinned entries can't be evicted, so this entry should never - * be called on a pinned entry. Added assert to verify this. + * JRM - 3/20/06 + * Pinned entries can't be evicted, so this entry should never + * be called on a pinned entry. Added assert to verify this. * - * JRM -- 3/28/07 - * Added sanity checks for the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM -- 3/28/07 + * Added sanity checks for the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -2222,18 +2225,18 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_FLUSH + * Macro: H5C__UPDATE_RP_FOR_FLUSH * * Purpose: Update the replacement policy data structures for a flush - * of the specified cache entry. + * of the specified cache entry. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2241,29 +2244,29 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_flush() to the - * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze - * a bit more performance out of the cache. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_flush() to the + * macro H5C__UPDATE_RP_FOR_FLUSH in an effort to squeeze + * a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause difficulties with + * pre-processor, I'll have to remove them. * - * JRM - 7/28/04 - * Split macro into two versions, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * JRM - 7/28/04 + * Split macro into two versions, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. * - * JRM - 3/20/06 - * While pinned entries can be flushed, they don't reside in - * the replacement policy data structures when unprotected. - * Thus I modified this macro to do nothing if the entry is - * pinned. + * JRM - 3/20/06 + * While pinned entries can be flushed, they don't reside in + * the replacement policy data structures when unprotected. + * Thus I modified this macro to do nothing if the entry is + * pinned. * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM - 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -2285,28 +2288,28 @@ if ( ( (cache_ptr)->index_size != \ /* modified LRU specific code */ \ \ /* remove the entry from the LRU list, and re-insert it at the \ - * head. \ - */ \ + * head. \ + */ \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* since the entry is being flushed or cleared, one would think \ - * that it must be dirty -- but that need not be the case. Use the \ - * dirty flag to infer whether the entry is on the clean or dirty \ - * LRU list, and remove it. Then insert it at the head of the \ - * clean LRU list. \ + * that it must be dirty -- but that need not be the case. Use the \ + * dirty flag to infer whether the entry is on the clean or dirty \ + * LRU list, and remove it. Then insert it at the head of the \ + * clean LRU list. \ * \ * The function presumes that a dirty entry will be either cleared \ - * or flushed shortly, so it is OK if we put a dirty entry on the \ - * clean LRU list. \ + * or flushed shortly, so it is OK if we put a dirty entry on the \ + * clean LRU list. \ */ \ \ if ( (entry_ptr)->is_dirty ) { \ @@ -2347,17 +2350,17 @@ if ( ( (cache_ptr)->index_size != \ /* modified LRU specific code */ \ \ /* remove the entry from the LRU list, and re-insert it at the \ - * head. \ - */ \ + * head. \ + */ \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* End modified LRU specific code. */ \ @@ -2366,26 +2369,26 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_INSERT_APPEND + * Macro: H5C__UPDATE_RP_FOR_INSERT_APPEND * * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. + * insertion of the specified cache entry. * - * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the - * new entry as the LEAST recently used entry, not the - * most recently used. + * Unlike H5C__UPDATE_RP_FOR_INSERTION below, mark the + * new entry as the LEAST recently used entry, not the + * most recently used. * - * For now at least, this macro should only be used in - * the reconstruction of the metadata cache from a cache - * image block. + * For now at least, this macro should only be used in + * the reconstruction of the metadata cache from a cache + * image block. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2421,7 +2424,7 @@ if ( ( (cache_ptr)->index_size != \ \ H5C__DLL_APPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* insert the entry at the tail of the clean or dirty LRU list as \ @@ -2462,7 +2465,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->pel_tail_ptr, \ (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ - \ + \ } else { \ \ /* modified LRU specific code */ \ @@ -2471,7 +2474,7 @@ if ( ( (cache_ptr)->index_size != \ \ H5C__DLL_APPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* End modified LRU specific code. */ \ @@ -2480,18 +2483,18 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_INSERTION + * Macro: H5C__UPDATE_RP_FOR_INSERTION * * Purpose: Update the replacement policy data structures for an - * insertion of the specified cache entry. + * insertion of the specified cache entry. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2499,31 +2502,31 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_insertion() to the - * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze - * a bit more performance out of the cache. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_insertion() to the + * macro H5C__UPDATE_RP_FOR_INSERTION in an effort to squeeze + * a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause difficulties with + * pre-processor, I'll have to remove them. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. * - * JRM - 3/10/06 - * This macro should never be called on a pinned entry. - * Inserted an assert to verify this. + * JRM - 3/10/06 + * This macro should never be called on a pinned entry. + * Inserted an assert to verify this. * - * JRM - 8/9/06 - * Not any more. We must now allow insertion of pinned - * entries. Updated macro to support this. + * JRM - 8/9/06 + * Not any more. We must now allow insertion of pinned + * entries. Updated macro to support this. * - * JRM - 3/28/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM - 3/28/07 + * Added sanity checks using the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -2555,7 +2558,7 @@ if ( ( (cache_ptr)->index_size != \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* insert the entry at the head of the clean or dirty LRU list as \ @@ -2596,7 +2599,7 @@ if ( ( (cache_ptr)->index_size != \ (cache_ptr)->pel_tail_ptr, \ (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ - \ + \ } else { \ \ /* modified LRU specific code */ \ @@ -2605,7 +2608,7 @@ if ( ( (cache_ptr)->index_size != \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* End modified LRU specific code. */ \ @@ -2614,22 +2617,22 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_PROTECT + * Macro: H5C__UPDATE_RP_FOR_PROTECT * * Purpose: Update the replacement policy data structures for a - * protect of the specified cache entry. + * protect of the specified cache entry. * - * To do this, unlink the specified entry from any data - * structures used by the replacement policy, and add the - * entry to the protected list. + * To do this, unlink the specified entry from any data + * structures used by the replacement policy, and add the + * entry to the protected list. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2637,28 +2640,28 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_protect() to the - * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze - * a bit more performance out of the cache. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_protect() to the + * macro H5C__UPDATE_RP_FOR_PROTECT in an effort to squeeze + * a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause difficulties with + * pre-processor, I'll have to remove them. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. * - * JRM - 3/17/06 - * Modified macro to attempt to remove pinned entriese from - * the pinned entry list instead of from the data structures - * maintained by the replacement policy. + * JRM - 3/17/06 + * Modified macro to attempt to remove pinned entriese from + * the pinned entry list instead of from the data structures + * maintained by the replacement policy. * - * JRM - 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM - 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -2674,12 +2677,12 @@ if ( ( (cache_ptr)->index_size != \ HDassert( !((entry_ptr)->is_read_only) ); \ HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ HDassert( (entry_ptr)->size > 0 ); \ - \ + \ if ( (entry_ptr)->is_pinned ) { \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ \ } else { \ @@ -2690,7 +2693,7 @@ if ( ( (cache_ptr)->index_size != \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* Similarly, remove the entry from the clean or dirty LRU list \ @@ -2736,12 +2739,12 @@ if ( ( (cache_ptr)->index_size != \ HDassert( !((entry_ptr)->is_read_only) ); \ HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ HDassert( (entry_ptr)->size > 0 ); \ - \ + \ if ( (entry_ptr)->is_pinned ) { \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->pel_head_ptr, \ - (cache_ptr)->pel_tail_ptr, \ - (cache_ptr)->pel_len, \ + (cache_ptr)->pel_tail_ptr, \ + (cache_ptr)->pel_len, \ (cache_ptr)->pel_size, (fail_val)) \ \ } else { \ @@ -2752,7 +2755,7 @@ if ( ( (cache_ptr)->index_size != \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* End modified LRU specific code. */ \ @@ -2770,18 +2773,18 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_MOVE + * Macro: H5C__UPDATE_RP_FOR_MOVE * * Purpose: Update the replacement policy data structures for a - * move of the specified cache entry. + * move of the specified cache entry. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2802,20 +2805,20 @@ if ( ( (cache_ptr)->index_size != \ HDassert( (entry_ptr)->size > 0 ); \ \ if ( ! ( (entry_ptr)->is_pinned ) && ! ( (entry_ptr->is_protected ) ) ) { \ - \ + \ /* modified LRU specific code */ \ \ /* remove the entry from the LRU list, and re-insert it at the head. \ - */ \ + */ \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* remove the entry from either the clean or dirty LUR list as \ @@ -2824,43 +2827,43 @@ if ( ( (cache_ptr)->index_size != \ if ( was_dirty ) { \ \ H5C__AUX_DLL_REMOVE((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_head_ptr, \ (cache_ptr)->dLRU_tail_ptr, \ (cache_ptr)->dLRU_list_len, \ (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ + (fail_val)) \ \ } else { \ \ H5C__AUX_DLL_REMOVE((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_head_ptr, \ (cache_ptr)->cLRU_tail_ptr, \ (cache_ptr)->cLRU_list_len, \ (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ + (fail_val)) \ } \ \ /* insert the entry at the head of either the clean or dirty \ - * LRU list as appropriate. \ + * LRU list as appropriate. \ */ \ \ if ( (entry_ptr)->is_dirty ) { \ \ H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->dLRU_head_ptr, \ + (cache_ptr)->dLRU_head_ptr, \ (cache_ptr)->dLRU_tail_ptr, \ (cache_ptr)->dLRU_list_len, \ (cache_ptr)->dLRU_list_size, \ - (fail_val)) \ + (fail_val)) \ \ } else { \ \ H5C__AUX_DLL_PREPEND((entry_ptr), \ - (cache_ptr)->cLRU_head_ptr, \ + (cache_ptr)->cLRU_head_ptr, \ (cache_ptr)->cLRU_tail_ptr, \ (cache_ptr)->cLRU_list_len, \ (cache_ptr)->cLRU_list_size, \ - (fail_val)) \ + (fail_val)) \ } \ \ /* End modified LRU specific code. */ \ @@ -2879,20 +2882,20 @@ if ( ( (cache_ptr)->index_size != \ HDassert( (entry_ptr)->size > 0 ); \ \ if ( ! ( (entry_ptr)->is_pinned ) && ! ( (entry_ptr->is_protected ) ) ) { \ - \ + \ /* modified LRU specific code */ \ \ /* remove the entry from the LRU list, and re-insert it at the head. \ - */ \ + */ \ \ H5C__DLL_REMOVE((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ H5C__DLL_PREPEND((entry_ptr), (cache_ptr)->LRU_head_ptr, \ (cache_ptr)->LRU_tail_ptr, \ - (cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_len, \ (cache_ptr)->LRU_list_size, (fail_val)) \ \ /* End modified LRU specific code. */ \ @@ -2901,25 +2904,25 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE + * Macro: H5C__UPDATE_RP_FOR_SIZE_CHANGE * * Purpose: Update the replacement policy data structures for a - * size change of the specified cache entry. + * size change of the specified cache entry. * - * To do this, determine if the entry is pinned. If it is, - * update the size of the pinned entry list. + * To do this, determine if the entry is pinned. If it is, + * update the size of the pinned entry list. * - * If it isn't pinned, the entry must handled by the - * replacement policy. Update the appropriate replacement - * policy data structures. + * If it isn't pinned, the entry must handled by the + * replacement policy. Update the appropriate replacement + * policy data structures. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -2927,9 +2930,9 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM -- 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -2949,49 +2952,49 @@ if ( ( (cache_ptr)->index_size != \ \ if ( (entry_ptr)->coll_access ) { \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->coll_list_len, \ - (cache_ptr)->coll_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->coll_list_len, \ + (cache_ptr)->coll_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ } \ \ if ( (entry_ptr)->is_pinned ) { \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, \ - (entry_ptr)->size, \ - (new_size)); \ - \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, \ + (entry_ptr)->size, \ + (new_size)); \ + \ } else { \ \ /* modified LRU specific code */ \ \ - /* Update the size of the LRU list */ \ + /* Update the size of the LRU list */ \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ \ /* Similarly, update the size of the clean or dirty LRU list as \ - * appropriate. At present, the entry must be clean, but that \ - * could change. \ + * appropriate. At present, the entry must be clean, but that \ + * could change. \ */ \ \ if ( (entry_ptr)->is_dirty ) { \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ - (cache_ptr)->dLRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->dLRU_list_len, \ + (cache_ptr)->dLRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ \ } else { \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ - (cache_ptr)->cLRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->cLRU_list_len, \ + (cache_ptr)->cLRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ } \ \ /* End modified LRU specific code. */ \ @@ -3011,24 +3014,24 @@ if ( ( (cache_ptr)->index_size != \ HDassert( ((entry_ptr)->ro_ref_count) == 0 ); \ HDassert( (entry_ptr)->size > 0 ); \ HDassert( new_size > 0 ); \ - \ + \ if ( (entry_ptr)->is_pinned ) { \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ - (cache_ptr)->pel_size, \ - (entry_ptr)->size, \ - (new_size)); \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->pel_len, \ + (cache_ptr)->pel_size, \ + (entry_ptr)->size, \ + (new_size)); \ \ } else { \ \ /* modified LRU specific code */ \ \ - /* Update the size of the LRU list */ \ + /* Update the size of the LRU list */ \ \ - H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ - (cache_ptr)->LRU_list_size, \ - (entry_ptr)->size, \ - (new_size)); \ + H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr)->LRU_list_len, \ + (cache_ptr)->LRU_list_size, \ + (entry_ptr)->size, \ + (new_size)); \ \ /* End modified LRU specific code. */ \ } \ @@ -3037,22 +3040,22 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_UNPIN + * Macro: H5C__UPDATE_RP_FOR_UNPIN * * Purpose: Update the replacement policy data structures for an - * unpin of the specified cache entry. + * unpin of the specified cache entry. * - * To do this, unlink the specified entry from the protected - * entry list, and re-insert it in the data structures used - * by the current replacement policy. + * To do this, unlink the specified entry from the protected + * entry list, and re-insert it in the data structures used + * by the current replacement policy. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the macro - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the macro + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -3060,9 +3063,9 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM -- 3/28/07 - * Added sanity checks based on the new is_read_only and - * ro_ref_count fields of struct H5C_cache_entry_t. + * JRM -- 3/28/07 + * Added sanity checks based on the new is_read_only and + * ro_ref_count fields of struct H5C_cache_entry_t. * *------------------------------------------------------------------------- */ @@ -3158,22 +3161,22 @@ if ( ( (cache_ptr)->index_size != \ #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__UPDATE_RP_FOR_UNPROTECT + * Macro: H5C__UPDATE_RP_FOR_UNPROTECT * * Purpose: Update the replacement policy data structures for an - * unprotect of the specified cache entry. + * unprotect of the specified cache entry. * - * To do this, unlink the specified entry from the protected - * list, and re-insert it in the data structures used by the - * current replacement policy. + * To do this, unlink the specified entry from the protected + * list, and re-insert it in the data structures used by the + * current replacement policy. * - * At present, we only support the modified LRU policy, so - * this function deals with that case unconditionally. If - * we ever support other replacement policies, the function - * should switch on the current policy and act accordingly. + * At present, we only support the modified LRU policy, so + * this function deals with that case unconditionally. If + * we ever support other replacement policies, the function + * should switch on the current policy and act accordingly. * * Return: N/A * @@ -3181,24 +3184,24 @@ if ( ( (cache_ptr)->index_size != \ * * Modifications: * - * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to - * squeeze a bit more performance out of the cache. + * JRM - 7/27/04 + * Converted the function H5C_update_rp_for_unprotect() to + * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to + * squeeze a bit more performance out of the cache. * - * At least for the first cut, I am leaving the comments and - * white space in the macro. If they cause difficulties with - * pre-processor, I'll have to remove them. + * At least for the first cut, I am leaving the comments and + * white space in the macro. If they cause difficulties with + * pre-processor, I'll have to remove them. * - * JRM - 7/28/04 - * Split macro into two version, one supporting the clean and - * dirty LRU lists, and the other not. Yet another attempt - * at optimization. + * JRM - 7/28/04 + * Split macro into two version, one supporting the clean and + * dirty LRU lists, and the other not. Yet another attempt + * at optimization. * - * JRM - 3/17/06 - * Modified macro to put pinned entries on the pinned entry - * list instead of inserting them in the data structures - * maintained by the replacement policy. + * JRM - 3/17/06 + * Modified macro to put pinned entries on the pinned entry + * list instead of inserting them in the data structures + * maintained by the replacement policy. * *------------------------------------------------------------------------- */ @@ -3447,10 +3450,10 @@ if ( ( (entry_ptr) == NULL ) || \ } \ } /* H5C__COLL_DLL_REMOVE() */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__INSERT_IN_COLL_LIST + * Macro: H5C__INSERT_IN_COLL_LIST * * Purpose: Insert entry into collective entries list * @@ -3477,10 +3480,10 @@ if ( ( (entry_ptr) == NULL ) || \ \ } /* H5C__INSERT_IN_COLL_LIST */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__REMOVE_FROM_COLL_LIST + * Macro: H5C__REMOVE_FROM_COLL_LIST * * Purpose: Remove entry from collective entries list * @@ -3507,10 +3510,10 @@ if ( ( (entry_ptr) == NULL ) || \ \ } /* H5C__REMOVE_FROM_COLL_LIST */ - + /*------------------------------------------------------------------------- * - * Macro: H5C__MOVE_TO_TOP_IN_COLL_LIST + * Macro: H5C__MOVE_TO_TOP_IN_COLL_LIST * * Purpose: Update entry position in collective entries list * @@ -3563,7 +3566,7 @@ if ( ( (entry_ptr) == NULL ) || \ * * The fields of this structure are discussed individually below: * - * tag: Address (i.e. "tag") of the object header for all the entries + * tag: Address (i.e. "tag") of the object header for all the entries * corresponding to parts of that object. * * head: Head of doubly-linked list of all entries belonging to the tag. @@ -3571,7 +3574,7 @@ if ( ( (entry_ptr) == NULL ) || \ * entry_cnt: Number of entries on linked list of entries for this tag. * * corked: Boolean flag indicating whether entries for this object can be - * evicted. + * evicted. * ****************************************************************************/ typedef struct H5C_tag_info_t { @@ -3613,32 +3616,32 @@ typedef struct H5C_tag_info_t { * Note that index_size and index_len now refer to the total size of * and number of entries in the hash table. * - * JRM - 7/19/04 + * JRM - 7/19/04 * * The TBBT has since been replaced with a skip list. This change * greatly predates this note. * - * JRM - 9/26/05 + * JRM - 9/26/05 * - * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. - * This field is used to validate pointers to instances of - * H5C_t. + * magic: Unsigned 32 bit integer always set to H5C__H5C_T_MAGIC. + * This field is used to validate pointers to instances of + * H5C_t. * * flush_in_progress: Boolean flag indicating whether a flush is in - * progress. + * progress. * * log_info: Information used by the MDC logging functionality. * Described in H5Clog.h. * - * aux_ptr: Pointer to void used to allow wrapper code to associate - * its data with an instance of H5C_t. The H5C cache code - * sets this field to NULL, and otherwise leaves it alone. + * aux_ptr: Pointer to void used to allow wrapper code to associate + * its data with an instance of H5C_t. The H5C cache code + * sets this field to NULL, and otherwise leaves it alone. * - * max_type_id: Integer field containing the maximum type id number assigned - * to a type of entry in the cache. All type ids from 0 to - * max_type_id inclusive must be defined. The names of the - * types are stored in the type_name_table discussed below, and - * indexed by the ids. + * max_type_id: Integer field containing the maximum type id number assigned + * to a type of entry in the cache. All type ids from 0 to + * max_type_id inclusive must be defined. The names of the + * types are stored in the type_name_table discussed below, and + * indexed by the ids. * * class_table_ptr: Pointer to an array of H5C_class_t of length * max_type_id + 1. Entry classes for the cache. @@ -3654,19 +3657,19 @@ typedef struct H5C_tag_info_t { * to reduce its size as entries are unprotected. * * b) When running in parallel mode, the cache may not be - * permitted to flush a dirty entry in response to a read. - * If there are no clean entries available to evict, the - * cache will exceed its maximum size. Again the cache + * permitted to flush a dirty entry in response to a read. + * If there are no clean entries available to evict, the + * cache will exceed its maximum size. Again the cache * will attempt to reduce its size to the max_cache_size * limit on the next cache write. * - * c) When an entry increases in size, the cache may exceed - * the max_cache_size limit until the next time the cache - * attempts to load or insert an entry. + * c) When an entry increases in size, the cache may exceed + * the max_cache_size limit until the next time the cache + * attempts to load or insert an entry. * - * d) When the evictions_enabled field is false (see below), - * the cache size will increase without limit until the - * field is set to true. + * d) When the evictions_enabled field is false (see below), + * the cache size will increase without limit until the + * field is set to true. * * min_clean_size: Nominal minimum number of clean bytes in the cache. * The cache attempts to maintain this number of bytes of @@ -3674,7 +3677,7 @@ typedef struct H5C_tag_info_t { * a soft limit. * * close_warning_received: Boolean flag indicating that a file closing - * warning has been received. + * warning has been received. * * * In addition to the call back functions required for each entry, the @@ -3682,19 +3685,19 @@ typedef struct H5C_tag_info_t { * the cache as a whole: * * check_write_permitted: In certain applications, the cache may not - * be allowed to write to disk at certain time. If specified, - * the check_write_permitted function is used to determine if - * a write is permissible at any given point in time. + * be allowed to write to disk at certain time. If specified, + * the check_write_permitted function is used to determine if + * a write is permissible at any given point in time. * - * If no such function is specified (i.e. this field is NULL), - * the cache uses the following write_permitted field to - * determine whether writes are permitted. + * If no such function is specified (i.e. this field is NULL), + * the cache uses the following write_permitted field to + * determine whether writes are permitted. * * write_permitted: If check_write_permitted is NULL, this boolean flag - * indicates whether writes are permitted. + * indicates whether writes are permitted. * - * log_flush: If provided, this function is called whenever a dirty - * entry is flushed to disk. + * log_flush: If provided, this function is called whenever a dirty + * entry is flushed to disk. * * * In cases where memory is plentiful, and performance is an issue, it may @@ -3702,11 +3705,11 @@ typedef struct H5C_tag_info_t { * writes. The following field is used to implement this. * * evictions_enabled: Boolean flag that is initialized to TRUE. When - * this flag is set to FALSE, the metadata cache will not - * attempt to evict entries to make space for newly protected - * entries, and instead the will grow without limit. + * this flag is set to FALSE, the metadata cache will not + * attempt to evict entries to make space for newly protected + * entries, and instead the will grow without limit. * - * Needless to say, this feature must be used with care. + * Needless to say, this feature must be used with care. * * * The cache requires an index to facilitate searching for entries. The @@ -3724,7 +3727,7 @@ typedef struct H5C_tag_info_t { * index, and must have the same length and size as the index proper. * * index_len: Number of entries currently in the hash table used to index - * the cache. + * the cache. * * index_size: Number of bytes of cache entries currently stored in the * hash table used to index the cache. @@ -3736,84 +3739,84 @@ typedef struct H5C_tag_info_t { * of the cache's memory footprint. * * index_ring_len: Array of integer of length H5C_RING_NTYPES used to - * maintain a count of entries in the index by ring. Note - * that the sum of all the cells in this array must equal - * the value stored in index_len above. + * maintain a count of entries in the index by ring. Note + * that the sum of all the cells in this array must equal + * the value stored in index_len above. * * index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all entries in the index - * by ring. Note that the sum of all cells in this array must - * equal the value stored in index_size above. + * maintain the sum of the sizes of all entries in the index + * by ring. Note that the sum of all cells in this array must + * equal the value stored in index_size above. * * clean_index_size: Number of bytes of clean entries currently stored in - * the hash table. Note that the index_size field (above) - * is also the sum of the sizes of all entries in the cache. - * Thus we should have the invariant that clean_index_size + - * dirty_index_size == index_size. + * the hash table. Note that the index_size field (above) + * is also the sum of the sizes of all entries in the cache. + * Thus we should have the invariant that clean_index_size + + * dirty_index_size == index_size. * - * WARNING: + * WARNING: * - * The value of the clean_index_size must not be mistaken - * for the current clean size of the cache. Rather, the - * clean size of the cache is the current value of - * clean_index_size plus the amount of empty space (if any) + * The value of the clean_index_size must not be mistaken + * for the current clean size of the cache. Rather, the + * clean size of the cache is the current value of + * clean_index_size plus the amount of empty space (if any) * in the cache. * * clean_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all clean entries in the - * index by ring. Note that the sum of all cells in this array - * must equal the value stored in clean_index_size above. + * maintain the sum of the sizes of all clean entries in the + * index by ring. Note that the sum of all cells in this array + * must equal the value stored in clean_index_size above. * * dirty_index_size: Number of bytes of dirty entries currently stored in - * the hash table. Note that the index_size field (above) - * is also the sum of the sizes of all entries in the cache. - * Thus we should have the invariant that clean_index_size + - * dirty_index_size == index_size. + * the hash table. Note that the index_size field (above) + * is also the sum of the sizes of all entries in the cache. + * Thus we should have the invariant that clean_index_size + + * dirty_index_size == index_size. * * dirty_index_ring_size: Array of size_t of length H5C_RING_NTYPES used to - * maintain the sum of the sizes of all dirty entries in the - * index by ring. Note that the sum of all cells in this array - * must equal the value stored in dirty_index_size above. - * - * index: Array of pointer to H5C_cache_entry_t of size - * H5C__HASH_TABLE_LEN. At present, this value is a power - * of two, not the usual prime number. - * - * I hope that the variable size of cache elements, the large - * hash table size, and the way in which HDF5 allocates space - * will combine to avoid problems with periodicity. If so, we - * can use a trivial hash function (a bit-and and a 3 bit left - * shift) with some small savings. - * - * If not, it will become evident in the statistics. Changing - * to the usual prime number length hash table will require - * changing the H5C__HASH_FCN macro and the deletion of the - * H5C__HASH_MASK #define. No other changes should be required. - * - * il_len: Number of entries on the index list. - * - * This must always be equal to index_len. As such, this - * field is redundant. However, the existing linked list - * management macros expect to maintain a length field, so - * this field exists primarily to avoid adding complexity to - * these macros. - * - * il_size: Number of bytes of cache entries currently stored in the - * index list. - * - * This must always be equal to index_size. As such, this - * field is redundant. However, the existing linked list - * management macros expect to maintain a size field, so - * this field exists primarily to avoid adding complexity to - * these macros. - * - * il_head: Pointer to the head of the doubly linked list of entries in + * maintain the sum of the sizes of all dirty entries in the + * index by ring. Note that the sum of all cells in this array + * must equal the value stored in dirty_index_size above. + * + * index: Array of pointer to H5C_cache_entry_t of size + * H5C__HASH_TABLE_LEN. At present, this value is a power + * of two, not the usual prime number. + * + * I hope that the variable size of cache elements, the large + * hash table size, and the way in which HDF5 allocates space + * will combine to avoid problems with periodicity. If so, we + * can use a trivial hash function (a bit-and and a 3 bit left + * shift) with some small savings. + * + * If not, it will become evident in the statistics. Changing + * to the usual prime number length hash table will require + * changing the H5C__HASH_FCN macro and the deletion of the + * H5C__HASH_MASK #define. No other changes should be required. + * + * il_len: Number of entries on the index list. + * + * This must always be equal to index_len. As such, this + * field is redundant. However, the existing linked list + * management macros expect to maintain a length field, so + * this field exists primarily to avoid adding complexity to + * these macros. + * + * il_size: Number of bytes of cache entries currently stored in the + * index list. + * + * This must always be equal to index_size. As such, this + * field is redundant. However, the existing linked list + * management macros expect to maintain a size field, so + * this field exists primarily to avoid adding complexity to + * these macros. + * + * il_head: Pointer to the head of the doubly linked list of entries in * the index list. Note that cache entries on this list are - * linked by their il_next and il_prev fields. + * linked by their il_next and il_prev fields. * * This field is NULL if the index is empty. * - * il_tail: Pointer to the tail of the doubly linked list of entries in + * il_tail: Pointer to the tail of the doubly linked list of entries in * the index list. Note that cache entries on this list are * linked by their il_next and il_prev fields. * @@ -3830,32 +3833,32 @@ typedef struct H5C_tag_info_t { * * The following fields are maintained to facilitate this. * - * entries_removed_counter: Counter that is incremented each time an - * entry is removed from the cache by any means (eviction, - * expungement, or take ownership at this point in time). - * Functions that perform scans on lists may set this field - * to zero prior to calling H5C__flush_single_entry(). - * Unexpected changes to the counter indicate that an entry - * was removed from the cache as a side effect of the flush. - * - * last_entry_removed_ptr: Pointer to the instance of H5C_cache_entry_t - * which contained the last entry to be removed from the cache, - * or NULL if there either is no such entry, or if a function - * performing a scan of a list has set this field to NULL prior - * to calling H5C__flush_single_entry(). - * - * WARNING!!! This field must NEVER be dereferenced. It is - * maintained to allow functions that perform scans of lists - * to compare this pointer with their pointers to next, thus - * allowing them to avoid unnecessary restarts of scans if the - * pointers don't match, and if entries_removed_counter is - * one. - * - * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t + * entries_removed_counter: Counter that is incremented each time an + * entry is removed from the cache by any means (eviction, + * expungement, or take ownership at this point in time). + * Functions that perform scans on lists may set this field + * to zero prior to calling H5C__flush_single_entry(). + * Unexpected changes to the counter indicate that an entry + * was removed from the cache as a side effect of the flush. + * + * last_entry_removed_ptr: Pointer to the instance of H5C_cache_entry_t + * which contained the last entry to be removed from the cache, + * or NULL if there either is no such entry, or if a function + * performing a scan of a list has set this field to NULL prior + * to calling H5C__flush_single_entry(). + * + * WARNING!!! This field must NEVER be dereferenced. It is + * maintained to allow functions that perform scans of lists + * to compare this pointer with their pointers to next, thus + * allowing them to avoid unnecessary restarts of scans if the + * pointers don't match, and if entries_removed_counter is + * one. + * + * entry_watched_for_removal: Pointer to an instance of H5C_cache_entry_t * which contains the 'next' entry for an iteration. Removing * this entry must trigger a rescan of the iteration, so each * entry removed from the cache is compared against this pointer - * and the pointer is reset to NULL if the watched entry is + * and the pointer is reset to NULL if the watched entry is * removed. * (This functions similarly to a "dead man's switch") * @@ -3870,14 +3873,14 @@ typedef struct H5C_tag_info_t { * are flushed. (this has been changed -- dirty entries are now removed from * the skip list as they are flushed. JRM - 10/25/05) * - * Update 4/21/20: + * Update 4/21/20: * - * Profiling indicates that the cost of maintaining the skip list is + * Profiling indicates that the cost of maintaining the skip list is * significant. As it is only used on flush and close, maintaining it * only when needed is an obvious optimization. * * To do this, we add a flag to control maintenanace of the skip list. - * This flag is initially set to FALSE, which disables all operations + * This flag is initially set to FALSE, which disables all operations * on the skip list. * * At the beginning of either flush or close, we scan the index list, @@ -3885,27 +3888,27 @@ typedef struct H5C_tag_info_t { * on skip list by setting above control flag to true. * * At the end of a complete flush, we verify that the skip list is empty, - * and set the control flag back to false, so as to avoid skip list - * maintenance overhead until the next flush or close. + * and set the control flag back to false, so as to avoid skip list + * maintenance overhead until the next flush or close. * * In the case of a partial flush (i.e. flush marked entries), we remove * all remaining entries from the skip list, and then set the control flag - * back to false -- again avoiding skip list maintenance overhead until + * back to false -- again avoiding skip list maintenance overhead until * the next flush or close. * * slist_enabled: Boolean flag used to control operation of the skip - * list. If this filed is FALSE, operations on the + * list. If this filed is FALSE, operations on the * slist are no-ops, and the slist must be empty. If * it is TRUE, operations on the slist proceed as usual, * and all dirty entries in the metadata cache must be * listed in the slist. * * slist_changed: Boolean flag used to indicate whether the contents of - * the slist has changed since the last time this flag was - * reset. This is used in the cache flush code to detect - * conditions in which pre-serialize or serialize callbacks - * have modified the slist -- which obliges us to restart - * the scan of the slist from the beginning. + * the slist has changed since the last time this flag was + * reset. This is used in the cache flush code to detect + * conditions in which pre-serialize or serialize callbacks + * have modified the slist -- which obliges us to restart + * the scan of the slist from the beginning. * * slist_len: Number of entries currently in the skip list * used to maintain a sorted list of dirty entries in the @@ -3916,14 +3919,14 @@ typedef struct H5C_tag_info_t { * dirty entries in the cache. * * slist_ring_len: Array of integer of length H5C_RING_NTYPES used to - * maintain a count of entries in the slist by ring. Note - * that the sum of all the cells in this array must equal - * the value stored in slist_len above. + * maintain a count of entries in the slist by ring. Note + * that the sum of all the cells in this array must equal + * the value stored in slist_len above. * * slist_ring_size: Array of size_t of length H5C_RING_NTYPES used to * maintain the sum of the sizes of all entries in the - * slist by ring. Note that the sum of all cells in this - * array must equal the value stored in slist_size above. + * slist by ring. Note that the sum of all cells in this + * array must equal the value stored in slist_size above. * * slist_ptr: pointer to the instance of H5SL_t used maintain a sorted * list of dirty entries in the cache. This sorted list has @@ -3938,7 +3941,7 @@ typedef struct H5C_tag_info_t { * some optimizations when I get to it. * * num_last_entries: The number of entries in the cache that can only be - * flushed after all other entries in the cache have + * flushed after all other entries in the cache have * been flushed. At this time, this will only ever be * one entry (the superblock), and the code has been * protected with HDasserts to enforce this. This restraint @@ -3947,10 +3950,10 @@ typedef struct H5C_tag_info_t { * explicit tests for that case should be added when said * HDasserts are removed. * - * Update: There are now two possible last entries - * (superblock and file driver info message). This - * number will probably increase as we add superblock - * messages. JRM -- 11/18/14 + * Update: There are now two possible last entries + * (superblock and file driver info message). This + * number will probably increase as we add superblock + * messages. JRM -- 11/18/14 * * With the addition of the fractal heap, the cache must now deal with * the case in which entries may be dirtied, moved, or have their sizes @@ -3959,12 +3962,12 @@ typedef struct H5C_tag_info_t { * H5C_DO_SANITY_CHECKS is TRUE. * * slist_len_increase: Number of entries that have been added to the - * slist since the last time this field was set to zero. - * Note that this value can be negative. + * slist since the last time this field was set to zero. + * Note that this value can be negative. * * slist_size_increase: Total size of all entries that have been added - * to the slist since the last time this field was set to - * zero. Note that this value can be negative. + * to the slist since the last time this field was set to + * zero. Note that this value can be negative. * * Cache entries belonging to a particular object are "tagged" with that * object's base object header address. @@ -3981,7 +3984,7 @@ typedef struct H5C_tag_info_t { * freelist, as well as shared entries like global * heaps and shared object header messages, are not tagged. * - * ignore_tags: Boolean flag to disable tag validation during entry insertion. + * ignore_tags: Boolean flag to disable tag validation during entry insertion. * * num_objs_corked: Unsigned integer field containing the number of objects * that are "corked". The "corked" status of an object is @@ -4020,15 +4023,15 @@ typedef struct H5C_tag_info_t { * * Pinning an entry has the following implications: * - * 1) A pinned entry cannot be evicted. Thus unprotected + * 1) A pinned entry cannot be evicted. Thus unprotected * pinned entries reside in the pinned entry list, instead * of the LRU list(s) (or other lists maintained by the current * replacement policy code). * * 2) A pinned entry can be accessed or modified at any time. * This places an additional burden on the associated pre-serialize - * and serialize callbacks, which must ensure the the entry is in - * a consistent state before creating an image of it. + * and serialize callbacks, which must ensure the the entry is in + * a consistent state before creating an image of it. * * 3) A pinned entry can be marked as dirty (and possibly * change size) while it is unprotected. @@ -4043,21 +4046,21 @@ typedef struct H5C_tag_info_t { * * Maintaining the pinned entry list requires the following fields: * - * pel_len: Number of entries currently residing on the pinned - * entry list. + * pel_len: Number of entries currently residing on the pinned + * entry list. * - * pel_size: Number of bytes of cache entries currently residing on - * the pinned entry list. + * pel_size: Number of bytes of cache entries currently residing on + * the pinned entry list. * * pel_head_ptr: Pointer to the head of the doubly linked list of pinned - * but not protected entries. Note that cache entries on - * this list are linked by their next and prev fields. + * but not protected entries. Note that cache entries on + * this list are linked by their next and prev fields. * * This field is NULL if the list is empty. * * pel_tail_ptr: Pointer to the tail of the doubly linked list of pinned - * but not protected entries. Note that cache entries on - * this list are linked by their next and prev fields. + * but not protected entries. Note that cache entries on + * this list are linked by their next and prev fields. * * This field is NULL if the list is empty. * @@ -4115,13 +4118,13 @@ typedef struct H5C_tag_info_t { * LRU_list_len: Number of cache entries currently on the LRU list. * * Observe that LRU_list_len + pl_len + pel_len must always - * equal index_len. + * equal index_len. * * LRU_list_size: Number of bytes of cache entries currently residing on the * LRU list. * * Observe that LRU_list_size + pl_size + pel_size must always - * equal index_size. + * equal index_size. * * LRU_head_ptr: Pointer to the head of the doubly linked LRU list. Cache * entries on this list are linked by their next and prev fields. @@ -4190,10 +4193,10 @@ typedef struct H5C_tag_info_t { * the structure described below: * * size_increase_possible: Depending on the configuration data given - * in the resize_ctl field, it may or may not be possible - * to increase the size of the cache. Rather than test for - * all the ways this can happen, we simply set this flag when - * we receive a new configuration. + * in the resize_ctl field, it may or may not be possible + * to increase the size of the cache. Rather than test for + * all the ways this can happen, we simply set this flag when + * we receive a new configuration. * * flash_size_increase_possible: Depending on the configuration data given * in the resize_ctl field, it may or may not be possible @@ -4214,37 +4217,37 @@ typedef struct H5C_tag_info_t { * we receive a new configuration. * * resize_enabled: This is another convenience flag which is set whenever - * a new set of values for resize_ctl are provided. Very - * simply, + * a new set of values for resize_ctl are provided. Very + * simply, * - * resize_enabled = size_increase_possible || + * resize_enabled = size_increase_possible || * size_decrease_possible; * - * cache_full: Boolean flag used to keep track of whether the cache is - * full, so we can refrain from increasing the size of a - * cache which hasn't used up the space allotted to it. + * cache_full: Boolean flag used to keep track of whether the cache is + * full, so we can refrain from increasing the size of a + * cache which hasn't used up the space allotted to it. * - * The field is initialized to FALSE, and then set to TRUE - * whenever we attempt to make space in the cache. + * The field is initialized to FALSE, and then set to TRUE + * whenever we attempt to make space in the cache. * * size_decreased: Boolean flag set to TRUE whenever the maximum cache - * size is decreased. The flag triggers a call to - * H5C__make_space_in_cache() on the next call to H5C_protect(). + * size is decreased. The flag triggers a call to + * H5C__make_space_in_cache() on the next call to H5C_protect(). * * resize_in_progress: As the metadata cache has become re-entrant, it is - * possible that a protect may trigger a call to - * H5C__auto_adjust_cache_size(), which may trigger a flush, - * which may trigger a protect, which will result in another - * call to H5C__auto_adjust_cache_size(). + * possible that a protect may trigger a call to + * H5C__auto_adjust_cache_size(), which may trigger a flush, + * which may trigger a protect, which will result in another + * call to H5C__auto_adjust_cache_size(). * - * The resize_in_progress boolean flag is used to detect this, - * and to prevent the infinite recursion that would otherwise - * occur. + * The resize_in_progress boolean flag is used to detect this, + * and to prevent the infinite recursion that would otherwise + * occur. * - * Note that this issue is not hypothetical -- this field - * was added 12/29/15 to fix a bug exposed in the testing - * of changes to the file driver info superblock extension - * management code needed to support rings. + * Note that this issue is not hypothetical -- this field + * was added 12/29/15 to fix a bug exposed in the testing + * of changes to the file driver info superblock extension + * management code needed to support rings. * * msic_in_progress: As the metadata cache has become re-entrant, and as * the free space manager code has become more tightly @@ -4263,62 +4266,62 @@ typedef struct H5C_tag_info_t { * exposed by modifications to test/fheap.c to cause it to * use paged allocation. * - * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration - * data for automatic cache resizing. + * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration + * data for automatic cache resizing. * * epoch_markers_active: Integer field containing the number of epoch - * markers currently in use in the LRU list. This value - * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1]. + * markers currently in use in the LRU list. This value + * must be in the range [0, H5C__MAX_EPOCH_MARKERS - 1]. * * epoch_marker_active: Array of boolean of length H5C__MAX_EPOCH_MARKERS. - * This array is used to track which epoch markers are currently - * in use. + * This array is used to track which epoch markers are currently + * in use. * * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1. * - * To manage the epoch marker cache entries, it is necessary - * to track their order in the LRU list. This is done with - * epoch_marker_ringbuf. When markers are inserted at the - * head of the LRU list, the index of the marker in the - * epoch_markers array is inserted at the tail of the ring - * buffer. When it becomes the epoch_marker_active'th marker - * in the LRU list, it will have worked its way to the head - * of the ring buffer as well. This allows us to remove it - * without scanning the LRU list if such is required. + * To manage the epoch marker cache entries, it is necessary + * to track their order in the LRU list. This is done with + * epoch_marker_ringbuf. When markers are inserted at the + * head of the LRU list, the index of the marker in the + * epoch_markers array is inserted at the tail of the ring + * buffer. When it becomes the epoch_marker_active'th marker + * in the LRU list, it will have worked its way to the head + * of the ring buffer as well. This allows us to remove it + * without scanning the LRU list if such is required. * * epoch_marker_ringbuf_first: Integer field containing the index of the - * first entry in the ring buffer. + * first entry in the ring buffer. * * epoch_marker_ringbuf_last: Integer field containing the index of the - * last entry in the ring buffer. + * last entry in the ring buffer. * * epoch_marker_ringbuf_size: Integer field containing the number of entries - * in the ring buffer. + * in the ring buffer. * * epoch_markers: Array of instances of H5C_cache_entry_t of length - * H5C__MAX_EPOCH_MARKERS. The entries are used as markers - * in the LRU list to identify cache entries that haven't - * been accessed for some (small) specified number of - * epochs. These entries (if any) can then be evicted and - * the cache size reduced -- ideally without evicting any - * of the current working set. Needless to say, the epoch - * length and the number of epochs before an unused entry - * must be chosen so that all, or almost all, the working - * set will be accessed before the limit. - * - * Epoch markers only appear in the LRU list, never in - * the index or slist. While they are of type - * H5C__EPOCH_MARKER_TYPE, and have associated class - * functions, these functions should never be called. - * - * The addr fields of these instances of H5C_cache_entry_t - * are set to the index of the instance in the epoch_markers - * array, the size is set to 0, and the type field points - * to the constant structure epoch_marker_class defined - * in H5C.c. The next and prev fields are used as usual - * to link the entry into the LRU list. - * - * All other fields are unused. + * H5C__MAX_EPOCH_MARKERS. The entries are used as markers + * in the LRU list to identify cache entries that haven't + * been accessed for some (small) specified number of + * epochs. These entries (if any) can then be evicted and + * the cache size reduced -- ideally without evicting any + * of the current working set. Needless to say, the epoch + * length and the number of epochs before an unused entry + * must be chosen so that all, or almost all, the working + * set will be accessed before the limit. + * + * Epoch markers only appear in the LRU list, never in + * the index or slist. While they are of type + * H5C__EPOCH_MARKER_TYPE, and have associated class + * functions, these functions should never be called. + * + * The addr fields of these instances of H5C_cache_entry_t + * are set to the index of the instance in the epoch_markers + * array, the size is set to 0, and the type field points + * to the constant structure epoch_marker_class defined + * in H5C.c. The next and prev fields are used as usual + * to link the entry into the LRU list. + * + * All other fields are unused. * * * Cache hit rate collection fields: @@ -4328,62 +4331,62 @@ typedef struct H5C_tag_info_t { * collection is enabled. The following fields support this capability. * * cache_hits: Number of cache hits since the last time the cache hit - * rate statistics were reset. Note that when automatic cache - * re-sizing is enabled, this field will be reset every automatic - * resize epoch. + * rate statistics were reset. Note that when automatic cache + * re-sizing is enabled, this field will be reset every automatic + * resize epoch. * * cache_accesses: Number of times the cache has been accessed while - * since the last since the last time the cache hit rate statistics - * were reset. Note that when automatic cache re-sizing is enabled, - * this field will be reset every automatic resize epoch. + * since the last since the last time the cache hit rate statistics + * were reset. Note that when automatic cache re-sizing is enabled, + * this field will be reset every automatic resize epoch. * * * Metadata cache image management related fields. * - * image_ctl: Instance of H5C_cache_image_ctl_t containing configuration - * data for generation of a cache image on file close. + * image_ctl: Instance of H5C_cache_image_ctl_t containing configuration + * data for generation of a cache image on file close. * * serialization_in_progress: Boolean field that is set to TRUE iff - * the cache is in the process of being serialized. This - * field is needed to support the H5C_serialization_in_progress() - * call, which is in turn required for sanity checks in some - * cache clients. + * the cache is in the process of being serialized. This + * field is needed to support the H5C_serialization_in_progress() + * call, which is in turn required for sanity checks in some + * cache clients. * - * load_image: Boolean flag indicating that the metadata cache image - * superblock extension message exists and should be - * read, and the image block read and decoded on the next - * call to H5C_protect(). + * load_image: Boolean flag indicating that the metadata cache image + * superblock extension message exists and should be + * read, and the image block read and decoded on the next + * call to H5C_protect(). * * image_loaded: Boolean flag indicating that the metadata cache has * loaded the metadata cache image as directed by the * MDC cache image superblock extension message. * * delete_image: Boolean flag indicating whether the metadata cache image - * superblock message should be deleted and the cache image - * file space freed after they have been read and decoded. + * superblock message should be deleted and the cache image + * file space freed after they have been read and decoded. * - * This flag should be set to TRUE iff the file is opened - * R/W and there is a cache image to be read. + * This flag should be set to TRUE iff the file is opened + * R/W and there is a cache image to be read. * * image_addr: haddr_t containing the base address of the on disk - * metadata cache image, or HADDR_UNDEF if that value is - * undefined. Note that this field is used both in the - * construction and write, and the read and decode of - * metadata cache image blocks. + * metadata cache image, or HADDR_UNDEF if that value is + * undefined. Note that this field is used both in the + * construction and write, and the read and decode of + * metadata cache image blocks. * - * image_len: hsize_t containing the size of the on disk metadata cache - * image, or zero if that value is undefined. Note that this - * field is used both in the construction and write, and the - * read and decode of metadata cache image blocks. + * image_len: hsize_t containing the size of the on disk metadata cache + * image, or zero if that value is undefined. Note that this + * field is used both in the construction and write, and the + * read and decode of metadata cache image blocks. * * image_data_len: size_t containing the number of bytes of data in the - * on disk metadata cache image, or zero if that value is - * undefined. + * on disk metadata cache image, or zero if that value is + * undefined. * - * In most cases, this value is the same as the image_len - * above. It exists to allow for metadata cache image blocks - * that are larger than the actual image. Thus in all - * cases image_data_len <= image_len. + * In most cases, this value is the same as the image_len + * above. It exists to allow for metadata cache image blocks + * that are larger than the actual image. Thus in all + * cases image_data_len <= image_len. * * To create the metadata cache image, we must first serialize all the * entries in the metadata cache. This is done by a scan of the index. @@ -4410,35 +4413,35 @@ typedef struct H5C_tag_info_t { * Note that all these new fields would work just as well as booleans. * * entries_loaded_counter: Number of entries loaded into the cache - * since the last time this field was reset. + * since the last time this field was reset. * * entries_inserted_counter: Number of entries inserted into the cache - * since the last time this field was reset. + * since the last time this field was reset. * * entries relocated_counter: Number of entries whose base address has - * been changed since the last time this field was reset. + * been changed since the last time this field was reset. * * entry_fd_height_change_counter: Number of entries whose flush dependency - * height has changed since the last time this field was reset. + * height has changed since the last time this field was reset. * * The following fields are used assemble the cache image prior to * writing it to disk. * * num_entries_in_image: Unsigned integer field containing the number of entries - * to be copied into the metadata cache image. Note that - * this value will be less than the number of entries in - * the cache, and the superblock and its related entries - * are not written to the metadata cache image. + * to be copied into the metadata cache image. Note that + * this value will be less than the number of entries in + * the cache, and the superblock and its related entries + * are not written to the metadata cache image. * * image_entries: Pointer to a dynamically allocated array of instance of - * H5C_image_entry_t of length num_entries_in_image, or NULL - * if that array does not exist. This array is used to - * assemble entry data to be included in the image, and to - * sort them by flush dependency height and LRU rank. + * H5C_image_entry_t of length num_entries_in_image, or NULL + * if that array does not exist. This array is used to + * assemble entry data to be included in the image, and to + * sort them by flush dependency height and LRU rank. * * image_buffer: Pointer to the dynamically allocated buffer of length - * image_len in which the metadata cache image is assembled, - * or NULL if that buffer does not exist. + * image_len in which the metadata cache image is assembled, + * or NULL if that buffer does not exist. * * * Free Space Manager Related fields: @@ -4460,13 +4463,13 @@ typedef struct H5C_tag_info_t { * flush is complete. * * rdfsm_settled: Boolean flag indicating whether the raw data free space - * manager is settled -- i.e. whether the correct space has - * been allocated for it in the file. + * manager is settled -- i.e. whether the correct space has + * been allocated for it in the file. * - * Note that the name of this field is deceptive. In the - * multi file case, the flag applies to all free space - * managers that are not involved in allocating space for - * free space manager metadata. + * Note that the name of this field is deceptive. In the + * multi file case, the flag applies to all free space + * managers that are not involved in allocating space for + * free space manager metadata. * * mdfsm_settled: Boolean flag indicating whether the meta data free space * manager is settled -- i.e. whether the correct space has @@ -4474,8 +4477,8 @@ typedef struct H5C_tag_info_t { * * Note that the name of this field is deceptive. In the * multi file case, the flag applies only to free space - * managers that are involved in allocating space for free - * space managers. + * managers that are involved in allocating space for free + * space managers. * * * Statistics collection fields: @@ -4485,144 +4488,144 @@ typedef struct H5C_tag_info_t { * is true. * * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been in cache when requested in - * the current epoch. + * are used to record the number of times an entry with type id + * equal to the array index has been in cache when requested in + * the current epoch. * * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has not been in cache when - * requested in the current epoch. + * are used to record the number of times an entry with type id + * equal to the array index has not been in cache when + * requested in the current epoch. * * write_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been write protected - * in the current epoch. + * cells are used to record the number of times an entry with + * type id equal to the array index has been write protected + * in the current epoch. * - * Observe that (hits + misses) = (write_protects + read_protects). + * Observe that (hits + misses) = (write_protects + read_protects). * * read_protects: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been read protected in - * the current epoch. + * cells are used to record the number of times an entry with + * type id equal to the array index has been read protected in + * the current epoch. * * Observe that (hits + misses) = (write_protects + read_protects). * * max_read_protects: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to maximum number of simultaneous read - * protects on any entry with type id equal to the array index - * in the current epoch. + * The cells are used to maximum number of simultaneous read + * protects on any entry with type id equal to the array index + * in the current epoch. * * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been inserted into the - * cache in the current epoch. + * are used to record the number of times an entry with type + * id equal to the array index has been inserted into the + * cache in the current epoch. * * pinned_insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been inserted - * pinned into the cache in the current epoch. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been inserted + * pinned into the cache in the current epoch. * * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times a dirty entry with type - * id equal to the array index has been cleared in the current - * epoch. + * are used to record the number of times a dirty entry with type + * id equal to the array index has been cleared in the current + * epoch. * * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been written to disk in the + * are used to record the number of times an entry with type id + * equal to the array index has been written to disk in the * current epoch. * * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been evicted from the cache in - * the current epoch. + * are used to record the number of times an entry with type id + * equal to the array index has been evicted from the cache in + * the current epoch. * * take_ownerships: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry with - * type id equal to the array index has been removed from the - * cache via the H5C__TAKE_OWNERSHIP_FLAG in the current epoch. + * cells are used to record the number of times an entry with + * type id equal to the array index has been removed from the + * cache via the H5C__TAKE_OWNERSHIP_FLAG in the current epoch. * * moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been moved in the current - * epoch. + * are used to record the number of times an entry with type + * id equal to the array index has been moved in the current + * epoch. * * entry_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been moved - * during its pre-serialize callback in the current epoch. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been moved + * during its pre-serialize callback in the current epoch. * * cache_flush_moves: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has been moved - * during a cache flush in the current epoch. + * The cells are used to record the number of times an entry + * with type id equal to the array index has been moved + * during a cache flush in the current epoch. * * pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been pinned in the current - * epoch. + * are used to record the number of times an entry with type + * id equal to the array index has been pinned in the current + * epoch. * * unpins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been unpinned in the current - * epoch. + * are used to record the number of times an entry with type + * id equal to the array index has been unpinned in the current + * epoch. * - * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been marked dirty while pinned - * in the current epoch. + * dirty_pins: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been marked dirty while pinned + * in the current epoch. * * pinned_flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry - * with type id equal to the array index has been flushed while - * pinned in the current epoch. + * cells are used to record the number of times an entry + * with type id equal to the array index has been flushed while + * pinned in the current epoch. * * pinned_clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. The - * cells are used to record the number of times an entry - * with type id equal to the array index has been cleared while - * pinned in the current epoch. + * cells are used to record the number of times an entry + * with type id equal to the array index has been cleared while + * pinned in the current epoch. * * size_increases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has increased in - * size in the current epoch. + * The cells are used to record the number of times an entry + * with type id equal to the array index has increased in + * size in the current epoch. * * size_decreases: Array of int64 of length H5C__MAX_NUM_TYPE_IDS + 1. - * The cells are used to record the number of times an entry - * with type id equal to the array index has decreased in - * size in the current epoch. + * The cells are used to record the number of times an entry + * with type id equal to the array index has decreased in + * size in the current epoch. * * entry_flush_size_changes: Array of int64 of length - * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record - * the number of times an entry with type id equal to the - * array index has changed size while in its pre-serialize - * callback. + * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record + * the number of times an entry with type id equal to the + * array index has changed size while in its pre-serialize + * callback. * * cache_flush_size_changes: Array of int64 of length - * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record - * the number of times an entry with type id equal to the - * array index has changed size during a cache flush + * H5C__MAX_NUM_TYPE_IDS + 1. The cells are used to record + * the number of times an entry with type id equal to the + * array index has changed size during a cache flush * * total_ht_insertions: Number of times entries have been inserted into the - * hash table in the current epoch. + * hash table in the current epoch. * * total_ht_deletions: Number of times entries have been deleted from the * hash table in the current epoch. * * successful_ht_searches: int64 containing the total number of successful - * searches of the hash table in the current epoch. + * searches of the hash table in the current epoch. * * total_successful_ht_search_depth: int64 containing the total number of - * entries other than the targets examined in successful - * searches of the hash table in the current epoch. + * entries other than the targets examined in successful + * searches of the hash table in the current epoch. * * failed_ht_searches: int64 containing the total number of unsuccessful * searches of the hash table in the current epoch. * * total_failed_ht_search_depth: int64 containing the total number of * entries examined in unsuccessful searches of the hash - * table in the current epoch. + * table in the current epoch. * * max_index_len: Largest value attained by the index_len field in the * current epoch. @@ -4631,10 +4634,10 @@ typedef struct H5C_tag_info_t { * current epoch. * * max_clean_index_size: Largest value attained by the clean_index_size field - * in the current epoch. + * in the current epoch. * * max_dirty_index_size: Largest value attained by the dirty_index_size field - * in the current epoch. + * in the current epoch. * * max_slist_len: Largest value attained by the slist_len field in the * current epoch. @@ -4685,11 +4688,11 @@ typedef struct H5C_tag_info_t { * The following fields track statistics on cache images. * * images_created: Integer field containing the number of cache images - * created since the last time statistics were reset. + * created since the last time statistics were reset. * - * At present, this field must always be either 0 or 1. - * Further, since cache images are only created at file - * close, this field should only be set at that time. + * At present, this field must always be either 0 or 1. + * Further, since cache images are only created at file + * close, this field should only be set at that time. * * images_read: Integer field containing the number of cache images * read from file. Note that reading an image is different @@ -4704,12 +4707,12 @@ typedef struct H5C_tag_info_t { * from process 0. * * images_loaded: Integer field containing the number of cache images - * loaded since the last time statistics were reset. + * loaded since the last time statistics were reset. * - * At present, this field must always be either 0 or 1. - * Further, since cache images are only loaded at the - * time of the first protect or on file close, this value - * should only change on those events. + * At present, this field must always be either 0 or 1. + * Further, since cache images are only loaded at the + * time of the first protect or on file close, this value + * should only change on those events. * * last_image_size: Size of the most recently loaded metadata cache image * loaded into the cache, or zero if no image has been @@ -4725,11 +4728,11 @@ typedef struct H5C_tag_info_t { * of prefetched entries are tracked in the flushes and evictions arrays * discused above. * - * prefetches: Number of prefetched entries that are loaded to the - * cache. + * prefetches: Number of prefetched entries that are loaded to the + * cache. * * dirty_prefetches: Number of dirty prefetched entries that are loaded - * into the cache. + * into the cache. * * prefetch_hits: Number of prefetched entries that are actually used. * @@ -4745,9 +4748,9 @@ typedef struct H5C_tag_info_t { * obtain estimates of how frequently these restarts occur. * * slist_scan_restarts: Number of times a scan of the slist (that contains - * calls to H5C__flush_single_entry()) has been restarted to - * avoid potential issues with change of status of the next - * entry in the scan. + * calls to H5C__flush_single_entry()) has been restarted to + * avoid potential issues with change of status of the next + * entry in the scan. * * LRU_scan_restarts: Number of times a scan of the LRU list (that contains * calls to H5C__flush_single_entry()) has been restarted to @@ -4755,43 +4758,43 @@ typedef struct H5C_tag_info_t { * entry in the scan. * * index_scan_restarts: Number of times a scan of the index has been - * restarted to avoid potential issues with load, insertion - * or change in flush dependency height of an entry other - * than the target entry as the result of call(s) to the - * pre_serialize or serialize callbacks. + * restarted to avoid potential issues with load, insertion + * or change in flush dependency height of an entry other + * than the target entry as the result of call(s) to the + * pre_serialize or serialize callbacks. * - * Note that at present, this condition can only be triggered - * by a call to H5C_serialize_single_entry(). + * Note that at present, this condition can only be triggered + * by a call to H5C_serialize_single_entry(). * * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been - * accessed in the current epoch. + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been + * accessed in the current epoch. * * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the minimum number of times any single - * entry with type id equal to the array index has been - * accessed in the current epoch. + * are used to record the minimum number of times any single + * entry with type id equal to the array index has been + * accessed in the current epoch. * * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been cleared - * in the current epoch. + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been cleared + * in the current epoch. * * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS + 1. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been - * flushed in the current epoch. + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been + * flushed in the current epoch. * - * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells * are used to record the maximum size of any single entry - * with type id equal to the array index that has resided in - * the cache in the current epoch. + * with type id equal to the array index that has resided in + * the cache in the current epoch. * - * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells + * max_pins: Array of size_t of length H5C__MAX_NUM_TYPE_IDS + 1. The cells * are used to record the maximum number of times that any single * entry with type id equal to the array index that has been * marked as pinned in the cache in the current epoch. @@ -4799,9 +4802,9 @@ typedef struct H5C_tag_info_t { * * Fields supporting testing: * - * prefix Array of char used to prefix debugging output. The - * field is intended to allow marking of output of with - * the processes mpi rank. + * prefix Array of char used to prefix debugging output. The + * field is intended to allow marking of output of with + * the processes mpi rank. * * get_entry_ptr_from_addr_counter: Counter used to track the number of * times the H5C_get_entry_ptr_from_addr() function has been @@ -4811,147 +4814,147 @@ typedef struct H5C_tag_info_t { ****************************************************************************/ struct H5C_t { - uint32_t magic; - hbool_t flush_in_progress; + uint32_t magic; + hbool_t flush_in_progress; H5C_log_info_t *log_info; - void * aux_ptr; - int32_t max_type_id; + void * aux_ptr; + int32_t max_type_id; const H5C_class_t * const *class_table_ptr; size_t max_cache_size; size_t min_clean_size; - H5C_write_permitted_func_t check_write_permitted; - hbool_t write_permitted; - H5C_log_flush_func_t log_flush; - hbool_t evictions_enabled; - hbool_t close_warning_received; + H5C_write_permitted_func_t check_write_permitted; + hbool_t write_permitted; + H5C_log_flush_func_t log_flush; + hbool_t evictions_enabled; + hbool_t close_warning_received; /* Fields for maintaining the [hash table] index of entries */ uint32_t index_len; size_t index_size; - uint32_t index_ring_len[H5C_RING_NTYPES]; - size_t index_ring_size[H5C_RING_NTYPES]; - size_t clean_index_size; - size_t clean_index_ring_size[H5C_RING_NTYPES]; - size_t dirty_index_size; - size_t dirty_index_ring_size[H5C_RING_NTYPES]; - H5C_cache_entry_t * index[H5C__HASH_TABLE_LEN]; + uint32_t index_ring_len[H5C_RING_NTYPES]; + size_t index_ring_size[H5C_RING_NTYPES]; + size_t clean_index_size; + size_t clean_index_ring_size[H5C_RING_NTYPES]; + size_t dirty_index_size; + size_t dirty_index_ring_size[H5C_RING_NTYPES]; + H5C_cache_entry_t * index[H5C__HASH_TABLE_LEN]; uint32_t il_len; size_t il_size; - H5C_cache_entry_t * il_head; - H5C_cache_entry_t * il_tail; + H5C_cache_entry_t * il_head; + H5C_cache_entry_t * il_tail; /* Fields to detect entries removed during scans */ - int64_t entries_removed_counter; - H5C_cache_entry_t * last_entry_removed_ptr; - H5C_cache_entry_t * entry_watched_for_removal; + int64_t entries_removed_counter; + H5C_cache_entry_t * last_entry_removed_ptr; + H5C_cache_entry_t * entry_watched_for_removal; /* Fields for maintaining list of in-order entries, for flushing */ hbool_t slist_enabled; - hbool_t slist_changed; + hbool_t slist_changed; uint32_t slist_len; size_t slist_size; - uint32_t slist_ring_len[H5C_RING_NTYPES]; - size_t slist_ring_size[H5C_RING_NTYPES]; + uint32_t slist_ring_len[H5C_RING_NTYPES]; + size_t slist_ring_size[H5C_RING_NTYPES]; H5SL_t * slist_ptr; uint32_t num_last_entries; #if H5C_DO_SANITY_CHECKS - int32_t slist_len_increase; - int64_t slist_size_increase; + int32_t slist_len_increase; + int64_t slist_size_increase; #endif /* H5C_DO_SANITY_CHECKS */ /* Fields for maintaining list of tagged entries */ H5SL_t * tag_list; hbool_t ignore_tags; - uint32_t num_objs_corked; + uint32_t num_objs_corked; /* Fields for tracking protected entries */ uint32_t pl_len; size_t pl_size; - H5C_cache_entry_t * pl_head_ptr; - H5C_cache_entry_t * pl_tail_ptr; + H5C_cache_entry_t * pl_head_ptr; + H5C_cache_entry_t * pl_tail_ptr; /* Fields for tracking pinned entries */ uint32_t pel_len; size_t pel_size; - H5C_cache_entry_t * pel_head_ptr; - H5C_cache_entry_t * pel_tail_ptr; + H5C_cache_entry_t * pel_head_ptr; + H5C_cache_entry_t * pel_tail_ptr; /* Fields for complete LRU list of entries */ uint32_t LRU_list_len; size_t LRU_list_size; - H5C_cache_entry_t * LRU_head_ptr; - H5C_cache_entry_t * LRU_tail_ptr; + H5C_cache_entry_t * LRU_head_ptr; + H5C_cache_entry_t * LRU_tail_ptr; #if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS /* Fields for clean LRU list of entries */ uint32_t cLRU_list_len; size_t cLRU_list_size; - H5C_cache_entry_t * cLRU_head_ptr; - H5C_cache_entry_t * cLRU_tail_ptr; + H5C_cache_entry_t * cLRU_head_ptr; + H5C_cache_entry_t * cLRU_tail_ptr; /* Fields for dirty LRU list of entries */ uint32_t dLRU_list_len; size_t dLRU_list_size; - H5C_cache_entry_t * dLRU_head_ptr; - H5C_cache_entry_t * dLRU_tail_ptr; + H5C_cache_entry_t * dLRU_head_ptr; + H5C_cache_entry_t * dLRU_tail_ptr; #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ #ifdef H5_HAVE_PARALLEL /* Fields for collective metadata reads */ uint32_t coll_list_len; size_t coll_list_size; - H5C_cache_entry_t * coll_head_ptr; - H5C_cache_entry_t * coll_tail_ptr; + H5C_cache_entry_t * coll_head_ptr; + H5C_cache_entry_t * coll_tail_ptr; /* Fields for collective metadata writes */ H5SL_t * coll_write_list; #endif /* H5_HAVE_PARALLEL */ /* Fields for automatic cache size adjustment */ - hbool_t size_increase_possible; - hbool_t flash_size_increase_possible; - size_t flash_size_increase_threshold; - hbool_t size_decrease_possible; - hbool_t resize_enabled; - hbool_t cache_full; - hbool_t size_decreased; - hbool_t resize_in_progress; - hbool_t msic_in_progress; - H5C_auto_size_ctl_t resize_ctl; + hbool_t size_increase_possible; + hbool_t flash_size_increase_possible; + size_t flash_size_increase_threshold; + hbool_t size_decrease_possible; + hbool_t resize_enabled; + hbool_t cache_full; + hbool_t size_decreased; + hbool_t resize_in_progress; + hbool_t msic_in_progress; + H5C_auto_size_ctl_t resize_ctl; /* Fields for epoch markers used in automatic cache size adjustment */ - int32_t epoch_markers_active; - hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS]; - int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1]; - int32_t epoch_marker_ringbuf_first; - int32_t epoch_marker_ringbuf_last; - int32_t epoch_marker_ringbuf_size; - H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS]; + int32_t epoch_markers_active; + hbool_t epoch_marker_active[H5C__MAX_EPOCH_MARKERS]; + int32_t epoch_marker_ringbuf[H5C__MAX_EPOCH_MARKERS+1]; + int32_t epoch_marker_ringbuf_first; + int32_t epoch_marker_ringbuf_last; + int32_t epoch_marker_ringbuf_size; + H5C_cache_entry_t epoch_markers[H5C__MAX_EPOCH_MARKERS]; /* Fields for cache hit rate collection */ - int64_t cache_hits; - int64_t cache_accesses; + int64_t cache_hits; + int64_t cache_accesses; /* fields supporting generation of a cache image on file close */ - H5C_cache_image_ctl_t image_ctl; - hbool_t serialization_in_progress; - hbool_t load_image; + H5C_cache_image_ctl_t image_ctl; + hbool_t serialization_in_progress; + hbool_t load_image; hbool_t image_loaded; - hbool_t delete_image; - haddr_t image_addr; - hsize_t image_len; - hsize_t image_data_len; - int64_t entries_loaded_counter; - int64_t entries_inserted_counter; - int64_t entries_relocated_counter; - int64_t entry_fd_height_change_counter; - uint32_t num_entries_in_image; - H5C_image_entry_t * image_entries; + hbool_t delete_image; + haddr_t image_addr; + hsize_t image_len; + hsize_t image_data_len; + int64_t entries_loaded_counter; + int64_t entries_inserted_counter; + int64_t entries_relocated_counter; + int64_t entry_fd_height_change_counter; + uint32_t num_entries_in_image; + H5C_image_entry_t * image_entries; void * image_buffer; /* Free Space Manager Related fields */ - hbool_t rdfsm_settled; - hbool_t mdfsm_settled; + hbool_t rdfsm_settled; + hbool_t mdfsm_settled; #if H5C_COLLECT_CACHE_STATS /* stats fields */ @@ -4980,12 +4983,12 @@ struct H5C_t { int64_t cache_flush_size_changes[H5C__MAX_NUM_TYPE_IDS + 1]; /* Fields for hash table operations */ - int64_t total_ht_insertions; - int64_t total_ht_deletions; - int64_t successful_ht_searches; - int64_t total_successful_ht_search_depth; - int64_t failed_ht_searches; - int64_t total_failed_ht_search_depth; + int64_t total_ht_insertions; + int64_t total_ht_deletions; + int64_t successful_ht_searches; + int64_t total_successful_ht_search_depth; + int64_t failed_ht_searches; + int64_t total_failed_ht_search_depth; uint32_t max_index_len; size_t max_index_size; size_t max_clean_index_size; @@ -5014,20 +5017,20 @@ struct H5C_t { int64_t entries_scanned_to_make_space; /* Fields for tracking skip list scan restarts */ - int64_t slist_scan_restarts; - int64_t LRU_scan_restarts; - int64_t index_scan_restarts; + int64_t slist_scan_restarts; + int64_t LRU_scan_restarts; + int64_t index_scan_restarts; /* Fields for tracking cache image operations */ - int32_t images_created; - int32_t images_read; - int32_t images_loaded; - hsize_t last_image_size; + int32_t images_created; + int32_t images_read; + int32_t images_loaded; + hsize_t last_image_size; /* Fields for tracking prefetched entries */ - int64_t prefetches; - int64_t dirty_prefetches; - int64_t prefetch_hits; + int64_t prefetches; + int64_t dirty_prefetches; + int64_t prefetch_hits; #if H5C_COLLECT_CACHE_ENTRY_STATS int32_t max_accesses[H5C__MAX_NUM_TYPE_IDS + 1]; @@ -5039,7 +5042,7 @@ struct H5C_t { #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ #endif /* H5C_COLLECT_CACHE_STATS */ - char prefix[H5C__PREFIX_LEN]; + char prefix[H5C__PREFIX_LEN]; #ifndef NDEBUG int64_t get_entry_ptr_from_addr_counter; @@ -5090,4 +5093,5 @@ H5_DLL herr_t H5C__verify_cork_tag_test(hid_t fid, haddr_t tag, hbool_t status); #endif /* H5C_TESTING */ #endif /* _H5Cpkg_H */ +/* clang-format on */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 6411375..47e0dc7 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -13,14 +13,12 @@ /*------------------------------------------------------------------------- * - * Created: H5Cprivate.h - * 6/3/04 - * John Mainzer + * Created: H5Cprivate.h + * 6/3/04 + * John Mainzer * - * Purpose: Constants and typedefs available to the rest of the - * library. - * - * Modifications: + * Purpose: Constants and typedefs available to the rest of the + * library. * *------------------------------------------------------------------------- */ @@ -28,11 +26,11 @@ #ifndef _H5Cprivate_H #define _H5Cprivate_H -#include "H5Cpublic.h" /* public prototypes */ +#include "H5Cpublic.h" /* public prototypes */ /* Private headers needed by this header */ -#include "H5private.h" /* Generic Functions */ -#include "H5Fprivate.h" /* File access */ +#include "H5private.h" /* Generic Functions */ +#include "H5Fprivate.h" /* File access */ /**************************/ /* Library Private Macros */ @@ -46,9 +44,9 @@ * or decrease it if appropriate. Its purposes is to detect corrupt * object sizes, so it probably doesn't matter if it is a bit big. * - * JRM - 5/17/04 + * JRM - 5/17/04 */ -#define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024)) +#define H5C_MAX_ENTRY_SIZE ((size_t)(32 * 1024 * 1024)) #ifdef H5_HAVE_PARALLEL /* we must maintain the clean and dirty LRU lists when we are compiled @@ -71,9 +69,9 @@ #define H5C__CLASS_SKIP_WRITES ((unsigned)0x4) /* Flags for pre-serialize callback */ -#define H5C__SERIALIZE_NO_FLAGS_SET ((unsigned)0) -#define H5C__SERIALIZE_RESIZED_FLAG ((unsigned)0x1) -#define H5C__SERIALIZE_MOVED_FLAG ((unsigned)0x2) +#define H5C__SERIALIZE_NO_FLAGS_SET ((unsigned)0) +#define H5C__SERIALIZE_RESIZED_FLAG ((unsigned)0x1) +#define H5C__SERIALIZE_MOVED_FLAG ((unsigned)0x2) /* Upper and lower limits on cache size. These limits are picked * out of a hat -- you should be able to change them as necessary. @@ -83,8 +81,8 @@ * upper bound on cache size is rather large for the current hash table * size. */ -#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024)) -#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024)) +#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024)) +#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024)) /* Default max cache size and min clean size are give here to make * them generally accessible. @@ -93,14 +91,15 @@ #define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024)) /* Values for cache entry magic field */ -#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A -#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef +#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A +#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef /* Cache configuration validation definitions */ #define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1 #define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2 #define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4 #define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8 +/* clang-format off */ #define H5C_RESIZE_CFG__VALIDATE_ALL \ ( \ H5C_RESIZE_CFG__VALIDATE_GENERAL | \ @@ -108,30 +107,31 @@ H5C_RESIZE_CFG__VALIDATE_DECREMENT | \ H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \ ) +/* clang-format on */ /* Cache configuration versions */ -#define H5C__CURR_AUTO_SIZE_CTL_VER 1 -#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1 -#define H5C__CURR_CACHE_IMAGE_CTL_VER 1 +#define H5C__CURR_AUTO_SIZE_CTL_VER 1 +#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1 +#define H5C__CURR_CACHE_IMAGE_CTL_VER 1 /* Default configuration settings */ -#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f -#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f -#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024)) -#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024)) -#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024)) -#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f -#define H5C__DEF_AR_INCREMENT 2.0f -#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024)) +#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f +#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f +#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024)) +#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024)) +#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024)) +#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f +#define H5C__DEF_AR_INCREMENT 2.0f +#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024)) #define H5C__DEF_AR_FLASH_MULTIPLE 1.0f #define H5C__DEV_AR_FLASH_THRESHOLD 0.25f -#define H5C__DEF_AR_DECREMENT 0.9f -#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024)) -#define H5C__DEF_AR_EPCHS_B4_EVICT 3 -#define H5C__DEF_AR_EMPTY_RESERVE 0.05f -#define H5C__MIN_AR_EPOCH_LENGTH 100 -#define H5C__DEF_AR_EPOCH_LENGTH 50000 -#define H5C__MAX_AR_EPOCH_LENGTH 1000000 +#define H5C__DEF_AR_DECREMENT 0.9f +#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024)) +#define H5C__DEF_AR_EPCHS_B4_EVICT 3 +#define H5C__DEF_AR_EMPTY_RESERVE 0.05f +#define H5C__MIN_AR_EPOCH_LENGTH 100 +#define H5C__DEF_AR_EPOCH_LENGTH 50000 +#define H5C__MAX_AR_EPOCH_LENGTH 1000000 /* #defines of flags used in the flags parameters in some of the * following function calls. Note that not all flags are applicable @@ -139,67 +139,67 @@ * function are ignored in that function. * * These flags apply to all function calls: - * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls) + * H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls) * * * These flags apply to H5C_insert_entry(): - * H5C__SET_FLUSH_MARKER_FLAG - * H5C__PIN_ENTRY_FLAG - * H5C__FLUSH_LAST_FLAG ; super block only - * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only + * H5C__SET_FLUSH_MARKER_FLAG + * H5C__PIN_ENTRY_FLAG + * H5C__FLUSH_LAST_FLAG ; super block only + * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_protect() - * H5C__READ_ONLY_FLAG - * H5C__FLUSH_LAST_FLAG ; super block only - * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only + * H5C__READ_ONLY_FLAG + * H5C__FLUSH_LAST_FLAG ; super block only + * H5C__FLUSH_COLLECTIVELY_FLAG ; super block only * * These flags apply to H5C_unprotect(): - * H5C__SET_FLUSH_MARKER_FLAG - * H5C__DELETED_FLAG - * H5C__DIRTIED_FLAG - * H5C__PIN_ENTRY_FLAG - * H5C__UNPIN_ENTRY_FLAG - * H5C__FREE_FILE_SPACE_FLAG - * H5C__TAKE_OWNERSHIP_FLAG + * H5C__SET_FLUSH_MARKER_FLAG + * H5C__DELETED_FLAG + * H5C__DIRTIED_FLAG + * H5C__PIN_ENTRY_FLAG + * H5C__UNPIN_ENTRY_FLAG + * H5C__FREE_FILE_SPACE_FLAG + * H5C__TAKE_OWNERSHIP_FLAG * * These flags apply to H5C_expunge_entry(): - * H5C__FREE_FILE_SPACE_FLAG + * H5C__FREE_FILE_SPACE_FLAG * * These flags apply to H5C_evict(): - * H5C__EVICT_ALLOW_LAST_PINS_FLAG + * H5C__EVICT_ALLOW_LAST_PINS_FLAG * * These flags apply to H5C_flush_cache(): - * H5C__FLUSH_INVALIDATE_FLAG - * H5C__FLUSH_CLEAR_ONLY_FLAG - * H5C__FLUSH_MARKED_ENTRIES_FLAG - * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination - * with H5C__FLUSH_INVALIDATE_FLAG) - * H5C__DURING_FLUSH_FLAG + * H5C__FLUSH_INVALIDATE_FLAG + * H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__FLUSH_MARKED_ENTRIES_FLAG + * H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination + * with H5C__FLUSH_INVALIDATE_FLAG) + * H5C__DURING_FLUSH_FLAG * * These flags apply to H5C_flush_single_entry(): - * H5C__FLUSH_INVALIDATE_FLAG - * H5C__FLUSH_CLEAR_ONLY_FLAG - * H5C__FLUSH_MARKED_ENTRIES_FLAG - * H5C__TAKE_OWNERSHIP_FLAG - * H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG - * H5C__GENERATE_IMAGE_FLAG - * H5C__UPDATE_PAGE_BUFFER_FLAG + * H5C__FLUSH_INVALIDATE_FLAG + * H5C__FLUSH_CLEAR_ONLY_FLAG + * H5C__FLUSH_MARKED_ENTRIES_FLAG + * H5C__TAKE_OWNERSHIP_FLAG + * H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG + * H5C__GENERATE_IMAGE_FLAG + * H5C__UPDATE_PAGE_BUFFER_FLAG */ -#define H5C__NO_FLAGS_SET 0x00000 -#define H5C__SET_FLUSH_MARKER_FLAG 0x00001 -#define H5C__DELETED_FLAG 0x00002 -#define H5C__DIRTIED_FLAG 0x00004 -#define H5C__PIN_ENTRY_FLAG 0x00008 -#define H5C__UNPIN_ENTRY_FLAG 0x00010 -#define H5C__FLUSH_INVALIDATE_FLAG 0x00020 -#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x00040 -#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x00080 -#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x00100 -#define H5C__READ_ONLY_FLAG 0x00200 -#define H5C__FREE_FILE_SPACE_FLAG 0x00400 -#define H5C__TAKE_OWNERSHIP_FLAG 0x00800 -#define H5C__FLUSH_LAST_FLAG 0x01000 -#define H5C__FLUSH_COLLECTIVELY_FLAG 0x02000 +#define H5C__NO_FLAGS_SET 0x00000 +#define H5C__SET_FLUSH_MARKER_FLAG 0x00001 +#define H5C__DELETED_FLAG 0x00002 +#define H5C__DIRTIED_FLAG 0x00004 +#define H5C__PIN_ENTRY_FLAG 0x00008 +#define H5C__UNPIN_ENTRY_FLAG 0x00010 +#define H5C__FLUSH_INVALIDATE_FLAG 0x00020 +#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x00040 +#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x00080 +#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x00100 +#define H5C__READ_ONLY_FLAG 0x00200 +#define H5C__FREE_FILE_SPACE_FLAG 0x00400 +#define H5C__TAKE_OWNERSHIP_FLAG 0x00800 +#define H5C__FLUSH_LAST_FLAG 0x01000 +#define H5C__FLUSH_COLLECTIVELY_FLAG 0x02000 #define H5C__EVICT_ALLOW_LAST_PINS_FLAG 0x04000 #define H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG 0x08000 #define H5C__DURING_FLUSH_FLAG 0x10000 /* Set when the entire cache is being flushed */ @@ -208,18 +208,18 @@ /* Debugging/sanity checking/statistics settings */ #ifndef NDEBUG -#define H5C_DO_SANITY_CHECKS 1 -#define H5C_DO_SLIST_SANITY_CHECKS 0 -#define H5C_DO_TAGGING_SANITY_CHECKS 1 -#define H5C_DO_EXTREME_SANITY_CHECKS 0 +#define H5C_DO_SANITY_CHECKS 1 +#define H5C_DO_SLIST_SANITY_CHECKS 0 +#define H5C_DO_TAGGING_SANITY_CHECKS 1 +#define H5C_DO_EXTREME_SANITY_CHECKS 0 #else /* NDEBUG */ /* With rare execptions, the following defines should be set * to 0 if NDEBUG is defined */ -#define H5C_DO_SANITY_CHECKS 0 -#define H5C_DO_SLIST_SANITY_CHECKS 0 -#define H5C_DO_TAGGING_SANITY_CHECKS 0 -#define H5C_DO_EXTREME_SANITY_CHECKS 0 +#define H5C_DO_SANITY_CHECKS 0 +#define H5C_DO_SLIST_SANITY_CHECKS 0 +#define H5C_DO_TAGGING_SANITY_CHECKS 0 +#define H5C_DO_EXTREME_SANITY_CHECKS 0 #endif /* NDEBUG */ /* Cork actions: cork/uncork/get cork status of an object */ @@ -235,7 +235,7 @@ * routines that the fractal heap direct block (and global heap) serialize * calls can use when resizing (and re-allocating) their image in the * cache. -QAK */ -#define H5C_DO_MEMORY_SANITY_CHECKS 0 +#define H5C_DO_MEMORY_SANITY_CHECKS 0 /* H5C_COLLECT_CACHE_STATS controls overall collection of statistics * on cache activity. In general, this #define should be set to 1 in @@ -243,9 +243,9 @@ */ #ifndef NDEBUG -#define H5C_COLLECT_CACHE_STATS 1 +#define H5C_COLLECT_CACHE_STATS 1 #else /* NDEBUG */ -#define H5C_COLLECT_CACHE_STATS 0 +#define H5C_COLLECT_CACHE_STATS 0 #endif /* NDEBUG */ /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics @@ -255,9 +255,9 @@ * H5C_COLLECT_CACHE_STATS is also defined to true. */ #if H5C_COLLECT_CACHE_STATS -#define H5C_COLLECT_CACHE_ENTRY_STATS 1 +#define H5C_COLLECT_CACHE_ENTRY_STATS 1 #else -#define H5C_COLLECT_CACHE_ENTRY_STATS 0 +#define H5C_COLLECT_CACHE_ENTRY_STATS 0 #endif /* H5C_COLLECT_CACHE_STATS */ @@ -276,204 +276,204 @@ typedef struct H5C_t H5C_t; * used by the metadata cache for each class of metadata cache entry. * The fields of the structure are discussed below: * - * id: Integer field containing the unique ID of the class of metadata - * cache entries. + * id: Integer field containing the unique ID of the class of metadata + * cache entries. * * name: Pointer to a string containing the name of the class of metadata - * cache entries. + * cache entries. * * mem_type: Instance of H5FD_mem_t, that is used to supply the - * mem type passed into H5F_block_read(). + * mem type passed into H5F_block_read(). * * flags: Flags indicating class-specific behavior. * - * Possible flags are: + * Possible flags are: * - * H5C__CLASS_NO_FLAGS_SET: No special processing. + * H5C__CLASS_NO_FLAGS_SET: No special processing. * - * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag is used only in + * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag is used only in * H5C_load_entry(). When it is set, entries are - * permitted to change their sizes on the first attempt - * to load. - * - * If the new size is larger than the old, the read buffer - * is reallocated to the new size, loaded from file, and the - * deserialize routine is called a second time on the - * new buffer. The entry returned by the first call to - * the deserialize routine is discarded (via the free_icr - * call) after the new size is retrieved (via the image_len - * call). Note that the new size is used as the size of the - * entry in the cache. - * - * If the new size is smaller than the old, no new loads - * or deserializes are performed, but the new size becomes - * the size of the entry in the cache. - * - * When this flag is set, an attempt to read past the - * end of file could occur. In this case, if the size - * returned get_load_size callback would result in a - * read past the end of file, the size is truncated to - * avoid this, and processing proceeds as normal. + * permitted to change their sizes on the first attempt + * to load. + * + * If the new size is larger than the old, the read buffer + * is reallocated to the new size, loaded from file, and the + * deserialize routine is called a second time on the + * new buffer. The entry returned by the first call to + * the deserialize routine is discarded (via the free_icr + * call) after the new size is retrieved (via the image_len + * call). Note that the new size is used as the size of the + * entry in the cache. + * + * If the new size is smaller than the old, no new loads + * or deserializes are performed, but the new size becomes + * the size of the entry in the cache. + * + * When this flag is set, an attempt to read past the + * end of file could occur. In this case, if the size + * returned get_load_size callback would result in a + * read past the end of file, the size is truncated to + * avoid this, and processing proceeds as normal. * * The following flags may only appear in test code. * - * H5C__CLASS_SKIP_READS: This flags is intended only for use in test - * code. When it is set, reads on load will be skipped, - * and an uninitialize buffer will be passed to the - * deserialize function. + * H5C__CLASS_SKIP_READS: This flags is intended only for use in test + * code. When it is set, reads on load will be skipped, + * and an uninitialize buffer will be passed to the + * deserialize function. * - * H5C__CLASS_SKIP_WRITES: This flags is intended only for use in test - * code. When it is set, writes of buffers prepared by the - * serialize callback will be skipped. + * H5C__CLASS_SKIP_WRITES: This flags is intended only for use in test + * code. When it is set, writes of buffers prepared by the + * serialize callback will be skipped. * * GET_INITIAL_LOAD_SIZE: Pointer to the 'get initial load size' function. * - * This function determines the size based on the information in the - * parameter "udata" or an initial speculative guess. The size is - * returned in the parameter "image_len_ptr". + * This function determines the size based on the information in the + * parameter "udata" or an initial speculative guess. The size is + * returned in the parameter "image_len_ptr". * - * For an entry with H5C__CLASS_NO_FLAGS_SET: - * This function returns in "image_len_ptr" the on disk size of the + * For an entry with H5C__CLASS_NO_FLAGS_SET: + * This function returns in "image_len_ptr" the on disk size of the * entry. * - * For an entry with H5C__CLASS_SPECULATIVE_LOAD_FLAG: - * This function returns in "image_len_ptr" an initial guess of the + * For an entry with H5C__CLASS_SPECULATIVE_LOAD_FLAG: + * This function returns in "image_len_ptr" an initial guess of the * entry's on disk size. This many bytes will be loaded from * the file and then passed to 'get_final_load_size' callback * for the actual (final) image length to be determined. * - * The typedef for the get_initial_load_size callback is as follows: + * The typedef for the get_initial_load_size callback is as follows: * - * typedef herr_t (*H5C_get_initial_load_size_func_t)(void *udata_ptr, - * size_t *image_len_ptr); + * typedef herr_t (*H5C_get_initial_load_size_func_t)(void *udata_ptr, + * size_t *image_len_ptr); * - * The parameters of the get_initial_load_size callback are as follows: + * The parameters of the get_initial_load_size callback are as follows: * - * udata_ptr: Pointer to user data provided in the protect call, which - * will also be passed through to the 'get_final_load_size', + * udata_ptr: Pointer to user data provided in the protect call, which + * will also be passed through to the 'get_final_load_size', * 'verify_chksum', and 'deserialize' callbacks. * - * image_len_ptr: Pointer to the length in bytes of the in-file image to + * image_len_ptr: Pointer to the length in bytes of the in-file image to * be deserialized is to be returned. * * This value is used by the cache to determine the size of * the disk image for the metadata, in order to read the disk * image from the file. * - * Processing in the get_load_size function should proceed as follows: + * Processing in the get_load_size function should proceed as follows: * - * If successful, the function will place the length in the *image_len_ptr + * If successful, the function will place the length in the *image_len_ptr * associated with supplied user data and then return SUCCEED. * - * On failure, the function must return FAIL and push error information - * onto the error stack with the error API routines, without modifying + * On failure, the function must return FAIL and push error information + * onto the error stack with the error API routines, without modifying * the value pointed to by image_len_ptr. * * * GET_FINAL_LOAD_SIZE: Pointer to the 'get final load size' function. * - * This function determines the final size of a speculatively loaded + * This function determines the final size of a speculatively loaded * metadata cache entry based on the parameter "image" and the "udata" * parameters. This callback _must_ be implemented for cache clients * which set the H5C__CLASS_SPECULATIVE_LOAD_FLAG and must return the * actual length of on-disk image after being called once. * - * This function might deserialize the needed metadata information to - * determine the actual size. The size is returned in the parameter + * This function might deserialize the needed metadata information to + * determine the actual size. The size is returned in the parameter * "actual_len_ptr". * - * The typedef for the get_load_size callback is as follows: + * The typedef for the get_load_size callback is as follows: * - * typedef herr_t (*H5C_get_final_load_size_func_t)(const void *image_ptr, - * size_t image_len, - * void *udata_ptr, - * size_t *actual_len_ptr); + * typedef herr_t (*H5C_get_final_load_size_func_t)(const void *image_ptr, + * size_t image_len, + * void *udata_ptr, + * size_t *actual_len_ptr); * - * The parameters of the get_load_size callback are as follows: + * The parameters of the get_load_size callback are as follows: * - * image_ptr: Pointer to a buffer containing the (possibly partial) + * image_ptr: Pointer to a buffer containing the (possibly partial) * metadata read in. * - * image_len: The length in bytes of the (possibly partial) in-file image + * image_len: The length in bytes of the (possibly partial) in-file image * to be queried for an actual length. * - * udata_ptr: Pointer to user data provided in the protect call, which - * will also be passed through to the 'verify_chksum' and + * udata_ptr: Pointer to user data provided in the protect call, which + * will also be passed through to the 'verify_chksum' and * 'deserialize' callbacks. * - * actual_len_ptr: Pointer to the location containing the actual length - * of the metadata entry on disk. + * actual_len_ptr: Pointer to the location containing the actual length + * of the metadata entry on disk. * - * Processing in the get_final_load_size function should proceed as follows: + * Processing in the get_final_load_size function should proceed as follows: * - * If successful, the function will place the length in the *actual_len_ptr + * If successful, the function will place the length in the *actual_len_ptr * associated with supplied image and/or user data and then return SUCCEED. * - * On failure, the function must return FAIL and push error information - * onto the error stack with the error API routines, without modifying + * On failure, the function must return FAIL and push error information + * onto the error stack with the error API routines, without modifying * the value pointed to by actual_len_ptr. * * * VERIFY_CHKSUM: Pointer to the verify_chksum function. * - * This function verifies the checksum computed for the metadata is - * the same as the checksum stored in the metadata. + * This function verifies the checksum computed for the metadata is + * the same as the checksum stored in the metadata. * - * It computes the checksum based on the metadata stored in the - * parameter "image_ptr" and the actual length of the metadata in the - * parameter "len" which is obtained from the "get_load_size" callback. + * It computes the checksum based on the metadata stored in the + * parameter "image_ptr" and the actual length of the metadata in the + * parameter "len" which is obtained from the "get_load_size" callback. * - * The typedef for the verify_chksum callback is as follows: + * The typedef for the verify_chksum callback is as follows: * - * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, - * size_t len, - * void *udata_ptr); + * typedef htri_t (*H5C_verify_chksum_func_t)(const void *image_ptr, + * size_t len, + * void *udata_ptr); * - * The parameters of the verify_chksum callback are as follows: + * The parameters of the verify_chksum callback are as follows: * - * image_ptr: Pointer to a buffer containing the metadata read in. + * image_ptr: Pointer to a buffer containing the metadata read in. * - * len: The actual length of the metadata. + * len: The actual length of the metadata. * - * udata_ptr: Pointer to user data. + * udata_ptr: Pointer to user data. * * * DESERIALIZE: Pointer to the deserialize function. * - * This function must be able to deserialize a buffer containing the + * This function must be able to deserialize a buffer containing the * on-disk image of a metadata cache entry, allocate and initialize the * equivalent in core representation, and return a pointer to that * representation. * - * The typedef for the deserialize callback is as follows: + * The typedef for the deserialize callback is as follows: * - * typedef void *(*H5C_deserialize_func_t)(const void * image_ptr, - * size_t len, + * typedef void *(*H5C_deserialize_func_t)(const void * image_ptr, + * size_t len, * void * udata_ptr, * boolean * dirty_ptr); * - * The parameters of the deserialize callback are as follows: + * The parameters of the deserialize callback are as follows: * - * image_ptr: Pointer to a buffer of length len containing the - * contents of the file starting at addr and continuing - * for len bytes. + * image_ptr: Pointer to a buffer of length len containing the + * contents of the file starting at addr and continuing + * for len bytes. * - * len: Length in bytes of the in file image to be deserialized. + * len: Length in bytes of the in file image to be deserialized. * * This parameter is supplied mainly for sanity checking. * Sanity checks should be performed when compiled in debug * mode, but the parameter may be unused when compiled in * production mode. * - * udata_ptr: Pointer to user data provided in the protect call, which - * must be passed through to the deserialize callback. + * udata_ptr: Pointer to user data provided in the protect call, which + * must be passed through to the deserialize callback. * * dirty_ptr: Pointer to boolean which the deserialize function - * must use to mark the entry dirty if it has to modify - * the entry to clean up file corruption left over from - * an old bug in the HDF5 library. + * must use to mark the entry dirty if it has to modify + * the entry to clean up file corruption left over from + * an old bug in the HDF5 library. * - * Processing in the deserialize function should proceed as follows: + * Processing in the deserialize function should proceed as follows: * * If the image contains valid data, and is of the correct length, * the deserialize function must allocate space for an in-core @@ -501,7 +501,7 @@ typedef struct H5C_t H5C_t; * * IMAGE_LEN: Pointer to the image length callback. * - * The image_len callback is used to obtain the size of newly inserted + * The image_len callback is used to obtain the size of newly inserted * entries and assert verification. * * The typedef for the image_len callback is as follows: @@ -509,58 +509,58 @@ typedef struct H5C_t H5C_t; * typedef herr_t (*H5C_image_len_func_t)(void *thing, * size_t *image_len_ptr); * - * The parameters of the image_len callback are as follows: + * The parameters of the image_len callback are as follows: * - * thing: Pointer to the in core representation of the entry. + * thing: Pointer to the in core representation of the entry. * - * image_len_ptr: Pointer to size_t in which the callback will return - * the length (in bytes) of the cache entry. + * image_len_ptr: Pointer to size_t in which the callback will return + * the length (in bytes) of the cache entry. * - * Processing in the image_len function should proceed as follows: + * Processing in the image_len function should proceed as follows: * - * If successful, the function will place the length of the on disk - * image associated with the in core representation provided in the - * thing parameter in *image_len_ptr, and then return SUCCEED. + * If successful, the function will place the length of the on disk + * image associated with the in core representation provided in the + * thing parameter in *image_len_ptr, and then return SUCCEED. * - * If the function fails, it must return FAIL and push error information + * If the function fails, it must return FAIL and push error information * onto the error stack with the error API routines, and return without * modifying the values pointed to by the image_len_ptr parameter. * * * PRE_SERIALIZE: Pointer to the pre-serialize callback. * - * The pre-serialize callback is invoked by the metadata cache before - * it needs a current on-disk image of the metadata entry for purposes - * either constructing a journal or flushing the entry to disk. - * - * If the client needs to change the address or length of the entry prior - * to flush, the pre-serialize callback is responsible for these actions, - * so that the actual serialize callback (described below) is only - * responsible for serializing the data structure, not moving it on disk - * or resizing it. - * - * In addition, the client may use the pre-serialize callback to - * ensure that the entry is ready to be flushed -- in particular, - * if the entry contains references to other entries that are in - * temporary file space, the pre-serialize callback must move those - * entries into real file space so that the serialzed entry will - * contain no invalid data. - * - * One would think that the base address and length of - * the length of the entry's image on disk would be well known. - * However, that need not be the case as free space section info - * entries will change size (and possibly location) depending on the - * number of blocks of free space being manages, and fractal heap - * direct blocks can change compressed size (and possibly location) - * on serialization if compression is enabled. Similarly, it may - * be necessary to move entries from temporary to real file space. - * - * The pre-serialize callback must report any such changes to the - * cache, which must then update its internal structures as needed. - * - * The typedef for the pre-serialize callback is as follows: - * - * typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, + * The pre-serialize callback is invoked by the metadata cache before + * it needs a current on-disk image of the metadata entry for purposes + * either constructing a journal or flushing the entry to disk. + * + * If the client needs to change the address or length of the entry prior + * to flush, the pre-serialize callback is responsible for these actions, + * so that the actual serialize callback (described below) is only + * responsible for serializing the data structure, not moving it on disk + * or resizing it. + * + * In addition, the client may use the pre-serialize callback to + * ensure that the entry is ready to be flushed -- in particular, + * if the entry contains references to other entries that are in + * temporary file space, the pre-serialize callback must move those + * entries into real file space so that the serialzed entry will + * contain no invalid data. + * + * One would think that the base address and length of + * the length of the entry's image on disk would be well known. + * However, that need not be the case as free space section info + * entries will change size (and possibly location) depending on the + * number of blocks of free space being manages, and fractal heap + * direct blocks can change compressed size (and possibly location) + * on serialization if compression is enabled. Similarly, it may + * be necessary to move entries from temporary to real file space. + * + * The pre-serialize callback must report any such changes to the + * cache, which must then update its internal structures as needed. + * + * The typedef for the pre-serialize callback is as follows: + * + * typedef herr_t (*H5C_pre_serialize_func_t)(H5F_t *f, * void * thing, * haddr_t addr, * size_t len, @@ -568,154 +568,154 @@ typedef struct H5C_t H5C_t; * size_t * new_len_ptr, * unsigned * flags_ptr); * - * The parameters of the pre-serialize callback are as follows: + * The parameters of the pre-serialize callback are as follows: * - * f: File pointer -- needed if other metadata cache entries - * must be modified in the process of serializing the - * target entry. + * f: File pointer -- needed if other metadata cache entries + * must be modified in the process of serializing the + * target entry. * - * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. - * This is the same pointer returned by a protect of the - * addr and len given above. + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. + * This is the same pointer returned by a protect of the + * addr and len given above. * - * addr: Base address in file of the entry to be serialized. + * addr: Base address in file of the entry to be serialized. * - * This parameter is supplied mainly for sanity checking. - * Sanity checks should be performed when compiled in debug - * mode, but the parameter may be unused when compiled in - * production mode. + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. * - * len: Length in bytes of the in file image of the entry to be - * serialized. Also the size the image passed to the - * serialize callback (discussed below) unless that - * value is altered by this function. + * len: Length in bytes of the in file image of the entry to be + * serialized. Also the size the image passed to the + * serialize callback (discussed below) unless that + * value is altered by this function. * - * This parameter is supplied mainly for sanity checking. - * Sanity checks should be performed when compiled in debug - * mode, but the parameter may be unused when compiled in - * production mode. + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. * - * new_addr_ptr: Pointer to haddr_t. If the entry is moved by - * the serialize function, the new on disk base address must - * be stored in *new_addr_ptr, and the appropriate flag set - * in *flags_ptr. + * new_addr_ptr: Pointer to haddr_t. If the entry is moved by + * the serialize function, the new on disk base address must + * be stored in *new_addr_ptr, and the appropriate flag set + * in *flags_ptr. * - * If the entry is not moved by the serialize function, - * *new_addr_ptr is undefined on pre-serialize callback - * return. + * If the entry is not moved by the serialize function, + * *new_addr_ptr is undefined on pre-serialize callback + * return. * - * new_len_ptr: Pointer to size_t. If the entry is resized by the - * serialize function, the new length of the on disk image - * must be stored in *new_len_ptr, and the appropriate flag set + * new_len_ptr: Pointer to size_t. If the entry is resized by the + * serialize function, the new length of the on disk image + * must be stored in *new_len_ptr, and the appropriate flag set * in *flags_ptr. * - * If the entry is not resized by the pre-serialize function, - * *new_len_ptr is undefined on pre-serialize callback - * return. + * If the entry is not resized by the pre-serialize function, + * *new_len_ptr is undefined on pre-serialize callback + * return. * - * flags_ptr: Pointer to an unsigned integer used to return flags - * indicating whether the preserialize function resized or moved - * the entry. If the entry was neither resized or moved, the + * flags_ptr: Pointer to an unsigned integer used to return flags + * indicating whether the preserialize function resized or moved + * the entry. If the entry was neither resized or moved, the * serialize function must set *flags_ptr to zero. The * H5C__SERIALIZE_RESIZED_FLAG or H5C__SERIALIZE_MOVED_FLAG must * be set to indicate a resize or move respectively. * - * If the H5C__SERIALIZE_RESIZED_FLAG is set, the new length - * must be stored in *new_len_ptr. + * If the H5C__SERIALIZE_RESIZED_FLAG is set, the new length + * must be stored in *new_len_ptr. * - * If the H5C__SERIALIZE_MOVED_FLAG flag is set, the - * new image base address must be stored in *new_addr_ptr. + * If the H5C__SERIALIZE_MOVED_FLAG flag is set, the + * new image base address must be stored in *new_addr_ptr. * - * Processing in the pre-serialize function should proceed as follows: + * Processing in the pre-serialize function should proceed as follows: * - * The pre-serialize function must examine the in core representation - * indicated by the thing parameter, if the pre-serialize function does + * The pre-serialize function must examine the in core representation + * indicated by the thing parameter, if the pre-serialize function does * not need to change the size or location of the on-disk image, it must * set *flags_ptr to zero. * - * If the size of the on-disk image must be changed, the pre-serialize + * If the size of the on-disk image must be changed, the pre-serialize * function must load the length of the new image into *new_len_ptr, and * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr. * - * If the base address of the on disk image must be changed, the + * If the base address of the on disk image must be changed, the * pre-serialize function must set *new_addr_ptr to the new base address, * and set the H5C__SERIALIZE_MOVED_FLAG in *flags_ptr. * - * In addition, the pre-serialize callback may perform any other - * processing required before the entry is written to disk + * In addition, the pre-serialize callback may perform any other + * processing required before the entry is written to disk * - * If it is successful, the function must return SUCCEED. + * If it is successful, the function must return SUCCEED. * - * If it fails for any reason, the function must return FAIL and - * push error information on the error stack with the error API - * routines. + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. * * * SERIALIZE: Pointer to the serialize callback. * - * The serialize callback is invoked by the metadata cache whenever - * it needs a current on disk image of the metadata entry for purposes - * either constructing a journal entry or flushing the entry to disk. + * The serialize callback is invoked by the metadata cache whenever + * it needs a current on disk image of the metadata entry for purposes + * either constructing a journal entry or flushing the entry to disk. * - * At this point, the base address and length of the entry's image on + * At this point, the base address and length of the entry's image on * disk must be well known and not change during the serialization * process. * - * While any size and/or location changes must have been handled - * by a pre-serialize call, the client may elect to handle any other - * changes to the entry required to place it in correct form for - * writing to disk in this call. + * While any size and/or location changes must have been handled + * by a pre-serialize call, the client may elect to handle any other + * changes to the entry required to place it in correct form for + * writing to disk in this call. * - * The typedef for the serialize callback is as follows: + * The typedef for the serialize callback is as follows: * - * typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, + * typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, * void * image_ptr, * size_t len, * void * thing); * - * The parameters of the serialize callback are as follows: + * The parameters of the serialize callback are as follows: * - * f: File pointer -- needed if other metadata cache entries - * must be modified in the process of serializing the - * target entry. + * f: File pointer -- needed if other metadata cache entries + * must be modified in the process of serializing the + * target entry. * - * image_ptr: Pointer to a buffer of length len bytes into which a - * serialized image of the target metadata cache entry is - * to be written. + * image_ptr: Pointer to a buffer of length len bytes into which a + * serialized image of the target metadata cache entry is + * to be written. * - * Note that this buffer will not in general be initialized - * to any particular value. Thus the serialize function may - * not assume any initial value and must set each byte in - * the buffer. + * Note that this buffer will not in general be initialized + * to any particular value. Thus the serialize function may + * not assume any initial value and must set each byte in + * the buffer. * - * len: Length in bytes of the in file image of the entry to be - * serialized. Also the size of *image_ptr (below). + * len: Length in bytes of the in file image of the entry to be + * serialized. Also the size of *image_ptr (below). * - * This parameter is supplied mainly for sanity checking. - * Sanity checks should be performed when compiled in debug - * mode, but the parameter may be unused when compiled in - * production mode. + * This parameter is supplied mainly for sanity checking. + * Sanity checks should be performed when compiled in debug + * mode, but the parameter may be unused when compiled in + * production mode. * - * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. - * This is the same pointer returned by a protect of the - * addr and len given above. + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. + * This is the same pointer returned by a protect of the + * addr and len given above. * - * Processing in the serialize function should proceed as follows: + * Processing in the serialize function should proceed as follows: * - * If there are any remaining changes to the entry required before - * write to disk, they must be dealt with first. + * If there are any remaining changes to the entry required before + * write to disk, they must be dealt with first. * - * The serialize function must then examine the in core - * representation indicated by the thing parameter, and write a - * serialized image of its contents into the provided buffer. + * The serialize function must then examine the in core + * representation indicated by the thing parameter, and write a + * serialized image of its contents into the provided buffer. * - * If it is successful, the function must return SUCCEED. + * If it is successful, the function must return SUCCEED. * - * If it fails for any reason, the function must return FAIL and - * push error information on the error stack with the error API - * routines. + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. * * * NOTIFY: Pointer to the notify callback. @@ -724,98 +724,98 @@ typedef struct H5C_t H5C_t; * action on an entry has taken/will take place and the client indicates * it wishes to be notified about the action. * - * The typedef for the notify callback is as follows: + * The typedef for the notify callback is as follows: * - * typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, + * typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, * void *thing); * - * The parameters of the notify callback are as follows: + * The parameters of the notify callback are as follows: * - * action: An enum indicating the metadata cache action that has taken/ + * action: An enum indicating the metadata cache action that has taken/ * will take place. * - * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. This - * is the same pointer that would be returned by a protect - * of the addr and len of the entry. + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect + * of the addr and len of the entry. * - * Processing in the notify function should proceed as follows: + * Processing in the notify function should proceed as follows: * - * The notify function may perform any action it would like, including + * The notify function may perform any action it would like, including * metadata cache calls. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * - * If it fails for any reason, the function must return FAIL and - * push error information on the error stack with the error API - * routines. + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. * * * FREE_ICR: Pointer to the free ICR callback. * - * The free ICR callback is invoked by the metadata cache when it - * wishes to evict an entry, and needs the client to free the memory - * allocated for the in core representation. + * The free ICR callback is invoked by the metadata cache when it + * wishes to evict an entry, and needs the client to free the memory + * allocated for the in core representation. * - * The typedef for the free ICR callback is as follows: + * The typedef for the free ICR callback is as follows: * - * typedef herr_t (*H5C_free_icr_func_t)(void * thing)); + * typedef herr_t (*H5C_free_icr_func_t)(void * thing)); * - * The parameters of the free ICR callback are as follows: + * The parameters of the free ICR callback are as follows: * - * thing: Pointer to void containing the address of the in core - * representation of the target metadata cache entry. This - * is the same pointer that would be returned by a protect - * of the addr and len of the entry. + * thing: Pointer to void containing the address of the in core + * representation of the target metadata cache entry. This + * is the same pointer that would be returned by a protect + * of the addr and len of the entry. * - * Processing in the free ICR function should proceed as follows: + * Processing in the free ICR function should proceed as follows: * - * The free ICR function must free all memory allocated to the - * in core representation. + * The free ICR function must free all memory allocated to the + * in core representation. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * - * If it fails for any reason, the function must return FAIL and - * push error information on the error stack with the error API - * routines. + * If it fails for any reason, the function must return FAIL and + * push error information on the error stack with the error API + * routines. * - * At least when compiled with debug, it would be useful if the - * free ICR call would fail if the in core representation has been - * modified since the last serialize callback. + * At least when compiled with debug, it would be useful if the + * free ICR call would fail if the in core representation has been + * modified since the last serialize callback. * * GET_FSF_SIZE: Pointer to the get file space free size callback. * - * In principle, there is no need for the get file space free size - * callback. However, as an optimization, it is sometimes convenient - * to allocate and free file space for a number of cache entries - * simultaneously in a single contiguous block of file space. + * In principle, there is no need for the get file space free size + * callback. However, as an optimization, it is sometimes convenient + * to allocate and free file space for a number of cache entries + * simultaneously in a single contiguous block of file space. * - * File space allocation is done by the client, so the metadata cache - * need not be involved. However, since the metadata cache typically + * File space allocation is done by the client, so the metadata cache + * need not be involved. However, since the metadata cache typically * handles file space release when an entry is destroyed, some - * adjustment on the part of the metadata cache is required for this - * operation. + * adjustment on the part of the metadata cache is required for this + * operation. * * The get file space free size callback exists to support this - * operation. + * operation. * - * If a group of cache entries that were allocated as a group are to - * be discarded and their file space released, the type of the first - * (i.e. lowest address) entry in the group must implement the - * get free file space size callback. + * If a group of cache entries that were allocated as a group are to + * be discarded and their file space released, the type of the first + * (i.e. lowest address) entry in the group must implement the + * get free file space size callback. * - * To free the file space of all entries in the group in a single - * operation, first expunge all entries other than the first without - * the free file space flag. + * To free the file space of all entries in the group in a single + * operation, first expunge all entries other than the first without + * the free file space flag. * - * Then, to complete the operation, unprotect or expunge the first - * entry in the block with the free file space flag set. Since - * the get free file space callback is implemented, the metadata - * cache will use this callback to get the size of the block to be - * freed, instead of using the size of the entry as is done otherwise. + * Then, to complete the operation, unprotect or expunge the first + * entry in the block with the free file space flag set. Since + * the get free file space callback is implemented, the metadata + * cache will use this callback to get the size of the block to be + * freed, instead of using the size of the entry as is done otherwise. * - * At present this callback is used only by the H5FA and H5EA dblock - * and dblock page client classes. + * At present this callback is used only by the H5FA and H5EA dblock + * and dblock page client classes. * * The typedef for the get_fsf_size callback is as follows: * @@ -829,15 +829,15 @@ typedef struct H5C_t H5C_t; * is the same pointer that would be returned by a protect() * call of the associated addr and len. * - * fs_size_ptr: Pointer to hsize_t in which the callback will return + * fs_size_ptr: Pointer to hsize_t in which the callback will return * the size of the piece of file space to be freed. Note - * that the space to be freed is presumed to have the same - * base address as the cache entry. + * that the space to be freed is presumed to have the same + * base address as the cache entry. * * The function simply returns the size of the block of file space - * to be freed in *fsf_size_ptr. + * to be freed in *fsf_size_ptr. * - * If the function is successful, it must return SUCCEED. + * If the function is successful, it must return SUCCEED. * * If it fails for any reason, the function must return FAIL and * push error information on the error stack with the error API @@ -850,11 +850,11 @@ typedef enum H5C_notify_action_t { H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache * via the insert call */ - H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the + H5C_NOTIFY_ACTION_AFTER_LOAD, /* Entry has been loaded into the * from file via the protect call */ - H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to - * file. + H5C_NOTIFY_ACTION_AFTER_FLUSH, /* Entry has just been flushed to + * file. */ H5C_NOTIFY_ACTION_BEFORE_EVICT, /* Entry is about to be evicted * from cache. @@ -885,20 +885,20 @@ typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, hsize_t *fsf_size_ptr); /* Metadata cache client class definition */ typedef struct H5C_class_t { - int id; - const char * name; - H5FD_mem_t mem_type; - unsigned flags; - H5C_get_initial_load_size_func_t get_initial_load_size; - H5C_get_final_load_size_func_t get_final_load_size; - H5C_verify_chksum_func_t verify_chksum; - H5C_deserialize_func_t deserialize; - H5C_image_len_func_t image_len; - H5C_pre_serialize_func_t pre_serialize; - H5C_serialize_func_t serialize; - H5C_notify_func_t notify; - H5C_free_icr_func_t free_icr; - H5C_get_fsf_size_t fsf_size; + int id; + const char * name; + H5FD_mem_t mem_type; + unsigned flags; + H5C_get_initial_load_size_func_t get_initial_load_size; + H5C_get_final_load_size_func_t get_final_load_size; + H5C_verify_chksum_func_t verify_chksum; + H5C_deserialize_func_t deserialize; + H5C_image_len_func_t image_len; + H5C_pre_serialize_func_t pre_serialize; + H5C_serialize_func_t serialize; + H5C_notify_func_t notify; + H5C_free_icr_func_t free_icr; + H5C_get_fsf_size_t fsf_size; } H5C_class_t; /* Type definitions of callback functions used by the cache as a whole */ @@ -980,9 +980,9 @@ typedef int H5C_ring_t; * * The fields of this structure are discussed individually below: * - * JRM - 4/26/04 + * JRM - 4/26/04 * - * magic: Unsigned 32 bit integer that must always be set to + * magic: Unsigned 32 bit integer that must always be set to * H5C__H5C_CACHE_ENTRY_T_MAGIC when the entry is valid. * The field must be set to H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC * just before the entry is freed. @@ -1001,129 +1001,129 @@ typedef int H5C_ring_t; * detect this case, and re-start its scan from the bottom * of the LRU when this situation occurs. * - * cache_ptr: Pointer to the cache that this entry is contained within. + * cache_ptr: Pointer to the cache that this entry is contained within. * - * addr: Base address of the cache entry on disk. + * addr: Base address of the cache entry on disk. * - * size: Length of the cache entry on disk in bytes Note that unlike + * size: Length of the cache entry on disk in bytes Note that unlike * normal caches, the entries in this cache are of arbitrary size. * - * The file space allocations for cache entries implied by the + * The file space allocations for cache entries implied by the * addr and size fields must be disjoint. * - * image_ptr: Pointer to void. When not NULL, this field points to a - * dynamically allocated block of size bytes in which the - * on disk image of the metadata cache entry is stored. + * image_ptr: Pointer to void. When not NULL, this field points to a + * dynamically allocated block of size bytes in which the + * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is - * written to disk + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is + * written to disk * * image_up_to_date: Boolean flag that is set to TRUE when *image_ptr - * is up to date, and set to false when the entry is dirtied. + * is up to date, and set to false when the entry is dirtied. * - * type: Pointer to the instance of H5C_class_t containing pointers - * to the methods for cache entries of the current type. This - * field should be NULL when the instance of H5C_cache_entry_t - * is not in use. + * type: Pointer to the instance of H5C_class_t containing pointers + * to the methods for cache entries of the current type. This + * field should be NULL when the instance of H5C_cache_entry_t + * is not in use. * - * The name is not particularly descriptive, but is retained - * to avoid changes in existing code. + * The name is not particularly descriptive, but is retained + * to avoid changes in existing code. * - * is_dirty: Boolean flag indicating whether the contents of the cache - * entry has been modified since the last time it was written - * to disk. + * is_dirty: Boolean flag indicating whether the contents of the cache + * entry has been modified since the last time it was written + * to disk. * - * dirtied: Boolean flag used to indicate that the entry has been - * dirtied while protected. + * dirtied: Boolean flag used to indicate that the entry has been + * dirtied while protected. * - * This field is set to FALSE in the protect call, and may - * be set to TRUE by the H5C_mark_entry_dirty() call at any - * time prior to the unprotect call. + * This field is set to FALSE in the protect call, and may + * be set to TRUE by the H5C_mark_entry_dirty() call at any + * time prior to the unprotect call. * - * The H5C_mark_entry_dirty() call exists as a convenience - * function for the fractal heap code which may not know if - * an entry is protected or pinned, but knows that is either - * protected or pinned. The dirtied field was added as in - * the parallel case, it is necessary to know whether a - * protected entry is dirty prior to the protect call. + * The H5C_mark_entry_dirty() call exists as a convenience + * function for the fractal heap code which may not know if + * an entry is protected or pinned, but knows that is either + * protected or pinned. The dirtied field was added as in + * the parallel case, it is necessary to know whether a + * protected entry is dirty prior to the protect call. * * is_protected: Boolean flag indicating whether this entry is protected - * (or locked, to use more conventional terms). When it is - * protected, the entry cannot be flushed or accessed until - * it is unprotected (or unlocked -- again to use more - * conventional terms). + * (or locked, to use more conventional terms). When it is + * protected, the entry cannot be flushed or accessed until + * it is unprotected (or unlocked -- again to use more + * conventional terms). * - * Note that protected entries are removed from the LRU lists - * and inserted on the protected list. + * Note that protected entries are removed from the LRU lists + * and inserted on the protected list. * * is_read_only: Boolean flag that is only meaningful if is_protected is - * TRUE. In this circumstance, it indicates whether the - * entry has been protected read-only, or read/write. + * TRUE. In this circumstance, it indicates whether the + * entry has been protected read-only, or read/write. * - * If the entry has been protected read-only (i.e. is_protected - * and is_read_only are both TRUE), we allow the entry to be - * protected more than once. + * If the entry has been protected read-only (i.e. is_protected + * and is_read_only are both TRUE), we allow the entry to be + * protected more than once. * - * In this case, the number of readers is maintained in the - * ro_ref_count field (see below), and unprotect calls simply - * decrement that field until it drops to zero, at which point - * the entry is actually unprotected. + * In this case, the number of readers is maintained in the + * ro_ref_count field (see below), and unprotect calls simply + * decrement that field until it drops to zero, at which point + * the entry is actually unprotected. * * ro_ref_count: Integer field used to maintain a count of the number of - * outstanding read-only protects on this entry. This field - * must be zero whenever either is_protected or is_read_only - * are TRUE. + * outstanding read-only protects on this entry. This field + * must be zero whenever either is_protected or is_read_only + * are TRUE. * - * is_pinned: Boolean flag indicating whether the entry has been pinned - * in the cache. + * is_pinned: Boolean flag indicating whether the entry has been pinned + * in the cache. * - * For very hot entries, the protect / unprotect overhead - * can become excessive. Thus the cache has been extended - * to allow an entry to be "pinned" in the cache. + * For very hot entries, the protect / unprotect overhead + * can become excessive. Thus the cache has been extended + * to allow an entry to be "pinned" in the cache. * - * Pinning an entry in the cache has several implications: + * Pinning an entry in the cache has several implications: * - * 1) A pinned entry cannot be evicted. Thus unprotected - * pinned entries must be stored in the pinned entry - * list, instead of being managed by the replacement - * policy code (LRU at present). + * 1) A pinned entry cannot be evicted. Thus unprotected + * pinned entries must be stored in the pinned entry + * list, instead of being managed by the replacement + * policy code (LRU at present). * - * 2) A pinned entry can be accessed or modified at any time. - * This places an extra burden on the pre-serialize and - * serialize callbacks, which must ensure that a pinned - * entry is consistent and ready to write to disk before - * generating an image. + * 2) A pinned entry can be accessed or modified at any time. + * This places an extra burden on the pre-serialize and + * serialize callbacks, which must ensure that a pinned + * entry is consistent and ready to write to disk before + * generating an image. * - * 3) A pinned entry can be marked as dirty (and possibly - * change size) while it is unprotected. + * 3) A pinned entry can be marked as dirty (and possibly + * change size) while it is unprotected. * - * 4) The flush-destroy code must allow pinned entries to - * be unpinned (and possibly unprotected) during the - * flush. + * 4) The flush-destroy code must allow pinned entries to + * be unpinned (and possibly unprotected) during the + * flush. * - * JRM -- 3/16/06 + * JRM -- 3/16/06 * - * in_slist: Boolean flag indicating whether the entry is in the skip list - * As a general rule, entries are placed in the list when they + * in_slist: Boolean flag indicating whether the entry is in the skip list + * As a general rule, entries are placed in the list when they * are marked dirty. However they may remain in the list after * being flushed. * * Update: Dirty entries are now removed from the skip list - * when they are flushed. + * when they are flushed. * * flush_marker: Boolean flag indicating that the entry is to be flushed - * the next time H5C_flush_cache() is called with the - * H5C__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when - * the entry is flushed for whatever reason. + * the next time H5C_flush_cache() is called with the + * H5C__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when + * the entry is flushed for whatever reason. * * flush_me_last: Boolean flag indicating that this entry should not be - * flushed from the cache until all other entries without + * flushed from the cache until all other entries without * the flush_me_last flag set have been flushed. * - * Note: + * Note: * - * At this time, the flush_me_last + * At this time, the flush_me_last * flag will only be applied to one entry, the superblock, * and the code utilizing these flags is protected with HDasserts * to enforce this. This restraint can certainly be relaxed in @@ -1132,37 +1132,37 @@ typedef int H5C_ring_t; * will need to be expanded and tested appropriately if that * functionality is desired. * - * Update: There are now two possible last entries - * (superblock and file driver info message). This - * number will probably increase as we add superblock - * messages. JRM -- 11/18/14 + * Update: There are now two possible last entries + * (superblock and file driver info message). This + * number will probably increase as we add superblock + * messages. JRM -- 11/18/14 * * clear_on_unprotect: Boolean flag used only in PHDF5. When H5C is used - * to implement the metadata cache In the parallel case, only - * the cache with mpi rank 0 is allowed to actually write to - * file -- all other caches must retain dirty entries until they - * are advised that the entry is clean. + * to implement the metadata cache In the parallel case, only + * the cache with mpi rank 0 is allowed to actually write to + * file -- all other caches must retain dirty entries until they + * are advised that the entry is clean. * - * This flag is used in the case that such an advisory is - * received when the entry is protected. If it is set when an - * entry is unprotected, and the dirtied flag is not set in - * the unprotect, the entry's is_dirty flag is reset by flushing - * it with the H5C__FLUSH_CLEAR_ONLY_FLAG. + * This flag is used in the case that such an advisory is + * received when the entry is protected. If it is set when an + * entry is unprotected, and the dirtied flag is not set in + * the unprotect, the entry's is_dirty flag is reset by flushing + * it with the H5C__FLUSH_CLEAR_ONLY_FLAG. * * flush_immediately: Boolean flag used only in Phdf5 -- and then only - * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. + * for H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED. * - * When a distributed metadata write is triggered at a - * sync point, this field is used to mark entries that - * must be flushed before leaving the sync point. At all - * other times, this field should be set to FALSE. + * When a distributed metadata write is triggered at a + * sync point, this field is used to mark entries that + * must be flushed before leaving the sync point. At all + * other times, this field should be set to FALSE. * * flush_in_progress: Boolean flag that is set to true iff the entry - * is in the process of being flushed. This allows the cache - * to detect when a call is the result of a flush callback. + * is in the process of being flushed. This allows the cache + * to detect when a call is the result of a flush callback. * * destroy_in_progress: Boolean flag that is set to true iff the entry - * is in the process of being flushed and destroyed. + * is in the process of being flushed and destroyed. * * * Fields supporting rings for flush ordering: @@ -1180,8 +1180,8 @@ typedef int H5C_ring_t; * within rings. Unlike rings, flush dependencies are applied to ALL * writes, not just those triggered by flush or serialize calls. * - * ring: Instance of H5C_ring_t indicating the ring to which this - * entry is assigned. + * ring: Instance of H5C_ring_t indicating the ring to which this + * entry is assigned. * * * Fields supporting the 'flush dependency' feature: @@ -1211,18 +1211,18 @@ typedef int H5C_ring_t; * this field is nonzero, then this entry cannot be flushed. * * flush_dep_nunser_children: Number of flush dependency children - * that are either unserialized, or have a non-zero number of - * positive number of unserialized children. + * that are either unserialized, or have a non-zero number of + * positive number of unserialized children. * - * Note that since there is no requirement that a clean entry - * be serialized, it is possible that flush_dep_nunser_children - * to be greater than flush_dep_ndirty_children. + * Note that since there is no requirement that a clean entry + * be serialized, it is possible that flush_dep_nunser_children + * to be greater than flush_dep_ndirty_children. * - * This field exist to facilitate correct ordering of entry - * serializations when it is necessary to serialize all the - * entries in the metadata cache. Thus in the cache - * serialization, no entry can be serialized unless this - * field contains 0. + * This field exist to facilitate correct ordering of entry + * serializations when it is necessary to serialize all the + * entries in the metadata cache. Thus in the cache + * serialization, no entry can be serialized unless this + * field contains 0. * * Fields supporting the hash table: * @@ -1239,25 +1239,25 @@ typedef int H5C_ring_t; * The il_next and il_prev fields discussed below were added to support * the index list. * - * ht_next: Next pointer used by the hash table to store multiple - * entries in a single hash bin. This field points to the - * next entry in the doubly linked list of entries in the - * hash bin, or NULL if there is no next entry. + * ht_next: Next pointer used by the hash table to store multiple + * entries in a single hash bin. This field points to the + * next entry in the doubly linked list of entries in the + * hash bin, or NULL if there is no next entry. * * ht_prev: Prev pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the * previous entry in the doubly linked list of entries in - * the hash bin, or NULL if there is no previuos entry. + * the hash bin, or NULL if there is no previuos entry. * - * il_next: Next pointer used by the index to maintain a doubly linked - * list of all entries in the index (and thus in the cache). - * This field contains a pointer to the next entry in the - * index list, or NULL if there is no next entry. + * il_next: Next pointer used by the index to maintain a doubly linked + * list of all entries in the index (and thus in the cache). + * This field contains a pointer to the next entry in the + * index list, or NULL if there is no next entry. * - * il_prev: Prev pointer used by the index to maintain a doubly linked - * list of all entries in the index (and thus in the cache). - * This field contains a pointer to the previous entry in the - * index list, or NULL if there is no previous entry. + * il_prev: Prev pointer used by the index to maintain a doubly linked + * list of all entries in the index (and thus in the cache). + * This field contains a pointer to the previous entry in the + * index list, or NULL if there is no previous entry. * * * Fields supporting replacement policies: @@ -1294,43 +1294,43 @@ typedef int H5C_ring_t; * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU, the protected list, or - * the pinned list depending on the current values of - * is_protected and is_pinned. If there is no next entry - * on the list, this field should be set to NULL. + * next: Next pointer in either the LRU, the protected list, or + * the pinned list depending on the current values of + * is_protected and is_pinned. If there is no next entry + * on the list, this field should be set to NULL. * - * prev: Prev pointer in either the LRU, the protected list, - * or the pinned list depending on the current values of - * is_protected and is_pinned. If there is no previous - * entry on the list, this field should be set to NULL. + * prev: Prev pointer in either the LRU, the protected list, + * or the pinned list depending on the current values of + * is_protected and is_pinned. If there is no previous + * entry on the list, this field should be set to NULL. * - * aux_next: Next pointer on either the clean or dirty LRU lists. - * This entry should be NULL when either is_protected or - * is_pinned is true. + * aux_next: Next pointer on either the clean or dirty LRU lists. + * This entry should be NULL when either is_protected or + * is_pinned is true. * - * When is_protected and is_pinned are false, and is_dirty is - * true, it should point to the next item on the dirty LRU - * list. + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the next item on the dirty LRU + * list. * - * When is_protected and is_pinned are false, and is_dirty is - * false, it should point to the next item on the clean LRU - * list. In either case, when there is no next item, it - * should be NULL. + * When is_protected and is_pinned are false, and is_dirty is + * false, it should point to the next item on the clean LRU + * list. In either case, when there is no next item, it + * should be NULL. * - * aux_prev: Previous pointer on either the clean or dirty LRU lists. - * This entry should be NULL when either is_protected or - * is_pinned is true. + * aux_prev: Previous pointer on either the clean or dirty LRU lists. + * This entry should be NULL when either is_protected or + * is_pinned is true. * - * When is_protected and is_pinned are false, and is_dirty is - * true, it should point to the previous item on the dirty - * LRU list. + * When is_protected and is_pinned are false, and is_dirty is + * true, it should point to the previous item on the dirty + * LRU list. * - * When is_protected and is_pinned are false, and is_dirty - * is false, it should point to the previous item on the - * clean LRU list. + * When is_protected and is_pinned are false, and is_dirty + * is false, it should point to the previous item on the + * clean LRU list. * - * In either case, when there is no previous item, it should - * be NULL. + * In either case, when there is no previous item, it should + * be NULL. * * Fields supporting the cache image feature: * @@ -1346,170 +1346,170 @@ typedef int H5C_ring_t; * further details. * * include_in_image: Boolean flag indicating whether this entry should - * be included in the metadata cache image. This field should - * always be false prior to the H5C_prep_for_file_close() call. - * During that call, it should be set to TRUE for all entries - * that are to be included in the metadata cache image. At - * present, only the superblock, the superblock extension - * object header and its chunks (if any) are omitted from - * the image. + * be included in the metadata cache image. This field should + * always be false prior to the H5C_prep_for_file_close() call. + * During that call, it should be set to TRUE for all entries + * that are to be included in the metadata cache image. At + * present, only the superblock, the superblock extension + * object header and its chunks (if any) are omitted from + * the image. * - * lru_rank: Rank of the entry in the LRU just prior to file close. + * lru_rank: Rank of the entry in the LRU just prior to file close. * - * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during - * the process of flushing the cache. + * Note that the first entry on the LRU has lru_rank 1, + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during + * the process of flushing the cache. * * image_dirty: Boolean flag indicating whether the entry should be marked - * as dirty in the metadata cache image. The flag is set to - * TRUE iff the entry is dirty when H5C_prep_for_file_close() - * is called. + * as dirty in the metadata cache image. The flag is set to + * TRUE iff the entry is dirty when H5C_prep_for_file_close() + * is called. * * fd_parent_count: If the entry is a child in one or more flush dependency - * relationships, this field contains the number of flush - * dependency parents. + * relationships, this field contains the number of flush + * dependency parents. * - * In all other cases, the field is set to zero. + * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any parents - * that are not in the image are removed from this count and - * from the fd_parent_addrs array below. + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any parents + * that are not in the image are removed from this count and + * from the fd_parent_addrs array below. * - * Finally observe that if the entry is dirty and in the - * cache image, and its parent is dirty and not in the cache - * image, then the entry must be removed from the cache image - * to avoid violating the flush dependency flush ordering. + * Finally observe that if the entry is dirty and in the + * cache image, and its parent is dirty and not in the cache + * image, then the entry must be removed from the cache image + * to avoid violating the flush dependency flush ordering. * * fd_parent_addrs: If the entry is a child in one or more flush dependency - * relationship when H5C_prep_for_file_close() is called, this - * field must contain a pointer to an array of size - * fd_parent_count containing the on disk addresses of the - * parent. + * relationship when H5C_prep_for_file_close() is called, this + * field must contain a pointer to an array of size + * fd_parent_count containing the on disk addresses of the + * parent. * - * In all other cases, the field is set to NULL. + * In all other cases, the field is set to NULL. * - * Note that while this list of addresses is initially taken - * from the flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any parents - * that are not in the image are removed from this list, and - * and from the fd_parent_count above. + * Note that while this list of addresses is initially taken + * from the flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any parents + * that are not in the image are removed from this list, and + * and from the fd_parent_count above. * - * Finally observe that if the entry is dirty and in the - * cache image, and its parent is dirty and not in the cache - * image, then the entry must be removed from the cache image - * to avoid violating the flush dependency flush ordering. + * Finally observe that if the entry is dirty and in the + * cache image, and its parent is dirty and not in the cache + * image, then the entry must be removed from the cache image + * to avoid violating the flush dependency flush ordering. * * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush - * dependency children. + * relationship, this field contains the number of flush + * dependency children. * - * In all other cases, the field is set to zero. + * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any children - * that are not in the image are removed from this count. + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any children + * that are not in the image are removed from this count. * * fd_dirty_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of dirty flush - * dependency children. + * relationship, this field contains the number of dirty flush + * dependency children. * - * In all other cases, the field is set to zero. + * In all other cases, the field is set to zero. * - * Note that while this count is initially taken from the - * flush dependency fields above, if the entry is in the - * cache image (i.e. include_in_image is TRUE), any dirty - * children that are not in the image are removed from this - * count. + * Note that while this count is initially taken from the + * flush dependency fields above, if the entry is in the + * cache image (i.e. include_in_image is TRUE), any dirty + * children that are not in the image are removed from this + * count. * * image_fd_height: Flush dependency height of the entry in the cache image. * - * The flush dependency height of any entry involved in a - * flush dependency relationship is defined to be the - * longest flush dependency path from that entry to an entry - * with no flush dependency children. - * - * Since the image_fd_height is used to order entries in the - * cache image so that fd parents preceed fd children, for - * purposes of this field, and entry is at flush dependency - * level 0 if it either has no children, or if all of its - * children are not in the cache image. - * - * Note that if a child in a flush dependency relationship is - * dirty and in the cache image, and its parent is dirty and - * not in the cache image, then the child must be excluded - * from the cache image to maintain flush ordering. - * - * prefetched: Boolean flag indicating that the on disk image of the entry - * has been loaded into the cache prior any request for the - * entry by the rest of the library. - * - * As of this writing (8/10/15), this can only happen through - * the load of a cache image block, although other scenarios - * are contemplated for the use of this feature. Note that - * unlike the usual prefetch situation, this means that a - * prefetched entry can be dirty, and/or can be a party to - * flush dependency relationship(s). This complicates matters - * somewhat. - * - * The essential feature of a prefetched entry is that it - * consists only of a buffer containing the on disk image of - * the entry. Thus it must be deserialized before it can - * be passed back to the library on a protect call. This - * task is handled by H5C_deserialized_prefetched_entry(). - * In essence, this routine calls the deserialize callback - * provided in the protect call with the on disk image, - * deletes the prefetched entry from the cache, and replaces - * it with the deserialized entry returned by the deserialize - * callback. - * - * Further, if the prefetched entry is a flush dependency parent, - * all its flush dependency children (which must also be - * prefetched entries), must be transferred to the new cache - * entry returned by the deserialization callback. - * - * Finally, if the prefetched entry is a flush dependency child, - * this flush dependency must be destroyed prior to the - * deserialize call. - * - * In addition to the above special processing on the first - * protect call on a prefetched entry (after which is no longer - * a prefetched entry), prefetched entries also require special - * tretment on flush and evict. - * - * On flush, a dirty prefetched entry must simply be written - * to disk and marked clean without any call to any client - * callback. - * - * On eviction, if a prefetched entry is a flush dependency - * child, that flush dependency relationship must be destroyed - * just prior to the eviction. If the flush dependency code - * is working properly, it should be impossible for any entry - * that is a flush dependency parent to be evicted. + * The flush dependency height of any entry involved in a + * flush dependency relationship is defined to be the + * longest flush dependency path from that entry to an entry + * with no flush dependency children. + * + * Since the image_fd_height is used to order entries in the + * cache image so that fd parents preceed fd children, for + * purposes of this field, and entry is at flush dependency + * level 0 if it either has no children, or if all of its + * children are not in the cache image. + * + * Note that if a child in a flush dependency relationship is + * dirty and in the cache image, and its parent is dirty and + * not in the cache image, then the child must be excluded + * from the cache image to maintain flush ordering. + * + * prefetched: Boolean flag indicating that the on disk image of the entry + * has been loaded into the cache prior any request for the + * entry by the rest of the library. + * + * As of this writing (8/10/15), this can only happen through + * the load of a cache image block, although other scenarios + * are contemplated for the use of this feature. Note that + * unlike the usual prefetch situation, this means that a + * prefetched entry can be dirty, and/or can be a party to + * flush dependency relationship(s). This complicates matters + * somewhat. + * + * The essential feature of a prefetched entry is that it + * consists only of a buffer containing the on disk image of + * the entry. Thus it must be deserialized before it can + * be passed back to the library on a protect call. This + * task is handled by H5C_deserialized_prefetched_entry(). + * In essence, this routine calls the deserialize callback + * provided in the protect call with the on disk image, + * deletes the prefetched entry from the cache, and replaces + * it with the deserialized entry returned by the deserialize + * callback. + * + * Further, if the prefetched entry is a flush dependency parent, + * all its flush dependency children (which must also be + * prefetched entries), must be transferred to the new cache + * entry returned by the deserialization callback. + * + * Finally, if the prefetched entry is a flush dependency child, + * this flush dependency must be destroyed prior to the + * deserialize call. + * + * In addition to the above special processing on the first + * protect call on a prefetched entry (after which is no longer + * a prefetched entry), prefetched entries also require special + * tretment on flush and evict. + * + * On flush, a dirty prefetched entry must simply be written + * to disk and marked clean without any call to any client + * callback. + * + * On eviction, if a prefetched entry is a flush dependency + * child, that flush dependency relationship must be destroyed + * just prior to the eviction. If the flush dependency code + * is working properly, it should be impossible for any entry + * that is a flush dependency parent to be evicted. * * prefetch_type_id: Integer field containing the type ID of the prefetched - * entry. This ID must match the ID of the type provided in any - * protect call on the prefetched entry. + * entry. This ID must match the ID of the type provided in any + * protect call on the prefetched entry. * - * The value of this field is undefined in prefetched is FALSE. + * The value of this field is undefined in prefetched is FALSE. * - * age: Number of times a prefetched entry has appeared in - * subsequent cache images. The field exists to allow - * imposition of a limit on how many times a prefetched - * entry can appear in subsequent cache images without being - * converted to a regular entry. + * age: Number of times a prefetched entry has appeared in + * subsequent cache images. The field exists to allow + * imposition of a limit on how many times a prefetched + * entry can appear in subsequent cache images without being + * converted to a regular entry. * - * This field must be zero if prefetched is FALSE. + * This field must be zero if prefetched is FALSE. * * prefetched_dirty: Boolean field that must be set to FALSE unless the - * following conditions hold: + * following conditions hold: * - * 1) The file has been opened R/O. + * 1) The file has been opened R/O. * - * 2) The entry is either a prefetched entry, or was + * 2) The entry is either a prefetched entry, or was * re-constructed from a prefetched entry. * * 3) The base prefetched entry was marked dirty. @@ -1545,14 +1545,14 @@ typedef int H5C_ring_t; * we deal with this by disabling EOC in the R/O case. * * serialization_count: Integer field used to maintain a count of the - * number of times each entry is serialized during cache - * serialization. While no entry should be serialized more than - * once in any serialization call, throw an assertion if any - * flush depencency parent is serialized more than once during - * a single cache serialization. + * number of times each entry is serialized during cache + * serialization. While no entry should be serialized more than + * once in any serialization call, throw an assertion if any + * flush depencency parent is serialized more than once during + * a single cache serialization. * - * This is a debugging field, and thus is maintained only if - * NDEBUG is undefined. + * This is a debugging field, and thus is maintained only if + * NDEBUG is undefined. * * Fields supporting tagged entries: * @@ -1563,15 +1563,15 @@ typedef int H5C_ring_t; * not tagged. Tagged entries have a pointer to the tag info for the object, * which is shared state for all the entries for that object. * - * tl_next: Pointer to the next entry in the tag list for an object. - * NULL for the tail entry in the list, as well as untagged - * entries. + * tl_next: Pointer to the next entry in the tag list for an object. + * NULL for the tail entry in the list, as well as untagged + * entries. * - * tl_prev: Pointer to the previous entry in the tag list for an object. - * NULL for the head entry in the list, as well as untagged - * entries. + * tl_prev: Pointer to the previous entry in the tag list for an object. + * NULL for the head entry in the list, as well as untagged + * entries. * - * tag_info: Pointer to the common tag state for all entries belonging to + * tag_info: Pointer to the common tag state for all entries belonging to * an object. NULL for untagged entries. * * @@ -1581,43 +1581,43 @@ typedef int H5C_ring_t; * and H5C_COLLECT_CACHE_ENTRY_STATS are true. When present, they allow * collection of statistics on individual cache entries. * - * accesses: int32_t containing the number of times this cache entry has - * been referenced in its lifetime. + * accesses: int32_t containing the number of times this cache entry has + * been referenced in its lifetime. * - * clears: int32_t containing the number of times this cache entry has - * been cleared in its life time. + * clears: int32_t containing the number of times this cache entry has + * been cleared in its life time. * - * flushes: int32_t containing the number of times this cache entry has - * been flushed to file in its life time. + * flushes: int32_t containing the number of times this cache entry has + * been flushed to file in its life time. * - * pins: int32_t containing the number of times this cache entry has - * been pinned in cache in its life time. + * pins: int32_t containing the number of times this cache entry has + * been pinned in cache in its life time. * ****************************************************************************/ typedef struct H5C_cache_entry_t { - uint32_t magic; + uint32_t magic; H5C_t *cache_ptr; - haddr_t addr; - size_t size; - void *image_ptr; - hbool_t image_up_to_date; - const H5C_class_t *type; - hbool_t is_dirty; - hbool_t dirtied; - hbool_t is_protected; - hbool_t is_read_only; - int ro_ref_count; - hbool_t is_pinned; - hbool_t in_slist; - hbool_t flush_marker; + haddr_t addr; + size_t size; + void *image_ptr; + hbool_t image_up_to_date; + const H5C_class_t *type; + hbool_t is_dirty; + hbool_t dirtied; + hbool_t is_protected; + hbool_t is_read_only; + int ro_ref_count; + hbool_t is_pinned; + hbool_t in_slist; + hbool_t flush_marker; hbool_t flush_me_last; #ifdef H5_HAVE_PARALLEL - hbool_t clear_on_unprotect; - hbool_t flush_immediately; - hbool_t coll_access; + hbool_t clear_on_unprotect; + hbool_t flush_immediately; + hbool_t coll_access; #endif /* H5_HAVE_PARALLEL */ - hbool_t flush_in_progress; - hbool_t destroy_in_progress; + hbool_t flush_in_progress; + hbool_t destroy_in_progress; /* fields supporting rings for purposes of flush ordering */ H5C_ring_t ring; @@ -1629,8 +1629,8 @@ typedef struct H5C_cache_entry_t { unsigned flush_dep_nchildren; unsigned flush_dep_ndirty_children; unsigned flush_dep_nunser_children; - hbool_t pinned_from_client; - hbool_t pinned_from_cache; + hbool_t pinned_from_client; + hbool_t pinned_from_cache; /* fields supporting the hash table: */ struct H5C_cache_entry_t *ht_next; @@ -1662,9 +1662,9 @@ typedef struct H5C_cache_entry_t { hbool_t prefetched; int prefetch_type_id; int32_t age; - hbool_t prefetched_dirty; + hbool_t prefetched_dirty; -#ifndef NDEBUG /* debugging field */ +#ifndef NDEBUG /* debugging field */ int serialization_count; #endif /* NDEBUG */ @@ -1675,10 +1675,10 @@ typedef struct H5C_cache_entry_t { #if H5C_COLLECT_CACHE_ENTRY_STATS /* cache entry stats fields */ - int32_t accesses; - int32_t clears; - int32_t flushes; - int32_t pins; + int32_t accesses; + int32_t clears; + int32_t flushes; + int32_t pins; #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ } H5C_cache_entry_t; @@ -1694,43 +1694,43 @@ typedef struct H5C_cache_entry_t { * * The fields of this structure are discussed individually below: * - * JRM - 8/5/15 + * JRM - 8/5/15 * - * magic: Unsigned 32 bit integer that must always be set to + * magic: Unsigned 32 bit integer that must always be set to * H5C_IMAGE_ENTRY_T_MAGIC when the entry is valid. * The field must be set to H5C_IMAGE_ENTRY_T_BAD_MAGIC * just before the entry is freed. * - * addr: Base address of the cache entry on disk. + * addr: Base address of the cache entry on disk. * - * size: Length of the cache entry on disk in bytes. + * size: Length of the cache entry on disk in bytes. * - * ring: Instance of H5C_ring_t indicating the flush ordering ring - * to which this entry is assigned. + * ring: Instance of H5C_ring_t indicating the flush ordering ring + * to which this entry is assigned. * - * age: Number of times this prefetech entry has appeared in - * the current sequence of cache images. This field is - * initialized to 0 if the instance of H5C_image_entry_t - * is constructed from a regular entry. + * age: Number of times this prefetech entry has appeared in + * the current sequence of cache images. This field is + * initialized to 0 if the instance of H5C_image_entry_t + * is constructed from a regular entry. * - * If the instance is constructed from a prefetched entry - * currently residing in the metadata cache, the field is - * set to 1 + the age of the prefetched entry, or to - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX. + * If the instance is constructed from a prefetched entry + * currently residing in the metadata cache, the field is + * set to 1 + the age of the prefetched entry, or to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX if that sum exceeds + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX. * - * type_id: Integer field containing the type ID of the entry. + * type_id: Integer field containing the type ID of the entry. * - * lru_rank: Rank of the entry in the LRU just prior to file close. + * lru_rank: Rank of the entry in the LRU just prior to file close. * - * Note that the first entry on the LRU has lru_rank 1, - * and that entries not on the LRU at that time will have - * either lru_rank -1 (if pinned) or 0 (if loaded during - * the process of flushing the cache. + * Note that the first entry on the LRU has lru_rank 1, + * and that entries not on the LRU at that time will have + * either lru_rank -1 (if pinned) or 0 (if loaded during + * the process of flushing the cache. * - * is_dirty: Boolean flag indicating whether the contents of the cache - * entry has been modified since the last time it was written - * to disk as a regular piece of metadata. + * is_dirty: Boolean flag indicating whether the contents of the cache + * entry has been modified since the last time it was written + * to disk as a regular piece of metadata. * * image_fd_height: Flush dependency height of the entry in the cache image. * @@ -1758,17 +1758,17 @@ typedef struct H5C_cache_entry_t { * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of - * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are - * not in the image are removed from this count and + * H5C_cache_entry_t, if the entry is in the cache image + * (i.e. include_in_image is TRUE), any parents that are + * not in the image are removed from this count and * from the fd_parent_addrs array below. * * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of - * the instance of H5C_image_entry_t. + * This should have happened before the construction of + * the instance of H5C_image_entry_t. * * fd_parent_addrs: If the entry is a child in one or more flush dependency * relationship when H5C_prep_for_file_close() is called, this @@ -1781,27 +1781,27 @@ typedef struct H5C_cache_entry_t { * Note that while this list of addresses is initially taken * from the flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any parents that are not - * in the image are removed from this list, and from the - * fd_parent_count above. + * (i.e. include_in_image is TRUE), any parents that are not + * in the image are removed from this list, and from the + * fd_parent_count above. * * Finally observe that if the entry is dirty and in the * cache image, and its parent is dirty and not in the cache * image, then the entry must be removed from the cache image * to avoid violating the flush dependency flush ordering. - * This should have happened before the construction of - * the instance of H5C_image_entry_t. + * This should have happened before the construction of + * the instance of H5C_image_entry_t. * * fd_child_count: If the entry is a parent in a flush dependency - * relationship, this field contains the number of flush - * dependency children. + * relationship, this field contains the number of flush + * dependency children. * - * In all other cases, the field is set to zero. + * In all other cases, the field is set to zero. * * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any children + * (i.e. include_in_image is TRUE), any children * that are not in the image are removed from this count. * * fd_dirty_child_count: If the entry is a parent in a flush dependency @@ -1813,16 +1813,16 @@ typedef struct H5C_cache_entry_t { * Note that while this count is initially taken from the * flush dependency fields in the associated instance of * H5C_cache_entry_t, if the entry is in the cache image - * (i.e. include_in_image is TRUE), any dirty children - * that are not in the image are removed from this count. + * (i.e. include_in_image is TRUE), any dirty children + * that are not in the image are removed from this count. * - * image_ptr: Pointer to void. When not NULL, this field points to a - * dynamically allocated block of size bytes in which the - * on disk image of the metadata cache entry is stored. + * image_ptr: Pointer to void. When not NULL, this field points to a + * dynamically allocated block of size bytes in which the + * on disk image of the metadata cache entry is stored. * - * If the entry is dirty, the pre-serialize and serialize - * callbacks must be used to update this image before it is - * written to disk + * If the entry is dirty, the pre-serialize and serialize + * callbacks must be used to update this image before it is + * written to disk * * ****************************************************************************/ @@ -1854,95 +1854,95 @@ typedef struct H5C_image_entry_t { * The fields of the structure are discussed individually below: * * version: Integer field containing the version number of this version - * of the H5C_auto_size_ctl_t structure. Any instance of - * H5C_auto_size_ctl_t passed to the cache must have a known - * version number, or an error will be flagged. + * of the H5C_auto_size_ctl_t structure. Any instance of + * H5C_auto_size_ctl_t passed to the cache must have a known + * version number, or an error will be flagged. * * report_fcn: Pointer to the function that is to be called to report - * activities each time the auto cache resize code is executed. If the - * field is NULL, no call is made. + * activities each time the auto cache resize code is executed. If the + * field is NULL, no call is made. * - * If the field is not NULL, it must contain the address of a function - * of type H5C_auto_resize_report_fcn. + * If the field is not NULL, it must contain the address of a function + * of type H5C_auto_resize_report_fcn. * * set_initial_size: Boolean flag indicating whether the size of the - * initial size of the cache is to be set to the value given in - * the initial_size field. If set_initial_size is FALSE, the - * initial_size field is ignored. + * initial size of the cache is to be set to the value given in + * the initial_size field. If set_initial_size is FALSE, the + * initial_size field is ignored. * * initial_size: If enabled, this field contain the size the cache is - * to be set to upon receipt of this structure. Needless to say, - * initial_size must lie in the closed interval [min_size, max_size]. + * to be set to upon receipt of this structure. Needless to say, + * initial_size must lie in the closed interval [min_size, max_size]. * * min_clean_fraction: double in the range 0 to 1 indicating the fraction - * of the cache that is to be kept clean. This field is only used - * in parallel mode. Typical values are 0.1 to 0.5. + * of the cache that is to be kept clean. This field is only used + * in parallel mode. Typical values are 0.1 to 0.5. * * max_size: Maximum size to which the cache can be adjusted. The - * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must - * be greater than or equal to min_size. + * supplied value must fall in the closed interval + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must + * be greater than or equal to min_size. * * min_size: Minimum size to which the cache can be adjusted. The - * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must - * be less than or equal to max_size. + * supplied value must fall in the closed interval + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must + * be less than or equal to max_size. * * epoch_length: Number of accesses on the cache over which to collect - * hit rate stats before running the automatic cache resize code, - * if it is enabled. + * hit rate stats before running the automatic cache resize code, + * if it is enabled. * - * At the end of an epoch, we discard prior hit rate data and start - * collecting afresh. The epoch_length must lie in the closed - * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]. + * At the end of an epoch, we discard prior hit rate data and start + * collecting afresh. The epoch_length must lie in the closed + * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]. * * * Cache size increase control fields: * * incr_mode: Instance of the H5C_cache_incr_mode enumerated type whose - * value indicates how we determine whether the cache size should be - * increased. At present there are two possible values: + * value indicates how we determine whether the cache size should be + * increased. At present there are two possible values: * - * H5C_incr__off: Don't attempt to increase the size of the cache - * automatically. + * H5C_incr__off: Don't attempt to increase the size of the cache + * automatically. * - * When this increment mode is selected, the remaining fields - * in the cache size increase section ar ignored. + * When this increment mode is selected, the remaining fields + * in the cache size increase section ar ignored. * - * H5C_incr__threshold: Attempt to increase the size of the cache - * whenever the average hit rate over the last epoch drops - * below the value supplied in the lower_hr_threshold - * field. + * H5C_incr__threshold: Attempt to increase the size of the cache + * whenever the average hit rate over the last epoch drops + * below the value supplied in the lower_hr_threshold + * field. * - * Note that this attempt will fail if the cache is already - * at its maximum size, or if the cache is not already using - * all available space. + * Note that this attempt will fail if the cache is already + * at its maximum size, or if the cache is not already using + * all available space. * * lower_hr_threshold: Lower hit rate threshold. If the increment mode - * (incr_mode) is H5C_incr__threshold and the hit rate drops below the - * value supplied in this field in an epoch, increment the cache size by - * size_increment. Note that cache size may not be incremented above - * max_size, and that the increment may be further restricted by the - * max_increment field if it is enabled. + * (incr_mode) is H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * size_increment. Note that cache size may not be incremented above + * max_size, and that the increment may be further restricted by the + * max_increment field if it is enabled. * - * When enabled, this field must contain a value in the range [0.0, 1.0]. - * Depending on the incr_mode selected, it may also have to be less than - * upper_hr_threshold. + * When enabled, this field must contain a value in the range [0.0, 1.0]. + * Depending on the incr_mode selected, it may also have to be less than + * upper_hr_threshold. * * increment: Double containing the multiplier used to derive the new - * cache size from the old if a cache size increment is triggered. - * The increment must be greater than 1.0, and should not exceed 2.0. + * cache size from the old if a cache size increment is triggered. + * The increment must be greater than 1.0, and should not exceed 2.0. * - * The new cache size is obtained by multiplying the current max cache - * size by the increment, and then clamping to max_size and to stay - * within the max_increment as necessary. + * The new cache size is obtained by multiplying the current max cache + * size by the increment, and then clamping to max_size and to stay + * within the max_increment as necessary. * * apply_max_increment: Boolean flag indicating whether the max_increment - * field should be used to limit the maximum cache size increment. + * field should be used to limit the maximum cache size increment. * * max_increment: If enabled by the apply_max_increment field described - * above, this field contains the maximum number of bytes by which the - * cache size can be increased in a single re-size. + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. * * flash_incr_mode: Instance of the H5C_cache_flash_incr_mode enumerated * type whose value indicates whether and by what algorithm we should @@ -1991,96 +1991,96 @@ typedef struct H5C_image_entry_t { * is H5C_flash_incr__add_space. * * flash_threshold: Double containing the factor by which current max cache - * size is multiplied to obtain the size threshold for the add_space - * flash increment algorithm. The field is ignored unless - * flash_incr_mode is H5C_flash_incr__add_space. + * size is multiplied to obtain the size threshold for the add_space + * flash increment algorithm. The field is ignored unless + * flash_incr_mode is H5C_flash_incr__add_space. * * * Cache size decrease control fields: * * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose - * value indicates how we determine whether the cache size should be - * decreased. At present there are four possibilities. + * value indicates how we determine whether the cache size should be + * decreased. At present there are four possibilities. * - * H5C_decr__off: Don't attempt to decrease the size of the cache - * automatically. + * H5C_decr__off: Don't attempt to decrease the size of the cache + * automatically. * - * When this increment mode is selected, the remaining fields - * in the cache size decrease section are ignored. + * When this increment mode is selected, the remaining fields + * in the cache size decrease section are ignored. * - * H5C_decr__threshold: Attempt to decrease the size of the cache - * whenever the average hit rate over the last epoch rises - * above the value supplied in the upper_hr_threshold - * field. + * H5C_decr__threshold: Attempt to decrease the size of the cache + * whenever the average hit rate over the last epoch rises + * above the value supplied in the upper_hr_threshold + * field. * - * H5C_decr__age_out: At the end of each epoch, search the cache for - * entries that have not been accessed for at least the number - * of epochs specified in the epochs_before_eviction field, and - * evict these entries. Conceptually, the maximum cache size - * is then decreased to match the new actual cache size. However, - * this reduction may be modified by the min_size, the - * max_decrement, and/or the empty_reserve. + * H5C_decr__age_out: At the end of each epoch, search the cache for + * entries that have not been accessed for at least the number + * of epochs specified in the epochs_before_eviction field, and + * evict these entries. Conceptually, the maximum cache size + * is then decreased to match the new actual cache size. However, + * this reduction may be modified by the min_size, the + * max_decrement, and/or the empty_reserve. * - * H5C_decr__age_out_with_threshold: Same as age_out, but we only - * attempt to reduce the cache size when the hit rate observed - * over the last epoch exceeds the value provided in the - * upper_hr_threshold field. + * H5C_decr__age_out_with_threshold: Same as age_out, but we only + * attempt to reduce the cache size when the hit rate observed + * over the last epoch exceeds the value provided in the + * upper_hr_threshold field. * * upper_hr_threshold: Upper hit rate threshold. The use of this field - * varies according to the current decr_mode: + * varies according to the current decr_mode: * - * H5C_decr__off or H5C_decr__age_out: The value of this field is - * ignored. + * H5C_decr__off or H5C_decr__age_out: The value of this field is + * ignored. * - * H5C_decr__threshold: If the hit rate exceeds this threshold in any - * epoch, attempt to decrement the cache size by size_decrement. + * H5C_decr__threshold: If the hit rate exceeds this threshold in any + * epoch, attempt to decrement the cache size by size_decrement. * - * Note that cache size may not be decremented below min_size. + * Note that cache size may not be decremented below min_size. * - * Note also that if the upper_threshold is 1.0, the cache size - * will never be reduced. + * Note also that if the upper_threshold is 1.0, the cache size + * will never be reduced. * - * H5C_decr__age_out_with_threshold: If the hit rate exceeds this - * threshold in any epoch, attempt to reduce the cache size - * by evicting entries that have not been accessed for more - * than the specified number of epochs. + * H5C_decr__age_out_with_threshold: If the hit rate exceeds this + * threshold in any epoch, attempt to reduce the cache size + * by evicting entries that have not been accessed for more + * than the specified number of epochs. * * decrement: This field is only used when the decr_mode is - * H5C_decr__threshold. + * H5C_decr__threshold. * - * The field is a double containing the multiplier used to derive the - * new cache size from the old if a cache size decrement is triggered. - * The decrement must be in the range 0.0 (in which case the cache will + * The field is a double containing the multiplier used to derive the + * new cache size from the old if a cache size decrement is triggered. + * The decrement must be in the range 0.0 (in which case the cache will * try to contract to its minimum size) to 1.0 (in which case the * cache will never shrink). * * apply_max_decrement: Boolean flag used to determine whether decrements - * in cache size are to be limited by the max_decrement field. + * in cache size are to be limited by the max_decrement field. * * max_decrement: Maximum number of bytes by which the cache size can be - * decreased in a single re-size. Note that decrements may also be - * restricted by the min_size of the cache, and (in age out modes) by - * the empty_reserve field. + * decreased in a single re-size. Note that decrements may also be + * restricted by the min_size of the cache, and (in age out modes) by + * the empty_reserve field. * * epochs_before_eviction: Integer field used in H5C_decr__age_out and - * H5C_decr__age_out_with_threshold decrement modes. + * H5C_decr__age_out_with_threshold decrement modes. * - * This field contains the number of epochs an entry must remain - * unaccessed before it is evicted in an attempt to reduce the - * cache size. If applicable, this field must lie in the range - * [1, H5C__MAX_EPOCH_MARKERS]. + * This field contains the number of epochs an entry must remain + * unaccessed before it is evicted in an attempt to reduce the + * cache size. If applicable, this field must lie in the range + * [1, H5C__MAX_EPOCH_MARKERS]. * * apply_empty_reserve: Boolean field controlling whether the empty_reserve - * field is to be used in computing the new cache size when the - * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. + * field is to be used in computing the new cache size when the + * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. * * empty_reserve: To avoid a constant racheting down of cache size by small - * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold - * modes, this field allows one to require that any cache size - * reductions leave the specified fraction of unused space in the cache. + * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold + * modes, this field allows one to require that any cache size + * reductions leave the specified fraction of unused space in the cache. * - * The value of this field must be in the range [0.0, 1.0]. I would - * expect typical values to be in the range of 0.01 to 0.1. + * The value of this field must be in the range [0.0, 1.0]. I would + * expect typical values to be in the range of 0.01 to 0.1. * ****************************************************************************/ @@ -2103,34 +2103,34 @@ typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr, int32_t version, typedef struct H5C_auto_size_ctl_t { /* general configuration fields: */ - int32_t version; - H5C_auto_resize_rpt_fcn rpt_fcn; - hbool_t set_initial_size; - size_t initial_size; - double min_clean_fraction; - size_t max_size; - size_t min_size; - int64_t epoch_length; + int32_t version; + H5C_auto_resize_rpt_fcn rpt_fcn; + hbool_t set_initial_size; + size_t initial_size; + double min_clean_fraction; + size_t max_size; + size_t min_size; + int64_t epoch_length; /* size increase control fields: */ - enum H5C_cache_incr_mode incr_mode; - double lower_hr_threshold; - double increment; - hbool_t apply_max_increment; - size_t max_increment; + enum H5C_cache_incr_mode incr_mode; + double lower_hr_threshold; + double increment; + hbool_t apply_max_increment; + size_t max_increment; enum H5C_cache_flash_incr_mode flash_incr_mode; double flash_multiple; double flash_threshold; /* size decrease control fields: */ - enum H5C_cache_decr_mode decr_mode; - double upper_hr_threshold; - double decrement; - hbool_t apply_max_decrement; - size_t max_decrement; - int32_t epochs_before_eviction; - hbool_t apply_empty_reserve; - double empty_reserve; + enum H5C_cache_decr_mode decr_mode; + double upper_hr_threshold; + double decrement; + hbool_t apply_max_decrement; + size_t max_decrement; + int32_t epochs_before_eviction; + hbool_t apply_empty_reserve; + double empty_reserve; } H5C_auto_size_ctl_t; /**************************************************************************** @@ -2146,12 +2146,12 @@ typedef struct H5C_auto_size_ctl_t { * The fields of the structure are discussed individually below: * * version: Integer field containing the version number of this version - * of the H5C_image_ctl_t structure. Any instance of - * H5C_image_ctl_t passed to the cache must have a known - * version number, or an error will be flagged. + * of the H5C_image_ctl_t structure. Any instance of + * H5C_image_ctl_t passed to the cache must have a known + * version number, or an error will be flagged. * * generate_image: Boolean flag indicating whether a cache image should - * be created on file close. + * be created on file close. * * save_resize_status: Boolean flag indicating whether the cache image * should include the adaptive cache resize configuration and status. @@ -2183,40 +2183,40 @@ typedef struct H5C_auto_size_ctl_t { * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. * * flags: Unsigned integer containing flags controlling which aspects of the - * cache image functinality is actually executed. The primary impetus - * behind this field is to allow development of tests for partial - * implementations that will require little if any modification to run - * with the full implementation. In normal operation, all flags should - * be set. + * cache image functinality is actually executed. The primary impetus + * behind this field is to allow development of tests for partial + * implementations that will require little if any modification to run + * with the full implementation. In normal operation, all flags should + * be set. * ****************************************************************************/ -#define H5C_CI__GEN_MDCI_SBE_MESG ((unsigned)0x0001) -#define H5C_CI__GEN_MDC_IMAGE_BLK ((unsigned)0x0002) -#define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004) -#define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008) +#define H5C_CI__GEN_MDCI_SBE_MESG ((unsigned)0x0001) +#define H5C_CI__GEN_MDC_IMAGE_BLK ((unsigned)0x0002) +#define H5C_CI__SUPRESS_ENTRY_WRITES ((unsigned)0x0004) +#define H5C_CI__WRITE_CACHE_IMAGE ((unsigned)0x0008) /* This #define must set all defined H5C_CI flags. It is * used in the default value for instances of H5C_cache_image_ctl_t. * This value will only be modified in test code. */ -#define H5C_CI__ALL_FLAGS ((unsigned)0x000F) +#define H5C_CI__ALL_FLAGS ((unsigned)0x000F) #define H5C__DEFAULT_CACHE_IMAGE_CTL \ { \ - /* version = */ H5C__CURR_CACHE_IMAGE_CTL_VER, \ - /* generate_image = */ FALSE, \ - /* save_resize_status = */ FALSE, \ - /* entry_ageout = */ H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, \ - /* flags = */ H5C_CI__ALL_FLAGS \ + H5C__CURR_CACHE_IMAGE_CTL_VER, /* = version */ \ + FALSE, /* = generate_image */ \ + FALSE, /* = save_resize_status */ \ + H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE, /* = entry_ageout */ \ + H5C_CI__ALL_FLAGS /* = flags */ \ } typedef struct H5C_cache_image_ctl_t { - int32_t version; - hbool_t generate_image; + int32_t version; + hbool_t generate_image; hbool_t save_resize_status; int32_t entry_ageout; - unsigned flags; + unsigned flags; } H5C_cache_image_ctl_t; /* The cache logging output style */ @@ -2332,7 +2332,7 @@ H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, unsigned ce_array_len, haddr_t *ce_array_ptr); #endif /* H5_HAVE_PARALLEL */ -#ifndef NDEBUG /* debugging functions */ +#ifndef NDEBUG /* debugging functions */ H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name); H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); diff --git a/src/H5Dint.c b/src/H5Dint.c index 177ff1f..91c16b6 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -96,8 +96,11 @@ H5FL_EXTERN(H5D_chunk_info_t); /* Declare extern the free list to manage blocks of type conversion data */ H5FL_BLK_EXTERN(type_conv); +/* Disable warning for intentional identical branches here -QAK */ +H5_GCC_DIAG_OFF("larger-than=") /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; +H5_GCC_DIAG_ON("larger-than=") /* Dataset ID class */ static const H5I_class_t H5I_DATASET_CLS[1] = {{ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 7608d61..ace2e56 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -1014,6 +1014,7 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) FUNC_ENTER_STATIC_NOERR + /* clang-format off */ /* Set the VFL feature flags that this driver supports */ if(flags) { *flags = 0; @@ -1030,6 +1031,7 @@ H5FD__core_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */ } } /* end if */ + /* clang-format on */ FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD__core_query() */ @@ -1408,7 +1410,7 @@ done: * If we are not closing, we realloc the buffer to size equal * to the smallest multiple of the allocation increment that * equals or exceeds the eoa and set the eof accordingly. - * Note that we no longer truncate the backing store to the + * Note that we no longer truncate the backing store to the * new eof if applicable. * -- JRM * @@ -1508,9 +1510,9 @@ done: * Function: H5FD__core_lock * * Purpose: To place an advisory lock on a file. - * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * The lock type to apply depends on the parameter "rw": + * TRUE--opens for write: an exclusive lock + * FALSE--opens for read: a shared lock * * Return: SUCCEED/FAIL * diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 290d743..d6cf482 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -12,38 +12,38 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, November 10, 1997 - * - * Purpose: Implements a family of files that acts as a single hdf5 - * file. The purpose is to be able to split a huge file on a - * 64-bit platform, transfer all the <2GB members to a 32-bit - * platform, and then access the entire huge file on the 32-bit - * platform. - * - * All family members are logically the same size although their - * physical sizes may vary. The logical member size is - * determined by looking at the physical size of the first member - * when the file is opened. When creating a file family, the - * first member is created with a predefined physical size - * (actually, this happens when the file family is flushed, and - * can be quite time consuming on file systems that don't - * implement holes, like nfs). + * Programmer: Robb Matzke + * Monday, November 10, 1997 + * + * Purpose: Implements a family of files that acts as a single hdf5 + * file. The purpose is to be able to split a huge file on a + * 64-bit platform, transfer all the <2GB members to a 32-bit + * platform, and then access the entire huge file on the 32-bit + * platform. + * + * All family members are logically the same size although their + * physical sizes may vary. The logical member size is + * determined by looking at the physical size of the first member + * when the file is opened. When creating a file family, the + * first member is created with a predefined physical size + * (actually, this happens when the file family is flushed, and + * can be quite time consuming on file systems that don't + * implement holes, like nfs). * */ #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 */ -#include "H5FDfamily.h" /* Family file driver */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Pprivate.h" /* Property lists */ +#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 "H5FDfamily.h" /* Family file driver */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Pprivate.h" /* Property lists */ /* The size of the member name buffers */ #define H5FD_FAM_MEMB_NAME_BUF_SIZE 4096 @@ -53,19 +53,19 @@ static hid_t H5FD_FAMILY_g = 0; /* The description of a file belonging to this driver. */ typedef struct H5FD_family_t { - H5FD_t pub; /*public stuff, must be first */ - hid_t memb_fapl_id; /*file access property list for members */ - hsize_t memb_size; /*actual size of each member file */ - hsize_t pmem_size; /*member size passed in from property */ - unsigned nmembs; /*number of family members */ - unsigned amembs; /*number of member slots allocated */ - H5FD_t **memb; /*dynamic array of member pointers */ - haddr_t eoa; /*end of allocated addresses */ - char *name; /*name generator printf format */ - unsigned flags; /*flags for opening additional members */ + H5FD_t pub; /*public stuff, must be first */ + hid_t memb_fapl_id; /*file access property list for members */ + hsize_t memb_size; /*actual size of each member file */ + hsize_t pmem_size; /*member size passed in from property */ + unsigned nmembs; /*number of family members */ + unsigned amembs; /*number of member slots allocated */ + H5FD_t **memb; /*dynamic array of member pointers */ + haddr_t eoa; /*end of allocated addresses */ + char *name; /*name generator printf format */ + unsigned flags; /*flags for opening additional members */ /* Information from properties set by 'h5repart' tool */ - hsize_t mem_newsize; /*new member size passed in as private + hsize_t mem_newsize; /*new member size passed in as private * property. It's used only by h5repart */ hbool_t repart_members; /* Whether to mark the superblock dirty * when it is loaded, so that the family @@ -74,8 +74,8 @@ typedef struct H5FD_family_t { /* Driver-specific file access properties */ typedef struct H5FD_family_fapl_t { - hsize_t memb_size; /*size of each member */ - hid_t memb_fapl_id; /*file access property list of each memb*/ + hsize_t memb_size; /*size of each member */ + hid_t memb_fapl_id; /*file access property list of each memb*/ } H5FD_family_fapl_t; /* Callback prototypes */ @@ -85,11 +85,11 @@ static void *H5FD__family_fapl_copy(const void *_old_fa); static herr_t H5FD__family_fapl_free(void *_fa); static hsize_t H5FD__family_sb_size(H5FD_t *_file); static herr_t H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, - unsigned char *buf/*out*/); + unsigned char *buf/*out*/); static herr_t H5FD__family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); static H5FD_t *H5FD__family_open(const char *name, unsigned flags, - hid_t fapl_id, haddr_t maxaddr); + hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD__family_close(H5FD_t *_file); static int H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD__family_query(const H5FD_t *_f1, unsigned long *flags); @@ -98,9 +98,9 @@ static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); static haddr_t H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD__family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, void *_buf/*out*/); + size_t size, void *_buf/*out*/); static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, - size_t size, const void *_buf); + size_t size, const void *_buf); static herr_t H5FD__family_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static herr_t H5FD__family_lock(H5FD_t *_file, hbool_t rw); @@ -108,41 +108,41 @@ static herr_t H5FD__family_unlock(H5FD_t *_file); /* The class struct */ static const H5FD_class_t H5FD_family_g = { - "family", /* name */ - HADDR_MAX, /* maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ + "family", /* name */ + HADDR_MAX, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ H5FD__family_term, /* terminate */ - H5FD__family_sb_size, /* sb_size */ - H5FD__family_sb_encode, /* sb_encode */ - H5FD__family_sb_decode, /* sb_decode */ - sizeof(H5FD_family_fapl_t), /* fapl_size */ - H5FD__family_fapl_get, /* fapl_get */ - H5FD__family_fapl_copy, /* fapl_copy */ - H5FD__family_fapl_free, /* fapl_free */ - 0, /* dxpl_size */ - NULL, /* dxpl_copy */ - NULL, /* dxpl_free */ - H5FD__family_open, /* open */ - H5FD__family_close, /* close */ - H5FD__family_cmp, /* cmp */ - H5FD__family_query, /* query */ - NULL, /* get_type_map */ - NULL, /* alloc */ - NULL, /* free */ - H5FD__family_get_eoa, /* get_eoa */ - H5FD__family_set_eoa, /* set_eoa */ - H5FD__family_get_eof, /* get_eof */ + H5FD__family_sb_size, /* sb_size */ + H5FD__family_sb_encode, /* sb_encode */ + H5FD__family_sb_decode, /* sb_decode */ + sizeof(H5FD_family_fapl_t), /* fapl_size */ + H5FD__family_fapl_get, /* fapl_get */ + H5FD__family_fapl_copy, /* fapl_copy */ + H5FD__family_fapl_free, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD__family_open, /* open */ + H5FD__family_close, /* close */ + H5FD__family_cmp, /* cmp */ + H5FD__family_query, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + H5FD__family_get_eoa, /* get_eoa */ + H5FD__family_set_eoa, /* set_eoa */ + H5FD__family_get_eof, /* get_eof */ H5FD__family_get_handle, /* get_handle */ - H5FD__family_read, /* read */ - H5FD__family_write, /* write */ - H5FD__family_flush, /* flush */ - H5FD__family_truncate, /* truncate */ + H5FD__family_read, /* read */ + H5FD__family_write, /* write */ + H5FD__family_flush, /* flush */ + H5FD__family_truncate, /* truncate */ H5FD__family_lock, /* lock */ H5FD__family_unlock, /* unlock */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; - + /*-------------------------------------------------------------------------- NAME H5FD__init_package -- Initialize interface-specific information @@ -169,7 +169,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD__init_package() */ - + /*------------------------------------------------------------------------- * Function: H5FD_family_init * @@ -201,11 +201,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FD_family_init() */ - + /*--------------------------------------------------------------------------- - * Function: H5FD__family_term + * Function: H5FD__family_term * - * Purpose: Shut down the VFD + * Purpose: Shut down the VFD * * Returns: Non-negative on success or negative on failure * @@ -225,21 +225,21 @@ H5FD__family_term(void) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD__family_term() */ - + /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_family + * Function: H5Pset_fapl_family * - * Purpose: Sets the file access property list FAPL_ID to use the family - * driver. The MEMB_SIZE is the size in bytes of each file - * member (used only when creating a new file) and the - * MEMB_FAPL_ID is a file access property list to be used for - * each family member. + * Purpose: Sets the file access property list FAPL_ID to use the family + * driver. The MEMB_SIZE is the size in bytes of each file + * member (used only when creating a new file) and the + * MEMB_FAPL_ID is a file access property list to be used for + * each family member. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -248,7 +248,7 @@ herr_t H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id) { herr_t ret_value; - H5FD_family_fapl_t fa={0, -1}; + H5FD_family_fapl_t fa={0, -1}; H5P_genplist_t *plist; /* Property list pointer */ FUNC_ENTER_API(FAIL) @@ -275,18 +275,18 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5Pget_fapl_family + * Function: H5Pget_fapl_family * - * Purpose: Returns information about the family file access property - * list though the function arguments. + * Purpose: Returns information about the family file access property + * list though the function arguments. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -295,7 +295,7 @@ herr_t H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*out*/, hid_t *memb_fapl_id/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ - const H5FD_family_fapl_t *fa; + const H5FD_family_fapl_t *fa; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) @@ -319,18 +319,18 @@ done: FUNC_LEAVE_API(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_fapl_get + * Function: H5FD__family_fapl_get * - * Purpose: Gets a file access property list which could be used to - * create an identical file. + * Purpose: Gets a file access property list which could be used to + * create an identical file. * - * Return: Success: Ptr to new file access property list. + * Return: Success: Ptr to new file access property list. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 13, 1999 * *------------------------------------------------------------------------- @@ -338,8 +338,8 @@ done: static void * H5FD__family_fapl_get(H5FD_t *_file) { - H5FD_family_t *file = (H5FD_family_t*)_file; - H5FD_family_fapl_t *fa = NULL; + H5FD_family_t *file = (H5FD_family_t*)_file; + H5FD_family_fapl_t *fa = NULL; H5P_genplist_t *plist; /* Property list pointer */ void *ret_value = NULL; /* Return value */ @@ -364,17 +364,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_fapl_copy + * Function: H5FD__family_fapl_copy * - * Purpose: Copies the family-specific file access properties. + * Purpose: Copies the family-specific file access properties. * - * Return: Success: Ptr to a new property list + * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -417,17 +417,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_fapl_free + * Function: H5FD__family_fapl_free * - * Purpose: Frees the family-specific file access properties. + * Purpose: Frees the family-specific file access properties. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -435,7 +435,7 @@ done: static herr_t H5FD__family_fapl_free(void *_fa) { - H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa; + H5FD_family_fapl_t *fa = (H5FD_family_fapl_t*)_fa; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -448,18 +448,18 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_sb_size + * Function: H5FD__family_sb_size * - * Purpose: Returns the size of the private information to be stored in - * the superblock. + * Purpose: Returns the size of the private information to be stored in + * the superblock. * - * Return: Success: The super block driver data size. + * Return: Success: The super block driver data size. * - * Failure: never fails + * Failure: never fails * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, May 10, 2005 * *------------------------------------------------------------------------- @@ -474,21 +474,21 @@ H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) FUNC_LEAVE_NOAPI(8) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_sb_encode + * Function: H5FD__family_sb_encode * - * Purpose: Encode driver information for the superblock. The NAME - * argument is a nine-byte buffer which will be initialized with - * an eight-character name/version number and null termination. + * Purpose: Encode driver information for the superblock. The NAME + * argument is a nine-byte buffer which will be initialized with + * an eight-character name/version number and null termination. * - * The encoding is the member file size and name template. + * The encoding is the member file size and name template. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, May 10, 2005 * *------------------------------------------------------------------------- @@ -496,7 +496,7 @@ H5FD__family_sb_size(H5FD_t H5_ATTR_UNUSED *_file) static herr_t H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/) { - H5FD_family_t *file = (H5FD_family_t*)_file; + H5FD_family_t *file = (H5FD_family_t*)_file; FUNC_ENTER_STATIC_NOERR @@ -517,21 +517,21 @@ H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD__family_sb_encode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD__family_sb_decode + * Function: H5FD__family_sb_decode * - * Purpose: This function has 2 separate purpose. One is to decodes the + * Purpose: This function has 2 separate purpose. One is to decodes the * superblock information for this driver. The NAME argument is * the eight-character (plus null termination) name stored in i * the file. The FILE argument is updated according to the * information in the superblock. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Tuesday, May 10, 2005 * *------------------------------------------------------------------------- @@ -539,7 +539,7 @@ H5FD__family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out static herr_t H5FD__family_sb_decode(H5FD_t *_file, const char H5_ATTR_UNUSED *name, const unsigned char *buf) { - H5FD_family_t *file = (H5FD_family_t*)_file; + H5FD_family_t *file = (H5FD_family_t*)_file; uint64_t msize; herr_t ret_value = SUCCEED; /* Return value */ @@ -572,19 +572,19 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_sb_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD__family_open + * Function: H5FD__family_open * - * Purpose: Creates and/or opens a family of files as an HDF5 file. + * Purpose: Creates and/or opens a family of files as an HDF5 file. * - * Return: Success: A pointer to a new file dat structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: Success: A pointer to a new file dat structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -595,16 +595,16 @@ done: * memb_name & temp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static H5FD_t * H5FD__family_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t maxaddr) + haddr_t maxaddr) { - H5FD_family_t *file = NULL; - char *memb_name = NULL, *temp = NULL; - hsize_t eof = HADDR_UNDEF; - unsigned t_flags = flags & ~H5F_ACC_CREAT; - H5FD_t *ret_value = NULL; + H5FD_family_t *file = NULL; + char *memb_name = NULL, *temp = NULL; + hsize_t eof = HADDR_UNDEF; + unsigned t_flags = flags & ~H5F_ACC_CREAT; + H5FD_t *ret_value = NULL; FUNC_ENTER_STATIC @@ -746,21 +746,21 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_open() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") + - /*------------------------------------------------------------------------- - * Function: H5FD__family_close + * Function: H5FD__family_close * - * Purpose: Closes a family of files. + * Purpose: Closes a family of files. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative with as many members closed as - * possible. The only subsequent operation - * permitted on the file is a close operation. + * Failure: Negative with as many members closed as + * possible. The only subsequent operation + * permitted on the file is a close operation. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -769,8 +769,8 @@ static herr_t H5FD__family_close(H5FD_t *_file) { H5FD_family_t *file = (H5FD_family_t*)_file; - unsigned nerrors = 0; /* Number of errors while closing member files */ - unsigned u; /* Local index variable */ + unsigned nerrors = 0; /* Number of errors while closing member files */ + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -800,19 +800,19 @@ H5FD__family_close(H5FD_t *_file) FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_close() */ - + /*------------------------------------------------------------------------- - * Function: H5FD__family_cmp + * Function: H5FD__family_cmp * - * Purpose: Compares two file families to see if they are the same. It - * does this by comparing the first member of the two families. + * Purpose: Compares two file families to see if they are the same. It + * does this by comparing the first member of the two families. * - * Return: Success: like strcmp() + * Return: Success: like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by the + * caller). * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -820,8 +820,8 @@ H5FD__family_close(H5FD_t *_file) static int H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_family_t *f1 = (const H5FD_family_t*)_f1; - const H5FD_family_t *f2 = (const H5FD_family_t*)_f2; + const H5FD_family_t *f1 = (const H5FD_family_t*)_f1; + const H5FD_family_t *f2 = (const H5FD_family_t*)_f2; int ret_value = 0; FUNC_ENTER_STATIC_NOERR @@ -834,17 +834,17 @@ H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_cmp() */ - + /*------------------------------------------------------------------------- - * Function: H5FD__family_query + * Function: H5FD__family_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 25, 2000 * *------------------------------------------------------------------------- @@ -852,7 +852,7 @@ H5FD__family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) static herr_t H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */) { - const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */ + const H5FD_family_t *file = (const H5FD_family_t*)_file; /* Family VFD info */ FUNC_ENTER_STATIC_NOERR @@ -872,19 +872,19 @@ H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5FD__family_query() */ - + /*------------------------------------------------------------------------- - * Function: H5FD__family_get_eoa + * Function: H5FD__family_get_eoa * - * Purpose: Returns the end-of-address marker for the file. The EOA - * marker is the first address past the last byte allocated in - * the format address space. + * Purpose: Returns the end-of-address marker for the file. The EOA + * marker is the first address past the last byte allocated in + * the format address space. * - * Return: Success: The end-of-address-marker + * Return: Success: The end-of-address-marker * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -892,24 +892,24 @@ H5FD__family_query(const H5FD_t * _file, unsigned long *flags /* out */) static haddr_t H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) { - const H5FD_family_t *file = (const H5FD_family_t*)_file; + const H5FD_family_t *file = (const H5FD_family_t*)_file; FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(file->eoa) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_set_eoa + * Function: H5FD__family_set_eoa * - * Purpose: Set the end-of-address marker for the file. + * Purpose: Set the end-of-address marker for the file. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -920,14 +920,14 @@ H5FD__family_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) * memb_name in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static herr_t H5FD__family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t abs_eoa) { - H5FD_family_t *file = (H5FD_family_t*)_file; - haddr_t addr = abs_eoa; - char *memb_name = NULL; - unsigned u; /* Local index variable */ + H5FD_family_t *file = (H5FD_family_t*)_file; + haddr_t addr = abs_eoa; + char *memb_name = NULL; + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -987,22 +987,22 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") + - /*------------------------------------------------------------------------- - * Function: H5FD__family_get_eof + * Function: H5FD__family_get_eof * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the total family size or the current EOA marker. + * Purpose: Returns the end-of-file marker, which is the greater of + * either the total family size or the current EOA marker. * - * Return: Success: End of file address, the first address past - * the end of the family of files or the current - * EOA, whichever is larger. + * Return: Success: End of file address, the first address past + * the end of the family of files or the current + * EOA, whichever is larger. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1010,9 +1010,9 @@ H5_GCC_DIAG_ON(format-nonliteral) static haddr_t H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_family_t *file = (const H5FD_family_t*)_file; - haddr_t eof=0; - int i; /* Local index variable */ + const H5FD_family_t *file = (const H5FD_family_t*)_file; + haddr_t eof=0; + int i; /* Local index variable */ haddr_t ret_value = HADDR_UNDEF; /* Return value */ FUNC_ENTER_STATIC_NOERR @@ -1045,7 +1045,7 @@ H5FD__family_get_eof(const H5FD_t *_file, H5FD_mem_t type) FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5FD__family_get_handle * @@ -1085,34 +1085,34 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_read + * Function: H5FD__family_read * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR + * into buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero. Result is stored in caller-supplied - * buffer BUF. + * Return: Success: Zero. Result is stored in caller-supplied + * buffer BUF. * - * Failure: -1, contents of buffer BUF are undefined. + * Failure: -1, contents of buffer BUF are undefined. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- */ static herr_t H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, - void *_buf/*out*/) + void *_buf/*out*/) { - H5FD_family_t *file = (H5FD_family_t*)_file; - unsigned char *buf = (unsigned char*)_buf; - haddr_t sub; - size_t req; + H5FD_family_t *file = (H5FD_family_t*)_file; + unsigned char *buf = (unsigned char*)_buf; + haddr_t sub; + size_t req; hsize_t tempreq; - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ @@ -1131,12 +1131,12 @@ H5FD__family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s sub = addr % file->memb_size; - /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to - * write files bigger than 4GB. */ + /* This check is for mainly for IA32 architecture whose size_t's size + * is 4 bytes, to prevent overflow when user application is trying to + * write files bigger than 4GB. */ tempreq = file->memb_size-sub; - if(tempreq > SIZET_MAX) - tempreq = SIZET_MAX; + if(tempreq > SIZET_MAX) + tempreq = SIZET_MAX; req = MIN(size, (size_t)tempreq); HDassert(unmembs); @@ -1153,33 +1153,33 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_write + * Function: H5FD__family_write * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR + * from buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero + * Return: Success: Zero * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- */ static herr_t H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, - const void *_buf) + const void *_buf) { - H5FD_family_t *file = (H5FD_family_t*)_file; - const unsigned char *buf = (const unsigned char*)_buf; - haddr_t sub; - size_t req; + H5FD_family_t *file = (H5FD_family_t*)_file; + const unsigned char *buf = (const unsigned char*)_buf; + haddr_t sub; + size_t req; hsize_t tempreq; - unsigned u; /* Local index variable */ + unsigned u; /* Local index variable */ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1202,8 +1202,8 @@ H5FD__family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; - if(tempreq > SIZET_MAX) - tempreq = SIZET_MAX; + if(tempreq > SIZET_MAX) + tempreq = SIZET_MAX; req = MIN(size, (size_t)tempreq); HDassert(unmembs); @@ -1220,16 +1220,16 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5FD__family_flush + * Function: H5FD__family_flush * - * Purpose: Flushes all family members. + * Purpose: Flushes all family members. * - * Return: Success: 0 - * Failure: -1, as many files flushed as possible. + * Return: Success: 0 + * Failure: -1, as many files flushed as possible. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1237,8 +1237,8 @@ done: static herr_t H5FD__family_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { - H5FD_family_t *file = (H5FD_family_t*)_file; - unsigned u, nerrors = 0; + H5FD_family_t *file = (H5FD_family_t*)_file; + unsigned u, nerrors = 0; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1254,17 +1254,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_flush() */ - + /*------------------------------------------------------------------------- - * Function: H5FD__family_truncate + * Function: H5FD__family_truncate * - * Purpose: Truncates all family members. + * Purpose: Truncates all family members. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1, as many files truncated as possible. + * Failure: -1, as many files truncated as possible. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, February 23, 2008 * *------------------------------------------------------------------------- @@ -1272,9 +1272,9 @@ done: static herr_t H5FD__family_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing) { - H5FD_family_t *file = (H5FD_family_t*)_file; - unsigned u, nerrors = 0; - herr_t ret_value = SUCCEED; /* Return value */ + H5FD_family_t *file = (H5FD_family_t*)_file; + unsigned u, nerrors = 0; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1289,7 +1289,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_truncate() */ - + /*------------------------------------------------------------------------- * Function: H5FD__family_lock * @@ -1309,7 +1309,7 @@ H5FD__family_lock(H5FD_t *_file, hbool_t rw) { H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1337,7 +1337,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__family_lock() */ - + /*------------------------------------------------------------------------- * Function: H5FD__family_unlock * @@ -1352,8 +1352,8 @@ done: static herr_t H5FD__family_unlock(H5FD_t *_file) { - H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ - unsigned u; /* Local index variable */ + H5FD_family_t *file = (H5FD_family_t *)_file; /* VFD file struct */ + unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index d183511..899c85f 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -12,15 +12,15 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Robb Matzke - * Monday, November 10, 1997 - * - * Purpose: Implements a file driver which dispatches I/O requests to - * other file drivers depending on the purpose of the address - * region being accessed. For instance, all meta-data could be - * place in one file while all raw data goes to some other file. - * This also serves as an example of coding a complex file driver, - * therefore, it should not use any non-public definitions. + * Programmer: Robb Matzke + * Monday, November 10, 1997 + * + * Purpose: Implements a file driver which dispatches I/O requests to + * other file drivers depending on the purpose of the address + * region being accessed. For instance, all meta-data could be + * place in one file while all raw data goes to some other file. + * This also serves as an example of coding a complex file driver, + * therefore, it should not use any non-public definitions. */ #include #include @@ -30,23 +30,23 @@ #ifndef FALSE -#define FALSE 0 +#define FALSE 0 #endif #ifndef TRUE -#define TRUE 1 +#define TRUE 1 #endif /* Loop through all mapped files */ -#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ - H5FD_mem_t ITER, LOOPVAR; \ - unsigned SEEN[H5FD_MEM_NTYPES]; \ - \ - memset(SEEN, 0, sizeof SEEN); \ +#define UNIQUE_MEMBERS_CORE(MAP, ITER, SEEN, LOOPVAR) { \ + H5FD_mem_t ITER, LOOPVAR; \ + unsigned SEEN[H5FD_MEM_NTYPES]; \ + \ + memset(SEEN, 0, sizeof SEEN); \ for (ITER=H5FD_MEM_SUPER; ITER0 && LOOPVAR0 && LOOPVARsizeof(meta_name) - QK & JK - 2013/01/17 */ - strncpy(meta_name, meta_ext, sizeof(meta_name)); + strncpy(meta_name, meta_ext, sizeof(meta_name)); meta_name[sizeof(meta_name) - 1] = '\0'; } - else - sprintf(meta_name, "%%s%s", meta_ext); + else + sprintf(meta_name, "%%s%s", meta_ext); } else { - strncpy(meta_name, "%s.meta", sizeof(meta_name)); + strncpy(meta_name, "%s.meta", sizeof(meta_name)); meta_name[sizeof(meta_name) - 1] = '\0'; } memb_name[H5FD_MEM_SUPER] = meta_name; /* process raw filename */ if(raw_ext) { - if(strstr(raw_ext, "%s")) { + if(strstr(raw_ext, "%s")) { /* Note: this doesn't accommodate for when the '%s' in the user's * string is at a position >sizeof(raw_name) - QK & JK - 2013/01/17 */ - strncpy(raw_name, raw_ext, sizeof(raw_name)); + strncpy(raw_name, raw_ext, sizeof(raw_name)); raw_name[sizeof(raw_name) - 1] = '\0'; } - else - sprintf(raw_name, "%%s%s", raw_ext); + else + sprintf(raw_name, "%%s%s", raw_ext); } else { - strncpy(raw_name, "%s.raw", sizeof(raw_name)); + strncpy(raw_name, "%s.raw", sizeof(raw_name)); raw_name[sizeof(raw_name) - 1] = '\0'; } memb_name[H5FD_MEM_DRAW] = raw_name; @@ -343,96 +343,96 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, return H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE); } - + /*------------------------------------------------------------------------- - * Function: H5Pset_fapl_multi + * Function: H5Pset_fapl_multi * - * Purpose: Sets the file access property list FAPL_ID to use the multi - * driver. The MEMB_MAP array maps memory usage types to other - * memory usage types and is the mechanism which allows the - * caller to specify how many files are created. The array - * contains H5FD_MEM_NTYPES entries which are either the value - * H5FD_MEM_DEFAULT or a memory usage type and the number of - * unique values determines the number of files which are - * opened. For each memory usage type which will be associated - * with a file the MEMB_FAPL array should have a property list - * and the MEMB_NAME array should be a name generator (a - * printf-style format with a %s which will be replaced with the - * name passed to H5FDopen(), usually from H5Fcreate() or - * H5Fopen()). + * Purpose: Sets the file access property list FAPL_ID to use the multi + * driver. The MEMB_MAP array maps memory usage types to other + * memory usage types and is the mechanism which allows the + * caller to specify how many files are created. The array + * contains H5FD_MEM_NTYPES entries which are either the value + * H5FD_MEM_DEFAULT or a memory usage type and the number of + * unique values determines the number of files which are + * opened. For each memory usage type which will be associated + * with a file the MEMB_FAPL array should have a property list + * and the MEMB_NAME array should be a name generator (a + * printf-style format with a %s which will be replaced with the + * name passed to H5FDopen(), usually from H5Fcreate() or + * H5Fopen()). * - * If RELAX is set then opening an existing file for read-only - * access will not fail if some file members are missing. This - * allows a file to be accessed in a limited sense if just the - * meta data is available. + * If RELAX is set then opening an existing file for read-only + * access will not fail if some file members are missing. This + * allows a file to be accessed in a limited sense if just the + * meta data is available. * - * Defaults: Default values for each of the optional arguments are: + * Defaults: Default values for each of the optional arguments are: * - * memb_map: The default member map has the value - * H5FD_MEM_DEFAULT for each element. + * memb_map: The default member map has the value + * H5FD_MEM_DEFAULT for each element. * - * memb_fapl: The value H5P_DEFAULT for each element. + * memb_fapl: The value H5P_DEFAULT for each element. * - * memb_name: The string `%s-X.h5' where `X' is one of the - * letters `s' (H5FD_MEM_SUPER), - * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW), - * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP), - * `o' (H5FD_MEM_OHDR). + * memb_name: The string `%s-X.h5' where `X' is one of the + * letters `s' (H5FD_MEM_SUPER), + * `b' (H5FD_MEM_BTREE), `r' (H5FD_MEM_DRAW), + * `g' (H5FD_MEM_GHEAP), 'l' (H5FD_MEM_LHEAP), + * `o' (H5FD_MEM_OHDR). * - * memb_addr: The value HADDR_UNDEF for each element. + * memb_addr: The value HADDR_UNDEF for each element. * * - * Example: To set up a multi file access property list which partitions - * data into meta and raw files each being 1/2 of the address - * space one would say: + * Example: To set up a multi file access property list which partitions + * data into meta and raw files each being 1/2 of the address + * space one would say: * - * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; - * hid_t memb_fapl[H5FD_MEM_NTYPES]; - * const char *memb[H5FD_MEM_NTYPES]; - * haddr_t memb_addr[H5FD_MEM_NTYPES]; + * H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; + * hid_t memb_fapl[H5FD_MEM_NTYPES]; + * const char *memb[H5FD_MEM_NTYPES]; + * haddr_t memb_addr[H5FD_MEM_NTYPES]; * - * // The mapping... - * for (mt=0; mt=H5FD_MEM_NTYPES) + /* Map usage type */ + mmt = memb_map[mt]; + if (mmt<0 || mmt>=H5FD_MEM_NTYPES) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1) - if (H5FD_MEM_DEFAULT==mmt) mmt = mt; + if (H5FD_MEM_DEFAULT==mmt) mmt = mt; - /* - * All members of MEMB_FAPL must be either defaults or actual file - * access property lists. - */ - if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) + /* + * All members of MEMB_FAPL must be either defaults or actual file + * access property lists. + */ + if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1) - /* All names must be defined */ - if (!memb_name[mmt] || !memb_name[mmt][0]) + /* All names must be defined */ + if (!memb_name[mmt] || !memb_name[mmt][0]) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1) } @@ -506,30 +506,30 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, return H5Pset_driver(fapl_id, H5FD_MULTI, &fa); } - + /*------------------------------------------------------------------------- - * Function: H5Pget_fapl_multi + * Function: H5Pget_fapl_multi * - * Purpose: Returns information about the multi file access property - * list though the function arguments which are the same as for - * H5Pset_fapl_multi() above. + * Purpose: Returns information about the multi file access property + * list though the function arguments which are the same as for + * H5Pset_fapl_multi() above. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- */ herr_t H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, - hid_t *memb_fapl/*out*/, char **memb_name/*out*/, - haddr_t *memb_addr/*out*/, hbool_t *relax) + hid_t *memb_fapl/*out*/, char **memb_name/*out*/, + haddr_t *memb_addr/*out*/, hbool_t *relax) { const H5FD_multi_fapl_t *fa; - H5FD_mem_t mt; + H5FD_mem_t mt; static const char *func="H5FDget_fapl_multi"; /* Function Name for error reporting */ /*NO TRACE*/ @@ -548,41 +548,41 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, if (memb_map) memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t)); if (memb_fapl) { - for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]>=0) - memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); - else - memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/ - } + for (mt=H5FD_MEM_DEFAULT; mtmemb_fapl[mt]>=0) + memb_fapl[mt] = H5Pcopy(fa->memb_fapl[mt]); + else + memb_fapl[mt] = fa->memb_fapl[mt]; /*default or bad ID*/ + } } if(memb_name) { - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(fa->memb_name[mt]) - memb_name[mt] = my_strdup(fa->memb_name[mt]); - else - memb_name[mt] = NULL; - } + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if(fa->memb_name[mt]) + memb_name[mt] = my_strdup(fa->memb_name[mt]); + else + memb_name[mt] = NULL; + } } if (memb_addr) - memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); + memcpy(memb_addr, fa->memb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); if (relax) - *relax = fa->relax; + *relax = fa->relax; return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_size + * Function: H5FD_multi_sb_size * - * Purpose: Returns the size of the private information to be stored in - * the superblock. + * Purpose: Returns the size of the private information to be stored in + * the superblock. * - * Return: Success: The super block driver data size. + * Return: Success: The super block driver data size. * - * Failure: never fails + * Failure: never fails * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- @@ -590,16 +590,16 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, static hsize_t H5FD_multi_sb_size(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - unsigned nseen = 0; - hsize_t nbytes = 8; /*size of header*/ + H5FD_multi_t *file = (H5FD_multi_t*)_file; + unsigned nseen = 0; + hsize_t nbytes = 8; /*size of header*/ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* How many unique files? */ UNIQUE_MEMBERS(file->fa.memb_map, mt) { - nseen++; + nseen++; } END_MEMBERS; /* Addresses and EOA markers */ @@ -614,40 +614,40 @@ H5FD_multi_sb_size(H5FD_t *_file) return nbytes; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_encode + * Function: H5FD_multi_sb_encode * - * Purpose: Encode driver information for the superblock. The NAME - * argument is a nine-byte buffer which will be initialized with - * an eight-character name/version number and null termination. + * Purpose: Encode driver information for the superblock. The NAME + * argument is a nine-byte buffer which will be initialized with + * an eight-character name/version number and null termination. * - * The encoding is a six-byte member mapping followed two bytes - * which are unused. For each unique file in usage-type order - * encode all the starting addresses as unsigned 64-bit integers, - * then all the EOA values as unsigned 64-bit integers, then all - * the template names as null terminated strings which are - * multiples of 8 characters. + * The encoding is a six-byte member mapping followed two bytes + * which are unused. For each unique file in usage-type order + * encode all the starting addresses as unsigned 64-bit integers, + * then all the EOA values as unsigned 64-bit integers, then all + * the template names as null terminated strings which are + * multiples of 8 characters. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, - unsigned char *buf/*out*/) + unsigned char *buf/*out*/) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - haddr_t memb_eoa; - unsigned char *p; - size_t nseen; - size_t i; - H5FD_mem_t m; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + haddr_t memb_eoa; + unsigned char *p; + size_t nseen; + size_t i; + H5FD_mem_t m; static const char *func="H5FD_multi_sb_encode"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -698,23 +698,23 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, return 0; } /* end H5FD_multi_sb_encode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_sb_decode + * Function: H5FD_multi_sb_decode * - * Purpose: Decodes the superblock information for this driver. The NAME - * argument is the eight-character (plus null termination) name - * stored in the file. + * Purpose: Decodes the superblock information for this driver. The NAME + * argument is the eight-character (plus null termination) name + * stored in the file. * - * The FILE argument is updated according to the information in - * the superblock. This may mean that some member files are - * closed and others are opened. + * The FILE argument is updated according to the information in + * the superblock. This may mean that some member files are + * closed and others are opened. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 16, 1999 * *------------------------------------------------------------------------- @@ -722,17 +722,17 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, static herr_t H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - char x[2*H5FD_MEM_NTYPES*8]; - H5FD_mem_t map[H5FD_MEM_NTYPES]; - int i; - size_t nseen=0; - hbool_t map_changed=FALSE; - hbool_t in_use[H5FD_MEM_NTYPES]; - const char *memb_name[H5FD_MEM_NTYPES]; - haddr_t memb_addr[H5FD_MEM_NTYPES]; - haddr_t memb_eoa[H5FD_MEM_NTYPES]; - haddr_t *ap; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + char x[2*H5FD_MEM_NTYPES*8]; + H5FD_mem_t map[H5FD_MEM_NTYPES]; + int i; + size_t nseen=0; + hbool_t map_changed=FALSE; + hbool_t in_use[H5FD_MEM_NTYPES]; + const char *memb_name[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + haddr_t memb_eoa[H5FD_MEM_NTYPES]; + haddr_t *ap; static const char *func="H5FD_multi_sb_decode"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -839,20 +839,20 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) return 0; } /* end H5FD_multi_sb_decode() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_get + * Function: H5FD_multi_fapl_get * - * Purpose: Returns a file access property list which indicates how the - * specified file is being accessed. The return list could be - * used to access another file the same way. + * Purpose: Returns a file access property list which indicates how the + * specified file is being accessed. The return list could be + * used to access another file the same way. * - * Return: Success: Ptr to new file access property list with all - * members copied from the file struct. + * Return: Success: Ptr to new file access property list with all + * members copied from the file struct. * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, August 13, 1999 * *------------------------------------------------------------------------- @@ -860,7 +860,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) static void * H5FD_multi_fapl_get(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_multi_t *file = (H5FD_multi_t*)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -868,17 +868,17 @@ H5FD_multi_fapl_get(H5FD_t *_file) return H5FD_multi_fapl_copy(&(file->fa)); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_copy + * Function: H5FD_multi_fapl_copy * - * Purpose: Copies the multi-specific file access properties. + * Purpose: Copies the multi-specific file access properties. * - * Return: Success: Ptr to a new property list + * Return: Success: Ptr to a new property list * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -898,20 +898,20 @@ H5FD_multi_fapl_copy(const void *_old_fa) memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t)); ALL_MEMBERS(mt) { - if (old_fa->memb_fapl[mt]>=0) { - if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) { + if (old_fa->memb_fapl[mt]>=0) { + if (H5Iinc_ref(old_fa->memb_fapl[mt]) < 0) { nerrors++; break; } - new_fa->memb_fapl[mt] = old_fa->memb_fapl[mt]; - } - if (old_fa->memb_name[mt]) { - new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); + new_fa->memb_fapl[mt] = old_fa->memb_fapl[mt]; + } + if (old_fa->memb_name[mt]) { + new_fa->memb_name[mt] = my_strdup(old_fa->memb_name[mt]); if (NULL == new_fa->memb_name[mt]) { nerrors++; break; } - } + } } END_MEMBERS; if (nerrors) { @@ -927,17 +927,17 @@ H5FD_multi_fapl_copy(const void *_old_fa) return new_fa; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_fapl_free + * Function: H5FD_multi_fapl_free * - * Purpose: Frees the multi-specific file access properties. + * Purpose: Frees the multi-specific file access properties. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -945,17 +945,17 @@ H5FD_multi_fapl_copy(const void *_old_fa) static herr_t H5FD_multi_fapl_free(void *_fa) { - H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa; + H5FD_multi_fapl_t *fa = (H5FD_multi_fapl_t*)_fa; static const char *func="H5FD_multi_fapl_free"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - if (fa->memb_fapl[mt]>=0) + if (fa->memb_fapl[mt]>=0) if(H5Idec_ref(fa->memb_fapl[mt])<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1) - if (fa->memb_name[mt]) + if (fa->memb_name[mt]) free(fa->memb_name[mt]); } END_MEMBERS; free(fa); @@ -963,19 +963,19 @@ H5FD_multi_fapl_free(void *_fa) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_open + * Function: H5FD_multi_open * - * Purpose: Creates and/or opens a multi HDF5 file. + * Purpose: Creates and/or opens a multi HDF5 file. * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: Success: A pointer to a new file data structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -983,10 +983,10 @@ H5FD_multi_fapl_free(void *_fa) static H5FD_t * H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - H5FD_multi_t *file=NULL; - hid_t close_fapl=-1; + H5FD_multi_t *file=NULL; + hid_t close_fapl=-1; const H5FD_multi_fapl_t *fa; - H5FD_mem_t m; + H5FD_mem_t m; static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1060,19 +1060,19 @@ error: return NULL; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_close + * Function: H5FD_multi_close * - * Purpose: Closes a multi file. + * Purpose: Closes a multi file. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative with as many members closed as - * possible. The only subsequent operation - * permitted on the file is a close operation. + * Failure: Negative with as many members closed as + * possible. The only subsequent operation + * permitted on the file is a close operation. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1080,8 +1080,8 @@ error: static herr_t H5FD_multi_close(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors=0; static const char *func="H5FD_multi_close"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1089,21 +1089,21 @@ H5FD_multi_close(H5FD_t *_file) /* Close as many members as possible */ ALL_MEMBERS(mt) { - if (file->memb[mt]) { - if (H5FDclose(file->memb[mt])<0) { + if (file->memb[mt]) { + if (H5FDclose(file->memb[mt])<0) { nerrors++; - } else { + } else { file->memb[mt] = NULL; - } - } + } + } } END_MEMBERS; if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1) /* Clean up other stuff */ ALL_MEMBERS(mt) { - if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]); - if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); + if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]); + if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]); } END_MEMBERS; free(file->name); @@ -1111,22 +1111,21 @@ H5FD_multi_close(H5FD_t *_file) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_cmp + * Function: H5FD_multi_cmp * - * Purpose: Compares two file families to see if they are the same. It - * does this by comparing the first common member of the two - * families. If the families have no members in common then the - * file with the earliest member is smaller than the other file. - * We abort if neither file has any members. + * Purpose: Compares two file families to see if they are the same. It + * does this by comparing the first common member of the two + * families. If the families have no members in common then the + * file with the earliest member is smaller than the other file. + * We abort if neither file has any members. * - * Return: Success: like strcmp() + * Return: Success: like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by th caller). * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1134,24 +1133,24 @@ H5FD_multi_close(H5FD_t *_file) static int H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) { - const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1; - const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2; - H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; - int cmp=0; + const H5FD_multi_t *f1 = (const H5FD_multi_t*)_f1; + const H5FD_multi_t *f2 = (const H5FD_multi_t*)_f2; + H5FD_mem_t out_mt = H5FD_MEM_DEFAULT; + int cmp=0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { out_mt = mt; - if(f1->memb[mt] && f2->memb[mt]) + if(f1->memb[mt] && f2->memb[mt]) break; - if(!cmp) { - if(f1->memb[mt]) + if(!cmp) { + if(f1->memb[mt]) cmp = -1; - else if(f2->memb[mt]) + else if(f2->memb[mt]) cmp = 1; - } + } } END_MEMBERS; assert(cmp || out_mt=H5FD_MEM_NTYPES) @@ -1160,18 +1159,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_query + * Function: H5FD_multi_query * - * Purpose: Set the flags that this VFL driver is capable of supporting. + * Purpose: Set the flags that this VFL driver is capable of supporting. * (listed in H5FDpublic.h) * - * Return: Success: non-negative + * Return: Success: non-negative * - * Failure: negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, September 26, 2000 * *------------------------------------------------------------------------- @@ -1194,16 +1193,16 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) return(0); } /* end H5FD_multi_query() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_type_map + * Function: H5FD_multi_get_type_map * - * Purpose: Retrieve the memory type mapping for this file + * Purpose: Retrieve the memory type mapping for this file * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 9, 2008 * *------------------------------------------------------------------------- @@ -1211,7 +1210,7 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) static herr_t H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; /* Copy file's free space type mapping */ memcpy(type_map, file->fa.memb_map, sizeof(file->fa.memb_map)); @@ -1219,19 +1218,19 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) return(0); } /* end H5FD_multi_get_type_map() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_eoa + * Function: H5FD_multi_get_eoa * - * Purpose: Returns the end-of-address marker for the file. The EOA - * marker is the first address past the last byte allocated in - * the format address space. + * Purpose: Returns the end-of-address marker for the file. The EOA + * marker is the first address past the last byte allocated in + * the format address space. * - * Return: Success: The end-of-address-marker + * Return: Success: The end-of-address-marker * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1239,7 +1238,7 @@ H5FD_multi_get_type_map(const H5FD_t *_file, H5FD_mem_t *type_map) static haddr_t H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; haddr_t eoa = 0; static const char *func="H5FD_multi_get_eoa"; /* Function Name for error reporting */ @@ -1256,26 +1255,26 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) UNIQUE_MEMBERS(file->fa.memb_map, mt) { haddr_t memb_eoa; - if (file->memb[mt]) { + if (file->memb[mt]) { /* Retrieve EOA */ - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { memb_eoa = H5FDget_eoa(file->memb[mt], mt); - } H5E_END_TRY; + } H5E_END_TRY; - if(HADDR_UNDEF == memb_eoa) + if(HADDR_UNDEF == memb_eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) if(memb_eoa>0) memb_eoa += file->fa.memb_addr[mt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - memb_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF != memb_eoa); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + memb_eoa = file->memb_next[mt]; + assert(HADDR_UNDEF != memb_eoa); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) - } + } if(memb_eoa > eoa) eoa = memb_eoa; @@ -1286,44 +1285,44 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - if(file->memb[mmt]) { + if(file->memb[mmt]) { H5E_BEGIN_TRY { - eoa = H5FDget_eoa(file->memb[mmt], mmt); + eoa = H5FDget_eoa(file->memb[mmt], mmt); } H5E_END_TRY; - if(HADDR_UNDEF == eoa) + if(HADDR_UNDEF == eoa) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) - if(eoa > 0) + if(eoa > 0) eoa += file->fa.memb_addr[mmt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - eoa = file->memb_next[mmt]; - assert(HADDR_UNDEF != eoa); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + eoa = file->memb_next[mmt]; + assert(HADDR_UNDEF != eoa); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) - } + } } return eoa; } /* end H5FD_multi_get_eoa() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_set_eoa + * Function: H5FD_multi_set_eoa * - * Purpose: Set the end-of-address marker for the file by savig the new - * EOA value in the file struct. Also set the EOA marker for the - * subfile in which the new EOA value falls. We don't set the - * EOA values of any other subfiles. + * Purpose: Set the end-of-address marker for the file by savig the new + * EOA value in the file struct. Also set the EOA marker for the + * subfile in which the new EOA value falls. We don't set the + * EOA values of any other subfiles. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1331,9 +1330,9 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) static herr_t H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; - herr_t status; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; + herr_t status; static const char *func="H5FD_multi_set_eoa"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1364,7 +1363,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) assert(eoa < file->memb_next[mmt]); H5E_BEGIN_TRY { - status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); + status = H5FDset_eoa(file->memb[mmt], mmt, (eoa - file->fa.memb_addr[mmt])); } H5E_END_TRY; if(status < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) @@ -1372,20 +1371,20 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) return 0; } /* end H5FD_multi_set_eoa() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_get_eof + * Function: H5FD_multi_get_eof * - * Purpose: Returns the end-of-file marker, which is the greater of - * either the total multi size or the current EOA marker. + * Purpose: Returns the end-of-file marker, which is the greater of + * either the total multi size or the current EOA marker. * - * Return: Success: End of file address, the first address past - * the end of the multi of files or the current - * EOA, whichever is larger. + * Return: Success: End of file address, the first address past + * the end of the multi of files or the current + * EOA, whichever is larger. * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1393,8 +1392,8 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) static haddr_t H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) { - const H5FD_multi_t *file = (const H5FD_multi_t*)_file; - haddr_t eof = 0; + const H5FD_multi_t *file = (const H5FD_multi_t*)_file; + haddr_t eof = 0; static const char *func="H5FD_multi_get_eof"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1433,31 +1432,31 @@ H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) if(H5FD_MEM_DEFAULT == mmt) mmt = type; - if(file->memb[mmt]) { + if(file->memb[mmt]) { /* Retrieve EOF */ H5E_BEGIN_TRY { - eof = H5FDget_eof(file->memb[mmt], mmt); + eof = H5FDget_eof(file->memb[mmt], mmt); } H5E_END_TRY; - if(HADDR_UNDEF == eof) + if(HADDR_UNDEF == eof) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) - if(eof > 0) + if(eof > 0) eof += file->fa.memb_addr[mmt]; - } else if(file->fa.relax) { - /* - * The member is not open yet (maybe it doesn't exist). Make the - * best guess about the end-of-file. - */ - eof = file->memb_next[mmt]; - assert(HADDR_UNDEF != eof); - } else { + } else if(file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + eof = file->memb_next[mmt]; + assert(HADDR_UNDEF != eof); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) - } + } } return eof; } - + /*------------------------------------------------------------------------- * Function: H5FD_multi_get_handle * @@ -1488,17 +1487,17 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle)); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_alloc + * Function: H5FD_multi_alloc * - * Purpose: Allocate file memory. + * Purpose: Allocate file memory. * - * Return: Success: Address of new memory + * Return: Success: Address of new memory * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 12, 1999 * *------------------------------------------------------------------------- @@ -1506,9 +1505,9 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; - haddr_t addr; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; + haddr_t addr; static const char *func="H5FD_multi_alloc"; /* Function Name for error reporting */ mmt = file->fa.memb_map[type]; @@ -1529,31 +1528,31 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /*#ifdef TMP if ( addr + size > file->eoa ) { - if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) { + if ( H5FD_multi_set_eoa(_file, addr + size) < 0 ) { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, \ - "can't set eoa", HADDR_UNDEF) - } + "can't set eoa", HADDR_UNDEF) + } } #else if ( addr + size > file->eoa ) - file->eoa = addr + size; + file->eoa = addr + size; #endif */ return addr; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_free + * Function: H5FD_multi_free * - * Purpose: Frees memory + * Purpose: Frees memory * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 12, 1999 * *------------------------------------------------------------------------- @@ -1561,8 +1560,8 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mmt; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mmt; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -1575,20 +1574,20 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi return H5FDfree(file->memb[mmt], mmt, dxpl_id, addr-file->fa.memb_addr[mmt], size); } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_read + * Function: H5FD_multi_read * - * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR - * into buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR + * into buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero. Result is stored in caller-supplied - * buffer BUF. + * Return: Success: Zero. Result is stored in caller-supplied + * buffer BUF. * - * Failure: -1, contents of buffer BUF are undefined. + * Failure: -1, contents of buffer BUF are undefined. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1597,26 +1596,26 @@ static herr_t H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; - haddr_t start_addr = 0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; + haddr_t start_addr = 0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - mmt = file->fa.memb_map[mt]; - if(H5FD_MEM_DEFAULT == mmt) + mmt = file->fa.memb_map[mt]; + if(H5FD_MEM_DEFAULT == mmt) mmt = mt; - assert(mmt > 0 && mmt < H5FD_MEM_NTYPES); + assert(mmt > 0 && mmt < H5FD_MEM_NTYPES); - if(file->fa.memb_addr[mmt] > addr) + if(file->fa.memb_addr[mmt] > addr) continue; - if(file->fa.memb_addr[mmt] >= start_addr) { - start_addr = file->fa.memb_addr[mmt]; - hi = mmt; - } /* end if */ + if(file->fa.memb_addr[mmt] >= start_addr) { + start_addr = file->fa.memb_addr[mmt]; + hi = mmt; + } /* end if */ } /* end for */ assert(hi > 0); @@ -1624,19 +1623,19 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, return H5FDread(file->memb[hi], type, dxpl_id, addr - start_addr, size, _buf); } /* end H5FD_multi_read() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_write + * Function: H5FD_multi_write * - * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR - * from buffer BUF according to data transfer properties in - * DXPL_ID. + * Purpose: Writes SIZE bytes of data to FILE beginning at address ADDR + * from buffer BUF according to data transfer properties in + * DXPL_ID. * - * Return: Success: Zero + * Return: Success: Zero * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1645,26 +1644,26 @@ static herr_t H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *_buf) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; - haddr_t start_addr = 0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt, mmt, hi = H5FD_MEM_DEFAULT; + haddr_t start_addr = 0; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Find the file to which this address belongs */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - mmt = file->fa.memb_map[mt]; - if(H5FD_MEM_DEFAULT == mmt) + mmt = file->fa.memb_map[mt]; + if(H5FD_MEM_DEFAULT == mmt) mmt = mt; - assert(mmt > 0 && mmt 0 && mmtfa.memb_addr[mmt] > addr) + if(file->fa.memb_addr[mmt] > addr) continue; - if(file->fa.memb_addr[mmt] >= start_addr) { - start_addr = file->fa.memb_addr[mmt]; - hi = mmt; - } /* end if */ + if(file->fa.memb_addr[mmt] >= start_addr) { + start_addr = file->fa.memb_addr[mmt]; + hi = mmt; + } /* end if */ } /* end for */ assert(hi > 0); @@ -1672,17 +1671,17 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, return H5FDwrite(file->memb[hi], type, dxpl_id, addr - start_addr, size, _buf); } /* end H5FD_multi_write() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_flush + * Function: H5FD_multi_flush * - * Purpose: Flushes all multi members. + * Purpose: Flushes all multi members. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1, as many files flushed as possible. + * Failure: -1, as many files flushed as possible. * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, August 4, 1999 * *------------------------------------------------------------------------- @@ -1690,13 +1689,13 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, static herr_t H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt; + int nerrors=0; static const char *func="H5FD_multi_flush"; /* Function Name for error reporting */ #if 0 - H5FD_mem_t mmt; + H5FD_mem_t mmt; /* Debugging stuff... */ fprintf(stderr, "multifile access information:\n"); @@ -1704,9 +1703,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* print the map */ fprintf(stderr, " map="); for (mt=1; mtmemb_map[mt]; - if (H5FD_MEM_DEFAULT==mmt) mmt = mt; - fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt); + mmt = file->memb_map[mt]; + if (H5FD_MEM_DEFAULT==mmt) mmt = mt; + fprintf(stderr, "%s%d", 1==mt?"":",", (int)mmt); } fprintf(stderr, "\n"); @@ -1716,14 +1715,14 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n"); for (mt=1; mtmemb_addr[mt]) { - haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); - fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", - (int)mt, (unsigned long long)(file->memb_addr[mt]), - (unsigned long long)eoa, - (unsigned long long)(file->memb_next[mt]), - file->memb_name[mt]); - } + if (HADDR_UNDEF!=file->memb_addr[mt]) { + haddr_t eoa = H5FDget_eoa(file->memb[mt], mt); + fprintf(stderr, " %6d %20llu %20llu %20llu %s\n", + (int)mt, (unsigned long long)(file->memb_addr[mt]), + (unsigned long long)eoa, + (unsigned long long)(file->memb_next[mt]), + file->memb_name[mt]); + } } #endif @@ -1732,11 +1731,11 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* Flush each file */ for (mt=H5FD_MEM_SUPER; mtmemb[mt]) { - H5E_BEGIN_TRY { - if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++; - } H5E_END_TRY; - } + if (file->memb[mt]) { + H5E_BEGIN_TRY { + if (H5FDflush(file->memb[mt],dxpl_id,closing)<0) nerrors++; + } H5E_END_TRY; + } } if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) @@ -1744,16 +1743,16 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) return 0; } - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_truncate + * Function: H5FD_multi_truncate * - * Purpose: Truncates all multi members. + * Purpose: Truncates all multi members. * - * Return: Success: 0 - * Failure: -1, as many files truncated as possible. + * Return: Success: 0 + * Failure: -1, as many files truncated as possible. * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, January 31, 2008 * *------------------------------------------------------------------------- @@ -1761,9 +1760,9 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) static herr_t H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - H5FD_mem_t mt; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + H5FD_mem_t mt; + int nerrors=0; static const char *func="H5FD_multi_truncate"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1771,12 +1770,12 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) /* Truncate each file */ for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { - if(file->memb[mt]) { - H5E_BEGIN_TRY { - if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0) + if(file->memb[mt]) { + H5E_BEGIN_TRY { + if(H5FDtruncate(file->memb[mt], dxpl_id, closing) < 0) nerrors++; - } H5E_END_TRY; - } + } H5E_END_TRY; + } } if(nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error truncating member files", -1) @@ -1784,28 +1783,28 @@ H5FD_multi_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) return 0; } /* end H5FD_multi_truncate() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_lock + * Function: H5FD_multi_lock * - * Purpose: Place a lock on all multi members. - * When there is error in locking a member file, it will not - * proceed further and will try to remove the locks of those - * member files that are locked before error is encountered. + * Purpose: Place a lock on all multi members. + * When there is error in locking a member file, it will not + * proceed further and will try to remove the locks of those + * member files that are locked before error is encountered. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi; March 2015 + * Programmer: Vailin Choi; March 2015 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_lock(H5FD_t *_file, hbool_t rw) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors = 0; - H5FD_mem_t out_mt; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors = 0; + H5FD_mem_t out_mt; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1842,26 +1841,26 @@ H5FD_multi_lock(H5FD_t *_file, hbool_t rw) } /* H5FD_multi_lock() */ - + /*------------------------------------------------------------------------- - * Function: H5FD_multi_unlock + * Function: H5FD_multi_unlock * - * Purpose: Remove the lock on all multi members. - * It will try to unlock all member files but will record error - * encountered. + * Purpose: Remove the lock on all multi members. + * It will try to unlock all member files but will record error + * encountered. * - * Return: Success: 0 - * Failure: -1 + * Return: Success: 0 + * Failure: -1 * - * Programmer: Vailin Choi; March 2015 + * Programmer: Vailin Choi; March 2015 * *------------------------------------------------------------------------- */ static herr_t H5FD_multi_unlock(H5FD_t *_file) { - H5FD_multi_t *file = (H5FD_multi_t*)_file; - int nerrors=0; + H5FD_multi_t *file = (H5FD_multi_t*)_file; + int nerrors=0; static const char *func="H5FD_multi_unlock"; /* Function Name for error reporting */ /* Clear the error stack */ @@ -1870,7 +1869,7 @@ H5FD_multi_unlock(H5FD_t *_file) ALL_MEMBERS(mt) { if(file->memb[mt]) if(H5FDunlock(file->memb[mt]) < 0) - nerrors++; + nerrors++; } END_MEMBERS; if(nerrors) @@ -1879,18 +1878,18 @@ H5FD_multi_unlock(H5FD_t *_file) return 0; } /* H5FD_multi_unlock() */ - + /*------------------------------------------------------------------------- - * Function: compute_next + * Function: compute_next * - * Purpose: Compute the memb_next[] values of the file based on the - * file's member map and the member starting addresses. + * Purpose: Compute the memb_next[] values of the file based on the + * file's member map and the member starting addresses. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 23, 1999 * *------------------------------------------------------------------------- @@ -1902,36 +1901,36 @@ compute_next(H5FD_multi_t *file) H5Eclear2(H5E_DEFAULT); ALL_MEMBERS(mt) { - file->memb_next[mt] = HADDR_UNDEF; + file->memb_next[mt] = HADDR_UNDEF; } END_MEMBERS; UNIQUE_MEMBERS(file->fa.memb_map, mt1) { - UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { - if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && - (HADDR_UNDEF==file->memb_next[mt1] || - file->memb_next[mt1]>file->fa.memb_addr[mt2])) { - file->memb_next[mt1] = file->fa.memb_addr[mt2]; - } - } END_MEMBERS; - if (HADDR_UNDEF==file->memb_next[mt1]) { - file->memb_next[mt1] = HADDR_MAX; /*last member*/ - } + UNIQUE_MEMBERS2(file->fa.memb_map, mt2) { + if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && + (HADDR_UNDEF==file->memb_next[mt1] || + file->memb_next[mt1]>file->fa.memb_addr[mt2])) { + file->memb_next[mt1] = file->fa.memb_addr[mt2]; + } + } END_MEMBERS; + if (HADDR_UNDEF==file->memb_next[mt1]) { + file->memb_next[mt1] = HADDR_MAX; /*last member*/ + } } END_MEMBERS; return 0; } - + /*------------------------------------------------------------------------- - * Function: open_members + * Function: open_members * - * Purpose: Opens all members which are not opened yet. + * Purpose: Opens all members which are not opened yet. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Monday, August 23, 1999 * *------------------------------------------------------------------------- @@ -1942,7 +1941,7 @@ compute_next(H5FD_multi_t *file) * tmp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static int open_members(H5FD_multi_t *file) { @@ -1976,9 +1975,9 @@ open_members(H5FD_multi_t *file) return 0; } -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") + - #ifdef _H5private_H /* * This is not related to the functionality of the driver code. diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index d659a34..48834be 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -22,13 +22,13 @@ #include "H5FDpublic.h" /* Private headers needed by this file */ -#include "H5Pprivate.h" /* Property lists */ +#include "H5Pprivate.h" /* Property lists */ /* * The MPI drivers are needed because there are * places where we check for things that aren't handled by these drivers. */ -#include "H5FDmpi.h" /* MPI-based file drivers */ +#include "H5FDmpi.h" /* MPI-based file drivers */ /**************************/ @@ -75,16 +75,16 @@ typedef struct { /* Define default file image info */ #define H5FD_DEFAULT_FILE_IMAGE_INFO { \ - /* file image buffer */ NULL, \ - /* buffer size */ 0, \ + NULL, /* file image buffer */ \ + 0, /* buffer size */ \ { /* Callbacks */ \ - /* image_malloc */ NULL, \ - /* image_memcpy */ NULL, \ - /* image_realloc */ NULL, \ - /* image_free */ NULL, \ - /* udata_copy */ NULL, \ - /* udata_free */ NULL, \ - /* udata */ NULL, \ + NULL, /* image_malloc */ \ + NULL, /* image_memcpy */ \ + NULL, /* image_realloc */ \ + NULL, /* image_free */ \ + NULL, /* udata_copy */ \ + NULL, /* udata_free */ \ + NULL, /* udata */ \ } \ } @@ -97,8 +97,8 @@ typedef struct { #ifdef H5_HAVE_PARALLEL /* MPIO-specific file access properties */ typedef struct H5FD_mpio_fapl_t { - MPI_Comm comm; /*communicator */ - MPI_Info info; /*file information */ + MPI_Comm comm; /*communicator */ + MPI_Info info; /*file information */ } H5FD_mpio_fapl_t; #endif /* H5_HAVE_PARALLEL */ @@ -125,7 +125,7 @@ H5_DLL void *H5FD_fapl_get(H5FD_t *file); H5_DLL herr_t H5FD_free_driver_info(hid_t driver_id, const void *driver_info); H5_DLL hid_t H5FD_register(const void *cls, size_t size, hbool_t app_ref); H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, - haddr_t maxaddr); + haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); H5_DLL herr_t H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); @@ -160,7 +160,7 @@ H5_DLL herr_t H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged); H5_DLL haddr_t H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off); H5_DLL herr_t H5FD_mpi_haddr_to_MPIOff(haddr_t addr, MPI_Offset *mpi_off/*out*/); H5_DLL herr_t H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, - MPI_Comm *comm_new, MPI_Info *info_new); + MPI_Comm *comm_new, MPI_Info *info_new); H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info); #ifdef NOT_YET H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index cb6e6fe..244159c 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -115,16 +115,16 @@ typedef struct H5F_t H5F_t; /* Encode a 64-bit unsigned integer and its length into a variable-sized buffer */ /* (Assumes that the high bits of the integer are zero) */ # define UINT64ENCODE_VARLEN(p, n) { \ - uint64_t __n = (uint64_t)(n); \ - unsigned _s = H5VM_limit_enc_size(__n); \ - \ - *(p)++ = (uint8_t)_s; \ - UINT64ENCODE_VAR(p, __n, _s); \ + uint64_t __n = (uint64_t)(n); \ + unsigned _s = H5VM_limit_enc_size(__n); \ + \ + *(p)++ = (uint8_t)_s; \ + UINT64ENCODE_VAR(p, __n, _s); \ } # define H5_ENCODE_UNSIGNED(p, n) { \ - HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ - UINT32ENCODE(p, n) \ + HDcompile_assert(sizeof(unsigned) == sizeof(uint32_t)); \ + UINT32ENCODE(p, n) \ } /* Assumes the endianness of uint64_t is the same as double */ @@ -168,8 +168,8 @@ typedef struct H5F_t H5F_t; ((*(p) & (unsigned)0x80) ? (unsigned)(~0xffffffff) : (unsigned)0x0))); (p)++; \ } -# define UINT32DECODE(p, i) { \ - (i) = (uint32_t)(*(p) & 0xff); (p)++; \ +# define UINT32DECODE(p, i) { \ + (i) = (uint32_t)(*(p) & 0xff); (p)++; \ (i) |= ((uint32_t)(*(p) & 0xff) << 8); (p)++; \ (i) |= ((uint32_t)(*(p) & 0xff) << 16); (p)++; \ (i) |= ((uint32_t)(*(p) & 0xff) << 24); (p)++; \ @@ -245,34 +245,36 @@ typedef struct H5F_t H5F_t; (p) += 8; \ } +/* clang-format off */ /* Address-related macros */ -#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ - HADDR_UNDEF==(X)+(haddr_t)(Z) || \ +#define H5F_addr_overflow(X,Z) (HADDR_UNDEF==(X) || \ + HADDR_UNDEF==(X)+(haddr_t)(Z) || \ (X)+(haddr_t)(Z)<(X)) #define H5F_addr_defined(X) ((X)!=HADDR_UNDEF) /* The H5F_addr_eq() macro guarantees that Y is not HADDR_UNDEF by making * certain that X is not HADDR_UNDEF and then checking that X equals Y */ -#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ +#define H5F_addr_eq(X,Y) ((X)!=HADDR_UNDEF && \ (X)==(Y)) #define H5F_addr_ne(X,Y) (!H5F_addr_eq((X),(Y))) -#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ +#define H5F_addr_lt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ (X)<(Y)) -#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ +#define H5F_addr_le(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ (X)<=(Y)) -#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ +#define H5F_addr_gt(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ (X)>(Y)) -#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ - (Y)!=HADDR_UNDEF && \ +#define H5F_addr_ge(X,Y) ((X)!=HADDR_UNDEF && \ + (Y)!=HADDR_UNDEF && \ (X)>=(Y)) -#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ +#define H5F_addr_cmp(X,Y) (H5F_addr_eq((X), (Y)) ? 0 : \ (H5F_addr_lt((X), (Y)) ? -1 : 1)) #define H5F_addr_pow2(N) ((haddr_t)1<<(N)) #define H5F_addr_overlap(O1,L1,O2,L2) (((O1) < (O2) && ((O1) + (L1)) > (O2)) || \ ((O1) >= (O2) && (O1) < ((O2) + (L2)))) +/* clang-format on */ /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5F_MODULE @@ -466,9 +468,11 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_ADDR_BYTE_NUM_NAME "addr_byte_num" /* Byte number in an address */ #define H5F_CRT_OBJ_BYTE_NUM_NAME "obj_byte_num" /* Byte number for object size */ #define H5F_CRT_SUPER_VERS_NAME "super_version" /* Version number of the superblock */ -#define H5F_CRT_SHMSG_NINDEXES_NAME "num_shmsg_indexes" /* Number of shared object header message indexes */ +/* Number of shared object header message indexes */ +#define H5F_CRT_SHMSG_NINDEXES_NAME "num_shmsg_indexes" #define H5F_CRT_SHMSG_INDEX_TYPES_NAME "shmsg_message_types" /* Types of message in each index */ -#define H5F_CRT_SHMSG_INDEX_MINSIZE_NAME "shmsg_message_minsize" /* Minimum size of messages in each index */ +/* Minimum size of messages in each index */ +#define H5F_CRT_SHMSG_INDEX_MINSIZE_NAME "shmsg_message_minsize" #define H5F_CRT_SHMSG_LIST_MAX_NAME "shmsg_list_max" /* Shared message list maximum size */ #define H5F_CRT_SHMSG_BTREE_MIN_NAME "shmsg_btree_min" /* Shared message B-tree minimum size */ #define H5F_CRT_FILE_SPACE_STRATEGY_NAME "file_space_strategy" /* File space handling strategy */ diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index a9292ed..deb63d5 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -30,12 +30,12 @@ #include "H5Gprivate.h" /* Other private headers needed by this file */ -#include "H5B2private.h" /* v2 B-trees */ -#include "H5FLprivate.h" /* Free Lists */ -#include "H5HFprivate.h" /* Fractal heaps */ -#include "H5HLprivate.h" /* Local Heaps */ -#include "H5Oprivate.h" /* Object headers */ -#include "H5SLprivate.h" /* Skip lists */ +#include "H5B2private.h" /* v2 B-trees */ +#include "H5FLprivate.h" /* Free Lists */ +#include "H5HFprivate.h" /* Fractal heaps */ +#include "H5HLprivate.h" /* Local Heaps */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5SLprivate.h" /* Skip lists */ /**************************/ /* Package Private Macros */ @@ -47,7 +47,7 @@ /* Size of a symbol table node on disk */ #define H5G_NODE_SIZE(f) ( \ /* General metadata fields */ \ - H5_SIZEOF_MAGIC \ + H5_SIZEOF_MAGIC /*magic number */ \ + 1 /* Version */ \ + 1 /* Reserved */ \ + 2 /* Number of symbols */ \ @@ -68,10 +68,10 @@ * symbol table entry. */ typedef enum H5G_cache_type_t { - H5G_CACHED_ERROR = -1, /*force enum to be signed */ + H5G_CACHED_ERROR = -1, /*force enum to be signed */ H5G_NOTHING_CACHED = 0, /*nothing is cached, must be 0 */ H5G_CACHED_STAB = 1, /*symbol table, `stab' */ - H5G_CACHED_SLINK = 2, /*symbolic link */ + H5G_CACHED_SLINK = 2, /*symbolic link */ H5G_NCACHED /*THIS MUST BE LAST */ } H5G_cache_type_t; @@ -90,7 +90,7 @@ typedef union H5G_cache_t { } stab; struct { - size_t lval_offset; /*link value offset */ + size_t lval_offset; /*link value offset */ } slink; } H5G_cache_t; @@ -159,7 +159,7 @@ typedef struct { typedef struct H5G_bt_common_t { /* downward */ const char *name; /*points to temporary memory */ - H5HL_t *heap; /*symbol table heap */ + H5HL_t *heap; /*symbol table heap */ } H5G_bt_common_t; /* @@ -206,13 +206,13 @@ typedef struct H5G_bt_lkp_t { */ typedef struct H5G_bt_it_it_t { /* downward */ - H5HL_t *heap; /*symbol table heap */ - hsize_t skip; /*initial entries to skip */ - H5G_lib_iterate_t op; /*iteration operator */ - void *op_data; /*user-defined operator data */ + H5HL_t *heap; /*symbol table heap */ + hsize_t skip; /*initial entries to skip */ + H5G_lib_iterate_t op; /*iteration operator */ + void *op_data; /*user-defined operator data */ /* upward */ - hsize_t *final_ent; /*final entry looked at */ + hsize_t *final_ent; /*final entry looked at */ } H5G_bt_it_it_t; /* Data passed through B-tree iteration for copying copy symbol table content */ @@ -394,9 +394,9 @@ H5_DLL void H5G__ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5_copy_depth_t depth); H5_DLL void H5G__ent_reset(H5G_entry_t *ent); H5_DLL herr_t H5G__ent_decode_vec(const H5F_t *f, const uint8_t **pp, - const uint8_t *p_end, H5G_entry_t *ent, unsigned n); + const uint8_t *p_end, H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_encode_vec(const H5F_t *f, uint8_t **pp, - const H5G_entry_t *ent, unsigned n); + const H5G_entry_t *ent, unsigned n); H5_DLL herr_t H5G__ent_convert(H5F_t *f, H5HL_t *heap, const char *name, const H5O_link_t *lnk, H5O_type_t obj_type, const void *crt_info, H5G_entry_t *ent); @@ -406,15 +406,15 @@ H5_DLL herr_t H5G__ent_debug(const H5G_entry_t *ent, FILE * stream, int indent, /* Functions that understand symbol table nodes */ H5_DLL herr_t H5G__node_init(H5F_t *f); H5_DLL int H5G__node_iterate(H5F_t *f, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); + const void *_rt_key, void *_udata); H5_DLL int H5G__node_sumup(H5F_t *f, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); + const void *_rt_key, void *_udata); H5_DLL int H5G__node_by_idx(H5F_t *f, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); + const void *_rt_key, void *_udata); H5_DLL int H5G__node_copy(H5F_t *f, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); + const void *_rt_key, void *_udata); H5_DLL int H5G__node_build_table(H5F_t *f, const void *_lt_key, haddr_t addr, - const void *_rt_key, void *_udata); + const void *_rt_key, void *_udata); H5_DLL herr_t H5G__node_iterate_size(H5F_t *f, const void *_lt_key, haddr_t addr, const void *_rt_key, void *_udata); H5_DLL herr_t H5G__node_free(H5G_node_t *sym); diff --git a/src/H5Gprivate.h b/src/H5Gprivate.h index da1a538..5fff5ff 100644 --- a/src/H5Gprivate.h +++ b/src/H5Gprivate.h @@ -29,9 +29,9 @@ #include "H5Gpublic.h" /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Bprivate.h" /* B-trees */ -#include "H5Fprivate.h" /* File access */ +#include "H5private.h" /* Generic Functions */ +#include "H5Bprivate.h" /* B-trees */ +#include "H5Fprivate.h" /* File access */ #include "H5RSprivate.h" /* Reference-counted strings */ /* @@ -42,7 +42,7 @@ ((sizeof_size) + /*offset of name into heap */ \ (sizeof_addr) + /*address of object header */ \ 4 + /*entry type */ \ - 4 + /*reserved */ \ + 4 + /*reserved */ \ H5G_SIZEOF_SCRATCH) /*scratch pad space */ #define H5G_SIZEOF_ENTRY_FILE(F) \ H5G_SIZEOF_ENTRY(H5F_SIZEOF_ADDR(F), H5F_SIZEOF_SIZE(F)) @@ -61,6 +61,7 @@ /* Definitions for link info settings */ #define H5G_CRT_LINK_INFO_NAME "link info" #define H5G_CRT_LINK_INFO_SIZE sizeof(H5O_linfo_t) +/* clang-format off */ #define H5G_CRT_LINK_INFO_DEF {H5G_CRT_LINFO_TRACK_CORDER, \ H5G_CRT_LINFO_INDEX_CORDER, \ H5G_CRT_LINFO_MAX_CORDER, \ @@ -69,6 +70,7 @@ H5G_CRT_LINFO_LINK_FHEAP_ADDR, \ H5G_CRT_LINFO_NAME_BT2_ADDR \ } +/* clang-format on */ /* Defaults for group info values */ #define H5G_CRT_GINFO_LHEAP_SIZE_HINT 0 @@ -82,6 +84,7 @@ /* Definitions for group info settings */ #define H5G_CRT_GROUP_INFO_NAME "group info" #define H5G_CRT_GROUP_INFO_SIZE sizeof(H5O_ginfo_t) +/* clang-format off */ #define H5G_CRT_GROUP_INFO_DEF {H5G_CRT_GINFO_LHEAP_SIZE_HINT, \ H5G_CRT_GINFO_STORE_LINK_PHASE_CHANGE, \ H5G_CRT_GINFO_MAX_COMPACT, \ @@ -90,6 +93,7 @@ H5G_CRT_GINFO_EST_NUM_ENTRIES, \ H5G_CRT_GINFO_EST_NAME_LEN \ } +/* clang-format on */ /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5G_MODULE @@ -103,12 +107,12 @@ * a symbolic link or a mount point. The normal operation is to follow the * symbolic link or mount point and return information about its target. */ -#define H5G_TARGET_NORMAL 0x0000 -#define H5G_TARGET_SLINK 0x0001 -#define H5G_TARGET_MOUNT 0x0002 -#define H5G_TARGET_UDLINK 0x0004 -#define H5G_TARGET_EXISTS 0x0008 -#define H5G_CRT_INTMD_GROUP 0x0010 +#define H5G_TARGET_NORMAL 0x0000 +#define H5G_TARGET_SLINK 0x0001 +#define H5G_TARGET_MOUNT 0x0002 +#define H5G_TARGET_UDLINK 0x0004 +#define H5G_TARGET_EXISTS 0x0008 +#define H5G_CRT_INTMD_GROUP 0x0010 /* Type of operation being performed for call to H5G_name_replace() */ typedef enum { diff --git a/src/H5Lprivate.h b/src/H5Lprivate.h index cdd6531..d40a1e4 100644 --- a/src/H5Lprivate.h +++ b/src/H5Lprivate.h @@ -22,8 +22,8 @@ #include "H5Lpublic.h" /* Private headers needed by this file */ -#include "H5Gprivate.h" /* Groups */ -#include "H5Oprivate.h" /* Object headers */ +#include "H5Gprivate.h" /* Groups */ +#include "H5Oprivate.h" /* Object headers */ /**************************/ @@ -37,11 +37,16 @@ #define H5L_CRT_INTERMEDIATE_GROUP_NAME "intermediate_group" /* Create intermediate groups flag */ /* ======== Link access property names ======== */ -#define H5L_ACS_NLINKS_NAME "max soft links" /* Number of soft links to traverse */ -#define H5L_ACS_ELINK_PREFIX_NAME "external link prefix" /* External link prefix */ -#define H5L_ACS_ELINK_FAPL_NAME "external link fapl" /* file access property list for external link access */ -#define H5L_ACS_ELINK_FLAGS_NAME "external link flags" /* file access flags for external link traversal */ -#define H5L_ACS_ELINK_CB_NAME "external link callback" /* callback function for external link traversal */ +/* Number of soft links to traverse */ +#define H5L_ACS_NLINKS_NAME "max soft links" +/* External link prefix */ +#define H5L_ACS_ELINK_PREFIX_NAME "external link prefix" +/* file access property list for external link access */ +#define H5L_ACS_ELINK_FAPL_NAME "external link fapl" +/* file access flags for external link traversal */ +#define H5L_ACS_ELINK_FLAGS_NAME "external link flags" +/* callback function for external link traversal */ +#define H5L_ACS_ELINK_CB_NAME "external link callback" /****************************/ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index d25a955..01e1545 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -25,9 +25,9 @@ #define _H5Lpublic_H /* Public headers needed by this file */ -#include "H5public.h" /* Generic Functions */ -#include "H5Ipublic.h" /* IDs */ -#include "H5Tpublic.h" /* Datatypes */ +#include "H5public.h" /* Generic Functions */ +#include "H5Ipublic.h" /* IDs */ +#include "H5Tpublic.h" /* Datatypes */ /*****************/ /* Public Macros */ @@ -67,10 +67,12 @@ typedef enum { H5L_TYPE_HARD = 0, /* Hard link id */ H5L_TYPE_SOFT = 1, /* Soft link id */ H5L_TYPE_EXTERNAL = 64, /* External link id */ - H5L_TYPE_MAX = 255 /* Maximum link type id */ + H5L_TYPE_MAX = 255 /* Maximum link type id */ } H5L_type_t; -#define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT /* Maximum value link value for "built-in" link types */ -#define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL /* Link ids at or above this value are "user-defined" link types. */ +/* Maximum value link value for "built-in" link types */ +#define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT +/* Link ids at or above this value are "user-defined" link types. */ +#define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL /* Information struct for link (for H5Lget_info/H5Lget_info_by_idx) */ typedef struct { diff --git a/src/H5MFpkg.h b/src/H5MFpkg.h index 3d4d560..0af4130 100644 --- a/src/H5MFpkg.h +++ b/src/H5MFpkg.h @@ -30,7 +30,7 @@ #include "H5MFprivate.h" /* Other private headers needed by this file */ -#include "H5FSprivate.h" /* File free space */ +#include "H5FSprivate.h" /* File free space */ /**************************/ @@ -51,9 +51,12 @@ /* Free-space section types for file */ /* (values stored in free space data structures in file) */ -#define H5MF_FSPACE_SECT_SIMPLE 0 /* For non-paged aggregation: section is a range of actual bytes in file */ -#define H5MF_FSPACE_SECT_SMALL 1 /* For paged aggregation: "small" meta/raw data section which is < fsp_size) */ -#define H5MF_FSPACE_SECT_LARGE 2 /* For paged aggregation: "large" Section which is >= fsp_size) */ +/* For non-paged aggregation: section is a range of actual bytes in file */ +#define H5MF_FSPACE_SECT_SIMPLE 0 +/* For paged aggregation: "small" meta/raw data section which is < fsp_size) */ +#define H5MF_FSPACE_SECT_SMALL 1 +/* For paged aggregation: "large" Section which is >= fsp_size) */ +#define H5MF_FSPACE_SECT_LARGE 2 /* Get section class type based on size */ #define H5MF_SECT_CLASS_TYPE(F, S) \ @@ -155,7 +158,7 @@ typedef struct H5MF_fs_t { H5F_fs_state_t *fs_state; haddr_t *fs_addr; H5FS_t **fs_man; - hsize_t align_thres; /* Threshold for alignment */ + hsize_t align_thres; /* Threshold for alignment */ hsize_t alignment; /* Alignment */ } H5MF_fs_t; diff --git a/src/H5PLint.c b/src/H5PLint.c index 4aa04e1..ddecc4a 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -300,7 +300,7 @@ done: * get_plugin_info function pointer, but early (4.4.7, at least) gcc * only allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(pedantic) +H5_GCC_DIAG_OFF("pedantic") herr_t H5PL__open(const char *path, H5PL_type_t type, H5PL_key_t key, hbool_t *success, const void **plugin_info) { @@ -369,7 +369,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__open() */ -H5_GCC_DIAG_ON(pedantic) +H5_GCC_DIAG_ON("pedantic") /*------------------------------------------------------------------------- diff --git a/src/H5PLplugin_cache.c b/src/H5PLplugin_cache.c index 504905c..cf3cb9f 100644 --- a/src/H5PLplugin_cache.c +++ b/src/H5PLplugin_cache.c @@ -253,7 +253,7 @@ done: /* See the other use of H5PL_GET_LIB_FUNC() for an explanation * for why we disable -Wpedantic here. */ -H5_GCC_DIAG_OFF(pedantic) +H5_GCC_DIAG_OFF("pedantic") herr_t H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *found, const void **plugin_info) { @@ -302,5 +302,5 @@ H5PL__find_plugin_in_cache(const H5PL_search_params_t *search_params, hbool_t *f done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5PL__find_plugin_in_cache() */ -H5_GCC_DIAG_ON(pedantic) +H5_GCC_DIAG_ON("pedantic") diff --git a/src/H5Tconv.c b/src/H5Tconv.c index f495829..f73bc5d 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -7577,9 +7577,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7601,9 +7601,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7625,9 +7625,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7649,9 +7649,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7673,9 +7673,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7697,9 +7697,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7721,9 +7721,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7745,9 +7745,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7769,9 +7769,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7793,9 +7793,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7817,9 +7817,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7841,9 +7841,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7865,9 +7865,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7889,9 +7889,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7913,9 +7913,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7937,9 +7937,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7961,9 +7961,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -7985,9 +7985,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8009,9 +8009,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8033,9 +8033,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8057,9 +8057,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8081,9 +8081,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8105,9 +8105,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8129,9 +8129,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8153,9 +8153,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8177,9 +8177,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long long, 0, ULLONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8201,9 +8201,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8225,9 +8225,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long long, 0, ULLONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } @@ -8250,9 +8250,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } #endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/ @@ -8276,9 +8276,9 @@ 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) { -H5_GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF("float-equal") H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long long, 0, ULLONG_MAX); -H5_GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON("float-equal") } #endif /*H5T_CONV_INTERNAL_LDOUBLE_ULLONG*/ @@ -9008,8 +9008,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } #endif - /* - * Put the data in little endian order so our loops aren't so + /* Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming * little endian and then we'll fix the order at the end. */ @@ -9022,26 +9021,23 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } - /*zero-set all destination bits*/ + /* Zero-set all destination bits*/ H5T__bit_set (d, dst.offset, dst.prec, FALSE); /* Copy source into a temporary buffer */ H5T__bit_copy(int_buf, (size_t)0, s, src.offset, src.prec); - /* - * Find the sign bit value of the source. - */ + /* Find the sign bit value of the source */ if(H5T_SGN_2 == src.u.i.sign) sign = (size_t)H5T__bit_get_d(int_buf, src.prec - 1, (size_t)1); - /* - * What is the bit position(starting from 0 as first one) for the most significant - * bit(MSB) of S which is set? + /* What is the bit position(starting from 0 as first one) for the most significant + * bit(MSB) of S which is set? */ if(H5T_SGN_2 == src.u.i.sign) { sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); if(sign && sfirst < 0) - /* The case 0x80...00, which is negative with maximal value */ + /* The case 0x80...00, which is negative with maximal value */ is_max_neg = 1; } else if(H5T_SGN_NONE == src.u.i.sign) sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, TRUE); @@ -9050,9 +9046,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(!sign && sfirst < 0) goto padding; - /* - * Convert source integer if it's negative - */ + /* Convert source integer if it's negative */ if(H5T_SGN_2 == src.u.i.sign && sign) { if(!is_max_neg) { /* Equivalent to ~(i - 1) */ @@ -9060,10 +9054,10 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_neg(int_buf, (size_t)0, buf_size * 8); sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); } else { - /* If it's maximal negative number 0x80...000, treat it as if it overflowed - * (create a carry) to help conversion. i.e. a character type number 0x80 - * is treated as 0x100. - */ + /* If it's maximal negative number 0x80...000, treat it as if it overflowed + * (create a carry) to help conversion. i.e. a character type number 0x80 + * is treated as 0x100. + */ sfirst = (ssize_t)(src.prec - 1); is_max_neg = 0; } @@ -9072,7 +9066,8 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of * sign bit to 0 in the temporary buffer because they're all negated from the previous - * step. */ + * step. + */ H5T__bit_set(int_buf, src.prec, (buf_size * 8) - src.prec, 0); /* Set sign bit in destination */ @@ -9081,8 +9076,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, first = (size_t)sfirst; - /* - * Calculate the true destination exponent by adjusting according to + /* Calculate the true destination exponent by adjusting according to * the destination exponent bias. Implied and non-implied normalization * should be the same. */ @@ -9102,7 +9096,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Roundup for mantissa */ if(first > dst.u.f.msize) { - /* If the bit sequence is bigger than the mantissa part, there'll be some + /* 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) { @@ -9117,11 +9111,11 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - /* If user's exception handler does deal with it, we do it by dropping off the - * extra bits at the end and do rounding. If we have .50...0(decimal) after radix - * point, we do roundup when the least significant digit before radix is odd, we do - * rounddown if it's even. - */ + /* If user's exception handler does deal with it, we do it by dropping off the + * extra bits at the end and do rounding. If we have .50...0(decimal) after radix + * point, we do roundup when the least significant digit before radix is odd, we do + * rounddown if it's even. + */ /* Check 1st dropoff bit, see if it's set. */ if(H5T__bit_get_d(int_buf, ((first - dst.u.f.msize) - 1), (size_t)1)) { @@ -9142,9 +9136,9 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T__bit_inc(int_buf, (size_t)0, buf_size * 8); do_round = 0; - /* If integer is like 0x0ff...fff and we need to round up the - * last f, we get 0x100...000. Treat this special case here. - */ + /* If integer is like 0x0ff...fff and we need to round up the + * last f, we get 0x100...000. Treat this special case here. + */ if(H5T__bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) { if (H5T_NORM_IMPLIED==dst.u.f.norm) { /* The bit at this 1's position was impled already, so this @@ -9163,7 +9157,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } } else { /* The bit sequence can fit mantissa part. Left shift to fit in from high-order of - * bit position. */ + * bit position. */ H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, dst.u.f.msize); } diff --git a/src/H5Tnative.c b/src/H5Tnative.c index c4a5775..24f8f23 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -19,13 +19,13 @@ #include "H5Tmodule.h" /* This source code file is part of the H5T module */ -#include "H5private.h" /* Generic Functions */ +#include "H5private.h" /* Generic Functions */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Pprivate.h" /* Property lists */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Tpkg.h" /* Datatypes */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Pprivate.h" /* Property lists */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ static H5T_t *H5T__get_native_type(H5T_t *dt, H5T_direction_t direction, @@ -41,7 +41,7 @@ static herr_t H5T__cmp_offset(size_t *comp_size, size_t *offset, size_t elem_siz size_t nelems, size_t align, size_t *struct_align); - + /*------------------------------------------------------------------------- * Function: H5Tget_native_type * @@ -107,7 +107,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Tget_native_type() */ - + /*------------------------------------------------------------------------- * Function: H5T__get_native_type * @@ -330,7 +330,7 @@ H5T__get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_ali case H5T_ENUM: { - H5T_path_t *tpath; /* Type conversion info */ + H5T_path_t *tpath; /* Type conversion info */ hid_t super_type_id, nat_super_type_id; /* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */ @@ -521,8 +521,8 @@ done: * the code below, but early (4.4.7, at least) gcc only allows * diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(duplicated-branches) - +H5_GCC_DIAG_OFF("duplicated-branches") + /*------------------------------------------------------------------------- * Function: H5T__get_native_integer * @@ -662,7 +662,7 @@ H5T__get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__get_native_integer() */ -H5_GCC_DIAG_ON(duplicated-branches) +H5_GCC_DIAG_ON("duplicated-branches") /* Disable warning for intentional identical branches here -QAK */ /* @@ -670,8 +670,8 @@ H5_GCC_DIAG_ON(duplicated-branches) * the code below, but early (4.4.7, at least) gcc only allows * diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(duplicated-branches) - +H5_GCC_DIAG_OFF("duplicated-branches") + /*------------------------------------------------------------------------- * Function: H5T__get_native_float * @@ -693,7 +693,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali H5T_t *dt=NULL; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ size_t align=0; /* Alignment necessary for native datatype */ - size_t native_size=0; /* Datatype size of the native type */ + size_t native_size=0; /* Datatype size of the native type */ enum match_type { /* The different kinds of floating point types we can match */ H5T_NATIVE_FLOAT_MATCH_FLOAT, H5T_NATIVE_FLOAT_MATCH_DOUBLE, @@ -711,50 +711,50 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(size<=sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); + native_size = sizeof(float); } else if(size<=sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } #if H5_SIZEOF_LONG_DOUBLE !=0 else if(size<=sizeof(long double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); + native_size = sizeof(long double); } #endif else { /* If not match, return the biggest datatype */ #if H5_SIZEOF_LONG_DOUBLE !=0 match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); + native_size = sizeof(long double); #else match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; native_size = sizeof(double); #endif - } + } } else { #if H5_SIZEOF_LONG_DOUBLE !=0 if(size>sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); + native_size = sizeof(long double); } else if(size>sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } else { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); - } + native_size = sizeof(float); + } #else if(size>sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } else { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); - } + native_size = sizeof(float); + } #endif } @@ -795,7 +795,7 @@ H5T__get_native_float(size_t size, H5T_direction_t direction, size_t *struct_ali done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__get_native_float() */ -H5_GCC_DIAG_ON(duplicated-branches) +H5_GCC_DIAG_ON("duplicated-branches") /* Disable warning for intentional identical branches here -QAK */ /* @@ -803,8 +803,8 @@ H5_GCC_DIAG_ON(duplicated-branches) * the code below, but early (4.4.7, at least) gcc only allows * diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(duplicated-branches) - +H5_GCC_DIAG_OFF("duplicated-branches") + /*------------------------------------------------------------------------- * Function: H5T__get_native_bitfield * @@ -889,22 +889,22 @@ H5T__get_native_bitfield(size_t prec, H5T_direction_t direction, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__get_native_bitfield() */ -H5_GCC_DIAG_ON(duplicated-branches) +H5_GCC_DIAG_ON("duplicated-branches") + - /*------------------------------------------------------------------------- - * Function: H5T__cmp_offset + * Function: H5T__cmp_offset * - * Purpose: This function is only for convenience. It computes the + * Purpose: This function is only for convenience. It computes the * compound type size, offset of the member being considered * and the alignment for the whole compound type. * - * Return: Success: Non-negative value. + * Return: Success: Non-negative value. * - * Failure: Negative value. + * Failure: Negative value. * - * Programmer: Raymond Lu - * December 10, 2002 + * Programmer: Raymond Lu + * December 10, 2002 * *------------------------------------------------------------------------- */ diff --git a/src/H5VMprivate.h b/src/H5VMprivate.h index 5c975f6..c9435b8 100644 --- a/src/H5VMprivate.h +++ b/src/H5VMprivate.h @@ -19,9 +19,9 @@ #define H5VMprivate_H /* Private headers needed by this file */ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /* Vector-Vector sequence operation callback */ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, @@ -41,7 +41,7 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, /* Other functions */ #define H5VM_vector_cpy(N,DST,SRC) { \ - HDassert(sizeof(*(DST))==sizeof(*(SRC))); \ + HDassert(sizeof(*(DST))==sizeof(*(SRC))); \ if (SRC) H5MM_memcpy (DST, SRC, (N)*sizeof(*(DST))); \ else HDmemset (DST, 0, (N)*sizeof(*(DST))); \ } @@ -85,32 +85,32 @@ typedef herr_t (*H5VM_opvv_func_t)(hsize_t dst_off, hsize_t src_off, #define H5VM_ZERO NULL H5_DLL hsize_t H5VM_hyper_stride(unsigned n, const hsize_t *size, - const hsize_t *total_size, - const hsize_t *offset, - hsize_t *stride); + const hsize_t *total_size, + const hsize_t *offset, + hsize_t *stride); H5_DLL htri_t H5VM_hyper_eq(unsigned n, const hsize_t *offset1, - const hsize_t *size1, const hsize_t *offset2, - const hsize_t *size2); + const hsize_t *size1, const hsize_t *offset2, + const hsize_t *size2); H5_DLL herr_t H5VM_hyper_fill(unsigned n, const hsize_t *_size, - const hsize_t *total_size, - const hsize_t *offset, void *_dst, - unsigned fill_value); + const hsize_t *total_size, + const hsize_t *offset, void *_dst, + unsigned fill_value); H5_DLL herr_t H5VM_hyper_copy(unsigned n, const hsize_t *size, - const hsize_t *dst_total_size, - const hsize_t *dst_offset, void *_dst, - const hsize_t *src_total_size, - const hsize_t *src_offset, const void *_src); + const hsize_t *dst_total_size, + const hsize_t *dst_offset, void *_dst, + const hsize_t *src_total_size, + const hsize_t *src_offset, const void *_src); H5_DLL herr_t H5VM_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size, - const hsize_t *stride, void *_dst, - unsigned fill_value); + const hsize_t *stride, void *_dst, + unsigned fill_value); H5_DLL herr_t H5VM_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size, - const hsize_t *dst_stride, void *_dst, - const hsize_t *src_stride, const void *_src); + const hsize_t *dst_stride, void *_dst, + const hsize_t *src_stride, const void *_src); H5_DLL herr_t H5VM_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size, - const hssize_t *dst_stride, void *_dst, - const hssize_t *src_stride, const void *_src); + const hssize_t *dst_stride, void *_dst, + const hssize_t *src_stride, const void *_src); H5_DLL herr_t H5VM_array_fill(void *_dst, const void *src, size_t size, - size_t count); + size_t count); H5_DLL herr_t H5VM_array_down(unsigned n, const hsize_t *total_size, hsize_t *down); H5_DLL hsize_t H5VM_array_offset_pre(unsigned n, @@ -204,7 +204,7 @@ H5VM_vector_zerop_u(int n, const hsize_t *v) if (!v) HGOTO_DONE(TRUE) while (n--) - if (*v++) + if (*v++) HGOTO_DONE(FALSE) done: @@ -241,7 +241,7 @@ H5VM_vector_zerop_s(int n, const hssize_t *v) if (!v) HGOTO_DONE(TRUE) while (n--) - if (*v++) + if (*v++) HGOTO_DONE(FALSE) done: @@ -291,9 +291,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5VM_vector_cmp_s + * Function: H5VM_vector_cmp_s * * Purpose: Compares two vectors of the same size and determines if V1 is * lexicographically less than, equal, or greater than V2. @@ -308,7 +308,7 @@ done: * * Failure: 0 if N is zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 8, 1998 * *------------------------------------------------------------------------- @@ -335,7 +335,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5VM_vector_inc * @@ -361,6 +361,7 @@ H5VM_vector_inc(int n, hsize_t *v1, const hsize_t *v2) /* Lookup table for general log2(n) routine */ static const unsigned char LogTable256[] = { + /* clang-clang-format off */ 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, @@ -377,9 +378,10 @@ static const unsigned char LogTable256[] = 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 + /* clang-clang-format on */ }; - + /*------------------------------------------------------------------------- * Function: H5VM_log2_gen * @@ -432,7 +434,7 @@ static const unsigned MultiplyDeBruijnBitPosition[32] = 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; - + /*------------------------------------------------------------------------- * Function: H5VM_log2_of2 * @@ -464,19 +466,19 @@ H5VM_log2_of2(uint32_t n) return(MultiplyDeBruijnBitPosition[(n * (uint32_t)0x077CB531UL) >> 27]); } /* H5VM_log2_of2() */ - + /*------------------------------------------------------------------------- - * Function: H5VM_power2up + * Function: H5VM_power2up * - * Purpose: Round up a number to the next power of 2 + * Purpose: Round up a number to the next power of 2 * * Note: Although this routine is 'static' in this file, that's intended * only as an optimization and the naming (with a single underscore) * reflects its inclusion in a "private" header file. * - * Return: Return the number which is a power of 2 + * Return: Return the number which is a power of 2 * - * Programmer: Vailin Choi; Nov 2014 + * Programmer: Vailin Choi; Nov 2014 * *------------------------------------------------------------------------- */ @@ -495,7 +497,7 @@ H5VM_power2up(hsize_t n) return(ret_value); } /* H5VM_power2up */ - + /*------------------------------------------------------------------------- * Function: H5VM_limit_enc_size * @@ -522,15 +524,15 @@ H5VM_limit_enc_size(uint64_t limit) static const unsigned char H5VM_bit_set_g[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static const unsigned char H5VM_bit_clear_g[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; - + /*------------------------------------------------------------------------- * Function: H5VM_bit_get * * Purpose: Determine the value of the n'th bit in a buffer. * - * Note: No range checking on is performed! + * Note: No range checking on is performed! * - * Note #2: Bits are sequentially stored in the buffer, starting with bit + * Note #2: Bits are sequentially stored in the buffer, starting with bit * offset 0 in the first byte's high-bit position, proceeding down * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. @@ -553,15 +555,15 @@ H5VM_bit_get(const unsigned char *buf, size_t offset) return (hbool_t)((buf[offset / 8] & (H5VM_bit_set_g[offset % 8])) ? TRUE : FALSE); } /* end H5VM_bit_get() */ - + /*------------------------------------------------------------------------- * Function: H5VM_bit_set * * Purpose: Set/reset the n'th bit in a buffer. * - * Note: No range checking on is performed! + * Note: No range checking on is performed! * - * Note #2: Bits are sequentially stored in the buffer, starting with bit + * Note #2: Bits are sequentially stored in the buffer, starting with bit * offset 0 in the first byte's high-bit position, proceeding down * to bit offset 7 in the first byte's low-bit position, then to * bit offset 8 in the second byte's high-bit position, etc. diff --git a/src/H5detect.c b/src/H5detect.c index 85f1f90..71124d9 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -52,7 +52,7 @@ static const char *FileHeader = "\n\ /* Disable warning about cast increasing the alignment of the target type, * that's _exactly_ what this code is probing. -QAK */ -H5_GCC_DIAG_OFF(cast-align) +H5_GCC_DIAG_OFF("cast-align") #if defined(__has_attribute) # if __has_attribute(no_sanitize_address) @@ -120,9 +120,9 @@ typedef struct malign_t { FILE *rawoutstream = NULL; /* global variables types detection code */ -H5_GCC_DIAG_OFF(larger-than=) +H5_GCC_DIAG_OFF("larger-than=") static detected_t d_g[MAXDETECT]; -H5_GCC_DIAG_ON(larger-than=) +H5_GCC_DIAG_ON("larger-than=") static malign_t m_g[MAXDETECT]; static volatile int nd_g = 0, na_g = 0; @@ -158,7 +158,7 @@ static H5JMP_BUF jbuf_g; #endif - + /*------------------------------------------------------------------------- * Function: precision * @@ -211,7 +211,7 @@ precision (detected_t *d) } } - + /*------------------------------------------------------------------------- * Function: DETECT_I/DETECT_BYTE * @@ -266,7 +266,7 @@ precision (detected_t *d) DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \ } - + /*------------------------------------------------------------------------- * Function: DETECT_F * @@ -305,10 +305,10 @@ precision (detected_t *d) for(_byte_mask = (unsigned char)1; _byte_mask; _byte_mask = (unsigned char) (_byte_mask << 1)) { \ _buf1[_i] ^= _byte_mask; \ HDmemcpy((void *)&_v2, (const void *)_buf1, sizeof(TYPE)); \ - H5_GCC_DIAG_OFF(float-equal) \ + H5_GCC_DIAG_OFF("float-equal") \ if(_v1 != _v2) \ _pad_mask[_i] |= _byte_mask; \ - H5_GCC_DIAG_ON(float-equal) \ + H5_GCC_DIAG_ON("float-equal") \ _buf1[_i] ^= _byte_mask; \ } /* end for */ \ \ @@ -363,7 +363,7 @@ precision (detected_t *d) } \ } - + /*------------------------------------------------------------------------- * Function: DETECT_M * @@ -415,10 +415,10 @@ precision (detected_t *d) else /* Little-Endian */ \ HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ _val2 = *((TYPE*)(_buf+align_g[_ano])); \ - H5_GCC_DIAG_OFF(float-equal) \ + H5_GCC_DIAG_OFF("float-equal") \ if(_val!=_val2) \ H5LONGJMP(jbuf_g, 1); \ - H5_GCC_DIAG_ON(float-equal) \ + H5_GCC_DIAG_ON("float-equal") \ /* End Cray Check */ \ (INFO.align)=align_g[_ano]; \ } else { \ @@ -439,7 +439,7 @@ precision (detected_t *d) #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) - + /*------------------------------------------------------------------------- * Function: sigsegv_handler * @@ -472,7 +472,7 @@ sigsegv_handler(int H5_ATTR_UNUSED signo) #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) - + /*------------------------------------------------------------------------- * Function: sigbus_handler * @@ -505,7 +505,7 @@ sigbus_handler(int H5_ATTR_UNUSED signo) #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) - + /*------------------------------------------------------------------------- * Function: sigill_handler * @@ -536,7 +536,7 @@ sigill_handler(int H5_ATTR_UNUSED signo) } #endif - + /*------------------------------------------------------------------------- * Function: print_results * @@ -815,7 +815,7 @@ done:\n\ fprintf(rawoutstream, "/* sigill_handler called: %d times */\n", sigill_handler_called_g); } /* end print_results() */ - + /*------------------------------------------------------------------------- * Function: iprint * @@ -905,7 +905,7 @@ iprint(detected_t *d) } - + /*------------------------------------------------------------------------- * Function: byte_cmp * @@ -932,7 +932,7 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask) return -1; } - + /*------------------------------------------------------------------------- * Function: bit_cmp * @@ -973,7 +973,7 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, return 0; } - + /*------------------------------------------------------------------------- * Function: fix_order * @@ -1041,7 +1041,7 @@ fix_order(int n, int last, int *perm, const char **mesg) } } - + /*------------------------------------------------------------------------- * Function: imp_bit * @@ -1095,7 +1095,7 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_ return (a[perm[major]] >> minor) & 0x01 ? 0 : 1; } - + /*------------------------------------------------------------------------- * Function: find_bias * @@ -1126,7 +1126,7 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a) return bias; } - + /*------------------------------------------------------------------------- * Function: print_header * @@ -1267,7 +1267,7 @@ bit.\n"; } - + /*------------------------------------------------------------------------- * Function: detect_C89_integers * @@ -1289,7 +1289,7 @@ detect_C89_integers(void) DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- * Function: detect_C89_floats * @@ -1305,7 +1305,7 @@ detect_C89_floats(void) DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers8 * @@ -1361,7 +1361,7 @@ detect_C99_integers8(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers16 * @@ -1393,7 +1393,7 @@ detect_C99_integers16(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers32 * @@ -1425,7 +1425,7 @@ detect_C99_integers32(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers64 * @@ -1471,7 +1471,7 @@ detect_C99_integers64(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_C99_integers * @@ -1491,7 +1491,7 @@ detect_C99_integers(void) detect_C99_integers64(); } - + /*------------------------------------------------------------------------- * Function: detect_C99_floats * @@ -1516,7 +1516,7 @@ detect_C99_floats(void) #endif } - + /*------------------------------------------------------------------------- * Function: detect_alignments * @@ -1593,7 +1593,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) } #endif - + /*------------------------------------------------------------------------- * Function: main * @@ -1685,4 +1685,4 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } -H5_GCC_DIAG_ON(cast-align) +H5_GCC_DIAG_ON("cast-align") diff --git a/src/H5public.h b/src/H5public.h index 20c7102..21846f6 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -81,12 +81,11 @@ extern "C" { */ /* These pragmas are only implemented usefully in gcc 4.6+ */ #if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 - #define H5_GCC_DIAG_STR(s) #s - #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) - #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) - #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + #define H5_GCC_DIAG_JOINSTR(x, y) x y + #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma(#x) + #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) + #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR("-W",x)) #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) #else #define H5_GCC_DIAG_OFF(x) @@ -182,10 +181,10 @@ typedef long long ssize_t; * type. */ #if H5_SIZEOF_LONG_LONG >= 8 -H5_GCC_DIAG_OFF(long-long) +H5_GCC_DIAG_OFF("long-long") typedef unsigned long long hsize_t; typedef signed long long hssize_t; -H5_GCC_DIAG_ON(long-long) +H5_GCC_DIAG_ON("long-long") # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG # define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG #else diff --git a/src/H5system.c b/src/H5system.c index e2747f4..651d2a7 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -105,7 +105,7 @@ static hbool_t H5_ntzset = FALSE; * format_templ in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") int HDfprintf(FILE *stream, const char *fmt, ...) { @@ -445,7 +445,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) HDva_end(ap); return nout; } /* end HDfprintf() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 68e9b03..66afc70 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,6 +20,7 @@ set (TEST_LIB_SOURCES set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h + ${HDF5_TEST_SOURCE_DIR}/H5srcdir.h ${HDF5_TEST_SOURCE_DIR}/cache_common.h ${HDF5_TEST_SOURCE_DIR}/external_common.h ${HDF5_TEST_SOURCE_DIR}/external_fname.h @@ -65,6 +66,17 @@ if (BUILD_SHARED_LIBS) set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_TEST_SRC_FORMAT ${HDF5_TEST_LIB_TARGET}) + else () + clang_format (HDF5_TEST_SRC_FORMAT ${HDF5_TEST_LIBSH_TARGET}) + endif () +endif () + ################################################################################# # If filter plugin tests can be tested ################################################################################# @@ -98,6 +110,13 @@ if (BUILD_SHARED_LIBS) set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${HDF5_TEST_PLUGIN_TARGET}_FORMAT ${HDF5_TEST_PLUGIN_TARGET}) + endif () + + #----------------------------------------------------------------------------- # Copy the filter plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( @@ -123,6 +142,13 @@ if (BUILD_SHARED_LIBS) set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN) #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${HDF5_TEST_PLUGIN_TARGET}_FORMAT ${HDF5_TEST_PLUGIN_TARGET}) + endif () + + #----------------------------------------------------------------------------- # Copy the filter plugin to a plugins folder #----------------------------------------------------------------------------- add_custom_command ( @@ -141,6 +167,7 @@ endif () ################################################################################# set (testhdf5_SOURCES + ${HDF5_TEST_SOURCE_DIR}/testhdf5.h ${HDF5_TEST_SOURCE_DIR}/testhdf5.c ${HDF5_TEST_SOURCE_DIR}/tarray.c ${HDF5_TEST_SOURCE_DIR}/tattr.c @@ -179,6 +206,7 @@ set(mirror_vfd_SOURCES ) set (ttsafe_SOURCES + ${HDF5_TEST_SOURCE_DIR}/ttsafe.h ${HDF5_TEST_SOURCE_DIR}/ttsafe.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c @@ -272,6 +300,13 @@ macro (ADD_H5_EXE file) target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () set_target_properties (${file} PROPERTIES FOLDER test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${file}_FORMAT ${file}) + endif () endmacro () set (H5_TESTS_MULTIPLE @@ -307,6 +342,13 @@ else () endif () set_target_properties (chunk_info PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_SRC_chunk_info_FORMAT chunk_info) +endif () + #-- Adding test for direct_chunk add_executable (direct_chunk ${HDF5_TEST_SOURCE_DIR}/direct_chunk.c) target_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -320,6 +362,12 @@ else () endif () set_target_properties (direct_chunk PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_direct_chunk_FORMAT direct_chunk) +endif () ######### Special handling for multiple sources ############# #-- Adding test for testhdf5 @@ -335,6 +383,13 @@ else () endif () set_target_properties (testhdf5 PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_testhdf5_FORMAT testhdf5) +endif () + #-- Adding test for cache_image add_executable (cache_image ${cache_image_SOURCES}) target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -348,6 +403,13 @@ else () endif () set_target_properties (cache_image PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_cache_image_FORMAT cache_image) +endif () + #-- Adding test for ttsafe add_executable (ttsafe ${ttsafe_SOURCES}) target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -366,6 +428,13 @@ else () endif () set_target_properties (ttsafe PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_ttsafe_FORMAT ttsafe) +endif () + ######### Special handling for extra link lib of threads ############# #-- Adding test for thread_id add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c) @@ -385,6 +454,13 @@ else () endif () set_target_properties (thread_id PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_thread_id_FORMAT thread_id) +endif () + #-- Adding test for mirror_vfd add_executable (mirror_vfd ${mirror_vfd_SOURCES}) target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -397,6 +473,13 @@ else () endif () set_target_properties (mirror_vfd PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_mirror_vfd_FORMAT mirror_vfd) +endif () + ############################################################################## ### A D D I T I O N A L T E S T S ### ############################################################################## @@ -457,8 +540,29 @@ set (H5_VDS_SWMR_TESTS vds_swmr_writer ) +macro (ADD_H5_VDS_EXE file) + add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c ${HDF5_TEST_SOURCE_DIR}/vds_swmr.h) + target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (${file} STATIC) + target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (${file} SHARED) + target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) + endif () + set_target_properties (${file} PROPERTIES FOLDER test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${file}_FORMAT ${file}) + endif () +endmacro () + foreach (h5_test ${H5_VDS_SWMR_TESTS}) - ADD_H5_EXE(${h5_test}) + ADD_H5_VDS_EXE(${h5_test}) endforeach () #-- Adding test for accum_swmr_reader @@ -476,6 +580,13 @@ else () endif () set_target_properties (accum_swmr_reader PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_accum_swmr_reader_FORMAT accum_swmr_reader) +endif () + #-- Set accum dependencies set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader) @@ -488,12 +599,19 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (filter_plugin SHARED) target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET}) set_target_properties (filter_plugin PROPERTIES FOLDER test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_filter_plugin_FORMAT filter_plugin) + endif () endif () ############################################################################## ### U S E C A S E S T E S T S ############################################################################## -set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) +set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h) add_executable (use_append_chunk ${use_append_chunk_SOURCES}) target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -506,7 +624,14 @@ else () endif () set_target_properties (use_append_chunk PROPERTIES FOLDER test) -set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_append_chunk_FORMAT use_append_chunk) +endif () + +set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h) add_executable (use_append_mchunks ${use_append_mchunks_SOURCES}) target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -519,6 +644,13 @@ else () endif () set_target_properties (use_append_mchunks PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_append_mchunks_FORMAT use_append_mchunks) +endif () + set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c) add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES}) target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -532,6 +664,13 @@ else () endif () set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_use_disable_mdc_flushes_FORMAT use_disable_mdc_flushes) +endif () + if (HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1d15b20..316b4cc 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -993,6 +993,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) TARGET_C_PROPERTIES (${genfile} STATIC) target_link_libraries (${genfile} PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${genfile} PROPERTIES FOLDER generator/test) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_${genfile}_FORMAT ${genfile}) + endif () endmacro () # generator executables diff --git a/test/big.c b/test/big.c index fee7813..a0d767f 100644 --- a/test/big.c +++ b/test/big.c @@ -14,8 +14,8 @@ /* * Programmer: Robb Matzke * Wednesday, April 8, 1998 - * Modified: Albert Cheng - * September 11, 2010 + * Modified: Albert Cheng + * September 11, 2010 */ /* * The purpose of this test is to verify if a virtual file driver can handle: @@ -53,20 +53,20 @@ */ #include "h5test.h" -#define DNAME "big.data" +#define DNAME "big.data" -#define WRT_N 50 -#define WRT_SIZE 4*1024 -#define FAMILY_SIZE 1024*1024*1024 +#define WRT_N 50 +#define WRT_SIZE 4*1024 +#define FAMILY_SIZE 1024*1024*1024 #define GB (HDoff_t)0x40000000L -#define MAX_TRIES 100 +#define MAX_TRIES 100 #if H5_SIZEOF_LONG_LONG >= 8 -# define GB8LL ((unsigned long long)8*1024*1024*1024) +# define GB8LL ((unsigned long long)8*1024*1024*1024) #else -# define GB8LL 0 /*cannot do the test*/ +# define GB8LL 0 /*cannot do the test*/ #endif /* Define Small, Large, Extra Large, Huge File which @@ -96,19 +96,19 @@ static int test_family(hid_t fapl); /* Array used to record all addresses at which data has been written */ /* so far. Used to prevent overlapping writes. */ static hsize_t values_used[WRT_N]; - + /*------------------------------------------------------------------------- - * Function: randll + * Function: randll * - * Purpose: Create a random long long value. - * Ensures that a write at this value doesn't overlap any - * previous write. + * Purpose: Create a random long long value. + * Ensures that a write at this value doesn't overlap any + * previous write. * - * Return: Success: Random value + * Return: Success: Random value * - * Failure: Random value which overlaps another write + * Failure: Random value which overlaps another write * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, November 24, 1998 * * Modifications: @@ -118,10 +118,10 @@ static hsize_t values_used[WRT_N]; static hsize_t randll(hsize_t limit, int current_index) { - hsize_t acc = 0; - int overlap = 1; - int i; - int tries = 0; + hsize_t acc = 0; + int overlap = 1; + int i; + int tries = 0; /* Generate up to MAX_TRIES random numbers until one of them */ /* does not overlap with any previous writes */ @@ -147,19 +147,19 @@ randll(hsize_t limit, int current_index) return acc; } - + /*------------------------------------------------------------------------- - * Function: is_sparse + * Function: is_sparse * - * Purpose: Determines if the file system of the current working - * directory supports holes. + * Purpose: Determines if the file system of the current working + * directory supports holes. * - * Return: Success: Non-zero if holes are supported; zero - * otherwise. + * Return: Success: Non-zero if holes are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, July 15, 1998 * * Modifications: @@ -169,8 +169,8 @@ randll(hsize_t limit, int current_index) static int is_sparse(void) { - int fd; - h5_stat_t sb; + int fd; + h5_stat_t sb; if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; @@ -185,19 +185,19 @@ is_sparse(void) #endif } - + /*------------------------------------------------------------------------- - * Function: supports_big + * Function: supports_big * - * Purpose: Determines if the file system of the current working - * directory supports big files. + * Purpose: Determines if the file system of the current working + * directory supports big files. * - * Return: Success: Non-zero if big files are supported; zero - * otherwise. + * Return: Success: Non-zero if big files are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Wednesday, April 18, 2007 * * Modifications: @@ -207,7 +207,7 @@ is_sparse(void) static fsizes_t supports_big(void) { - int fd = -1; + int fd = -1; fsizes_t fsize = NO_FILE; if((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) @@ -256,19 +256,19 @@ error: return fsize; } - + /*------------------------------------------------------------------------- - * Function: enough_room + * Function: enough_room * - * Purpose: Tries to create a bunch of sparse files to see if quotas will - * get in the way. Some systems also have problems opening - * enough files and we'll check that too. + * Purpose: Tries to create a bunch of sparse files to see if quotas will + * get in the way. Some systems also have problems opening + * enough files and we'll check that too. * - * Return: Success: Non-zero + * Return: Success: Non-zero * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Thursday, August 6, 1998 * * Modifications: @@ -281,14 +281,14 @@ error: * 'name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static int enough_room(hid_t fapl) { - int ret_value=0; - int fd[68]; - size_t i, size = (size_t)1 << 30; - char filename[1024], name[1024]; + int ret_value=0; + int fd[68]; + size_t i, size = (size_t)1 << 30; + char filename[1024], name[1024]; /* Initialize file descriptors */ for (i=0; i0 + * Failure: >0 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, April 8, 1998 * * Modifications: - * Robb Matzke, 15 Jul 1998 - * Addresses are written to the file DNAME instead of stdout. + * Robb Matzke, 15 Jul 1998 + * Addresses are written to the file DNAME instead of stdout. * *------------------------------------------------------------------------- */ static int writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) { - hsize_t size1[4] = {8, 1024, 1024, 1024}; - hsize_t size2[1] = {GB8LL}; - hsize_t hs_start[1]; - hsize_t hs_size[1]; - hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1; - int *buf = (int*)HDmalloc (sizeof(int) * WRT_SIZE); - int i, j; - FILE *out = HDfopen(DNAME, "w"); + hsize_t size1[4] = {8, 1024, 1024, 1024}; + hsize_t size2[1] = {GB8LL}; + hsize_t hs_start[1]; + hsize_t hs_size[1]; + hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1; + int *buf = (int*)HDmalloc (sizeof(int) * WRT_SIZE); + int i, j; + FILE *out = HDfopen(DNAME, "w"); hid_t dcpl; switch(testsize){ @@ -431,7 +431,7 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) hs_size[0] = WRT_SIZE; if ((mem_space = H5Screate_simple (1, hs_size, hs_size)) < 0) goto error; for (i=0; i0 + * Failure: >0 * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, April 10, 1998 * * Modifications: @@ -488,13 +488,13 @@ error: static int reader(char *filename, hid_t fapl) { - FILE *script = NULL; - hid_t file = -1, mspace = -1, fspace = -1, d2 = -1; - char ln[128], *s; - hsize_t hs_offset[1]; - hsize_t hs_size[1] = {WRT_SIZE}; - int *buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE); - int i, j, zero, wrong, nerrors = 0; + FILE *script = NULL; + hid_t file = -1, mspace = -1, fspace = -1, d2 = -1; + char ln[128], *s; + hsize_t hs_offset[1]; + hsize_t hs_size[1] = {WRT_SIZE}; + int *buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE); + int i, j, zero, wrong, nerrors = 0; /* Open script file */ script = HDfopen(DNAME, "r"); @@ -566,15 +566,15 @@ error: } - + /*------------------------------------------------------------------------- - * Function: usage + * Function: usage * - * Purpose: Print command usage + * Purpose: Print command usage * - * Return: void + * Return: void * - * Programmer: Albert Chent + * Programmer: Albert Chent * Mar 28, 2002 * * Modifications: @@ -601,8 +601,8 @@ usage(void) static int test_sec2(hid_t fapl) { - char filename[1024]; - fsizes_t testsize; + char filename[1024]; + fsizes_t testsize; testsize = supports_big(); if(testsize == NO_FILE) { @@ -636,8 +636,8 @@ error: static int test_stdio(hid_t fapl) { - char filename[1024]; - fsizes_t testsize; + char filename[1024]; + fsizes_t testsize; testsize = supports_big(); if(testsize == NO_FILE) { @@ -675,7 +675,7 @@ error: static int test_family(hid_t fapl) { - char filename[1024]; + char filename[1024]; /* Test huge file with the family driver */ HDputs("Testing big file with the Family Driver "); @@ -731,24 +731,24 @@ error: return 1; } /* end test_family() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Friday, April 10, 1998 * * Modifications: - * Albert Cheng, 2002/03/28 - * Added command option -fsize. - * Albert Cheng, 2002/04/19 - * Added command option -c. + * Albert Cheng, 2002/03/28 + * Added command option -fsize. + * Albert Cheng, 2002/04/19 + * Added command option -c. * * Raymond Lu, 2007/05/25 * Added similar tests for SEC2 and STDIO drivers. diff --git a/test/cache.c b/test/cache.c index da33052..660c6ab 100644 --- a/test/cache.c +++ b/test/cache.c @@ -2933,17 +2933,17 @@ express_test, unsigned paged) /*------------------------------------------------------------------------- * Function: check_insert_entry() * - * Purpose: Verify that H5C_insert_entry behaves as expected. - * Test the behaviour with different flags. + * Purpose: Verify that H5C_insert_entry behaves as expected. + * Test the behaviour with different flags. * - * This test was added primarily to test basic insert - * pinned entry functionallity, but I through in explicit - * tests for other functionallity that is tested implicitly - * elsewhere. + * This test was added primarily to test basic insert + * pinned entry functionallity, but I through in explicit + * tests for other functionallity that is tested implicitly + * elsewhere. * - * Return: void + * Return: void * - * Programmer: John Mainzer + * Programmer: John Mainzer * 8/10/06 * * Modifications: @@ -28266,6 +28266,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) /* Set up the expected array. This is used to maintain a table of the * expected status of every entry used in this test. */ + /* clang-format off */ struct expected_entry_status expected[150] = { /* entry entry in at main flush dep flush dep child flush flush flush */ @@ -28421,6 +28422,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; + /* clang-format on */ pass = TRUE; @@ -29100,16 +29102,19 @@ check_flush_deps(unsigned paged) test_entry_t *base_addr; /* Base address of entries for test */ int entry_type = PICO_ENTRY_TYPE; /* Use very small entry size (size of entries doesn't matter) */ unsigned u; /* Local index variable */ + + /* clang-format off */ struct expected_entry_status expected[5] = { - /* entry entry in at main flush dep flush dep child flush flush flush */ - /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ + /* entry entry in at main flush dep flush dep child flush flush flush */ + /* type: index: size: cache: addr: dirty: prot: pinned: dsrlzd: srlzd: dest: par type[]: par idx[]: dep npart: dep nchd: dep ndirty chd: order: corked: */ { PICO_ENTRY_TYPE, 0, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { PICO_ENTRY_TYPE, 1, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { PICO_ENTRY_TYPE, 2, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; + /* clang-format on */ if(paged) TESTING("flush dependencies (paged aggregation)") @@ -31070,6 +31075,8 @@ check_flush_deps_order(unsigned paged) H5C_t * cache_ptr = NULL; /* Metadata cache for this test */ int entry_type = PICO_ENTRY_TYPE; /* Use very small entry size (size of entries doesn't matter) */ unsigned u; /* Local index variable */ + unsigned flush_order; /* Index for tracking flush order */ + /* clang-format off */ struct expected_entry_status expected[5] = { /* entry entry in at main flush dep flush dep child flush flush flush */ @@ -31080,7 +31087,7 @@ check_flush_deps_order(unsigned paged) { PICO_ENTRY_TYPE, 3, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { PICO_ENTRY_TYPE, 4, PICO_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; - unsigned flush_order; /* Index for tracking flush order */ + /* clang-format on */ if(paged) TESTING("flush dependencies flush order (paged aggregation)") @@ -33617,6 +33624,7 @@ check_notify_cb(unsigned paged) test_entry_t * entry_ptr; /* Cache entry to examine/manipulate */ int entry_type = NOTIFY_ENTRY_TYPE; /* Use entry w/notify callback (size of entries doesn't matter) */ unsigned u; /* Local index variable */ + /* clang-format off */ struct expected_entry_status expected[5] = { /* entry entry in at main flush dep flush dep child flush flush flush */ @@ -33627,6 +33635,7 @@ check_notify_cb(unsigned paged) { NOTIFY_ENTRY_TYPE, 3, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { NOTIFY_ENTRY_TYPE, 4, NOTIFY_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} }; + /* clang-format on */ if(paged) TESTING("'notify' callback (paged)") @@ -33833,6 +33842,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) /* Set up the expected array. This is used to maintain a table of the * expected status of every entry used in this test. */ + /* clang-format off */ struct expected_entry_status expected[150] = { /* entry entry in at main flush dep flush dep child flush flush flush */ @@ -33988,6 +33998,7 @@ check_metadata_cork(hbool_t fill_via_insertion, unsigned paged) { HUGE_ENTRY_TYPE, 148, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { HUGE_ENTRY_TYPE, 149, HUGE_ENTRY_SIZE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, {0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE} } ; + /* clang-format on */ pass = TRUE; @@ -34663,6 +34674,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) { H5C_t * cache_ptr = file_ptr->shared->cache; int i; + /* clang-format off */ struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -34677,6 +34689,7 @@ cedds__expunge_dirty_entry_in_flush_test(H5F_t * file_ptr) { HUGE_ENTRY_TYPE, 2, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, { HUGE_ENTRY_TYPE, 3, HUGE_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE} }; + /* clang-format on */ if(pass) { @@ -34892,6 +34905,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) int i; const int num_huge_entries = 4; const int num_monster_entries = 32; + /* clang-format off */ struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -34938,6 +34952,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr) { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, }; + /* clang-format on */ if(pass) { @@ -35272,6 +35287,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) H5C_t * cache_ptr = file_ptr->shared->cache; int i; herr_t result; + /* clang-format off */ struct expected_entry_status expected[36] = { /* the expected array is used to maintain a table of the expected status of every @@ -35314,6 +35330,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr) { MONSTER_ENTRY_TYPE, 30, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,-1,-1,-1,-1,-1,-1,-1}, {-1,-1,-1,-1,-1,-1,-1,-1}, 0, 0, 0, -1, FALSE}, }; + /* clang-format on */ H5C_auto_size_ctl_t saved_auto_size_ctl; H5C_auto_size_ctl_t test_auto_size_ctl = { @@ -35748,6 +35765,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) test_entry_t * entry_ptr; test_entry_t * base_addr = NULL; struct H5C_cache_entry_t * scan_ptr; + /* clang-format off */ struct expected_entry_status expected[5] = { /* the expected array is used to maintain a table of the expected status of every @@ -35763,6 +35781,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr) { MONSTER_ENTRY_TYPE, 24, MONSTER_ENTRY_SIZE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, {-1,0,0,0,0,0,0,0}, {-1,0,0,0,0,0,0,0}, 0, 0, 0, -1, FALSE}, { MONSTER_ENTRY_TYPE, 31, MONSTER_ENTRY_SIZE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, {MONSTER_ENTRY_TYPE,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0}, 1, 0, 0, -1, FALSE}, }; + /* clang-format on */ if(pass) { diff --git a/test/error_test.c b/test/error_test.c index 7c6cf9f..1408c46 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -329,7 +329,7 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie * 'full_desc' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static herr_t test_long_desc(void) { @@ -384,7 +384,7 @@ error: return -1; } /* end test_long_desc() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- diff --git a/test/external.c b/test/external.c index c98c228..f66804e 100644 --- a/test/external.c +++ b/test/external.c @@ -925,7 +925,7 @@ test_path_absolute(hid_t fapl) hid_t dset = -1; /* dataset */ size_t i = 0; /* miscellaneous counter */ char cwdpath[1024]; /* working directory */ - char filename[1024]; /* file name */ + char filename[1088]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ hsize_t cur_size; /* current data space size */ @@ -1014,7 +1014,6 @@ test_path_relative(hid_t fapl) hid_t space = -1; /* data space */ hid_t dset = -1; /* dataset */ size_t i = 0; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ char filename[1024]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ @@ -1039,8 +1038,6 @@ test_path_relative(hid_t fapl) /* Create the dataset */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath))) - TEST_ERROR for (i = 0; i < N_EXT_FILES; i++) { HDsnprintf(filename, sizeof(filename), "extern_%dr.raw", (int)i + 1); if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) @@ -1108,7 +1105,6 @@ test_path_relative_cwd(hid_t fapl) hid_t dset2 = -1; /* dataset, opened a second time */ hid_t dset3 = -1; /* dataset, opened with different prefix */ size_t i = 0; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ char filename[1024]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ @@ -1134,8 +1130,6 @@ test_path_relative_cwd(hid_t fapl) /* Create the dataset */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath))) - TEST_ERROR for(i = 0; i < N_EXT_FILES; i++) { HDsnprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int)i + 1); if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) diff --git a/test/external_env.c b/test/external_env.c index 18e1f25..08f29ec 100644 --- a/test/external_env.c +++ b/test/external_env.c @@ -52,7 +52,6 @@ test_path_env(hid_t fapl) hid_t dapl = -1; /* dataset access property list */ hid_t dset = -1; /* dataset */ size_t i; /* miscellaneous counters */ - char cwdpath[1024]; /* working directory */ char filename[1024]; /* file name */ int part[PART_SIZE]; /* raw data buffer (partial) */ int whole[TOTAL_SIZE]; /* raw data buffer (total) */ @@ -72,8 +71,6 @@ test_path_env(hid_t fapl) /* Create the dataset */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR - if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath))) - TEST_ERROR for(i = 0; i < N_EXT_FILES; i++) { HDsnprintf(filename, sizeof(filename), "extern_env_%dr.raw", (int) i + 1); if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0) diff --git a/test/fheap.c b/test/fheap.c index bd44c1a..c3b885d 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -20,9 +20,9 @@ * This file needs to access private datatypes from the H5HF package. * This file also needs to access the fractal heap testing code. */ -#define H5HF_FRIEND /*suppress error about including H5HFpkg */ +#define H5HF_FRIEND /*suppress error about including H5HFpkg */ #define H5HF_TESTING -#include "H5HFpkg.h" /* Fractal heaps */ +#include "H5HFpkg.h" /* Fractal heaps */ #define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING @@ -30,9 +30,9 @@ /* Other private headers that this test requires */ #include "H5CXprivate.h" /* API Contexts */ -#include "H5MMprivate.h" /* Memory management */ -#include "H5Iprivate.h" /* IDs */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5Iprivate.h" /* IDs */ +#include "H5VMprivate.h" /* Vectors and arrays */ /* Max. testfile name length */ #define FHEAP_FILENAME_LEN 1024 @@ -73,12 +73,18 @@ #define HEAP_ID_LEN 7 /* # of bytes to use for heap ID */ #define SMALL_HEAP_ID_LEN 7 /* # of bytes to use for "small" heap's IDs */ #define LARGE_HEAP_ID_LEN 12 /* # of bytes to use for "large" heap's IDs */ -#define HEAP_MAX_ROOT_ROWS(fh) H5HF_get_max_root_rows(fh) /* Max. # of rows in root indirect block */ -#define DTABLE_WIDTH(fh) H5HF_get_dtable_width_test(fh) /* Width of doubling table for heap */ -#define DTABLE_MAX_DROWS(fh) H5HF_get_dtable_max_drows_test(fh) /* Max. # of direct block rows in any indirect block */ -#define IBLOCK_MAX_DROWS(fh, pos) H5HF_get_iblock_max_drows_test(fh, pos) /* Max. # of direct block rows in a indirect block */ -#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) /* Size of a direct block in a given row */ -#define DBLOCK_FREE(fh, r) H5HF_get_dblock_free_test(fh, r) /* Free space in a direct block of a given row */ +/* Max. # of rows in root indirect block */ +#define HEAP_MAX_ROOT_ROWS(fh) H5HF_get_max_root_rows(fh) +/* Width of doubling table for heap */ +#define DTABLE_WIDTH(fh) H5HF_get_dtable_width_test(fh) +/* Max. # of direct block rows in any indirect block */ +#define DTABLE_MAX_DROWS(fh) H5HF_get_dtable_max_drows_test(fh) +/* Max. # of direct block rows in a indirect block */ +#define IBLOCK_MAX_DROWS(fh, pos) H5HF_get_iblock_max_drows_test(fh, pos) +/* Size of a direct block in a given row */ +#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) +/* Free space in a direct block of a given row */ +#define DBLOCK_FREE(fh, r) H5HF_get_dblock_free_test(fh, r) /* The number of settings for testing: page buffering, file space strategy and persisting free-space */ #define NUM_PB_FS 6 @@ -173,18 +179,18 @@ static int check_stats(const H5HF_t *fh, const fheap_heap_state_t *state); static int del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids); - + /*------------------------------------------------------------------------- - * Function: init_small_cparam + * Function: init_small_cparam * - * Purpose: Initialize heap creation parameter structure with small + * Purpose: Initialize heap creation parameter structure with small * settings * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -210,18 +216,18 @@ init_small_cparam(H5HF_create_t *cparam) return(0); } /* init_small_cparam() */ - + /*------------------------------------------------------------------------- - * Function: init_large_cparam + * Function: init_large_cparam * - * Purpose: Initialize heap creation parameter structure with large + * Purpose: Initialize heap creation parameter structure with large * settings * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -247,17 +253,17 @@ init_large_cparam(H5HF_create_t *cparam) return(0); } /* init_large_cparam() */ - + /*------------------------------------------------------------------------- - * Function: check_stats + * Function: check_stats * - * Purpose: Verify stats for a heap + * Purpose: Verify stats for a heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -310,17 +316,17 @@ error: return(1); } /* check_stats() */ - + /*------------------------------------------------------------------------- - * Function: op_memcpy + * Function: op_memcpy * - * Purpose: Perform 'memcpy' for an object + * Purpose: Perform 'memcpy' for an object * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, September 11, 2006 * *------------------------------------------------------------------------- @@ -334,11 +340,11 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data) return(SUCCEED); } /* op_memcpy() */ - + /*------------------------------------------------------------------------- - * Function: add_obj + * Function: add_obj * - * Purpose: Add an object to heap + * Purpose: Add an object to heap * * Note: The following fields in the 'state' structure are set to * the values expected _after_ any block created for the object: @@ -350,11 +356,11 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data) * the current state, before any block has been created: * nobjs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -455,17 +461,17 @@ error: return(1); } /* add_obj() */ - + /*------------------------------------------------------------------------- - * Function: get_del_string + * Function: get_del_string * - * Purpose: Return string describing the kind of deletion to perform + * Purpose: Return string describing the kind of deletion to perform * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 6, 2006 * *------------------------------------------------------------------------- @@ -492,16 +498,16 @@ get_del_string(const fheap_test_param_t *tparam) return(str); } /* get_del_string() */ - + /*------------------------------------------------------------------------- - * Function: get_fill_size + * Function: get_fill_size * - * Purpose: Retrieve the size of objects to "bulk" fill blocks with + * Purpose: Retrieve the size of objects to "bulk" fill blocks with * - * Return: Size of object to pass down to "fill_heap" routine on + * Return: Size of object to pass down to "fill_heap" routine on * success/can't fail * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, July 27, 2006 * *------------------------------------------------------------------------- @@ -524,17 +530,17 @@ get_fill_size(const fheap_test_param_t *tparam) return(0); } /* get_fill_size() */ - + /*------------------------------------------------------------------------- - * Function: begin_test + * Function: begin_test * - * Purpose: Perform common "test being" operations + * Purpose: Perform common "test being" operations * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -545,7 +551,7 @@ get_fill_size(const fheap_test_param_t *tparam) * test_desc in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static int begin_test(fheap_test_param_t *tparam, const char *base_desc, fheap_heap_ids_t *keep_ids, size_t *fill_size) @@ -574,18 +580,18 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, /* Success */ return(0); } /* end begin_test() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") + - /*------------------------------------------------------------------------- - * Function: reopen_file + * Function: reopen_file * - * Purpose: Perform common "re-open" operations on file & heap for testing + * Purpose: Perform common "re-open" operations on file & heap for testing * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 18, 2006 * *------------------------------------------------------------------------- @@ -632,17 +638,17 @@ error: return(-1); } /* end reopen_file() */ - + /*------------------------------------------------------------------------- - * Function: open_heap + * Function: open_heap * - * Purpose: Perform common "open" operations on file & heap for testing + * Purpose: Perform common "open" operations on file & heap for testing * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -744,17 +750,17 @@ error: return(-1); } /* end open_heap() */ - + /*------------------------------------------------------------------------- - * Function: reopen_heap + * Function: reopen_heap * - * Purpose: Perform common "re-open" operations on heap for testing + * Purpose: Perform common "re-open" operations on heap for testing * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -782,16 +788,16 @@ error: return -1; } /* end reopen_heap() */ - + /*------------------------------------------------------------------------- - * Function: close_heap + * Function: close_heap * - * Purpose: Perform common "close" operations on file & heap for testing + * Purpose: Perform common "close" operations on file & heap for testing * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 4, 2006 * *------------------------------------------------------------------------- @@ -850,17 +856,17 @@ error: return(-1); } /* end close_heap() */ - + /*------------------------------------------------------------------------- - * Function: del_objs_half_refill + * Function: del_objs_half_refill * - * Purpose: Remove half of objects from heap and refill + * Purpose: Remove half of objects from heap and refill * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 6, 2006 * *------------------------------------------------------------------------- @@ -944,17 +950,17 @@ error: return(1); } /* del_objs_half_refill() */ - + /*------------------------------------------------------------------------- - * Function: del_objs + * Function: del_objs * - * Purpose: Remove objects from heap + * Purpose: Remove objects from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 6, 2006 * *------------------------------------------------------------------------- @@ -1026,11 +1032,11 @@ error: return(1); } /* del_objs() */ - + /*------------------------------------------------------------------------- - * Function: fill_heap + * Function: fill_heap * - * Purpose: Insert (small) objects to fill up the free space in a heap block + * Purpose: Insert (small) objects to fill up the free space in a heap block * * Note: The following fields in the 'state' structure are set to * the values expected _after_ the block has been created: @@ -1042,11 +1048,11 @@ error: * the current state, before the block has been created: * nobjs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -1228,17 +1234,17 @@ error: return(1); } /* fill_heap() */ - + /*------------------------------------------------------------------------- - * Function: fill_root_row + * Function: fill_root_row * - * Purpose: Fill up a row of direct blocks in the root indirect block + * Purpose: Fill up a row of direct blocks in the root indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1325,17 +1331,17 @@ error: return(1); } /* fill_root_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_partial row + * Function: fill_partial row * - * Purpose: Fill up part of a row of direct blocks in an non-root indirect block + * Purpose: Fill up part of a row of direct blocks in an non-root indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 11, 2006 * *------------------------------------------------------------------------- @@ -1371,17 +1377,17 @@ error: return(1); } /* fill_partial_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_row + * Function: fill_row * - * Purpose: Fill up entire row of direct blocks in an non-root indirect block + * Purpose: Fill up entire row of direct blocks in an non-root indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1405,20 +1411,20 @@ error: return(1); } /* fill_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_root_direct + * Function: fill_root_direct * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in the root indirect block * (Generally used to create & fill up direct blocks in a new * indirect block) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -1446,19 +1452,19 @@ error: return(1); } /* fill_root_direct() */ - + /*------------------------------------------------------------------------- - * Function: fill_2nd_indirect + * Function: fill_2nd_indirect * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a second-level indirect block (which only has * direct blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1486,18 +1492,18 @@ error: return(1); } /* fill_2nd_direct() */ - + /*------------------------------------------------------------------------- - * Function: fill_all_direct + * Function: fill_all_direct * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks up to the maximum direct block size * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1525,19 +1531,19 @@ error: return(1); } /* fill_all_direct() */ - + /*------------------------------------------------------------------------- - * Function: fill_2nd_indirect_row + * Function: fill_2nd_indirect_row * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a row of second-level indirect block (which only * have direct blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1564,19 +1570,19 @@ error: return(1); } /* fill_2nd_direct_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_all_2nd_indirect_rows + * Function: fill_all_2nd_indirect_rows * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in all rows of second-level indirect blocks (which only * have direct blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1603,19 +1609,19 @@ error: return(1); } /* fill_2nd_direct_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_3rd_indirect + * Function: fill_3rd_indirect * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a third-level indirect block (which * has one more level of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 18, 2006 * *------------------------------------------------------------------------- @@ -1642,19 +1648,19 @@ error: return(1); } /* fill_3rd_indirect() */ - + /*------------------------------------------------------------------------- - * Function: fill_3rd_indirect_row + * Function: fill_3rd_indirect_row * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a row of third-level indirect block (which * have one more level of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1682,19 +1688,19 @@ error: return(1); } /* fill_3rd_direct_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_all_3rd_indirect_rows + * Function: fill_all_3rd_indirect_rows * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in all rows of third-level indirect blocks (which * have one more level of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1722,19 +1728,19 @@ error: return(1); } /* fill_all_3rd_direct_rows() */ - + /*------------------------------------------------------------------------- - * Function: fill_4th_indirect_row + * Function: fill_4th_indirect_row * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in a row of fourth-level indirect blocks (which * have two more levels of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1772,19 +1778,19 @@ error: return(1); } /* fill_4th_direct_row() */ - + /*------------------------------------------------------------------------- - * Function: fill_all_4th_indirect_rows + * Function: fill_all_4th_indirect_rows * - * Purpose: Insert (small) objects to fill up the free space in all direct + * Purpose: Insert (small) objects to fill up the free space in all direct * heap blocks in all rows of fourth-level indirect blocks (which * have two more levels of indirect blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 10, 2006 * *------------------------------------------------------------------------- @@ -1830,16 +1836,16 @@ error: return(1); } /* fill_all_4th_direct_rows() */ - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Create fractal heap + * Purpose: Create fractal heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * *------------------------------------------------------------------------- @@ -1847,9 +1853,9 @@ error: static unsigned test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Heap address in file */ @@ -1948,16 +1954,16 @@ error: return 1; } /* test_create() */ - + /*------------------------------------------------------------------------- - * Function: test_reopen + * Function: test_reopen * - * Purpose: Create & reopen a fractal heap + * Purpose: Create & reopen a fractal heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 18, 2006 * *------------------------------------------------------------------------- @@ -1965,9 +1971,9 @@ error: static unsigned test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ @@ -2100,16 +2106,16 @@ error: return(1); } /* test_reopen() */ - + /*------------------------------------------------------------------------- - * Function: test_open_twice + * Function: test_open_twice * - * Purpose: Open a fractal heap twice + * Purpose: Open a fractal heap twice * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 18, 2006 * *------------------------------------------------------------------------- @@ -2117,11 +2123,11 @@ error: static unsigned test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - hid_t file2 = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5F_t *f2 = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t file2 = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f2 = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ H5HF_t *fh2 = NULL; /* 2nd fractal heap wrapper */ @@ -2277,16 +2283,16 @@ error: return 1; } /* test_open_twice() */ - + /*------------------------------------------------------------------------- - * Function: test_delete_open + * Function: test_delete_open * - * Purpose: Delete opened fractal heap (& open deleted heap) + * Purpose: Delete opened fractal heap (& open deleted heap) * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, January 5, 2007 * *------------------------------------------------------------------------- @@ -2294,9 +2300,9 @@ error: static unsigned test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_create_t test_cparam; /* Creation parameters for heap */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ H5HF_t *fh2 = NULL; /* 2nd fractal heap wrapper */ @@ -2450,16 +2456,16 @@ error: return 1; } /* test_delete_open() */ - + /*------------------------------------------------------------------------- - * Function: test_id_limits + * Function: test_id_limits * - * Purpose: Test limits for heap ID lengths + * Purpose: Test limits for heap ID lengths * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -2467,9 +2473,9 @@ error: static unsigned test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ unsigned deflate_level; /* Deflation level */ @@ -2794,16 +2800,16 @@ error: return 1; } /* test_id_limits() */ - + /*------------------------------------------------------------------------- - * Function: test_filtered_create + * Function: test_filtered_create * - * Purpose: Test creating a heap with I/O filters + * Purpose: Test creating a heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -2811,9 +2817,9 @@ error: static unsigned test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -2917,16 +2923,16 @@ error: return 1; } /* test_filtered_create() */ - + /*------------------------------------------------------------------------- - * Function: test_size + * Function: test_size * - * Purpose: Test querying heap size + * Purpose: Test querying heap size * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, August 14, 2007 * *------------------------------------------------------------------------- @@ -2934,9 +2940,9 @@ error: static unsigned test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ hsize_t empty_heap_size; /* Total size of empty heap on disk */ @@ -3057,7 +3063,7 @@ error: return 1; } /* test_size() */ - + /*------------------------------------------------------------------------- * Function: test_reopen_hdr * @@ -3195,16 +3201,16 @@ error: return(1); } /* test_reopen_hdr() */ - + /*------------------------------------------------------------------------- - * Function: test_man_insert_weird + * Function: test_man_insert_weird * - * Purpose: Test inserting "weird" sized objects into absolute heap + * Purpose: Test inserting "weird" sized objects into absolute heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 18, 2006 * *------------------------------------------------------------------------- @@ -3212,9 +3218,9 @@ error: static unsigned test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id[HEAP_ID_LEN]; /* Heap ID for object */ @@ -3299,23 +3305,23 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_weird() */ #ifdef ALL_INSERT_TESTS - + /*------------------------------------------------------------------------- - * Function: test_man_insert_first + * Function: test_man_insert_first * - * Purpose: Test inserting first object into absolute heap + * Purpose: Test inserting first object into absolute heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * *------------------------------------------------------------------------- @@ -3323,9 +3329,9 @@ error: static unsigned test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -3400,22 +3406,22 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_first() */ - + /*------------------------------------------------------------------------- - * Function: test_man_insert_second + * Function: test_man_insert_second * - * Purpose: Test inserting two objects into absolute heap + * Purpose: Test inserting two objects into absolute heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -3423,9 +3429,9 @@ error: static unsigned test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -3494,23 +3500,23 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_second() */ - + /*------------------------------------------------------------------------- - * Function: test_man_insert_root_mult + * Function: test_man_insert_root_mult * - * Purpose: Test inserting mult. objects into absolute heap, up to the + * Purpose: Test inserting mult. objects into absolute heap, up to the * limit of a root direct block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -3518,9 +3524,9 @@ error: static unsigned test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -3591,24 +3597,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_root_mult() */ - + /*------------------------------------------------------------------------- - * Function: test_man_insert_force_indirect + * Function: test_man_insert_force_indirect * - * Purpose: Test inserting mult. objects into absolute heap, filling the + * Purpose: Test inserting mult. objects into absolute heap, filling the * root direct block and forcing the root block to be converted * into an indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 6, 2006 * *------------------------------------------------------------------------- @@ -3616,9 +3622,9 @@ error: static unsigned test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -3696,24 +3702,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_force_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_insert_fill_second + * Function: test_man_insert_fill_second * - * Purpose: Test inserting mult. objects into absolute heap, filling the + * Purpose: Test inserting mult. objects into absolute heap, filling the * root direct block, forcing the root block to be converted * into an indirect block and filling the secnod indirect block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -3721,9 +3727,9 @@ error: static unsigned test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -3801,25 +3807,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_fill_second() */ - + /*------------------------------------------------------------------------- - * Function: test_man_insert_third_direct + * Function: test_man_insert_third_direct * - * Purpose: Test inserting mult. objects into absolute heap, filling the + * Purpose: Test inserting mult. objects into absolute heap, filling the * root direct block, forcing the root block to be converted * into an indirect block, filling the secnod indirect block and * creating a third direct block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -3827,9 +3833,9 @@ error: static unsigned test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -3912,24 +3918,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_insert_third_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_first_row + * Function: test_man_fill_first_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 13, 2006 * *------------------------------------------------------------------------- @@ -3937,9 +3943,9 @@ error: static unsigned test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4007,24 +4013,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_first_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_start_second_row + * Function: test_man_start_second_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block, then add another object to start second row. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 14, 2006 * *------------------------------------------------------------------------- @@ -4032,9 +4038,9 @@ error: static unsigned test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4109,24 +4115,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_start_second_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_second_row + * Function: test_man_fill_second_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block, then fill the second row also. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 14, 2006 * *------------------------------------------------------------------------- @@ -4134,9 +4140,9 @@ error: static unsigned test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4208,25 +4214,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_second_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_start_third_row + * Function: test_man_start_third_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first row of root indirect * block, fill the second row also, then add another object to * start the third row. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4234,9 +4240,9 @@ error: static unsigned test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4318,24 +4324,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_start_third_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_fourth_row + * Function: test_man_fill_fourth_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill first four rows of root indirect * block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4343,9 +4349,9 @@ error: static unsigned test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4415,24 +4421,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_fourth_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_all_root_direct + * Function: test_man_fill_all_root_direct * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4440,9 +4446,9 @@ error: static unsigned test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4510,24 +4516,24 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_all_root_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_first_recursive_indirect + * Function: test_man_first_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block and create first recursive indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -4535,9 +4541,9 @@ error: static unsigned test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4610,25 +4616,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_first_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_second_direct_recursive_indirect + * Function: test_man_second_direct_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block and start second * direct block in that indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4636,9 +4642,9 @@ error: static unsigned test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4719,25 +4725,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_second_direct_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_first_recursive_indirect + * Function: test_man_fill_first_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block and filling all * direct blocks in that indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4745,9 +4751,9 @@ error: static unsigned test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4820,26 +4826,26 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_first_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_second_recursive_indirect + * Function: test_man_second_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block, filling all * direct blocks in that indirect block and adding another * object to force creation of second recursive indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4847,9 +4853,9 @@ error: static unsigned test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -4929,27 +4935,27 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_second_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_second_recursive_indirect + * Function: test_man_fill_second_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block, filling all * direct blocks in that indirect block and then create second * recursive indirect block and fill all direct blocks in that * indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -4957,9 +4963,9 @@ error: static unsigned test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5036,27 +5042,27 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_second_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_recursive_indirect_row + * Function: test_man_fill_recursive_indirect_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, create first recursive indirect block, filling all * direct blocks in that indirect block and then create second * recursive indirect block and fill all direct blocks in that * indirect block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 21, 2006 * *------------------------------------------------------------------------- @@ -5064,9 +5070,9 @@ error: static unsigned test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5135,25 +5141,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_recursive_indirect_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_start_2nd_recursive_indirect + * Function: test_man_start_2nd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the first row of indirect * blocks and start on first block in second row of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5161,9 +5167,9 @@ error: static unsigned test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5243,25 +5249,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_start_2nd_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_recursive_indirect_two_deep + * Function: test_man_recursive_indirect_two_deep * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5269,9 +5275,9 @@ error: static unsigned test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5344,26 +5350,26 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_recursive_indirect_two_deep() */ - + /*------------------------------------------------------------------------- - * Function: test_man_start_3rd_recursive_indirect + * Function: test_man_start_3rd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and start first direct block * in 3rd level of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5371,9 +5377,9 @@ error: static unsigned test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5453,26 +5459,26 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_start_3rd_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_first_3rd_recursive_indirect + * Function: test_man_fill_first_3rd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and fill first indirect block * in 3rd level of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5480,9 +5486,9 @@ error: static unsigned test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5563,26 +5569,26 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_first_3rd_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_recursive_indirect_row + * Function: test_man_fill_3rd_recursive_indirect_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and fill all indirect blocks * first row of 3rd level of indirect blocks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5590,9 +5596,9 @@ error: static unsigned test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5669,26 +5675,26 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_3rd_recursive_indirect_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_all_3rd_recursive_indirect + * Function: test_man_fill_all_3rd_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep and fill all indirect blocks * that are three levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5696,9 +5702,9 @@ error: static unsigned test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5775,27 +5781,27 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_all_3rd_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_start_4th_recursive_indirect + * Function: test_man_start_4th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and start first direct block that * is four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5803,9 +5809,9 @@ error: static unsigned test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -5889,27 +5895,27 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_start_4th_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_first_4th_recursive_indirect + * Function: test_man_fill_first_4th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and fill the first (3rd level) * indirect block that is four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -5917,9 +5923,9 @@ error: static unsigned test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -6008,27 +6014,27 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_first_4th_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_4th_recursive_indirect_row + * Function: test_man_fill_4th_recursive_indirect_row * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and fill the first row of * indirect block that is four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6036,9 +6042,9 @@ error: static unsigned test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -6119,27 +6125,27 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_4th_recursive_indirect_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_all_4th_recursive_indirect + * Function: test_man_fill_all_4th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks * that are three levels deep and fill all rows of * indirect blocks that are four levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6147,9 +6153,9 @@ error: static unsigned test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -6230,17 +6236,17 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_all_4th_recursive_indirect() */ #endif /* ALL_INSERT_TESTS */ - + /*------------------------------------------------------------------------- - * Function: test_man_start_5th_recursive_indirect + * Function: test_man_start_5th_recursive_indirect * - * Purpose: Test inserting mult. objects into absolute heap, creating + * Purpose: Test inserting mult. objects into absolute heap, creating * enough direct blocks to fill all direct rows of root indirect * block, fill all direct blocks in the row of indirect * blocks that are 2 levels deep, fill all indirect blocks @@ -6248,11 +6254,11 @@ error: * that are four levels deep and start first direct block in * indirect blocks five levels deep * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -6260,9 +6266,9 @@ error: static unsigned test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -6363,22 +6369,22 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_start_5th_recursive_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_bogus + * Function: test_man_remove_bogus * - * Purpose: Test removing bogus heap IDs + * Purpose: Test removing bogus heap IDs * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -6386,9 +6392,9 @@ error: static unsigned test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id[HEAP_ID_LEN]; /* Heap ID for object */ @@ -6516,22 +6522,22 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_bogus() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_one + * Function: test_man_remove_one * - * Purpose: Test removing single object from heap + * Purpose: Test removing single object from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -6539,9 +6545,9 @@ error: static unsigned test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id[HEAP_ID_LEN]; /* Heap ID for object */ @@ -6679,22 +6685,22 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_one() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_two + * Function: test_man_remove_two * - * Purpose: Test removing two objects from heap + * Purpose: Test removing two objects from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 22, 2006 * *------------------------------------------------------------------------- @@ -6702,9 +6708,9 @@ error: static unsigned test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id1[HEAP_ID_LEN]; /* Heap ID for first object */ @@ -6871,23 +6877,23 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_two() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_one_larger + * Function: test_man_remove_one_larger * - * Purpose: Test removing single larger (but < standalone size) object + * Purpose: Test removing single larger (but < standalone size) object * from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 6, 2006 * *------------------------------------------------------------------------- @@ -6895,9 +6901,9 @@ error: static unsigned test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id[HEAP_ID_LEN]; /* Heap ID for object */ @@ -7039,23 +7045,23 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_one_larger() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_two_larger + * Function: test_man_remove_two_larger * - * Purpose: Test removing two larger (but < standalone size) objects + * Purpose: Test removing two larger (but < standalone size) objects * from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, June 10, 2006 * *------------------------------------------------------------------------- @@ -7063,9 +7069,9 @@ error: static unsigned test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id1[HEAP_ID_LEN]; /* Heap ID for first object */ @@ -7278,23 +7284,23 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_two_larger() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_three_larger + * Function: test_man_remove_three_larger * - * Purpose: Test removing three larger (but < standalone size) objects + * Purpose: Test removing three larger (but < standalone size) objects * from heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 12, 2006 * *------------------------------------------------------------------------- @@ -7302,9 +7308,9 @@ error: static unsigned test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char heap_id1[HEAP_ID_LEN]; /* Heap ID for first object */ @@ -7577,21 +7583,21 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_three_larger() */ - + /*------------------------------------------------------------------------- - * Function: test_man_incr_insert_remove + * Function: test_man_incr_insert_remove * - * Purpose: Test incremental insert & removal of objects in heap + * Purpose: Test incremental insert & removal of objects in heap * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Sunday, April 1, 2012 * *------------------------------------------------------------------------- @@ -7599,9 +7605,9 @@ error: static unsigned test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ unsigned char **heap_id = NULL; @@ -7700,7 +7706,7 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; HDfree(heap_id); @@ -7709,18 +7715,18 @@ error: return 1; } /* test_man_incr_insert_remove() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_root_direct + * Function: test_man_remove_root_direct * - * Purpose: Test filling and removing all objects from root direct block in + * Purpose: Test filling and removing all objects from root direct block in * heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 22, 2006 * *------------------------------------------------------------------------- @@ -7728,16 +7734,17 @@ error: static unsigned test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from root direct block of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from root direct block of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7777,23 +7784,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_root_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_two_direct + * Function: test_man_remove_two_direct * - * Purpose: Test filling and removing all objects from (first) two direct + * Purpose: Test filling and removing all objects from (first) two direct * blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 22, 2006 * *------------------------------------------------------------------------- @@ -7801,16 +7808,17 @@ error: static unsigned test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from two direct blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from two direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7865,23 +7873,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_two_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_first_row + * Function: test_man_remove_first_row * - * Purpose: Test filling and removing all objects from first row of direct + * Purpose: Test filling and removing all objects from first row of direct * blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 5, 2006 * *------------------------------------------------------------------------- @@ -7889,16 +7897,17 @@ error: static unsigned test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from first row of direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -7935,23 +7944,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_first_row() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_first_two_rows + * Function: test_man_remove_first_two_rows * - * Purpose: Test filling and removing all objects from first two rows of + * Purpose: Test filling and removing all objects from first two rows of * direct blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, June 12, 2006 * *------------------------------------------------------------------------- @@ -7959,16 +7968,17 @@ error: static unsigned test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from first two rows of direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8007,23 +8017,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_first_two_rows() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_first_four_rows + * Function: test_man_remove_first_four_rows * - * Purpose: Test filling and removing all objects from first four rows of + * Purpose: Test filling and removing all objects from first four rows of * direct blocks in heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 13, 2006 * *------------------------------------------------------------------------- @@ -8031,16 +8041,17 @@ error: static unsigned test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from first four rows of direct blocks of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8083,23 +8094,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_first_four_rows() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_all_root_direct + * Function: test_man_remove_all_root_direct * - * Purpose: Test filling and removing all objects from all direct blocks + * Purpose: Test filling and removing all objects from all direct blocks * in root indirect block of heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 13, 2006 * *------------------------------------------------------------------------- @@ -8107,16 +8118,17 @@ error: static unsigned test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from all direct blocks of root group in absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8153,23 +8165,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_all_root_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_2nd_indirect + * Function: test_man_remove_2nd_indirect * - * Purpose: Test filling and removing all objects up to 2nd level indirect + * Purpose: Test filling and removing all objects up to 2nd level indirect * blocks of heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, June 13, 2006 * *------------------------------------------------------------------------- @@ -8177,16 +8189,17 @@ error: static unsigned test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from 2nd level indirect blocks of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8227,23 +8240,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_2nd_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_remove_3rd_indirect + * Function: test_man_remove_3rd_indirect * - * Purpose: Test filling and removing all objects up to 3rd level indirect + * Purpose: Test filling and removing all objects up to 3rd level indirect * blocks of heap * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 24, 2006 * *------------------------------------------------------------------------- @@ -8251,16 +8264,17 @@ error: static unsigned test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Test description */ + /* Test description */ + const char *base_desc = "removing all objects from 3rd level indirect blocks of absolute heap %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8305,26 +8319,26 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_remove_3rd_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_man_skip_start_block + * Function: test_man_skip_start_block * - * Purpose: Test inserting object into absolute heap which is too large + * Purpose: Test inserting object into absolute heap which is too large * for starting block size, which forces root indirect block * creation * * Then, remove all the objects, in various ways * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 27, 2006 * *------------------------------------------------------------------------- @@ -8332,16 +8346,17 @@ error: static unsigned test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "inserting object that is too large for starting block, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "inserting object that is too large for starting block, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8384,24 +8399,24 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_skip_start_block() */ - + /*------------------------------------------------------------------------- - * Function: test_man_skip_start_block_add_back + * Function: test_man_skip_start_block_add_back * - * Purpose: Test inserting object into absolute heap which is too large + * Purpose: Test inserting object into absolute heap which is too large * for starting block size, which forces root indirect block * creation, then add object which fits in skipped direct block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 28, 2006 * *------------------------------------------------------------------------- @@ -8409,16 +8424,17 @@ error: static unsigned test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping starting block, then adding object back to first block, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "skipping starting block, then adding object back to first block, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8481,25 +8497,25 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_skip_start_block_add_back() */ - + /*------------------------------------------------------------------------- - * Function: test_man_skip_start_block_add_skipped + * Function: test_man_skip_start_block_add_skipped * - * Purpose: Test inserting object into absolute heap which is too large + * Purpose: Test inserting object into absolute heap which is too large * for starting block size, which forces root indirect block * creation, then add objects to fill skipped direct blocks * and add another object to start on next "normal" block * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 28, 2006 * *------------------------------------------------------------------------- @@ -8507,9 +8523,9 @@ error: static unsigned test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -8517,7 +8533,8 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping starting block, then adding objects to backfill and extend, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "skipping starting block, then adding objects to backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8590,25 +8607,25 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_skip_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_skip_2nd_block + * Function: test_man_skip_2nd_block * - * Purpose: Test inserting object into absolute heap which is small + * Purpose: Test inserting object into absolute heap which is small * enough for starting block size, then add object too large * for any blocks in first row of direct blocks, to force * early creation of indirect block (and range of skipped blocks) * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 1, 2006 * *------------------------------------------------------------------------- @@ -8616,16 +8633,17 @@ error: static unsigned test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -8683,16 +8701,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_skip_2nd_block() */ - + /*------------------------------------------------------------------------- - * Function: test_man_skip_2nd_block_add_skipped + * Function: test_man_skip_2nd_block_add_skipped * - * Purpose: Test inserting object into absolute heap which is small + * Purpose: Test inserting object into absolute heap which is small * enough for starting block size, then add object too large * for any blocks in first row of direct blocks, to force * early creation of indirect block (and range of skipped blocks). @@ -8700,11 +8718,11 @@ error: * block and all the skipped blocks, and one more object (to * start next "normal" block). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 1, 2006 * *------------------------------------------------------------------------- @@ -8712,9 +8730,9 @@ error: static unsigned test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -8722,8 +8740,9 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned v; /* Local index variables */ + /* Test description */ + const char *base_desc = "insert object to initial block, then add object too large for starting direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8825,16 +8844,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_skip_2nd_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_one_partial_skip_2nd_block_add_skipped + * Function: test_man_fill_one_partial_skip_2nd_block_add_skipped * - * Purpose: Test filling initial direct block, then add object small enough + * Purpose: Test filling initial direct block, then add object small enough * for initial block size (to create root indirect block), then * add object too large for any blocks in first three rows of * direct blocks, to force extension of indirect block (and range @@ -8844,11 +8863,11 @@ error: * block and all the skipped blocks, and one more object (to * start next "normal" block). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -8856,9 +8875,9 @@ error: static unsigned test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -8866,8 +8885,9 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t * size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping blocks with indirect root, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variable */ + /* Test description */ + const char *base_desc = "skipping blocks with indirect root, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -8991,16 +9011,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_one_partial_skip_2nd_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_row_skip_add_skipped + * Function: test_man_fill_row_skip_add_skipped * - * Purpose: Test filling first row of direct blocks, then + * Purpose: Test filling first row of direct blocks, then * add object too large for any blocks in first three rows of * direct blocks, to force extension of indirect block (and range * of skipped blocks). @@ -9009,11 +9029,11 @@ error: * block and all the skipped blocks, and one more object (to * start next "normal" block). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -9021,9 +9041,9 @@ error: static unsigned test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9031,7 +9051,8 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling first row, then skipping rows, then backfill and extend, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "filling first row, then skipping rows, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9120,26 +9141,26 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_row_skip_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_skip_direct_skip_indirect_two_rows_add_skipped + * Function: test_man_skip_direct_skip_indirect_two_rows_add_skipped * - * Purpose: Test adding object too large for all but the last row in the + * Purpose: Test adding object too large for all but the last row in the * direct blocks in root indirect block, then * add object too large for initial block in first two rows of * indirect blocks, to force extension of non-root * indirect block (and range of skipped blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 15, 2006 * *------------------------------------------------------------------------- @@ -9147,9 +9168,9 @@ error: static unsigned test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9158,8 +9179,9 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned v; /* Local index variables */ + /* Test description */ + const char *base_desc = "skipping direct blocks to last row and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -9247,25 +9269,25 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_skip_direct_skip_indirect_two_rows_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_indirect_start_block_add_skipped + * Function: test_man_fill_direct_skip_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for initial block in first row of direct * blocks in indirect block, to force extension of non-root * indirect block (and range of skipped blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -9273,9 +9295,9 @@ error: static unsigned test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9283,7 +9305,8 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping blocks in non-root indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9369,26 +9392,26 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_direct_skip_indirect_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped + * Function: test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for all direct blocks in first row of * indirect blocks, to force skipping a row of indirect blocks * (and range of skipped blocks), then backfill all direct blocks * skipped and extend to next "normal" direct block. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 3, 2006 * *------------------------------------------------------------------------- @@ -9396,9 +9419,9 @@ error: static unsigned test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9408,8 +9431,9 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variable */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9496,27 +9520,27 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped + * Function: test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, except the last * one, then insert object insert object that is too large to * hold in row of 2nd level indirect blocks (forcing the use of * the next row of 2nd level blocks), then backfill all skipped * direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 18, 2006 * *------------------------------------------------------------------------- @@ -9524,9 +9548,9 @@ error: static unsigned test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9535,8 +9559,9 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9635,16 +9660,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped + * Function: test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for all direct blocks in first row of * indirect blocks, to force skipping a row of indirect blocks * (and range of skipped blocks), then add object that is too @@ -9654,11 +9679,11 @@ error: * too large for initial block size in skipped indirect block * row's direct blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -9666,9 +9691,9 @@ error: static unsigned test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9678,8 +9703,9 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5 size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip row of direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variable */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping row of non-root indirect blocks, then skip row of direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9800,25 +9826,25 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_indirect_two_rows_add_skipped + * Function: test_man_fill_direct_skip_indirect_two_rows_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for initial block in first two rows of * indirect blocks, to force extension of non-root * indirect block (and range of skipped blocks). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 15, 2006 * *------------------------------------------------------------------------- @@ -9826,9 +9852,9 @@ error: static unsigned test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9838,8 +9864,9 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -9951,27 +9978,27 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_direct_skip_indirect_two_rows_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped + * Function: test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * add object too large for initial block in first two rows of * indirect blocks, to force extension of non-root * indirect block, then add object too large for first row of * indirect blocks, (and ranges of skipped blocks), then backfill * and extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 11, 2006 * *------------------------------------------------------------------------- @@ -9979,9 +10006,9 @@ error: static unsigned test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -9991,8 +10018,9 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks and skipping two rows of root indirect block, skip one row of root indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10131,26 +10159,26 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_skip_start_block_add_skipped + * Function: test_man_fill_2nd_direct_skip_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, the insert object * that is too large to hold in first row of direct blocks of * 3rd level indirect block, then backfill & extend all skipped * 3rd level indirect block's direct blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10158,9 +10186,9 @@ error: static unsigned test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -10168,7 +10196,8 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, and skip first rows of direct blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10257,16 +10286,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_2nd_direct_skip_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped + * Function: test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks in 3rd level indirect block, then insert object * that is too large to hold in first row of direct blocks of @@ -10274,11 +10303,11 @@ error: * backfill & extend all skipped 2nd level indirect block's direct * blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10286,9 +10315,9 @@ error: static unsigned test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -10296,7 +10325,8 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first rows of direct blocks of 3rd level indirect block's 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10395,27 +10425,27 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped + * Function: test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks in 3rd level indirect block, then insert object * that is too large to hold in first row of 2nd level indirect * blocks of 3rd level indirect block, then backfill & extend all * skipped direct blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10423,9 +10453,9 @@ error: static unsigned test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -10434,8 +10464,9 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first row of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first row of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10542,16 +10573,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped + * Function: test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks in 3rd level indirect block, then insert object * that is too large to hold in first & second rows of 2nd level @@ -10559,11 +10590,11 @@ error: * has one row of 2nd level indirect blocks) of 3rd level indirect * block, then backfill & extend all skipped direct blocks. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, April 11, 2006 * *------------------------------------------------------------------------- @@ -10571,9 +10602,9 @@ error: static unsigned test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -10582,8 +10613,9 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped( size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first two rows of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect block's direct blocks, and skip first two rows of indirect blocks of 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10694,16 +10726,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped + * Function: test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, all 3rd level * indirect blocks in first row except the last one, fill direct * blocks in last 3rd level indirect block, then insert object @@ -10712,11 +10744,11 @@ error: * use of the next row of 3rd level blocks), then backfill all * skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tues, April 18, 2006 * *------------------------------------------------------------------------- @@ -10724,9 +10756,9 @@ error: static unsigned test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -10735,8 +10767,9 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, except last one, fill all direct blocks in last 3rd level indirect block, and insert object too large for it's 2nd level indirect blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -10852,16 +10885,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped + * Function: test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, all 3rd level * indirect blocks in first row, fill direct blocks in 2nd row 3rd * level indirect block, fill all direct blocks in 1st row of @@ -10871,11 +10904,11 @@ error: * next row of 2nd level blocks), then backfill all skipped direct * blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tues, April 18, 2006 * *------------------------------------------------------------------------- @@ -10883,9 +10916,9 @@ error: static unsigned test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -10894,8 +10927,8 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ - unsigned u; /* Local index variables */ + unsigned u; /* Local index variables *//* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling first row of 3rd level indirect blocks, fill all direct blocks in next 3rd level indirect block, fill all 1st row of 2nd level indirect blocks, except last one, and insert object too large for 2nd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11017,16 +11050,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped + * Function: test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, then * fill all direct blocks in 4th level indirect block, then @@ -11034,11 +11067,11 @@ error: * level indirect blocks of 4th level indirect block, then * backfill all skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, April 15, 2006 * *------------------------------------------------------------------------- @@ -11046,9 +11079,9 @@ error: static unsigned test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -11057,8 +11090,9 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5 size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct blocks, and skip first row of 2nd indirect blocks of 4th level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11173,16 +11207,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped + * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, then * fill all direct blocks and 2nd level indirect blocks in 4th @@ -11192,11 +11226,11 @@ error: * 3rd level indirect block, then * backfill all skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11204,9 +11238,9 @@ error: static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -11215,8 +11249,9 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill 4th level indirect block's direct, 2nd level indirect blocks and 3rd level direct block, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11347,16 +11382,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped + * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, fill all * direct & indirect blocks in first row of 4th level indirect @@ -11368,11 +11403,11 @@ error: * 3rd level indirect block (in 4th level indirect block), then * backfill all skipped direct blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11380,9 +11415,9 @@ error: static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -11391,8 +11426,9 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, fill 2nd row 4th level indirect block's direct, 2nd level indirect blocks, first row of 3rd level indirect blocks, 3rd level direct block in 2nd row, and skip first row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11556,16 +11592,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped + * Function: test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, fill all * direct & indirect blocks in 4th level indirect @@ -11579,11 +11615,11 @@ error: * 4th level block), then backfill all skipped direct blocks & * extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11591,9 +11627,9 @@ error: static unsigned test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -11602,8 +11638,9 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 3rd level indirect blocks in 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11749,16 +11786,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped + * Function: test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped * - * Purpose: Test filling all direct blocks in root indirect block and all + * Purpose: Test filling all direct blocks in root indirect block and all * direct blocks in 2nd level indirect blocks, fill all direct * blocks and indirect blocks in 3rd level indirect block, fill all * direct & indirect blocks in first row of 4th level indirect @@ -11772,11 +11809,11 @@ error: * next row of 4th level blocks), then backfill all skipped direct * blocks & extend. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, April 17, 2006 * *------------------------------------------------------------------------- @@ -11784,9 +11821,9 @@ error: static unsigned test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -11795,8 +11832,9 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_ size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "filling direct blocks, filling 2nd level indirect blocks, filling 3rd level indirect blocks, fill first row of 4th level indirect blocks, except last one, fill first row of 3rd level indirect blocks in last 4th level indirect block except last 3rd level block, fill direct blocks in 3rd level block, and skip row of 2nd indirect blocks of 4th level indirect block's 3rd level indirect block, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -11978,27 +12016,27 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped() */ - + /*------------------------------------------------------------------------- - * Function: test_man_frag_simple + * Function: test_man_frag_simple * - * Purpose: Test inserting objects small enough to fit into first row of + * Purpose: Test inserting objects small enough to fit into first row of * direct blocks, but not to share a block with another object, * until start-block-size * 2 blocks are reached. Then, go back * and fill in the space in the blocks skipped. * * Then, remove all the objects, in various ways * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 24, 2006 * *------------------------------------------------------------------------- @@ -12006,17 +12044,18 @@ error: static unsigned test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u; /* Local index variables */ + /* Test description */ + const char *base_desc = "fragmenting small blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12110,26 +12149,26 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_frag_simple() */ - + /*------------------------------------------------------------------------- - * Function: test_man_frag_direct + * Function: test_man_frag_direct * - * Purpose: Test inserting small object to fit into each direct block + * Purpose: Test inserting small object to fit into each direct block * in root block, but not to share a block with another object, * Then, go back and fill in the space in the blocks skipped. * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 25, 2006 * *------------------------------------------------------------------------- @@ -12137,9 +12176,9 @@ error: static unsigned test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -12147,8 +12186,9 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar h5_stat_size_t empty_size; /* Size of a file with an empty heap */ size_t obj_size; /* Size of object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "fragmenting direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12279,16 +12319,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_frag_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_frag_2nd_direct + * Function: test_man_frag_2nd_direct * - * Purpose: Test filling all direct blocks in root indirect block, then + * Purpose: Test filling all direct blocks in root indirect block, then * inserting small object to fit into each direct block * in 2nd level indirect block, but not to share a block with * another object. @@ -12296,11 +12336,11 @@ error: * * Then, go back and remove all the objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 25, 2006 * *------------------------------------------------------------------------- @@ -12308,9 +12348,9 @@ error: static unsigned test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -12319,8 +12359,9 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "fill root direct blocks, then fragment 2nd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12388,16 +12429,16 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_frag_2nd_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_man_frag_3rd_direct + * Function: test_man_frag_3rd_direct * - * Purpose: Test filling all direct blocks in root indirect block and + * Purpose: Test filling all direct blocks in root indirect block and * all 2nd level indirect blocks, then * inserting small object to fit into each direct block * in 3rd level indirect block, but not to share a block with @@ -12406,11 +12447,11 @@ error: * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, July 25, 2006 * *------------------------------------------------------------------------- @@ -12418,9 +12459,9 @@ error: static unsigned test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -12429,8 +12470,9 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t * size_t obj_size; /* Size of object */ size_t fill_size; /* Size of objects for "bulk" filled blocks */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Test description */ unsigned u, v; /* Local index variables */ + /* Test description */ + const char *base_desc = "fill root direct blocks and 2nd level indirect blocks, then fragment 3rd level indirect block's direct blocks, then backfill and extend, then remove all objects %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, &fill_size) < 0) @@ -12506,23 +12548,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_man_frag_3rd_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_huge_insert_one + * Function: test_huge_insert_one * - * Purpose: Test inserting one huge object in the heap + * Purpose: Test inserting one huge object in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 7, 2006 * *------------------------------------------------------------------------- @@ -12530,9 +12572,9 @@ error: static unsigned test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -12544,7 +12586,8 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert one huge object, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert one huge object, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12655,23 +12698,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_huge_insert_one() */ - + /*------------------------------------------------------------------------- - * Function: test_huge_insert_two + * Function: test_huge_insert_two * - * Purpose: Test inserting two huge objects in the heap + * Purpose: Test inserting two huge objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 11, 2006 * *------------------------------------------------------------------------- @@ -12679,9 +12722,9 @@ error: static unsigned test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -12694,7 +12737,8 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert two huge objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert two huge objects, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -12884,23 +12928,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_huge_insert_two() */ - + /*------------------------------------------------------------------------- - * Function: test_huge_insert_three + * Function: test_huge_insert_three * - * Purpose: Test inserting three huge objects in the heap + * Purpose: Test inserting three huge objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 11, 2006 * *------------------------------------------------------------------------- @@ -12908,9 +12952,9 @@ error: static unsigned test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -12924,7 +12968,8 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert three huge objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert three huge objects, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13188,23 +13233,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_huge_insert_three() */ - + /*------------------------------------------------------------------------- - * Function: test_huge_insert_mix + * Function: test_huge_insert_mix * - * Purpose: Test inserting a mix of 'normal' & 'huge' objects in the heap + * Purpose: Test inserting a mix of 'normal' & 'huge' objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, August 11, 2006 * *------------------------------------------------------------------------- @@ -13212,9 +13257,9 @@ error: static unsigned test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -13230,7 +13275,8 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert mix of normal & huge objects, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13612,21 +13658,21 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_huge_insert_mix() */ - + /*------------------------------------------------------------------------- - * Function: test_filtered_huge + * Function: test_filtered_huge * - * Purpose: Test storing 'huge' object in a heap with I/O filters + * Purpose: Test storing 'huge' object in a heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, August 15, 2006 * *------------------------------------------------------------------------- @@ -13634,9 +13680,9 @@ error: static unsigned test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -13652,7 +13698,8 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam unsigned deflate_level; /* Deflation level */ size_t old_actual_id_len = 0; /* Old actual ID length */ hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */ - const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -13820,23 +13867,23 @@ error: H5MM_xfree(heap_id); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_filtered_huge() */ - + /*------------------------------------------------------------------------- - * Function: test_tiny_insert_one + * Function: test_tiny_insert_one * - * Purpose: Test inserting one tiny object in the heap + * Purpose: Test inserting one tiny object in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -13844,9 +13891,9 @@ error: static unsigned test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -13858,7 +13905,8 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert one tiny object, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert one tiny object, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -13969,23 +14017,23 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_tiny_insert_one() */ - + /*------------------------------------------------------------------------- - * Function: test_tiny_insert_two + * Function: test_tiny_insert_two * - * Purpose: Test inserting two tiny objects in the heap + * Purpose: Test inserting two tiny objects in the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -13993,9 +14041,9 @@ error: static unsigned test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -14008,7 +14056,8 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert two tiny objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert two tiny objects, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14198,24 +14247,24 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_tiny_insert_two() */ - + /*------------------------------------------------------------------------- - * Function: test_tiny_insert_mix + * Function: test_tiny_insert_mix * - * Purpose: Test inserting a mix of 'normal', 'huge' & 'tiny' objects in + * Purpose: Test inserting a mix of 'normal', 'huge' & 'tiny' objects in * the heap * * Then, remove all the objects, in various ways * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -14223,9 +14272,9 @@ error: static unsigned test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */ @@ -14243,7 +14292,8 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar size_t robj_size; /* Size of object read */ unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ - const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert mix of normal, huge & tiny objects, then remove %s"; /* Perform common test initialization operations */ if(begin_test(tparam, base_desc, &keep_ids, NULL) < 0) @@ -14805,21 +14855,21 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_tiny_insert_mix() */ - + /*------------------------------------------------------------------------- - * Function: test_filtered_man_root_direct + * Function: test_filtered_man_root_direct * - * Purpose: Test storing one 'managed' object in a heap with I/O filters + * Purpose: Test storing one 'managed' object in a heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, August 14, 2006 * *------------------------------------------------------------------------- @@ -14827,9 +14877,9 @@ error: static unsigned test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -14844,7 +14894,8 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ unsigned deflate_level; /* Deflation level */ - const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert one 'managed' object into heap with I/O filters, then remove %s"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -14977,21 +15028,21 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_filtered_man_root_direct() */ - + /*------------------------------------------------------------------------- - * Function: test_filtered_man_root_indirect + * Function: test_filtered_man_root_indirect * - * Purpose: Test storing several objects in a 'managed heap with I/O filters + * Purpose: Test storing several objects in a 'managed heap with I/O filters * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, October 24, 2006 * *------------------------------------------------------------------------- @@ -14999,9 +15050,9 @@ error: static unsigned test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -15017,7 +15068,8 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa unsigned char obj_type; /* Type of storage for object */ fheap_heap_state_t state; /* State of fractal heap */ unsigned deflate_level; /* Deflation level */ - const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove %s"; /* Test description */ + /* Test description */ + const char *base_desc = "insert two 'managed' objects into heap with I/O filters, then remove %s"; /* Copy heap creation properties */ HDmemcpy(&tmp_cparam, cparam, sizeof(H5HF_create_t)); @@ -15302,25 +15354,25 @@ error: H5E_BEGIN_TRY { if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_filtered_man_root_indirect() */ - + /*------------------------------------------------------------------------- - * Function: test_random + * Function: test_random * - * Purpose: Test inserting random sized objects into a heap, and read + * Purpose: Test inserting random sized objects into a heap, and read * them back. * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 9, 2006 * *------------------------------------------------------------------------- @@ -15328,9 +15380,9 @@ error: static unsigned test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -15503,21 +15555,21 @@ error: return(1); } /* test_random() */ - + /*------------------------------------------------------------------------- - * Function: test_random_pow2 + * Function: test_random_pow2 * - * Purpose: Test inserting random sized objects with a "power of 2 + * Purpose: Test inserting random sized objects with a "power of 2 * distribution" (which favors small objects) into a heap, * and read them back. * * Then, go back and remove all objects * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: 1 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 15, 2006 * *------------------------------------------------------------------------- @@ -15525,9 +15577,9 @@ error: static unsigned test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -15707,21 +15759,21 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_random_pow2() */ - + /*------------------------------------------------------------------------- - * Function: test_write + * Function: test_write * - * Purpose: Test inserting objects, then changing the value for them. + * Purpose: Test inserting objects, then changing the value for them. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, December 18, 2006 * *------------------------------------------------------------------------- @@ -15741,9 +15793,9 @@ static size_t test_write_filter(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATT static unsigned test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ H5HF_create_t tmp_cparam; /* Local heap creation parameters */ @@ -15991,23 +16043,23 @@ error: H5MM_xfree(rewrite_obj); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_write() */ - + /*------------------------------------------------------------------------- - * Function: test_bug1 + * Function: test_bug1 * - * Purpose: Test inserting several objects, then deleting one and + * Purpose: Test inserting several objects, then deleting one and * re-inserting an object, along with opening and closing * the file. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, November 28, 2006 * *------------------------------------------------------------------------- @@ -16015,9 +16067,9 @@ error: static unsigned test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) { - hid_t file = -1; /* File ID */ - char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ H5HF_t *fh = NULL; /* Fractal heap wrapper */ haddr_t fh_addr; /* Address of fractal heap */ size_t id_len; /* Size of fractal heap IDs */ @@ -16166,22 +16218,22 @@ error: H5MM_xfree(keep_ids.offs); if(fh) H5HF_close(fh); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_bug1() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test the fractal heap code + * Purpose: Test the fractal heap code * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, February 24, 2006 * *------------------------------------------------------------------------- @@ -16192,14 +16244,14 @@ main(void) fheap_test_param_t tparam; /* Testing parameters */ H5HF_create_t small_cparam; /* Creation parameters for "small" heap */ H5HF_create_t large_cparam; /* Creation parameters for "large" heap */ - hid_t fapl = -1, def_fapl = -1; /* File access property list for data files */ - hid_t pb_fapl = -1; /* File access property list for data files */ - hid_t fcpl = -1, def_fcpl = -1; /* File creation property list for data files */ + hid_t fapl = -1, def_fapl = -1; /* File access property list for data files */ + hid_t pb_fapl = -1; /* File access property list for data files */ + hid_t fcpl = -1, def_fcpl = -1; /* File creation property list for data files */ fheap_test_type_t curr_test; /* Current test being worked on */ unsigned u, v; /* Local index variable */ - unsigned nerrors = 0; /* Cumulative error count */ + unsigned nerrors = 0; /* Cumulative error count */ unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */ - int ExpressMode; /* Express testing level */ + int ExpressMode; /* Express testing level */ const char *envval; /* Environment variable */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ diff --git a/test/file_image.c b/test/file_image.c index 4898b92..824f512 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -677,7 +677,7 @@ error: * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static int test_get_file_image(const char * test_banner, const int file_name_num, @@ -782,7 +782,7 @@ test_get_file_image(const char * test_banner, ssize_t member_size; ssize_t size_remaining; - /* + /* * Modifications need to be made to accommodate userblock when * H5Fget_file_image() works for family driver */ @@ -944,7 +944,7 @@ test_get_file_image(const char * test_banner, error: return 1; } /* end test_get_file_image() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /****************************************************************************** diff --git a/test/h5test.c b/test/h5test.c index 4fa5102..8eb13b2 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -197,7 +197,7 @@ h5_clean_files(const char *base_name[], hid_t fapl) * sub_filename in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") void h5_delete_test_file(const char *base_name, hid_t fapl) { @@ -247,7 +247,7 @@ h5_delete_test_file(const char *base_name, hid_t fapl) return; } /* end h5_delete_test_file() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- @@ -1250,7 +1250,7 @@ h5_dump_info_object(MPI_Info info) * temp in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl) { @@ -1352,7 +1352,7 @@ h5_get_file_size(const char *filename, hid_t fapl) return(-1); } /* end get_file_size() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /* * This routine is designed to provide equivalent functionality to 'printf' diff --git a/test/ntypes.c b/test/ntypes.c index f1260ad..dd894f3 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -12,10 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu + * Programmer: Raymond Lu * October 14, 2001 * - * Purpose: Tests the H5Tget_native_type function. + * Purpose: Tests the H5Tget_native_type function. */ #include "h5test.h" @@ -62,16 +62,16 @@ int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5]; /*------------------------------------------------------------------------- - * Function: test_atomic_dtype + * Function: test_atomic_dtype * - * Purpose: Test H5Tget_native_type for atomic datatype + * Purpose: Test H5Tget_native_type for atomic datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -275,16 +275,16 @@ error: /*------------------------------------------------------------------------- - * Function: test_compound_dtype2 + * Function: test_compound_dtype2 * - * Purpose: Test H5Tget_native_type for compound datatype + * Purpose: Test H5Tget_native_type for compound datatype * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * October 15, 2002 + * Programmer: Raymond Lu + * October 15, 2002 * * Modifications: * @@ -1845,12 +1845,13 @@ error: static herr_t test_vlstr_dtype(hid_t file) { + /* Information to write */ const char *wdata[SPACE1_DIM1]= { "Four score and seven years ago our forefathers brought forth on this continent a new nation,", "conceived in liberty and dedicated to the proposition that all men are created equal.", "Now we are engaged in a great civil war,", "testing whether that nation or any nation so conceived and so dedicated can long endure." - }; /* Information to write */ + }; char *rdata[SPACE1_DIM1]; /* Information read in */ hbool_t rdata_alloc = FALSE; /* Whether the read data is allocated */ hid_t dataset = -1; /* Dataset ID */ diff --git a/test/tvlstr.c b/test/tvlstr.c index 5f715ce..0e0d928 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -108,12 +108,14 @@ void test_vlstr_free_custom(void *_mem, void *info) static void test_vlstrings_basic(void) { + /* Information to write */ const char *wdata[SPACE1_DIM1]= { "Four score and seven years ago our forefathers brought forth on this continent a new nation,", "conceived in liberty and dedicated to the proposition that all men are created equal.", "Now we are engaged in a great civil war,", "testing whether that nation or any nation so conceived and so dedicated can long endure." - }; /* Information to write */ + }; + char *rdata[SPACE1_DIM1]; /* Information read in */ char *wdata2; hid_t dataspace, dataset2; @@ -861,13 +863,12 @@ static void test_write_same_element(void) hid_t file1, dataset1; hid_t mspace, fspace, dtype; hsize_t fdim[] = {SPACE1_DIM1}; - char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"}; + const char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."}; + const char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"}; hsize_t marray[] = {NUMP}; hsize_t coord[SPACE1_RANK][NUMP]; herr_t ret; - char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."}; - file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file1, FAIL, "H5Fcreate"); diff --git a/test/vfd.c b/test/vfd.c index d849d96..5078996 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -822,7 +822,7 @@ error: * 'first_name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static herr_t test_family_opens(char *fname, hid_t fa_pl) { @@ -879,7 +879,7 @@ test_family_opens(char *fname, hid_t fa_pl) error: return -1; } /* end test_family_opens() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- @@ -1103,7 +1103,7 @@ error: * 'newname_individual', etc. in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static herr_t test_family_compat(void) { @@ -1187,7 +1187,7 @@ error: return -1; } /* end test_family_compat() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- @@ -1326,7 +1326,7 @@ error: * 'sf_name' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static herr_t test_multi_opens(char *fname) { @@ -1344,7 +1344,7 @@ test_multi_opens(char *fname) return(fid >= 0 ? FAIL : SUCCEED); } /* end test_multi_opens() */ -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") /*------------------------------------------------------------------------- diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index dba9e68..9f4ce88 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -39,7 +39,14 @@ else () endif () set_target_properties (testphdf5 PROPERTIES FOLDER test/par) -MACRO (ADD_H5P_EXE file) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_PAR_testphdf5_FORMAT testphdf5) +endif () + +macro (ADD_H5P_EXE file) add_executable (${file} ${HDF5_TEST_PAR_SOURCE_DIR}/${file}.c) target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}") target_include_directories (${file} @@ -59,7 +66,14 @@ MACRO (ADD_H5P_EXE file) ) endif () set_target_properties (${file} PROPERTIES FOLDER test/par) -ENDMACRO (ADD_H5P_EXE file) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TEST_PAR_${file}_FORMAT ${file}) + endif () +endmacro (ADD_H5P_EXE file) set (H5P_TESTS t_mpi diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index cf611b7..b086366 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -93,8 +93,9 @@ enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, #define MSPACE1_RANK 1 /* Rank of the first dataset in memory */ #define MSPACE1_DIM 27000 /* Dataset size in memory */ #define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ -#define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */ -#define FSPACE_DIM2 3600 /* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */ +#define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */ +#define FSPACE_DIM2 3600 +/* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */ #define MSPACE_RANK 2 #define MSPACE_DIM1 9 #define MSPACE_DIM2 3600 diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index ff9ca43..edb5ada 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -26,10 +26,12 @@ set (H5_TOOLS_LIB_HDRS ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5trav.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_dump.h + ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_error.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_utils.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_str.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5tools_ref.h ${HDF5_TOOLS_LIB_SOURCE_DIR}/h5diff.h + ${HDF5_TOOLS_LIB_SOURCE_DIR}/io_timer.h ) if (NOT ONLY_SHARED_LIBS) @@ -75,6 +77,17 @@ if (BUILD_SHARED_LIBS) set (install_targets ${install_targets} ${HDF5_TOOLS_LIBSH_TARGET}) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_TOOLS_SRC_FORMAT ${HDF5_TOOLS_LIB_TARGET}) + else () + clang_format (HDF5_TOOLS_SRC_FORMAT ${HDF5_TOOLS_LIBSH_TARGET}) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/libtest/CMakeLists.txt b/tools/libtest/CMakeLists.txt index 3e0f671..d094058 100644 --- a/tools/libtest/CMakeLists.txt +++ b/tools/libtest/CMakeLists.txt @@ -16,6 +16,13 @@ else () endif () set_target_properties (h5tools_test_utils PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_H5TOOLS_TEST_SRC_FORMAT h5tools_test_utils) +endif () + if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/tools/src/h5copy/CMakeLists.txt b/tools/src/h5copy/CMakeLists.txt index 8f230a0..d73b622 100644 --- a/tools/src/h5copy/CMakeLists.txt +++ b/tools/src/h5copy/CMakeLists.txt @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5copy-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5COPY_SRC_FORMAT h5copy) + else () + clang_format (HDF5_H5COPY_SRC_FORMAT h5copy-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5diff/CMakeLists.txt b/tools/src/h5diff/CMakeLists.txt index 4087ab4..f18b358 100644 --- a/tools/src/h5diff/CMakeLists.txt +++ b/tools/src/h5diff/CMakeLists.txt @@ -8,6 +8,7 @@ if (NOT ONLY_SHARED_LIBS) add_executable (h5diff ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.h ) target_include_directories (h5diff PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5diff PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -23,6 +24,7 @@ if (BUILD_SHARED_LIBS) add_executable (h5diff-shared ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.c ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_main.c + ${HDF5_TOOLS_SRC_H5DIFF_SOURCE_DIR}/h5diff_common.h ) target_include_directories (h5diff-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5diff-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") @@ -35,6 +37,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5diff-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5DIFF_SRC_FORMAT h5diff) + else () + clang_format (HDF5_H5DIFF_SRC_FORMAT h5diff-shared) + endif () +endif () + if (H5_HAVE_PARALLEL) if (NOT ONLY_SHARED_LIBS) add_executable (ph5diff diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c index 8c88510..cfaf7f6 100644 --- a/tools/src/h5diff/h5diff_common.c +++ b/tools/src/h5diff/h5diff_common.c @@ -69,7 +69,7 @@ static void check_options(diff_opt_t* opts) } } -#if TRILABS-227 +#if TRILABS_227 /*------------------------------------------------------------------------- * Function: parse_hsize_list * @@ -440,10 +440,10 @@ void parse_command_line(int argc, const char* argv[], const char** fname1, const H5TOOLS_DEBUG("objname2 = %s", *objname2); /* - * TRILABS-227 is complete except for an issue with printing indices + * TRILABS_227 is complete except for an issue with printing indices * the following calls will enable subsetting */ -#if TRILABS-227 +#if TRILABS_227 opts->sset[0] = parse_subset_params(*objname1); opts->sset[1] = parse_subset_params(*objname2); @@ -712,7 +712,7 @@ void usage(void) PRINTVALSTREAM(rawoutstream, " symbolic links are compared.).\n"); PRINTVALSTREAM(rawoutstream, "\n"); /* - * TRILABS-227 is complete except for an issue with printing indices + * TRILABS_227 is complete except for an issue with printing indices * the following will be needed for subsetting PRINTVALSTREAM(rawoutstream, " Subsetting options:\n"); PRINTVALSTREAM(rawoutstream, " Subsetting is available by using the fcompact form of subsetting, as follows:\n"); diff --git a/tools/src/h5dump/CMakeLists.txt b/tools/src/h5dump/CMakeLists.txt index cae7212..1282dde 100644 --- a/tools/src/h5dump/CMakeLists.txt +++ b/tools/src/h5dump/CMakeLists.txt @@ -9,10 +9,14 @@ if (NOT ONLY_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_defines.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_extern.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.h ) target_include_directories (h5dump PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5dump PRIVATE "${HDF5_CMAKE_C_FLAGS}") - #target_compile_definitions(h5dump PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5dump STATIC) target_link_libraries (h5dump PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dump PROPERTIES FOLDER tools) @@ -26,10 +30,14 @@ if (BUILD_SHARED_LIBS) ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.c ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.c + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_defines.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_extern.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_ddl.h + ${HDF5_TOOLS_SRC_H5DUMP_SOURCE_DIR}/h5dump_xml.h ) target_include_directories (h5dump-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") target_compile_options(h5dump-shared PRIVATE "${HDF5_CMAKE_C_FLAGS}") - #target_compile_definitions(h5dump-shared PRIVATE H5_TOOLS_DEBUG) TARGET_C_PROPERTIES (h5dump-shared SHARED) target_link_libraries (h5dump-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) set_target_properties (h5dump-shared PROPERTIES FOLDER tools) @@ -38,6 +46,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5dump-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5DUMP_SRC_FORMAT h5dump) + else () + clang_format (HDF5_H5DUMP_SRC_FORMAT h5dump-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5format_convert/CMakeLists.txt b/tools/src/h5format_convert/CMakeLists.txt index 863ecbe..ffa7c3a 100644 --- a/tools/src/h5format_convert/CMakeLists.txt +++ b/tools/src/h5format_convert/CMakeLists.txt @@ -27,6 +27,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5format_convert-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5FORMAT_SRC_FORMAT h5format_convert) + else () + clang_format (HDF5_H5FORMAT_SRC_FORMAT h5format_convert-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index a52467e..dedefd9 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -5,7 +5,7 @@ project (HDF5_TOOLS_SRC_H5IMPORT C) # Add the h5import executables # -------------------------------------------------------------------- if (NOT ONLY_SHARED_LIBS) - add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) + add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.h) target_include_directories (h5import PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5import STATIC) target_link_libraries (h5import PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) @@ -17,7 +17,7 @@ if (NOT ONLY_SHARED_LIBS) endif () if (BUILD_SHARED_LIBS) - add_executable (h5import-shared ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) + add_executable (h5import-shared ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.h) target_include_directories (h5import-shared PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") TARGET_C_PROPERTIES (h5import-shared SHARED) target_link_libraries (h5import-shared PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5import-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5IMPORT_SRC_FORMAT h5import) + else () + clang_format (HDF5_H5IMPORT_SRC_FORMAT h5import-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5jam/CMakeLists.txt b/tools/src/h5jam/CMakeLists.txt index 69d4c4d..36ec10e 100644 --- a/tools/src/h5jam/CMakeLists.txt +++ b/tools/src/h5jam/CMakeLists.txt @@ -46,6 +46,19 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5JAM_SRC_FORMAT h5jam) + clang_format (HDF5_H5UNJAM_SRC_FORMAT h5unjam) + else () + clang_format (HDF5_H5JAM_SRC_FORMAT h5jam-shared) + clang_format (HDF5_H5UNJAM_SRC_FORMAT h5unjam-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5ls/CMakeLists.txt b/tools/src/h5ls/CMakeLists.txt index c1ce006..dfac225 100644 --- a/tools/src/h5ls/CMakeLists.txt +++ b/tools/src/h5ls/CMakeLists.txt @@ -30,6 +30,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5ls-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5LS_SRC_FORMAT h5ls) + else () + clang_format (HDF5_H5LS_SRC_FORMAT h5ls-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index a4aa1ef..e776516 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -12,6 +12,7 @@ set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_refs.c ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_verify.c ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c + ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.h ) if (NOT ONLY_SHARED_LIBS) @@ -38,6 +39,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repack-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5REPACK_SRC_FORMAT h5repack) + else () + clang_format (HDF5_H5REPACK_SRC_FORMAT h5repack-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/h5stat/CMakeLists.txt b/tools/src/h5stat/CMakeLists.txt index f0722fd..eb10400 100644 --- a/tools/src/h5stat/CMakeLists.txt +++ b/tools/src/h5stat/CMakeLists.txt @@ -28,6 +28,17 @@ if (BUILD_SHARED_LIBS) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5stat-shared) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5STAT_SRC_FORMAT h5stat) + else () + clang_format (HDF5_H5STAT_SRC_FORMAT h5stat-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/src/misc/CMakeLists.txt b/tools/src/misc/CMakeLists.txt index 1e9cacc..80669af 100644 --- a/tools/src/misc/CMakeLists.txt +++ b/tools/src/misc/CMakeLists.txt @@ -86,6 +86,23 @@ if (BUILD_SHARED_LIBS) ) endif () +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + if (NOT ONLY_SHARED_LIBS) + clang_format (HDF5_H5DEBUG_SRC_FORMAT h5debug) + clang_format (HDF5_H5REPART_SRC_FORMAT h5repart) + clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp) + clang_format (HDF5_H5CLEAR_SRC_FORMAT h5clear) + else () + clang_format (HDF5_H5DEBUG_SRC_FORMAT h5debug-shared) + clang_format (HDF5_H5REPART_SRC_FORMAT h5repart-shared) + clang_format (HDF5_H5MKGRP_SRC_FORMAT h5mkgrp-shared) + clang_format (HDF5_H5CLEAR_SRC_FORMAT h5clear-shared) + endif () +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index 034c8d3..eff12a2 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -11,6 +11,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5copygentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5COPY_FORMAT h5copygentest) + endif () + #add_test (NAME h5copygentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () @@ -28,8 +35,16 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5COPY_TOOL_PLUGIN_LIB_TARGET} ${H5COPY_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5COPY_PLUGIN_FORMAT ${H5COPY_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index e4bfc99..31663e1 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -11,6 +11,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5diffgentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DIFF_FORMAT h5diffgentest) + endif () + #add_test (NAME h5diffgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () @@ -28,6 +35,13 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DIFF_PLUGIN_FORMAT ${H5DIFF_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 8a83699..a11d084 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -15,6 +15,13 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} ${H5DUMP_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DUMP_PLUGIN_FORMAT ${H5DUMP_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- @@ -40,6 +47,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5dumpgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5DUMP_FORMAT h5dumpgentest) + endif () + #add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 99420d8..af4808a 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -15,6 +15,13 @@ else () endif () set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5FC_h5fc_chk_idx_FORMAT h5fc_chk_idx) +endif () + if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c) target_include_directories (h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") @@ -22,6 +29,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5fc_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5FC_FORMAT h5fc_gentest) + endif () + #add_test (NAME h5fc_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt index f3991c5..d8af61f 100644 --- a/tools/test/h5import/CMakeLists.txt +++ b/tools/test/h5import/CMakeLists.txt @@ -15,6 +15,13 @@ else () endif () set_target_properties (h5importtest PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5IMPORT_FORMAT h5importtest) +endif () + if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 78160d3..67c8c5f 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -11,6 +11,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5jamgentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5JAM_FORMAT h5jamgentest) + endif () + #add_test (NAME h5jamgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () @@ -36,6 +43,14 @@ else () endif () set_target_properties (tellub PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5JAM_getub_FORMAT getub) + clang_format (HDF5_TOOLS_TEST_H5JAM_tellub_FORMAT tellub) +endif () + if (HDF5_TEST_TOOLS AND HDF5_TEST_SERIAL) include (CMakeTests.cmake) endif () diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt index 3993277..792de9f 100644 --- a/tools/test/h5ls/CMakeLists.txt +++ b/tools/test/h5ls/CMakeLists.txt @@ -15,8 +15,16 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5LS_TOOL_PLUGIN_LIB_TARGET} ${H5LS_TOOL_PLUGIN_LIB_NAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5LS_PLUGIN_FORMAT ${H5LS_TOOL_PLUGIN_LIB_TARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") + #----------------------------------------------------------------------------- # Copy plugin library to a plugins folder #----------------------------------------------------------------------------- diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt index 54cff64..061ed3f 100644 --- a/tools/test/h5repack/CMakeLists.txt +++ b/tools/test/h5repack/CMakeLists.txt @@ -17,6 +17,7 @@ else () endif () set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools) +# These are the same files used by the h5repack tool set (REPACK_COMMON_SOURCES ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_copy.c ${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack_filters.c @@ -62,6 +63,14 @@ if (BUILD_SHARED_LIBS) target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET}) H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} ${H5REPACK_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB") + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5REPACK_PLUGIN_FORMAT ${H5REPACK_TOOL_PLUGIN_LIB_TARGET}) + clang_format (HDF5_TOOLS_TEST_H5REPACK_VPLUGIN_FORMAT ${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}) + endif () + # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") #----------------------------------------------------------------------------- @@ -95,6 +104,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5repackgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5repackgentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5REPACK_FORMAT h5repackgentest) + endif () + #add_test (NAME h5repackgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index f50a747..6fc9f00 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -11,6 +11,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5stat_gentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_H5STAT_FORMAT h5stat_gentest) + endif () + #add_test (NAME h5stat_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) endif () diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 8f13d84..66ba655 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -17,6 +17,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_h5repart_gentest_FORMAT h5repart_gentest) + endif () + add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_TEST_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) @@ -29,6 +36,13 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) #add_test (NAME H5CLEAR-h5clear_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_h5clear_gentest_FORMAT h5clear_gentest) + endif () + add_subdirectory (vds) endif () @@ -44,6 +58,13 @@ else () endif () set_target_properties (h5repart_test PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_h5repart_test_FORMAT h5repart_test) +endif () + add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) target_include_directories (clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) @@ -55,6 +76,13 @@ else () endif () set_target_properties (clear_open_chk PROPERTIES FOLDER tools) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_clear_open_chk_FORMAT clear_open_chk) +endif () + if (HDF5_TEST_SERIAL) include (CMakeTestsRepart.cmake) include (CMakeTestsClear.cmake) diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt index 71261c4..b0d8ab3 100644 --- a/tools/test/misc/vds/CMakeLists.txt +++ b/tools/test/misc/vds/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 3.12) project (HDF5_TOOLS_TEST_MISC_VDS C) -MACRO (ADD_H5_GENERATOR genfile) +macro (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c) target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT ONLY_SHARED_LIBS) @@ -12,7 +12,14 @@ MACRO (ADD_H5_GENERATOR genfile) target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) endif () set_target_properties (${genfile} PROPERTIES FOLDER generator/tools) -ENDMACRO () + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_MISC_VDS_${genfile}_FORMAT ${genfile}) + endif () +endmacro () # generator executables set (H5_GENERATORS diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt index 3c45e85..5beb019 100644 --- a/tools/test/perform/CMakeLists.txt +++ b/tools/test/perform/CMakeLists.txt @@ -20,6 +20,13 @@ else () endif () set_target_properties (h5perf_serial PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_serial_FORMAT h5perf_serial) +endif () + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf_serial_alone - io_timer.c includes set (h5perf_serial_alone_SOURCES @@ -38,9 +45,14 @@ if (HDF5_BUILD_PERFORM_STANDALONE) target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIBSH_TARGET} "$<$:${MPI_C_LIBRARIES}>") endif () set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform) - set_property (TARGET h5perf_serial_alone - APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE - ) + set_property (TARGET h5perf_serial_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_serial_alone_FORMAT h5perf_serial_alone) + endif () endif () #-- Adding test for chunk @@ -58,6 +70,13 @@ else () endif () set_target_properties (chunk PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_chunk_FORMAT chunk) +endif () + #-- Adding test for iopipe set (iopipe_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c @@ -73,6 +92,13 @@ else () endif () set_target_properties (iopipe PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_iopipe_FORMAT iopipe) +endif () + #-- Adding test for chunk_cache set (chunk_cache_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk_cache.c @@ -88,6 +114,13 @@ else () endif () set_target_properties (chunk_cache PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_chunk_cache_FORMAT chunk_cache) +endif () + #-- Adding test for overhead set (overhead_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c @@ -103,6 +136,13 @@ else () endif () set_target_properties (overhead PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_overhead_FORMAT overhead) +endif () + #-- Adding test for perf_meta set (perf_meta_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c @@ -118,6 +158,13 @@ else () endif () set_target_properties (perf_meta PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_perf_meta_FORMAT perf_meta) +endif () + #-- Adding test for zip_perf set (zip_perf_SOURCES ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c @@ -133,22 +180,36 @@ else () endif () set_target_properties (zip_perf PROPERTIES FOLDER perform) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_zip_perf_FORMAT zip_perf) +endif () + if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) if (UNIX) - #-- Adding test for perf - only on unix systems - set (perf_SOURCES - ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c - ) - add_executable (perf ${perf_SOURCES}) - target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") - if (NOT BUILD_SHARED_LIBS) - TARGET_C_PROPERTIES (perf STATIC) - target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) - else () - TARGET_C_PROPERTIES (perf SHARED) - target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) - endif () - set_target_properties (perf PROPERTIES FOLDER perform) + #-- Adding test for perf - only on unix systems + set (perf_SOURCES + ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c + ) + add_executable (perf ${perf_SOURCES}) + target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") + if (NOT BUILD_SHARED_LIBS) + TARGET_C_PROPERTIES (perf STATIC) + target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) + else () + TARGET_C_PROPERTIES (perf SHARED) + target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + endif () + set_target_properties (perf PROPERTIES FOLDER perform) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_perf_FORMAT perf) + endif () endif () #-- Adding test for h5perf @@ -167,6 +228,13 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) endif () set_target_properties (h5perf PROPERTIES FOLDER perform) + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_FORMAT h5perf) + endif () + if (HDF5_BUILD_PERFORM_STANDALONE) #-- Adding test for h5perf set (h5perf_alone_SOURCES @@ -188,6 +256,13 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL) set_property (TARGET h5perf_alone APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE ) + + #----------------------------------------------------------------------------- + # Add Target to clang-format + #----------------------------------------------------------------------------- + if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_TOOLS_TEST_PERFORM_h5perf_alone_FORMAT h5perf_alone) + endif () endif () endif () diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index aa3a316..19b450f 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -1268,7 +1268,7 @@ done: * 'temp' in the code below, but early (4.4.7, at least) gcc only * allows diagnostic pragmas to be toggled outside of functions. */ -H5_GCC_DIAG_OFF(format-nonliteral) +H5_GCC_DIAG_OFF("format-nonliteral") static void do_cleanupfile(iotype iot, char *filename) { @@ -1330,5 +1330,5 @@ do_cleanupfile(iotype iot, char *filename) } } } -H5_GCC_DIAG_ON(format-nonliteral) +H5_GCC_DIAG_ON("format-nonliteral") diff --git a/utils/mirror_vfd/CMakeLists.txt b/utils/mirror_vfd/CMakeLists.txt index 6137e82..780300e 100644 --- a/utils/mirror_vfd/CMakeLists.txt +++ b/utils/mirror_vfd/CMakeLists.txt @@ -8,7 +8,9 @@ project (HDF5_UTILS_MIRRORVFD C) set (mirror_server_SOURCES ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_remote.c ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_server.c - ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_writer.c) + ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_writer.c + ${HDF5_UTILS_MIRRORVFD_SOURCE_DIR}/mirror_remote.h +) add_executable (mirror_server ${mirror_server_SOURCES}) target_include_directories (mirror_server PRIVATE "${HDF5_UITLS_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$:${MPI_C_INCLUDE_DIRS}>") if (NOT BUILD_SHARED_LIBS) @@ -23,6 +25,13 @@ set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};mirror_server set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} mirror_server) #----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_UTILS_MIRRORVFD_SERVER_FORMAT mirror_server) +endif () + +#----------------------------------------------------------------------------- # Add the mirror_server_stop executable #----------------------------------------------------------------------------- @@ -40,6 +49,13 @@ set_target_properties (mirror_server_stop PROPERTIES FOLDER utils) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};mirror_server_stop") set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} mirror_server_stop) +#----------------------------------------------------------------------------- +# Add Target to clang-format +#----------------------------------------------------------------------------- +if (HDF5_ENABLE_FORMATTERS) + clang_format (HDF5_UTILS_MIRRORVFD_STOP_FORMAT mirror_server_stop) +endif () + ############################################################################## ############################################################################## ### I N S T A L L A T I O N ### -- cgit v0.12