Skip to content

Commit

Permalink
Sync develop changes April 22 - May 7 to hdf5_1_14 (HDFGroup#4465)
Browse files Browse the repository at this point in the history
* Split H5Tconv.c into modules by type (HDFGroup#4393)

* Split H5Tconv.c into modules by type

* Add new H5Tconv headers to list of private headers

* Fix broken links in VOL API table (HDFGroup#4438)

* Don't print thread ID when the library isn't multithreaded. (HDFGroup#4428)

Corresponding changes to make error output for regression tests agnostic
to thread setting.

Signed-off-by: Quincey Koziol <[email protected]>

* Start refactoring H5E code to avoid using IDs internally (HDFGroup#4427)

* Add support for builtin_expect compiler hint (HDFGroup#4425)

* Add support for __builtin_expect extension

And H5_LIKELY / H5_UNLIKELY macros to wrap it

Signed-off-by: Quincey Koziol <[email protected]>

* Committing clang-format changes

---------

Signed-off-by: Quincey Koziol <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* sanitizer flags need set before compiler flags (HDFGroup#4444)

* Add navigate chapters and use release_docs in Learn Basics (HDFGroup#4441)

* Fix for github issue HDFGroup#3790: infinite loop closing library (HDFGroup#4445)

* Fix for github issue HDFGroup#3790: infinite loop closing library
Cause of the problem:
When h5dump tries to open the user provided test file, the metadata cache will
call the "get_final_load_size" callback to find out the actual size of the
the root object header.  The callback function will call
H5O__prefix_deserialize() to allocate space for the object header
data structure (via H5FL_CALLOC) and to deserialize the object header prefix
in order to find the actual size of the object header.
The metadata cache will then check whether the actual size obtained
will exceed the file's EOA.
Since the actual size obtained from the test file exceeds the EOA,
the metadata cache throws an error and return.
However, the oh structure that was allocated in H5O__prefix_deserialize()
was not freed and hence causing the problem described in this issue.
Fix:
1) Deallocate the oh structure after obtaining and saving the needed
information in udata which will be used later on in the "verify_chksum" callback.
2) Deserialize the object header prefix in the "object header's
"deserialize" callback regardless.  The original coding intends to keep the
deserialized prefix so that the object header's "deserialize" callback
does not need to deserialize the prefix again if the object header is coming
through the "get_final_load_size" callback.

* H5R Fortran wrappers and misc. H5R API/DOC updates (HDFGroup#4446)

    - Add Fortran H5R APIs:
      h5rcreate_attr_f, h5rcreate_object_f, h5rcreate_region_f,
      h5ropen_attr_f, h5ropen_object_f, h5ropen_region_f,
      h5rget_file_name_f, h5rget_attr_name_f, h5rget_obj_name_f,
      h5rcopy_f, h5requal_f, h5rdestroy_f, h5rget_type_f

    - Fixed function H5Requal actually to compare the reference pointers

      Fixed an issue with H5Requal always returning true because the
      function was only comparing the ref2_ptr to itself.

* Fix heap-buffer-overflow in H5Fio.c (HDFGroup#4450)

The buffer size for checksum was smaller than H5_SIZEOF_CHKSUM, causing an
overflow while calculating the offset to the checksum in the buffer.

A check was added so H5F_get_checksums would fail appropriately in all
of its occurrences.

Fix HDFGroupgh-4434

* Fix grammar in VOL guide (HDFGroup#4452)

* Fix bug in MPI-IO VFD (HDFGroup#4456)

Corrects incorrect usage of the vector_was_sorted parameter in H5FD__mpio_vector_build_types()

* Bump the github-actions group with 3 updates (HDFGroup#4455)

Bumps the github-actions group with 3 updates: [actions/download-artifact](https://github.com/actions/download-artifact), [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) and [github/codeql-action](https://github.com/github/codeql-action).

Updates `actions/download-artifact` from 4.1.4 to 4.1.7
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@c850b93...65a9edc)

Updates `peaceiris/actions-gh-pages` from 3.9.3 to 4.0.0
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](peaceiris/actions-gh-pages@373f7f2...4f9cc66)

Updates `github/codeql-action` from 3.24.9 to 3.25.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@1b1aada...d39d31e)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: peaceiris/actions-gh-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fixed failures with xl compilers. (HDFGroup#4458)

* type cast constant

* fixed return types

* Convert ERR test to use grep (HDFGroup#4451)

* Convert ERR test to use grep
* Eliminate use of .err files in CMake
* Show error output if grep fails
* Turn off cuda in NVHPC CI

* Removed "function/code stack" debugging configure option (HDFGroup#4454)

Easily replaced w/third-party tools, e.g. libbacktrace
(https://github.com/ianlancetaylor/libbacktrace)

* Clean up memory leaks in t_vfd (HDFGroup#4457)

* Fixes and cleanup for ph5diff (HDFGroup#4460)

* Fixes and cleanup for ph5diff

Fixes concurrency issues in ph5diff that can cause interleaved
output

Fixes an issue where output can sometimes be dropped if it ended
up in ph5diff's output overflow file

Fixes an issue where MPI_Init is called after HDF5 has been
initialized, preventing the library from setting up an MPI
attribute to perform cleanup on MPI_Finalize

Fixes an issue in config/cmake/runTest.cmake where the CMake
logic would try to access an invalid list index if the number
of lines in a test's output and reference files don't match

* Add release note

* Remove use of err files in autotools test scripts (HDFGroup#4461)

* Fix typo in H5Rget_obj_type (HDFGroup#4463)

Issue HDFGroupGH-1723

* Use ADD_H5_ERR_TEST to not compare output (HDFGroup#4464)
  • Loading branch information
lrknox authored May 7, 2024
1 parent 1952cd2 commit a354576
Show file tree
Hide file tree
Showing 186 changed files with 14,908 additions and 14,628 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ tools/h5diff/testfiles/tmpSingleSiteBethe.output.h5 -text
tools/h5diff/testfiles/tmpSingleSiteBethe.reference.h5 -text
tools/h5diff/testfiles/tmptest.he5 -text
tools/h5diff/testfiles/tmptest2.he5 -text
tools/h5dump/errfiles/non_existing.err -text
tools/h5format_convert/CMakeLists.txt -text
tools/h5format_convert/CMakeTests.cmake -text
tools/h5format_convert/Makefile.am -text
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/abi-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- uses: actions/[email protected]

- name: Get published binary (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-ubuntu-2204_gcc-binary
path: ${{ github.workspace }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cmake-bintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

# Get files created by cmake-ctest script
- name: Get published binary (Windows)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: zip-vs2022_cl-${{ inputs.build_mode }}-binary
path: ${{ github.workspace }}/hdf5
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
distribution: 'temurin'

- name: Get published binary (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-ubuntu-2204_gcc-${{ inputs.build_mode }}-binary
path: ${{ github.workspace }}
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
distribution: 'temurin'

- name: Get published binary (MacOS)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-osx12-${{ inputs.build_mode }}-binary
path: ${{ github.workspace }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cmake-ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:

# Get files created by release script
- name: Get zip-tarball (Windows)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: zip-tarball
path: ${{ github.workspace }}
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
# Get files created by release script
- name: Get tgz-tarball (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-tarball
path: ${{ github.workspace }}
Expand Down Expand Up @@ -270,7 +270,7 @@ jobs:
# Get files created by release script
- name: Get tgz-tarball (MacOS)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-tarball
path: ${{ github.workspace }}
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
# Get files created by release script
- name: Get tgz-tarball (Linux S3)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-tarball
path: ${{ github.workspace }}
Expand Down Expand Up @@ -432,7 +432,7 @@ jobs:

# Get files created by release script
- name: Get zip-tarball (Windows_intel)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: zip-tarball
path: ${{ github.workspace }}
Expand Down Expand Up @@ -527,7 +527,7 @@ jobs:
# Get files created by release script
- name: Get tgz-tarball (Linux_intel)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-tarball
path: ${{ github.workspace }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nvhpc-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
-DHDF5_BUILD_FORTRAN:BOOL=ON \
-DHDF5_BUILD_JAVA:BOOL=OFF \
-DMPIEXEC_MAX_NUMPROCS:STRING="2" \
-DMPIEXEC_PREFLAGS:STRING="--mca;opal_warn_on_missing_libcuda;0" \
$GITHUB_WORKSPACE
- name: CMake Build
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/release-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
# Get files created by tarball script
- name: Get doxygen (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: docs-doxygen
path: ${{ github.workspace }}/${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen
Expand All @@ -82,68 +82,68 @@ jobs:
run: zip -r ${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen.zip ./${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen

- name: Get tgz-tarball (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-tarball
path: ${{ github.workspace }}

- name: Get zip-tarball (Windows)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: zip-tarball
path: ${{ github.workspace }}

# Get files created by cmake-ctest script
- name: Get published binary (Windows)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: zip-vs2022_cl-binary
path: ${{ github.workspace }}

- name: Get published binary (MacOS)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-osx12-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-ubuntu-2204_gcc-binary
path: ${{ github.workspace }}

- name: Get published deb binary (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: deb-ubuntu-2204_gcc-binary
path: ${{ github.workspace }}

- name: Get published rpm binary (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: rpm-ubuntu-2204_gcc-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux S3)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-ubuntu-2204_gcc_s3-binary
path: ${{ github.workspace }}

- name: Get published binary (Windows_intel)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: zip-vs2022_intel-binary
path: ${{ github.workspace }}

- name: Get published binary (Linux_intel)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: tgz-ubuntu-2204_intel-binary
path: ${{ github.workspace }}

- name: Get published abi reports (Linux)
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: abi-reports
path: ${{ github.workspace }}
Expand All @@ -168,7 +168,7 @@ jobs:
echo "${{ steps.get-file-base.outputs.FILE_BASE }}" > ./last-file.txt
- name: Get NEWSLETTER
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: NEWSLETTER
path: ${{ github.workspace }}
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
ls ${{ runner.workspace }}
- name: branch-only-docs
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ github.workspace }}/${{ steps.get-file-base.outputs.FILE_BASE }}.doxygen
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
sarif_file: results.sarif
72 changes: 36 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,42 @@ if (BUILD_STATIC_EXECS)
endif ()
endif ()

option (HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF)
mark_as_advanced (HDF5_ENABLE_ANALYZER_TOOLS)
if (HDF5_ENABLE_ANALYZER_TOOLS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/tools.cmake)
endif ()
option (HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF)
mark_as_advanced (HDF5_ENABLE_SANITIZERS)
if (HDF5_ENABLE_SANITIZERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
endif ()
option (HDF5_ENABLE_FORMATTERS "format source files" OFF)
mark_as_advanced (HDF5_ENABLE_FORMATTERS)
if (HDF5_ENABLE_FORMATTERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake)
endif ()

#-----------------------------------------------------------------------------
# Option to use code coverage
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF)
if (HDF5_ENABLE_COVERAGE)
include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake)
if(CODE_COVERAGE AND CODE_COVERAGE_ADDED)
add_code_coverage () # Adds instrumentation to all targets
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
link_libraries (gcov)
else ()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif ()
endif ()
endif ()

#-----------------------------------------------------------------------------
# Option to indicate using a memory checker
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -1139,40 +1175,4 @@ if (EXISTS "${HDF5_SOURCE_DIR}/HDF5Examples" AND IS_DIRECTORY "${HDF5_SOURCE_DIR
endif ()
endif ()

option (HDF5_ENABLE_ANALYZER_TOOLS "enable the use of Clang tools" OFF)
mark_as_advanced (HDF5_ENABLE_ANALYZER_TOOLS)
if (HDF5_ENABLE_ANALYZER_TOOLS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/tools.cmake)
endif ()
option (HDF5_ENABLE_SANITIZERS "execute the Clang sanitizer" OFF)
mark_as_advanced (HDF5_ENABLE_SANITIZERS)
if (HDF5_ENABLE_SANITIZERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/sanitizers.cmake)
endif ()
option (HDF5_ENABLE_FORMATTERS "format source files" OFF)
mark_as_advanced (HDF5_ENABLE_FORMATTERS)
if (HDF5_ENABLE_FORMATTERS)
include (${HDF5_SOURCE_DIR}/config/sanitizer/formatting.cmake)
endif ()

#-----------------------------------------------------------------------------
# Option to use code coverage
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF)
if (HDF5_ENABLE_COVERAGE)
include (${HDF5_SOURCE_DIR}/config/sanitizer/code-coverage.cmake)
if(CODE_COVERAGE AND CODE_COVERAGE_ADDED)
add_code_coverage () # Adds instrumentation to all targets
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g --coverage -O0 -fprofile-arcs -ftest-coverage")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
link_libraries (gcov)
else ()
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif ()
endif ()
endif ()

include (CMakeInstallation.cmake)
35 changes: 31 additions & 4 deletions bin/make_err
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ sub create_init ($) {
my $desc; # Description of error message
my $sect_name; # Section of minor error messages
my $sect_desc; # Description of section
my $first_major = 0; # Whether the first major error code was saved
my $first_minor = 0; # Whether the first minor error code was saved

# Rename previous file
# rename "${prefix}${file}", "${prefix}${file}~" or die "unable to make backup";
Expand All @@ -241,12 +243,22 @@ sub create_init ($) {
print HEADER "/* Major error codes */\n";
print HEADER "/*********************/\n\n";
foreach $name (keys %major) {
print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"assert(${name}_g==H5I_INVALID_HID);\n";
print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MAJOR, \"${major{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\");\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, false))<0)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\");\n";
if ($first_major == 0) {
print HEADER " "x(0*$indent),"\n/* Remember first major error code ID */\n";
print HEADER " "x(0*$indent),"assert(H5E_first_maj_id_g==H5I_INVALID_HID);\n";
print HEADER " "x(0*$indent),"H5E_first_maj_id_g = ${name}_g;\n\n";
$first_major = 1;
}
$last_name = $name;
}
print HEADER " "x(0*$indent),"\n/* Remember last major error code ID */\n";
print HEADER " "x(0*$indent),"assert(H5E_last_maj_id_g==H5I_INVALID_HID);\n";
print HEADER " "x(0*$indent),"H5E_last_maj_id_g = ${last_name}_g;\n\n";

# Iterate over all the minor error sections
print HEADER "\n/*********************/\n";
Expand All @@ -257,13 +269,24 @@ sub create_init ($) {

# Iterate over all the minor errors in each section
for $name ( @{$section_list{$sect_name}}) {
print HEADER " "x(0*$indent),"assert(${name}_g==(-1));\n";
print HEADER " "x(0*$indent),"assert(${name}_g==H5I_INVALID_HID);\n";
print HEADER " "x(0*$indent),"if((msg = H5E__create_msg(cls, H5E_MINOR, \"${minor{$name}}\"))==NULL)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, \"error message initialization failed\");\n";
print HEADER " "x(0*$indent),"if((${name}_g = H5I_register(H5I_ERROR_MSG, msg, true))<0)\n";
print HEADER " "x(1*$indent),"HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, \"can't register error message\");\n";

if ($first_minor == 0) {
print HEADER " "x(0*$indent),"\n/* Remember first minor error code ID */\n";
print HEADER " "x(0*$indent),"assert(H5E_first_min_id_g==H5I_INVALID_HID);\n";
print HEADER " "x(0*$indent),"H5E_first_min_id_g = ${name}_g;\n\n";
$first_minor = 1;
}
$last_name = $name;
}
}
print HEADER " "x(0*$indent),"\n/* Remember last minor error code ID */\n";
print HEADER " "x(0*$indent),"assert(H5E_last_min_id_g==H5I_INVALID_HID);\n";
print HEADER " "x(0*$indent),"H5E_last_min_id_g = ${last_name}_g;\n";

print_endprotect(*HEADER, $file);

Expand Down Expand Up @@ -299,7 +322,9 @@ sub create_term ($) {
foreach $name (keys %major) {
print HEADER " "x($indent),"\n${name}_g=";
}
print HEADER " (-1);\n";
print HEADER " H5I_INVALID_HID;\n";
print HEADER " "x(0*$indent),"H5E_first_maj_id_g = H5I_INVALID_HID;\n\n";
print HEADER " "x(0*$indent),"H5E_last_maj_id_g = H5I_INVALID_HID;\n\n";

# Iterate over all the minor error sections
print HEADER "\n/* Reset minor error IDs */\n";
Expand All @@ -311,7 +336,9 @@ sub create_term ($) {
print HEADER " "x($indent),"\n${name}_g=";
}
}
print HEADER " (-1);\n";
print HEADER " H5I_INVALID_HID;\n";
print HEADER " "x(0*$indent),"H5E_first_min_id_g = H5I_INVALID_HID;\n\n";
print HEADER " "x(0*$indent),"H5E_last_min_id_g = H5I_INVALID_HID;\n\n";

print_endprotect(*HEADER, $file);

Expand Down
Loading

0 comments on commit a354576

Please sign in to comment.