mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-24 15:25:00 +08:00
a50d211755
* Brings hash table ID code over from Bitbucket branch * Includes reformatting via clang. * Excludes uthash.h from reformatting. * Still has the failing test issue in tid.c. This should only be a problem if a custom ID type is used and its free function deletes other IDs. * Fixes munged H5_GCC_DIAG_ON/OFF macros in H5I.c The H5_GCC_DIAG_ON/OFF macros used to turn off fallthrough warnings in uthash.h (external code) were munged when formatting with clang due to their lack of quotes. e.g.; H5_GCC_DIAG_OFF(implicit-fallthrough) was munged to: H5_GCC_DIAG_OFF(implicit - fallthrough) which compiles, but is useless. So, with quotes, this is now: H5_GCC_DIAG_OFF("implicit-fallthrough") which survives reformatting with clang. * Fixes issues with user callbacks in the ID hash tables The skip lists (previously) used to handle IDs use a mark-and-sweep scheme to deal with user-defined ID delete callbacks which themselves delete other IDs in the list. The uthash hash table implementation used to manage the IDs in this feature branch does not have this ability. This commit restores the skip lists for non-library ID types in lieu of significantly modifying the uthash code. The hash tables are used to manage the library IDs as those do not delete other IDs when they are closed. * Adds uthash.h to MANIFEST * Removes implicit-fallthrough diagnostic disable Removing -Wimplicit-fallthrough=5 means that the uthash code no longer raises warnings so the H5_GCC_DIAG_OFF/ON macros that disabled those warnings have been removed from H5I.c. * Adds a test to ensure you can delete IDs in the H5Iiterate() callback
28 lines
934 B
Bash
Executable File
28 lines
934 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Recursively format all C & C++ sources and header files, except those in the
|
|
# 'config' directory and generated files, such as H5LTanalyze.c, etc.
|
|
#
|
|
# Note that any files or directories that are excluded here should also be
|
|
# added to the 'exclude' list in .github/workflows/clang-format-check.yml
|
|
#
|
|
# (Remember to update both bin/format_source and bin/format_source_patch)
|
|
|
|
find . -type d \( -path ./config \) -prune \
|
|
-or \( \( \! \( \
|
|
-name H5LTanalyze.c \
|
|
-or -name H5LTparse.c \
|
|
-or -name H5LTparse.h \
|
|
-or -name H5Epubgen.h \
|
|
-or -name H5Einit.h \
|
|
-or -name H5Eterm.h \
|
|
-or -name H5Edefin.h \
|
|
-or -name H5version.h \
|
|
-or -name H5overflow.h \
|
|
-or -name uthash.h \
|
|
\) \) \
|
|
-and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp \) \) \
|
|
| xargs clang-format -style=file -i -fallback-style=none
|
|
|
|
exit 0
|